[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] gl_CHECK_NEXT_HEADERS implies AC_CHECK_HEADERS_ONCE
From: |
Paul Eggert |
Subject: |
[PATCH] gl_CHECK_NEXT_HEADERS implies AC_CHECK_HEADERS_ONCE |
Date: |
Wed, 19 Jan 2011 23:50:12 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 |
Here's a proposed patch to simplify gnulib's .m4 files slightly.
It doesn't affect behavior; it's just a minor refactoring.
Comments?
>From 7932675ddc06af7914aac92efd00734a62d59112 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Wed, 19 Jan 2011 22:21:06 -0800
Subject: [PATCH] gl_CHECK_NEXT_HEADERS implies AC_CHECK_HEADERS_ONCE
* 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 | 18 ++++++++++++++++++
m4/getopt.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 ++--
15 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 339dea9..4e2c221 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
2011-01-19 Paul Eggert <address@hidden>
+ gl_CHECK_NEXT_HEADERS implies AC_CHECK_HEADERS_ONCE
+ * 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.
+
assume <ctype.h>, ..., <time.h> exist
For years gnulib has been assuming the existence of the headers
<ctime.h>, <errno.h>, <fcntl.h>, <locale.h>, <signal.h>,
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index 793ab78..d351b84 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/netdb_h.m4 b/m4/netdb_h.m4
index 82afacd..9a01cd6 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 b9a250c..9f77cde 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 83b6493..6a46e47 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 9a43793..f656fda 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 4721d10..a044e37 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 <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], [[
diff --git a/m4/sys_file_h.m4 b/m4/sys_file_h.m4
index d665981..8538e1f 100644
--- a/m4/sys_file_h.m4
+++ b/m4/sys_file_h.m4
@@ -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
diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4
index e596c85..f167118 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 <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
diff --git a/m4/sys_times_h.m4 b/m4/sys_times_h.m4
index 508a3bf..61500cc 100644
--- a/m4/sys_times_h.m4
+++ b/m4/sys_times_h.m4
@@ -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], [[
diff --git a/m4/sys_utsname_h.m4 b/m4/sys_utsname_h.m4
index 7b261d8..7b48257 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 <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
diff --git a/m4/termios_h.m4 b/m4/termios_h.m4
index 8bf8448..2b799ef 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 ba45e8b..c81a113 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 f16fd1b..e8adf89 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 <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
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
index 575f680..014d9d6 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 <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
--
1.7.3
- [PATCH] gl_CHECK_NEXT_HEADERS implies AC_CHECK_HEADERS_ONCE,
Paul Eggert <=