diff options
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 174 |
1 files changed, 120 insertions, 54 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 42b8eb14d..7269ea16e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1258,12 +1258,89 @@ AC_DEFUN([jm_INCLUDED_REGEX], jm_with_regex=$ac_use_included_regex) if test "$jm_with_regex" = yes; then AC_LIBOBJ(regex) + jm_PREREQ_REGEX fi ], ) ] ) +# Prerequisites of lib/regex.c. +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. + + dnl Persuade glibc <string.h> to declare mempcpy(). + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([AC_HEADER_STDC]) + AC_CHECK_HEADERS_ONCE(limits.h string.h wchar.h wctype.h) + AC_CHECK_FUNCS_ONCE(isascii mempcpy) + AC_CHECK_FUNCS(btowc) +]) + +# onceonly.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. + +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. + +# 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_]translit(gl_HEADER_NAME,[./-], [___]), [ + AC_CHECK_HEADERS(gl_HEADER_NAME) + ]) + AC_REQUIRE([gl_CHECK_HEADER_]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_]gl_FUNC_NAME, [ + AC_CHECK_FUNCS(gl_FUNC_NAME) + ]) + AC_REQUIRE([gl_CHECK_FUNC_]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_]gl_DECL_NAME, [ + AC_CHECK_DECLS(gl_DECL_NAME) + ]) + AC_REQUIRE([gl_CHECK_DECL_]gl_DECL_NAME) + ]) +]) + #serial 2 dnl From Paul Eggert. @@ -1609,7 +1686,7 @@ AC_DEFUN([_jm_DECL_HEADERS], unistd.h sys/time.h utmp.h utmpx.h) ]) -#serial 29 +#serial 30 dnl We use jm_ for non Autoconf macros. m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl @@ -1635,7 +1712,6 @@ AC_DEFUN([jm_PREREQ], AC_REQUIRE([jm_PREREQ_POSIXVER]) AC_REQUIRE([jm_PREREQ_QUOTEARG]) AC_REQUIRE([jm_PREREQ_READUTMP]) - AC_REQUIRE([jm_PREREQ_REGEX]) AC_REQUIRE([jm_PREREQ_STAT]) AC_REQUIRE([jm_PREREQ_STRNLEN]) AC_REQUIRE([jm_PREREQ_TEMPNAME]) # called by mkstemp @@ -1779,17 +1855,6 @@ $ac_includes_default fi ]) -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_REQUIRE([AC_HEADER_STDC]) - AC_REQUIRE([AC_FUNC_ALLOCA]) -]) - AC_DEFUN([jm_PREREQ_STAT], [ AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h) @@ -2582,6 +2647,7 @@ AC_DEFUN([AC_FUNC_ACL], AC_DEFUN([AC_FUNC_FTW], [ # prerequisites + AC_REQUIRE([jm_FUNC_LSTAT]) AC_REQUIRE([AC_HEADER_DIRENT]) AC_CHECK_HEADERS(sys/param.h) AC_CHECK_DECLS([stpcpy]) @@ -2644,6 +2710,47 @@ main () fi ])# AC_FUNC_FTW +#serial 7 + +dnl From Jim Meyering. +dnl Determine whether lstat has the bug that it succeeds when given the +dnl zero-length file name argument. The lstat from SunOS4.1.4 and the Hurd +dnl (as of 1998-11-01) do this. +dnl +dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to +dnl compile the wrapper function. +dnl + +AC_DEFUN([jm_FUNC_LSTAT], +[ + AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) + AC_CACHE_CHECK([whether lstat accepts an empty string], + jm_cv_func_lstat_empty_string_bug, + [AC_TRY_RUN([ +# include <sys/types.h> +# include <sys/stat.h> + + int + main () + { + struct stat sbuf; + exit (lstat ("", &sbuf) ? 1 : 0); + } + ], + jm_cv_func_lstat_empty_string_bug=yes, + jm_cv_func_lstat_empty_string_bug=no, + dnl When crosscompiling, assume lstat is broken. + jm_cv_func_lstat_empty_string_bug=yes) + ]) + if test $jm_cv_func_lstat_empty_string_bug = yes; then + AC_LIBOBJ(lstat) + AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1, +[Define if lstat has the bug that it succeeds when given the zero-length + file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01) + do this. ]) + fi +]) + #serial 2 dnl From Jim Meyering. @@ -2769,47 +2876,6 @@ AC_DEFUN([jm_FUNC_MKTIME], #serial 7 dnl From Jim Meyering. -dnl Determine whether lstat has the bug that it succeeds when given the -dnl zero-length file name argument. The lstat from SunOS4.1.4 and the Hurd -dnl (as of 1998-11-01) do this. -dnl -dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to -dnl compile the wrapper function. -dnl - -AC_DEFUN([jm_FUNC_LSTAT], -[ - AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) - AC_CACHE_CHECK([whether lstat accepts an empty string], - jm_cv_func_lstat_empty_string_bug, - [AC_TRY_RUN([ -# include <sys/types.h> -# include <sys/stat.h> - - int - main () - { - struct stat sbuf; - exit (lstat ("", &sbuf) ? 1 : 0); - } - ], - jm_cv_func_lstat_empty_string_bug=yes, - jm_cv_func_lstat_empty_string_bug=no, - dnl When crosscompiling, assume lstat is broken. - jm_cv_func_lstat_empty_string_bug=yes) - ]) - if test $jm_cv_func_lstat_empty_string_bug = yes; then - AC_LIBOBJ(lstat) - AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1, -[Define if lstat has the bug that it succeeds when given the zero-length - file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01) - do this. ]) - fi -]) - -#serial 7 - -dnl From Jim Meyering. dnl Determine whether stat has the bug that it succeeds when given the dnl zero-length file name argument. The stat from SunOS4.1.4 and the Hurd dnl (as of 1998-11-01) do this. |