From 8397b02df89ed84cd54959cc2dbc1bb1852cfee9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 21 Jan 2011 15:46:54 -0800 Subject: [PATCH] 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. --- ChangeLog | 21 +++++++++++++++++++++ m4/getopt.m4 | 3 +-- m4/include_next.m4 | 3 +++ m4/netdb_h.m4 | 3 +-- m4/pthread.m4 | 1 - m4/sched_h.m4 | 3 +-- m4/search_h.m4 | 3 +-- m4/spawn_h.m4 | 3 +-- m4/sys_file_h.m4 | 3 +-- m4/sys_select_h.m4 | 3 +-- m4/sys_times_h.m4 | 3 +-- m4/sys_utsname_h.m4 | 3 +-- m4/termios_h.m4 | 4 +--- m4/unistd_h.m4 | 4 +--- m4/wchar_h.m4 | 3 +-- m4/wctype_h.m4 | 4 ++-- 16 files changed, 38 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index c72b3d834..3a7bd3856 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2011-01-21 Paul Eggert + + 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 maintainer-makefile: work with older git for submodule check diff --git a/m4/getopt.m4 b/m4/getopt.m4 index 793ab789d..d351b842b 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -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 diff --git a/m4/include_next.m4 b/m4/include_next.m4 index 2b20a76d5..b3c784918 100644 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -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]) diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4 index 82afacd51..9a01cd6a7 100644 --- a/m4/netdb_h.m4 +++ b/m4/netdb_h.m4 @@ -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 diff --git a/m4/pthread.m4 b/m4/pthread.m4 index b9a250c1e..9f77cde09 100644 --- a/m4/pthread.m4 +++ b/m4/pthread.m4 @@ -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 diff --git a/m4/sched_h.m4 b/m4/sched_h.m4 index 83b649310..6a46e4745 100644 --- a/m4/sched_h.m4 +++ b/m4/sched_h.m4 @@ -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 diff --git a/m4/search_h.m4 b/m4/search_h.m4 index 9a43793fd..f656fda77 100644 --- a/m4/search_h.m4 +++ b/m4/search_h.m4 @@ -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 diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4 index 4721d1028..a044e372f 100644 --- a/m4/spawn_h.m4 +++ b/m4/spawn_h.m4 @@ -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 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], [[ diff --git a/m4/sys_file_h.m4 b/m4/sys_file_h.m4 index d665981bd..8538e1fa8 100644 --- a/m4/sys_file_h.m4 +++ b/m4/sys_file_h.m4 @@ -1,5 +1,5 @@ # Configure a replacement for . -# 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 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 diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4 index e596c85f4..f1671186f 100644 --- a/m4/sys_select_h.m4 +++ b/m4/sys_select_h.m4 @@ -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 is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([sys/select.h]) if test $ac_cv_header_sys_select_h = yes; then diff --git a/m4/sys_times_h.m4 b/m4/sys_times_h.m4 index 508a3bf03..61500cc24 100644 --- a/m4/sys_times_h.m4 +++ b/m4/sys_times_h.m4 @@ -1,5 +1,5 @@ # Configure a replacement for . -# 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 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], [[ diff --git a/m4/sys_utsname_h.m4 b/m4/sys_utsname_h.m4 index 7b261d819..7b48257f5 100644 --- a/m4/sys_utsname_h.m4 +++ b/m4/sys_utsname_h.m4 @@ -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 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 diff --git a/m4/termios_h.m4 b/m4/termios_h.m4 index 8bf8448fd..2b799efb4 100644 --- a/m4/termios_h.m4 +++ b/m4/termios_h.m4 @@ -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 diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index ba45e8b7a..c81a1138e 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -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 diff --git a/m4/wchar_h.m4 b/m4/wchar_h.m4 index f16fd1b60..e8adf8924 100644 --- a/m4/wchar_h.m4 +++ b/m4/wchar_h.m4 @@ -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 (missing in Linux uClibc when built without wide dnl character support). dnl 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 diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4 index 575f680be..014d9d672 100644 --- a/m4/wctype_h.m4 +++ b/m4/wctype_h.m4 @@ -1,4 +1,4 @@ -# wctype_h.m4 serial 10 +# wctype_h.m4 serial 11 dnl A placeholder for ISO C99 , 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 -- 2.11.0