gl_CHECK_NEXT_HEADERS implies AC_CHECK_HEADERS_ONCE
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 21 Jan 2011 23:46:54 +0000 (15:46 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 21 Jan 2011 23:47:40 +0000 (15:47 -0800)
* m4/include_next.m4 (gl_CHECK_HEXT_HEADERS): Document this.
* m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Don't bother to invoke
AC_CHECK_HEADERS_ONCE on a header that we also invoke
gl_CHECK_NEXT_HEADERS on, since the latter invokes the former.
* m4/netdb_h.m4 (gl_HEADER_NETDB): Likewise.
* m4/pthread.m4 (gl_PTHREAD_CHECK): Likewise.
* m4/sched_h.m4 (gl_SCHED_H): Likewise.
* m4/search_h.m4 (gl_SEARCH_H): Likewise.
* m4/spawn_h.m4 (gl_SPAWN_H): Likewise.
* m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H): Likewise.
* m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise.
* m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise.
* m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise.
* m4/termios_h.m4 (gl_TERMIOS_H): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
* m4/wchar_h.m4 (gl_WCHAR_H): Likewise.
* m4/wctype_h.m4 (gl_WCTYPE_H): Likewise.

16 files changed:
ChangeLog
m4/getopt.m4
m4/include_next.m4
m4/netdb_h.m4
m4/pthread.m4
m4/sched_h.m4
m4/search_h.m4
m4/spawn_h.m4
m4/sys_file_h.m4
m4/sys_select_h.m4
m4/sys_times_h.m4
m4/sys_utsname_h.m4
m4/termios_h.m4
m4/unistd_h.m4
m4/wchar_h.m4
m4/wctype_h.m4

index c72b3d8..3a7bd38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2011-01-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       gl_CHECK_NEXT_HEADERS implies AC_CHECK_HEADERS_ONCE
+       * m4/include_next.m4 (gl_CHECK_HEXT_HEADERS): Document this.
+       * m4/getopt.m4 (gl_GETOPT_CHECK_HEADERS): Don't bother to invoke
+       AC_CHECK_HEADERS_ONCE on a header that we also invoke
+       gl_CHECK_NEXT_HEADERS on, since the latter invokes the former.
+       * m4/netdb_h.m4 (gl_HEADER_NETDB): Likewise.
+       * m4/pthread.m4 (gl_PTHREAD_CHECK): Likewise.
+       * m4/sched_h.m4 (gl_SCHED_H): Likewise.
+       * m4/search_h.m4 (gl_SEARCH_H): Likewise.
+       * m4/spawn_h.m4 (gl_SPAWN_H): Likewise.
+       * m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H): Likewise.
+       * m4/sys_select_h.m4 (gl_HEADER_SYS_SELECT): Likewise.
+       * m4/sys_times_h.m4 (gl_SYS_TIMES_H): Likewise.
+       * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H): Likewise.
+       * m4/termios_h.m4 (gl_TERMIOS_H): Likewise.
+       * m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
+       * m4/wchar_h.m4 (gl_WCHAR_H): Likewise.
+       * m4/wctype_h.m4 (gl_WCTYPE_H): Likewise.
+
 2011-01-21  Eric Blake  <eblake@redhat.com>
 
        maintainer-makefile: work with older git for submodule check
index 793ab78..d351b84 100644 (file)
@@ -1,4 +1,4 @@
-# getopt.m4 serial 32
+# getopt.m4 serial 33
 dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -56,7 +56,6 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
   gl_CHECK_NEXT_HEADERS([getopt.h])
-  AC_CHECK_HEADERS_ONCE([getopt.h])
   if test $ac_cv_header_getopt_h = yes; then
     HAVE_GETOPT_H=1
   else
index 2b20a76..b3c7849 100644 (file)
@@ -147,6 +147,9 @@ choke me
 # Note: This macro assumes that the header file is not empty after
 # preprocessing, i.e. it does not only define preprocessor macros but also
 # provides some type/enum definitions or function/variable declarations.
+#
+# This macro also checks whether each header exists, by invoking
+# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
 AC_DEFUN([gl_CHECK_NEXT_HEADERS],
 [
   gl_NEXT_HEADERS_INTERNAL([$1], [check])
index 82afacd..9a01cd6 100644 (file)
@@ -1,4 +1,4 @@
-# netdb_h.m4 serial 9
+# netdb_h.m4 serial 10
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_HEADER_NETDB],
 [
   AC_REQUIRE([gl_NETDB_H_DEFAULTS])
-  AC_CHECK_HEADERS_ONCE([netdb.h])
   gl_CHECK_NEXT_HEADERS([netdb.h])
   if test $ac_cv_header_netdb_h = yes; then
     HAVE_NETDB_H=1
index b9a250c..9f77cde 100644 (file)
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_PTHREAD_CHECK],
 [
    AC_REQUIRE([gl_PTHREAD_DEFAULTS])
-   AC_CHECK_HEADERS_ONCE([pthread.h])
    gl_CHECK_NEXT_HEADERS([pthread.h])
    if test $ac_cv_header_pthread_h = yes; then
      HAVE_PTHREAD_H=1
index 83b6493..6a46e47 100644 (file)
@@ -1,4 +1,4 @@
-# sched_h.m4 serial 2
+# sched_h.m4 serial 3
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,7 +19,6 @@ AC_DEFUN([gl_SCHED_H],
 
      gl_CHECK_NEXT_HEADERS([sched.h])
 
-     AC_CHECK_HEADERS_ONCE([sched.h])
      if test $ac_cv_header_sched_h = yes; then
        HAVE_SCHED_H=1
      else
index 9a43793..f656fda 100644 (file)
@@ -1,4 +1,4 @@
-# search_h.m4 serial 7
+# search_h.m4 serial 8
 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_SEARCH_H],
 [
   AC_REQUIRE([gl_SEARCH_H_DEFAULTS])
-  AC_CHECK_HEADERS_ONCE([search.h])
   gl_CHECK_NEXT_HEADERS([search.h])
   if test $ac_cv_header_search_h = yes; then
     HAVE_SEARCH_H=1
index 4721d10..a044e37 100644 (file)
@@ -1,4 +1,4 @@
-# spawn_h.m4 serial 11
+# spawn_h.m4 serial 12
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,6 @@ AC_DEFUN([gl_SPAWN_H],
   dnl <spawn.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([spawn.h])
 
-  AC_CHECK_HEADERS_ONCE([spawn.h])
   if test $ac_cv_header_spawn_h = yes; then
     HAVE_SPAWN_H=1
     AC_CHECK_TYPES([posix_spawnattr_t], [], [HAVE_POSIX_SPAWNATTR_T=0], [[
index d665981..8538e1f 100644 (file)
@@ -1,5 +1,5 @@
 # Configure a replacement for <sys/file.h>.
-# serial 5
+# serial 6
 
 # Copyright (C) 2008-2011 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -15,7 +15,6 @@ AC_DEFUN([gl_HEADER_SYS_FILE_H],
   dnl <sys/file.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([sys/file.h])
 
-  AC_CHECK_HEADERS_ONCE([sys/file.h])
   if test $ac_cv_header_sys_file_h = yes; then
     HAVE_SYS_FILE_H=1
   else
index e596c85..f167118 100644 (file)
@@ -1,4 +1,4 @@
-# sys_select_h.m4 serial 15
+# sys_select_h.m4 serial 16
 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -45,7 +45,6 @@ AC_DEFUN([gl_HEADER_SYS_SELECT],
           ])
       fi
     ])
-  AC_CHECK_HEADERS_ONCE([sys/select.h])
   dnl <sys/select.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([sys/select.h])
   if test $ac_cv_header_sys_select_h = yes; then
index 508a3bf..61500cc 100644 (file)
@@ -1,5 +1,5 @@
 # Configure a replacement for <sys/times.h>.
-# serial 7
+# serial 8
 
 # Copyright (C) 2008-2011 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -14,7 +14,6 @@ AC_DEFUN([gl_SYS_TIMES_H],
 
   dnl <sys/times.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([sys/times.h])
-  AC_CHECK_HEADERS_ONCE([sys/times.h])
   if test $ac_cv_header_sys_times_h = yes; then
     HAVE_SYS_TIMES_H=1
     AC_CHECK_TYPES([struct tms], [], [HAVE_STRUCT_TMS=0], [[
index 7b261d8..7b48257 100644 (file)
@@ -1,4 +1,4 @@
-# sys_utsname_h.m4 serial 6
+# sys_utsname_h.m4 serial 7
 dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,6 @@ AC_DEFUN([gl_SYS_UTSNAME_H],
 
   dnl <sys/utsname.h> is always overridden, because of GNULIB_POSIXCHECK.
   gl_CHECK_NEXT_HEADERS([sys/utsname.h])
-  AC_CHECK_HEADERS_ONCE([sys/utsname.h])
   if test $ac_cv_header_sys_utsname_h != yes; then
     HAVE_SYS_UTSNAME_H=0
     HAVE_STRUCT_UTSNAME=0
index 8bf8448..2b799ef 100644 (file)
@@ -1,4 +1,4 @@
-# termios_h.m4 serial 2
+# termios_h.m4 serial 3
 dnl Copyright (C) 2010-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,8 +11,6 @@ AC_DEFUN([gl_TERMIOS_H],
   AC_REQUIRE([gl_TERMIOS_H_DEFAULTS])
 
   gl_CHECK_NEXT_HEADERS([termios.h])
-
-  AC_CHECK_HEADERS_ONCE([termios.h])
   if test $ac_cv_header_termios_h != yes; then
     HAVE_TERMIOS_H=0
   fi
index ba45e8b..c81a113 100644 (file)
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 52
+# unistd_h.m4 serial 53
 dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,8 +14,6 @@ AC_DEFUN([gl_UNISTD_H],
   AC_REQUIRE([AC_C_INLINE])
 
   gl_CHECK_NEXT_HEADERS([unistd.h])
-
-  AC_CHECK_HEADERS_ONCE([unistd.h])
   if test $ac_cv_header_unistd_h = yes; then
     HAVE_UNISTD_H=1
   else
index f16fd1b..e8adf89 100644 (file)
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Eric Blake.
 
-# wchar_h.m4 serial 36
+# wchar_h.m4 serial 37
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -17,7 +17,6 @@ AC_DEFUN([gl_WCHAR_H],
   dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
   dnl character support).
   dnl <wchar.h> is always overridden, because of GNULIB_POSIXCHECK.
-  AC_CHECK_HEADERS_ONCE([wchar.h])
   gl_CHECK_NEXT_HEADERS([wchar.h])
   if test $ac_cv_header_wchar_h = yes; then
     HAVE_WCHAR_H=1
index 575f680..014d9d6 100644 (file)
@@ -1,4 +1,4 @@
-# wctype_h.m4 serial 10
+# wctype_h.m4 serial 11
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
@@ -75,7 +75,7 @@ AC_DEFUN([gl_WCTYPE_H],
             ])
         ])
     fi
-    gl_CHECK_NEXT_HEADERS([wctype.h])
+    gl_NEXT_HEADERS([wctype.h])
     HAVE_WCTYPE_H=1
   else
     HAVE_WCTYPE_H=0