]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/functions.m4 (AC_FUNC_FSEEKO): Don't compile the
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 26 Sep 2006 20:57:16 +0000 (20:57 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 26 Sep 2006 20:57:16 +0000 (20:57 +0000)
fseeko testing program twice; just use the earlier result.
* lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_MACRO_VALUE):
Set cache var to 'unknown' (not 'no') if leaving the macro unset
still doesn't let the program compile.
(AC_SYS_LARGEFILE): Test for _LARGE_FILES only if earlier tests
failed.

* lib/autoconf/functions.m4: Fix problems reported by Ralf Wildenhues.
(AC_FUNC_ERROR_AT_LINE): Don't bother to check for error.h.  Just
include it, without including anything else.
(AC_FUNC_FSEEKO): Avoid gcc -Wall warnings about constant
expressions.
(AC_FUNC_STRNLEN): Require AC_USE_SYSTEM_EXTENSIONS.

* lib/autoconf/functions.m4 (AC_FUNC_ERROR_AT_LINE): Check for
`error.h', and include it, for a `error_at_line' prototype.
Use a nonempty format string in the link test.
* lib/autoconf/functions.m4 (AC_FUNC_WAIT3): Include <sys/wait.h>,
for a declaration of wait3.

ChangeLog
lib/autoconf/functions.m4
lib/autoconf/specific.m4

index a94948b45733ce8cf826ba0232713a551b131e3f..f5292b2bbe18c3cdf6d020f7003193781a57936a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,43 @@
+2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/autoconf/functions.m4 (AC_FUNC_FSEEKO): Don't compile the
+       fseeko testing program twice; just use the earlier result.
+       * lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_MACRO_VALUE):
+       Set cache var to 'unknown' (not 'no') if leaving the macro unset
+       still doesn't let the program compile.
+       (AC_SYS_LARGEFILE): Test for _LARGE_FILES only if earlier tests
+       failed.
+
+       * lib/autoconf/functions.m4: Fix problems reported by Ralf Wildenhues.
+       (AC_FUNC_ERROR_AT_LINE): Don't bother to check for error.h.  Just
+       include it, without including anything else.
+       (AC_FUNC_FSEEKO): Avoid gcc -Wall warnings about constant
+       expressions.
+       (AC_FUNC_STRNLEN): Require AC_USE_SYSTEM_EXTENSIONS.
+
+2006-09-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * lib/autoconf/functions.m4 (AC_FUNC_ERROR_AT_LINE): Check for
+       `error.h', and include it, for a `error_at_line' prototype.
+       Use a nonempty format string in the link test.
+       * lib/autoconf/functions.m4 (AC_FUNC_WAIT3): Include <sys/wait.h>,
+       for a declaration of wait3.
+
+2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * NEWS: AC_CHECK_DECL now also works with aggregate objects.
+       * doc/autoconf.texi (Generic Declarations): Clarify that AC_CHECK_DECL
+       can apply to constants too, and that it checks for macro defns.
+       * lib/autoconf/general.m4 (AC_CHECK_DECL): Assume C89 or better,
+       and simply cast the identifier to void.  This handles structure
+       values.  Problem reported by Ralf Wildenhues.
+       * tests/semantics.at (AC_CHECK_DECLS): Also check enums.
+
+2006-09-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * tests/semantics.at (AC_CHECK_DECLS): Also check macros,
+       structure, and function symbols.
+
 2006-09-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * tests/semantics.at (AC_CHECK_MEMBERS): Also test with a struct
index 343e06f55a21af03a3d33c503de92ae31733b894..4d02641c996a1facbcb4974080c7e9979b59a9a0 100644 (file)
@@ -472,8 +472,8 @@ AN_FUNCTION([error_at_line], [AC_FUNC_ERROR_AT_LINE])
 AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
 [AC_LIBSOURCES([error.h, error.c])dnl
 AC_CACHE_CHECK([for error_at_line], ac_cv_lib_error_at_line,
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
-                                [error_at_line (0, 0, "", 0, "");])],
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <error.h>],
+                                [error_at_line (0, 0, "", 0, "an error occurred");])],
                [ac_cv_lib_error_at_line=yes],
                [ac_cv_lib_error_at_line=no])])
 if test $ac_cv_lib_error_at_line = no; then
@@ -589,17 +589,13 @@ AC_DEFUN([AC_FUNC_FSEEKO],
 [_AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1,
    [ac_cv_sys_largefile_source],
    [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).],
-   [@%:@include <stdio.h>], [return !fseeko;])
+   [@%:@include <stdio.h>],
+   [[return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);]])
 
 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
 # in glibc 2.1.3, but that breaks too many other things.
 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-AC_CACHE_CHECK([for fseeko], [ac_cv_func_fseeko],
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include <stdio.h>],
-                                [[return fseeko && fseeko (stdin, 0, 0);]])],
-               [ac_cv_func_fseeko=yes],
-               [ac_cv_func_fseeko=no])])
-if test $ac_cv_func_fseeko = yes; then
+if test $ac_cv_sys_largefile_source != unknown; then
   AC_DEFINE(HAVE_FSEEKO, 1,
     [Define to 1 if fseeko (and presumably ftello) exists and is declared.])
 fi
@@ -1653,7 +1649,8 @@ LIBS="-lintl $LIBS"])])dnl
 # ---------------
 AN_FUNCTION([strnlen], [AC_FUNC_STRNLEN])
 AC_DEFUN([AC_FUNC_STRNLEN],
-[AC_CACHE_CHECK([for working strnlen], ac_cv_func_strnlen_working,
+[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl
+AC_CACHE_CHECK([for working strnlen], ac_cv_func_strnlen_working,
 [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[
 #define S "foobar"
 #define S_LEN (sizeof S - 1)
@@ -1998,6 +1995,7 @@ AC_CACHE_CHECK([for wait3 that fills in rusage],
 [AC_INCLUDES_DEFAULT[
 #include <sys/time.h>
 #include <sys/resource.h>
+#include <sys/wait.h>
 /* HP-UX has wait3 but does not fill in rusage at all.  */
 int
 main ()
index 5b0dee2fc441c428a471a5e9b020b145edc8dd5e..db60d1c4a66fb432f581e5d62e753dd04d995fb5 100644 (file)
@@ -130,17 +130,18 @@ m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
 m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
 [AC_CACHE_CHECK([for $1 value needed for large files], [$3],
 [while :; do
-  $3=no
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$5], [$6])],
-                   [break])
+                   [$3=no; break])
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@define $1 $2
 $5], [$6])],
                    [$3=$2; break])
+  $3=unknown
   break
 done])
-if test "$$3" != no; then
-  AC_DEFINE_UNQUOTED([$1], [$$3], [$4])
-fi
+case $$3 in #(
+  no | unknown) ;;
+  *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
+esac
 rm -f conftest*[]dnl
 ])# _AC_SYS_LARGEFILE_MACRO_VALUE
 
@@ -181,10 +182,12 @@ if test "$enable_largefile" != no; then
     ac_cv_sys_file_offset_bits,
     [Number of bits in a file offset, on hosts where this is settable.],
     [_AC_SYS_LARGEFILE_TEST_INCLUDES])
-  _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
-    ac_cv_sys_large_files,
-    [Define for large files, on AIX-style hosts.],
-    [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
+      ac_cv_sys_large_files,
+      [Define for large files, on AIX-style hosts.],
+      [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+  fi
 fi
 ])# AC_SYS_LARGEFILE