diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2009-03-17 21:46:21 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2009-03-17 21:46:21 +0100 |
commit | e930d168adfce7a64caf4852892f43deacd94fc5 (patch) | |
tree | 8333fef12f8a0fc9bd7ff1bacd24a008020e6c41 /m4 | |
parent | aa0d4dd83795826383431d0892444827bf656687 (diff) | |
download | patch-e930d168adfce7a64caf4852892f43deacd94fc5.tar.gz |
Import of patch-2.5.9.tar.gzv2.5.9
Diffstat (limited to 'm4')
-rw-r--r-- | m4/backupfile.m4 | 23 | ||||
-rw-r--r-- | m4/c-bs-a.m4 | 29 | ||||
-rw-r--r-- | m4/d-ino.m4 | 6 | ||||
-rw-r--r-- | m4/dirname.m4 | 25 | ||||
-rw-r--r-- | m4/dos.m4 | 53 | ||||
-rw-r--r-- | m4/error.m4 | 17 | ||||
-rw-r--r-- | m4/getopt.m4 | 13 | ||||
-rw-r--r-- | m4/jm-glibc-io.m4 | 14 | ||||
-rw-r--r-- | m4/malloc.m4 | 42 | ||||
-rw-r--r-- | m4/mbrtowc.m4 | 5 | ||||
-rw-r--r-- | m4/mbstate_t.m4 | 36 | ||||
-rw-r--r-- | m4/memchr.m4 | 21 | ||||
-rw-r--r-- | m4/onceonly.m4 | 63 | ||||
-rw-r--r-- | m4/prereq.m4 | 153 | ||||
-rw-r--r-- | m4/quote.m4 | 13 | ||||
-rw-r--r-- | m4/quotearg.m4 | 16 | ||||
-rw-r--r-- | m4/realloc.m4 | 42 | ||||
-rw-r--r-- | m4/rmdir.m4 | 22 | ||||
-rw-r--r-- | m4/stdbool.m4 | 89 | ||||
-rw-r--r-- | m4/unlocked-io.m4 | 22 | ||||
-rw-r--r-- | m4/utimbuf.m4 | 8 | ||||
-rw-r--r-- | m4/xalloc.m4 | 26 |
22 files changed, 455 insertions, 283 deletions
diff --git a/m4/backupfile.m4 b/m4/backupfile.m4 new file mode 100644 index 0000000..0f63f4e --- /dev/null +++ b/m4/backupfile.m4 @@ -0,0 +1,23 @@ +# backupfile.m4 serial 1 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_BACKUPFILE], +[ + dnl Prerequisites of lib/backupfile.c. + AC_REQUIRE([AC_HEADER_DIRENT]) + AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID]) + AC_CHECK_HEADERS_ONCE(limits.h stdlib.h string.h) + AC_CHECK_DECLS_ONCE(getenv malloc) + jm_CHECK_TYPE_STRUCT_DIRENT_D_INO + + dnl Prerequisites of lib/addext.c. + AC_REQUIRE([jm_AC_DOS]) + AC_SYS_LONG_FILE_NAMES + AC_CHECK_HEADERS_ONCE(limits.h string.h unistd.h) + AC_CHECK_FUNCS(pathconf) +]) diff --git a/m4/c-bs-a.m4 b/m4/c-bs-a.m4 deleted file mode 100644 index 1c7eb1c..0000000 --- a/m4/c-bs-a.m4 +++ /dev/null @@ -1,29 +0,0 @@ -# c-bs-a.m4 serial 4 (fileutils-4.1.3) -dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert. - -AC_DEFUN([AC_C_BACKSLASH_A], -[ - AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a, - [AC_TRY_COMPILE([], - [ -#if '\a' == 'a' - syntax error; -#endif - char buf['\a' == 'a' ? -1 : 1]; - buf[0] = '\a'; - return buf[0] != "\a"[0]; - ], - ac_cv_c_backslash_a=yes, - ac_cv_c_backslash_a=no)]) - if test $ac_cv_c_backslash_a = yes; then - AC_DEFINE(HAVE_C_BACKSLASH_A, 1, - [Define if backslash-a works in C strings.]) - fi -]) diff --git a/m4/d-ino.m4 b/m4/d-ino.m4 index 6ca60dc..d2555e9 100644 --- a/m4/d-ino.m4 +++ b/m4/d-ino.m4 @@ -1,4 +1,4 @@ -#serial 4 +#serial 5 dnl From Jim Meyering. dnl @@ -35,8 +35,8 @@ AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO], ) if test $jm_cv_struct_dirent_d_ino = yes; then AC_DEFINE(D_INO_IN_DIRENT, 1, - [Define if there is a member named d_ino in the struct describing - directory headers.]) + [Define if there is a member named d_ino in the struct describing + directory headers.]) fi ] ) diff --git a/m4/dirname.m4 b/m4/dirname.m4 new file mode 100644 index 0000000..8b04bca --- /dev/null +++ b/m4/dirname.m4 @@ -0,0 +1,25 @@ +# dirname.m4 serial 1 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_DIRNAME], +[ + dnl Prerequisites of lib/dirname.h. + AC_REQUIRE([jm_AC_DOS]) + + dnl Prerequisites of lib/dirname.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) + + dnl Prerequisites of lib/basename.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) + + dnl Prerequisites of lib/stripslash.c. + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/dos.m4 b/m4/dos.m4 new file mode 100644 index 0000000..868626e --- /dev/null +++ b/m4/dos.m4 @@ -0,0 +1,53 @@ +#serial 5 + +# Define some macros required for proper operation of code in lib/*.c +# on MSDOS/Windows systems. + +# From Jim Meyering. + +AC_DEFUN([jm_AC_DOS], + [ + AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos], + [ + AC_TRY_COMPILE([], + [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ +neither MSDOS nor Windows +#endif], + [ac_cv_win_or_dos=yes], + [ac_cv_win_or_dos=no]) + ]) + + if test x"$ac_cv_win_or_dos" = xyes; then + ac_fs_accepts_drive_letter_prefix=1 + ac_fs_backslash_is_file_name_separator=1 + else + ac_fs_accepts_drive_letter_prefix=0 + ac_fs_backslash_is_file_name_separator=0 + fi + + AH_VERBATIM(FILESYSTEM_PREFIX_LEN, + [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX +# define FILESYSTEM_PREFIX_LEN(Filename) \ + ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) +#else +# define FILESYSTEM_PREFIX_LEN(Filename) 0 +#endif]) + + AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX], + $ac_fs_accepts_drive_letter_prefix, + [Define on systems for which file names may have a so-called + `drive letter' prefix, define this to compute the length of that + prefix, including the colon.]) + + AH_VERBATIM(ISSLASH, + [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR +# define ISSLASH(C) ((C) == '/' || (C) == '\\') +#else +# define ISSLASH(C) ((C) == '/') +#endif]) + + AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR], + $ac_fs_backslash_is_file_name_separator, + [Define if the backslash character may also serve as a file name + component separator.]) + ]) diff --git a/m4/error.m4 b/m4/error.m4 index 3fddb5c..14e23a7 100644 --- a/m4/error.m4 +++ b/m4/error.m4 @@ -1,13 +1,18 @@ -#serial 4 +#serial 7 -dnl FIXME: put these prerequisite-only *.m4 files in a separate -dnl directory -- otherwise, they'll conflict with existing files. +AC_DEFUN([gl_ERROR], +[ + AC_FUNC_ERROR_AT_LINE + dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). + jm_PREREQ_ERROR +]) -dnl These are the prerequisite macros for GNU's error.c file. +# Prerequisites of lib/error.c. AC_DEFUN([jm_PREREQ_ERROR], [ - AC_CHECK_FUNCS(strerror vprintf doprnt) + AC_REQUIRE([AC_HEADER_STDC]) + AC_REQUIRE([AC_FUNC_VPRINTF]) + AC_CHECK_FUNCS(strerror) AC_CHECK_DECLS([strerror]) AC_FUNC_STRERROR_R - AC_HEADER_STDC ]) diff --git a/m4/getopt.m4 b/m4/getopt.m4 new file mode 100644 index 0000000..558558d --- /dev/null +++ b/m4/getopt.m4 @@ -0,0 +1,13 @@ +# getopt.m4 serial 1 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_GETOPT], +[ + dnl Prerequisites of lib/getopt.c. + AC_CHECK_HEADERS_ONCE(string.h) +]) diff --git a/m4/jm-glibc-io.m4 b/m4/jm-glibc-io.m4 deleted file mode 100644 index e8054f0..0000000 --- a/m4/jm-glibc-io.m4 +++ /dev/null @@ -1,14 +0,0 @@ -#serial 7 -*- autoconf -*- - -dnl From Jim Meyering. -dnl -dnl See if the glibc *_unlocked I/O macros are available. -dnl Use only those *_unlocked macros that are declared. -dnl - -AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO], - [AC_CHECK_DECLS( - [clearerr_unlocked, feof_unlocked, ferror_unlocked, - fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked, - fread_unlocked, fwrite_unlocked, getc_unlocked, - getchar_unlocked, putc_unlocked, putchar_unlocked])]) diff --git a/m4/malloc.m4 b/m4/malloc.m4 index cb5cff3..2452acf 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,35 +1,25 @@ -#serial 6 +# malloc.m4 serial 7 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. dnl From Jim Meyering. dnl Determine whether malloc accepts 0 as its argument. dnl If it doesn't, arrange to use the replacement function. -dnl AC_DEFUN([jm_FUNC_MALLOC], [ - dnl xmalloc.c requires that this symbol be defined so it doesn't - dnl mistakenly use a broken malloc -- as it might if this test were omitted. - AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1, - [Define if the malloc check has been performed. ]) - - AC_CACHE_CHECK([whether malloc(0) returns a non-NULL pointer], - jm_cv_func_working_malloc, - [AC_TRY_RUN([ - char *malloc (); - int - main () - { - exit (malloc (0) ? 0 : 1); - } - ], - jm_cv_func_working_malloc=yes, - jm_cv_func_working_malloc=no, - dnl When crosscompiling, assume malloc(0) returns NULL. - jm_cv_func_working_malloc=no) - ]) - if test $jm_cv_func_working_malloc = no; then - AC_LIBOBJ(malloc) - AC_DEFINE(malloc, rpl_malloc, - [Define to rpl_malloc if the replacement function should be used.]) + AC_REQUIRE([AC_FUNC_MALLOC]) + dnl autoconf < 2.57 used the symbol ac_cv_func_malloc_works. + if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then + gl_PREREQ_MALLOC fi ]) + +# Prerequisites of lib/malloc.c. +AC_DEFUN([gl_PREREQ_MALLOC], [ + : +]) diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 index 0379847..21e9daa 100644 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -1,4 +1,4 @@ -# mbrtowc.m4 serial 4 (fileutils-4.1.3) +# mbrtowc.m4 serial 5 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General @@ -8,6 +8,9 @@ dnl the same distribution terms as the rest of that program. dnl From Paul Eggert +dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with +dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere. + AC_DEFUN([jm_FUNC_MBRTOWC], [ AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], diff --git a/m4/mbstate_t.m4 b/m4/mbstate_t.m4 index deab38e..a07f51b 100644 --- a/m4/mbstate_t.m4 +++ b/m4/mbstate_t.m4 @@ -1,5 +1,5 @@ -# mbstate_t.m4 serial 9 (fileutils-4.1.3) -dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. +# mbstate_t.m4 serial 9 +dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program @@ -12,27 +12,21 @@ dnl the same distribution terms as the rest of that program. # so you can't declare an object of that type. # Check for this incompatibility with Standard C. -# Include stdlib.h first, because otherwise this test would fail on Linux -# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits -# a syntax error in wchar.h due to the use of undefined __int32_t. - -AC_DEFUN([AC_MBSTATE_T], - [ - AC_CHECK_HEADERS(stdlib.h) - - AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, - [AC_TRY_COMPILE([ -#if HAVE_STDLIB_H -# include <stdlib.h> -#endif -#include <wchar.h>], - [mbstate_t x; return sizeof x;], - ac_cv_type_mbstate_t=yes, - ac_cv_type_mbstate_t=no)]) +# AC_TYPE_MBSTATE_T +# ----------------- +AC_DEFUN([AC_TYPE_MBSTATE_T], + [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT +# include <wchar.h>], + [mbstate_t x; return sizeof x;])], + [ac_cv_type_mbstate_t=yes], + [ac_cv_type_mbstate_t=no])]) if test $ac_cv_type_mbstate_t = yes; then - AC_DEFINE(HAVE_MBSTATE_T, 1,ma + AC_DEFINE([HAVE_MBSTATE_T], 1, [Define to 1 if <wchar.h> declares mbstate_t.]) else - AC_DEFINE(mbstate_t, int, + AC_DEFINE([mbstate_t], int, [Define to a type if <wchar.h> does not define.]) fi]) diff --git a/m4/memchr.m4 b/m4/memchr.m4 new file mode 100644 index 0000000..7b6cfc4 --- /dev/null +++ b/m4/memchr.m4 @@ -0,0 +1,21 @@ +# memchr.m4 serial 1 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_FUNC_MEMCHR], +[ + AC_REPLACE_FUNCS(memchr) + if test $ac_cv_func_memchr = no; then + jm_PREREQ_MEMCHR + fi +]) + +# Prerequisites of lib/memchr.c. +AC_DEFUN([jm_PREREQ_MEMCHR], [ + AC_CHECK_HEADERS_ONCE(limits.h stdlib.h) + AC_CHECK_HEADERS(bp-sym.h) +]) diff --git a/m4/onceonly.m4 b/m4/onceonly.m4 new file mode 100644 index 0000000..4ab8fd0 --- /dev/null +++ b/m4/onceonly.m4 @@ -0,0 +1,63 @@ +# onceonly.m4 serial 3 +dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +dnl This file defines some "once only" variants of standard autoconf macros. +dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS +dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS +dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS +dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC +dnl The advantage is that the check for each of the headers/functions/decls +dnl will be put only once into the 'configure' file. It keeps the size of +dnl the 'configure' file down, and avoids redundant output when 'configure' +dnl is run. +dnl The drawback is that the checks cannot be conditionalized. If you write +dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi +dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to +dnl empty, and the check will be inserted before the body of the AC_DEFUNed +dnl function. + +dnl Autoconf version 2.57 or newer is recommended. +AC_PREREQ(2.54) + +# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of +# AC_CHECK_HEADERS(HEADER1 HEADER2 ...). +AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ + : + AC_FOREACH([gl_HEADER_NAME], [$1], [ + AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]), + [-./], [___])), [ + AC_CHECK_HEADERS(gl_HEADER_NAME) + ]) + AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, + [-./], [___]))) + ]) +]) + +# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of +# AC_CHECK_FUNCS(FUNC1 FUNC2 ...). +AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ + : + AC_FOREACH([gl_FUNC_NAME], [$1], [ + AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ + AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME])) + ]) + AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) + ]) +]) + +# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of +# AC_CHECK_DECLS(DECL1, DECL2, ...). +AC_DEFUN([AC_CHECK_DECLS_ONCE], [ + : + AC_FOREACH([gl_DECL_NAME], [$1], [ + AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ + AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) + ]) + AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) + ]) +]) diff --git a/m4/prereq.m4 b/m4/prereq.m4 deleted file mode 100644 index 552e6a7..0000000 --- a/m4/prereq.m4 +++ /dev/null @@ -1,153 +0,0 @@ -#serial 22 - -dnl These are the prerequisite macros for files in the lib/ -dnl directories of the fileutils, sh-utils, and textutils packages. - -AC_DEFUN([jm_PREREQ], -[ - jm_PREREQ_ADDEXT - jm_PREREQ_CANON_HOST - jm_PREREQ_DIRNAME - jm_PREREQ_ERROR - jm_PREREQ_EXCLUDE - jm_PREREQ_GETPAGESIZE - jm_PREREQ_HARD_LOCALE - jm_PREREQ_HASH - jm_PREREQ_HUMAN - jm_PREREQ_MBSWIDTH - jm_PREREQ_MEMCHR - jm_PREREQ_PHYSMEM - jm_PREREQ_POSIXVER - jm_PREREQ_QUOTEARG - jm_PREREQ_READUTMP - jm_PREREQ_REGEX - jm_PREREQ_TEMPNAME # called by mkstemp - jm_PREREQ_XGETCWD - jm_PREREQ_XREADLINK -]) - -AC_DEFUN([jm_PREREQ_ADDEXT], -[ - dnl For addext.c. - AC_SYS_LONG_FILE_NAMES - AC_CHECK_FUNCS(pathconf) - AC_CHECK_HEADERS(limits.h string.h unistd.h) -]) - -AC_DEFUN([jm_PREREQ_CANON_HOST], -[ - dnl Add any libraries as early as possible. - dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1, - dnl so we have to add -lnsl to LIBS before checking for that function. - AC_SEARCH_LIBS(gethostbyname, [inet nsl]) - - dnl These come from -lnsl on Solaris5.5.1. - AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa) - - AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa) - AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \ - netinet/in.h arpa/inet.h) -]) - -AC_DEFUN([jm_PREREQ_DIRNAME], -[ - AC_HEADER_STDC - AC_CHECK_HEADERS(string.h) -]) - -AC_DEFUN([jm_PREREQ_EXCLUDE], -[ - AC_FUNC_FNMATCH_GNU([lib]) - AC_HEADER_STDBOOL -]) - -AC_DEFUN([jm_PREREQ_GETPAGESIZE], -[ - AC_CHECK_FUNCS(getpagesize) - AC_CHECK_HEADERS(OS.h unistd.h) -]) - -AC_DEFUN([jm_PREREQ_HARD_LOCALE], -[ - AC_C_PROTOTYPES - AC_CHECK_FUNCS(setlocale) - AC_CHECK_HEADERS(locale.h stdlib.h string.h) -]) - -AC_DEFUN([jm_PREREQ_HASH], -[ - AC_CHECK_HEADERS(stdlib.h) - AC_HEADER_STDBOOL - AC_REQUIRE([jm_CHECK_DECLS]) -]) - -# If you use human.c, you need the following files: -# inttypes.m4 ulonglong.m4 -AC_DEFUN([jm_PREREQ_HUMAN], -[ - AC_CHECK_HEADERS(limits.h stdlib.h string.h) - AC_CHECK_DECLS([getenv]) - AC_REQUIRE([jm_AC_TYPE_UINTMAX_T]) -]) - -AC_DEFUN([jm_PREREQ_MEMCHR], -[ - AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h) -]) - -AC_DEFUN([jm_PREREQ_PHYSMEM], -[ - AC_CHECK_HEADERS(sys/pstat.h unistd.h) - AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic) -]) - -AC_DEFUN([jm_PREREQ_POSIXVER], -[ - AC_CHECK_HEADERS(unistd.h) - AC_CHECK_DECLS([getenv]) -]) - -AC_DEFUN([jm_PREREQ_QUOTEARG], -[ - AC_CHECK_FUNCS(isascii iswprint) - jm_FUNC_MBRTOWC - AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h) - AC_HEADER_STDC - AC_C_BACKSLASH_A - AC_MBSTATE_T - AC_C_PROTOTYPES -]) - -AC_DEFUN([jm_PREREQ_REGEX], -[ - dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it. - dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary - dnl to get them. - AC_CHECK_FUNCS(bzero bcopy isascii btowc) - AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h) - AC_HEADER_STDC - AC_FUNC_ALLOCA -]) - -AC_DEFUN([jm_PREREQ_TEMPNAME], -[ - AC_HEADER_STDC - AC_HEADER_STAT - AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h) - AC_CHECK_FUNCS(__secure_getenv gettimeofday) - AC_CHECK_DECLS([getenv]) -]) - -AC_DEFUN([jm_PREREQ_XGETCWD], -[ - AC_C_PROTOTYPES - AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h) - AC_CHECK_FUNCS(getcwd) - AC_FUNC_GETCWD_NULL -]) - -AC_DEFUN([jm_PREREQ_XREADLINK], -[ - AC_C_PROTOTYPES - AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h) -]) diff --git a/m4/quote.m4 b/m4/quote.m4 new file mode 100644 index 0000000..025911f --- /dev/null +++ b/m4/quote.m4 @@ -0,0 +1,13 @@ +# quote.m4 serial 1 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_QUOTE], +[ + dnl Prerequisites of lib/quote.c. + AC_CHECK_HEADERS_ONCE(stddef.h) +]) diff --git a/m4/quotearg.m4 b/m4/quotearg.m4 new file mode 100644 index 0000000..2fba109 --- /dev/null +++ b/m4/quotearg.m4 @@ -0,0 +1,16 @@ +# quotearg.m4 serial 1 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_QUOTEARG], +[ + dnl Prerequisites of lib/quotearg.c. + AC_CHECK_HEADERS_ONCE(wchar.h wctype.h) + AC_CHECK_FUNCS_ONCE(iswprint mbsinit) + AC_TYPE_MBSTATE_T + jm_FUNC_MBRTOWC +]) diff --git a/m4/realloc.m4 b/m4/realloc.m4 index 7695e89..9f746f1 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -1,35 +1,25 @@ -#serial 6 +# realloc.m4 serial 7 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. dnl From Jim Meyering. dnl Determine whether realloc works when both arguments are 0. dnl If it doesn't, arrange to use the replacement function. -dnl AC_DEFUN([jm_FUNC_REALLOC], [ - dnl xmalloc.c requires that this symbol be defined so it doesn't - dnl mistakenly use a broken realloc -- as it might if this test were omitted. - AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1, - [Define if the realloc check has been performed. ]) - - AC_CACHE_CHECK([whether realloc(0,0) returns a non-NULL pointer], - jm_cv_func_working_realloc, - [AC_TRY_RUN([ - char *realloc (); - int - main () - { - exit (realloc (0, 0) ? 0 : 1); - } - ], - jm_cv_func_working_realloc=yes, - jm_cv_func_working_realloc=no, - dnl When crosscompiling, assume realloc(0,0) returns NULL. - jm_cv_func_working_realloc=no) - ]) - if test $jm_cv_func_working_realloc = no; then - AC_LIBOBJ(realloc) - AC_DEFINE(realloc, rpl_realloc, - [Define to rpl_realloc if the replacement function should be used.]) + AC_REQUIRE([AC_FUNC_REALLOC]) + dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works. + if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then + gl_PREREQ_REALLOC fi ]) + +# Prerequisites of lib/realloc.c. +AC_DEFUN([gl_PREREQ_REALLOC], [ + : +]) diff --git a/m4/rmdir.m4 b/m4/rmdir.m4 new file mode 100644 index 0000000..a86ff78 --- /dev/null +++ b/m4/rmdir.m4 @@ -0,0 +1,22 @@ +# rmdir.m4 serial 1 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_FUNC_RMDIR], +[ + AC_REPLACE_FUNCS(rmdir) + if test $ac_cv_func_rmdir = no; then + gl_PREREQ_RMDIR + fi +]) + +# Prerequisites of lib/rmdir.c. +AC_DEFUN([gl_PREREQ_RMDIR], [ + AC_REQUIRE([AC_HEADER_STAT]) + : +]) + diff --git a/m4/stdbool.m4 b/m4/stdbool.m4 new file mode 100644 index 0000000..ed000c8 --- /dev/null +++ b/m4/stdbool.m4 @@ -0,0 +1,89 @@ +# Check for stdbool.h that conforms to C99. + +# Copyright (C) 2002-2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# Prepare for substituting <stdbool.h> if it is not supported. + +AC_DEFUN([AM_STDBOOL_H], +[ + AC_REQUIRE([AC_HEADER_STDBOOL]) + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + AC_SUBST([STDBOOL_H]) + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + AC_SUBST([HAVE__BOOL]) +]) + +# This macro is only needed in autoconf <= 2.54. Newer versions of autoconf +# have this macro built-in. + +AC_DEFUN([AC_HEADER_STDBOOL], + [AC_CACHE_CHECK([for stdbool.h that conforms to C99], + [ac_cv_header_stdbool_h], + [AC_TRY_COMPILE( + [ + #include <stdbool.h> + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: false is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) -0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) -0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + ], + [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ], + [ac_cv_header_stdbool_h=yes], + [ac_cv_header_stdbool_h=no])]) + AC_CHECK_TYPES([_Bool]) + if test $ac_cv_header_stdbool_h = yes; then + AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) + fi]) diff --git a/m4/unlocked-io.m4 b/m4/unlocked-io.m4 new file mode 100644 index 0000000..f0c15d9 --- /dev/null +++ b/m4/unlocked-io.m4 @@ -0,0 +1,22 @@ +#serial 7 -*- autoconf -*- + +dnl From Jim Meyering. +dnl +dnl See if the glibc *_unlocked I/O macros or functions are available. +dnl Use only those *_unlocked macros or functions that are declared +dnl (because some of them were declared in Solaris 2.5.1 but were removed +dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run +dnl on Solaris 2.6). + +AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO], +[ + dnl Persuade glibc <stdio.h> to declare fgets_unlocked(), fputs_unlocked() + dnl etc. + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_CHECK_DECLS_ONCE( + [clearerr_unlocked feof_unlocked ferror_unlocked + fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked + fread_unlocked fwrite_unlocked getc_unlocked + getchar_unlocked putc_unlocked putchar_unlocked]) +]) diff --git a/m4/utimbuf.m4 b/m4/utimbuf.m4 index 4ea4952..21724aa 100644 --- a/m4/utimbuf.m4 +++ b/m4/utimbuf.m4 @@ -1,4 +1,4 @@ -#serial 4 +#serial 5 dnl From Jim Meyering @@ -8,7 +8,7 @@ dnl Some systems have utime.h but don't declare the struct anywhere. AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF], [ - AC_CHECK_HEADERS(utime.h) + AC_CHECK_HEADERS_ONCE(sys/time.h utime.h) AC_REQUIRE([AC_HEADER_TIME]) AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf, [AC_TRY_COMPILE( @@ -34,7 +34,7 @@ AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF], if test $fu_cv_sys_struct_utimbuf = yes; then AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, -[Define if struct utimbuf is declared -- usually in <utime.h>. - Some systems have utime.h but don't declare the struct anywhere. ]) + [Define if struct utimbuf is declared -- usually in <utime.h>. + Some systems have utime.h but don't declare the struct anywhere. ]) fi ]) diff --git a/m4/xalloc.m4 b/m4/xalloc.m4 new file mode 100644 index 0000000..1826bdc --- /dev/null +++ b/m4/xalloc.m4 @@ -0,0 +1,26 @@ +# xalloc.m4 serial 1 +dnl Copyright (C) 2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +AC_DEFUN([gl_XALLOC], +[ + gl_PREREQ_XMALLOC + gl_PREREQ_XSTRDUP +]) + +# Prerequisites of lib/xmalloc.c. +AC_DEFUN([gl_PREREQ_XMALLOC], [ + AC_REQUIRE([AC_HEADER_STDC]) + AC_REQUIRE([jm_FUNC_MALLOC]) + AC_REQUIRE([jm_FUNC_REALLOC]) +]) + +# Prerequisites of lib/xstrdup.c. +AC_DEFUN([gl_PREREQ_XSTRDUP], [ + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(string.h) +]) |