summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog119
-rw-r--r--m4/alloca.m410
-rw-r--r--m4/argz.m413
-rw-r--r--m4/assert_h.m46
-rw-r--r--m4/byteswap.m48
-rw-r--r--m4/errno_h.m410
-rw-r--r--m4/execinfo.m412
-rw-r--r--m4/float_h.m420
-rw-r--r--m4/fnmatch_h.m415
-rw-r--r--m4/getopt.m410
-rw-r--r--m4/glob_h.m415
-rw-r--r--m4/gnulib-common.m426
-rw-r--r--m4/iconv_h.m416
-rw-r--r--m4/ieee754-h.m46
-rw-r--r--m4/inttypes.m44
-rw-r--r--m4/libgmp.m47
-rw-r--r--m4/libtextstyle-optional.m48
-rw-r--r--m4/limits-h.m49
-rw-r--r--m4/monetary_h.m48
-rw-r--r--m4/net_if_h.m48
-rw-r--r--m4/netinet_in_h.m48
-rw-r--r--m4/parse-datetime.m43
-rw-r--r--m4/perror.m44
-rw-r--r--m4/selinux-context-h.m410
-rw-r--r--m4/selinux-label-h.m46
-rw-r--r--m4/stdalign.m47
-rw-r--r--m4/stdarg.m48
-rw-r--r--m4/stdbool.m417
-rw-r--r--m4/stddef_h.m414
-rw-r--r--m4/stdint.m48
-rw-r--r--m4/stdnoreturn.m48
-rw-r--r--m4/strerror.m44
-rw-r--r--m4/strerror_r.m46
-rw-r--r--m4/sys_socket_h.m47
-rw-r--r--m4/sysexits.m410
-rw-r--r--modules/alloca-opt1
-rw-r--r--modules/argz1
-rw-r--r--modules/assert-h1
-rw-r--r--modules/byteswap1
-rw-r--r--modules/errno1
-rw-r--r--modules/execinfo4
-rw-r--r--modules/float1
-rw-r--r--modules/fnmatch2
-rw-r--r--modules/fnmatch-h1
-rw-r--r--modules/getopt-posix1
-rw-r--r--modules/glob2
-rw-r--r--modules/glob-h1
-rw-r--r--modules/iconv-h1
-rw-r--r--modules/iconv_open2
-rw-r--r--modules/ieee754-h1
-rw-r--r--modules/libgmp6
-rw-r--r--modules/libtextstyle-optional4
-rw-r--r--modules/limits-h1
-rw-r--r--modules/monetary1
-rw-r--r--modules/net_if1
-rw-r--r--modules/netinet_in1
-rw-r--r--modules/selinux-h2
-rw-r--r--modules/sigsegv9
-rw-r--r--modules/stdalign1
-rw-r--r--modules/stdarg1
-rw-r--r--modules/stdbool3
-rw-r--r--modules/stddef1
-rw-r--r--modules/stdint3
-rw-r--r--modules/stdnoreturn1
-rw-r--r--modules/sysexits1
65 files changed, 315 insertions, 192 deletions
diff --git a/ChangeLog b/ChangeLog
index 29296575b1..193405c6a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,124 @@
2021-12-15 Bruno Haible <bruno@clisp.org>
+ Move .h file names out of the *.m4 files.
+ This is useful because Autoconf macros defined in *.m4 files can be
+ AC_REQUIREd. In the configure file, they are then expanded before
+ gl_INIT, i.e. at a place where it is not known whether they are required
+ for the lib/ or for the tests/ directory (or both).
+ * m4/gnulib-common.m4 (gl_CONDITIONAL_HEADER): New macro.
+ * m4/alloca.m4 (gl_FUNC_ALLOCA): Set GL_GENERATE_ALLOCA_H instead of
+ ALLOCA_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/alloca-opt (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/argz.m4 (gl_FUNC_ARGZ): Set GL_GENERATE_ARGZ_H instead of ARGZ_H.
+ Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/argz (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/assert_h.m4 (gl_ASSERT_H): Set GL_GENERATE_ASSERT_H instead of
+ ASSERT_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/assert-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/byteswap.m4 (gl_BYTESWAP): Set GL_GENERATE_BYTESWAP_H instead of
+ BYTESWAP_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/byteswap (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Set GL_GENERATE_ERRNO_H instead of
+ ERRNO_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ (gl_REPLACE_ERRNO_VALUE): Update.
+ * m4/perror.m4 (gl_FUNC_PERROR): Update.
+ * m4/strerror.m4 (gl_FUNC_STRERROR): Update.
+ * m4/strerror_r.m4 (gl_FUNC_STRERROR_R, gl_FUNC_STRERROR_R_WORKS):
+ Update.
+ * modules/errno (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/execinfo.m4 (gl_EXECINFO_H): Set GL_GENERATE_EXECINFO_H instead of
+ EXECINFO_H. Drop AC_SUBST and AM_CONDITIONAL invocations. Drop AC_LIBOBJ
+ invocation.
+ * modules/execinfo (configure.ac): Invoke gl_CONDITIONAL_HEADER and
+ AC_LIBOBJ.
+ * m4/float_h.m4 (gl_FLOAT_H): Set GL_GENERATE_FLOAT_H instead of
+ FLOAT_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/float (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/fnmatch_h.m4 (gl_FNMATCH_H, gl_REPLACE_FNMATCH_H): Set
+ GL_GENERATE_FNMATCH_H instead of FNMATCH_H. Drop AC_SUBST and
+ AM_CONDITIONAL invocations.
+ * modules/fnmatch-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * modules/fnmatch (configure.ac): Likewise.
+ * m4/getopt.m4 (gl_FUNC_GETOPT_POSIX, gl_GETOPT_SUBSTITUTE_HEADER): Set
+ GL_GENERATE_GETOPT_H instead of GETOPT_H. Set GL_GENERATE_GETOPT_CDEFS_H
+ instead of GETOPT_CDEFS_H. Drop AC_SUBST invocations.
+ * modules/getopt-posix (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/glob_h.m4 (gl_GLOB_H, gl_REPLACE_GLOB_H): Set GL_GENERATE_GLOB_H
+ instead of GLOB_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/glob-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * modules/glob (configure.ac): Likewise.
+ * m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS, gl_REPLACE_ICONV_H): Set
+ GL_GENERATE_ICONV_H instead of ICONV_H. Drop AC_SUBST and AM_CONDITIONAL
+ invocations.
+ (gl_ICONV_H): Update.
+ * modules/iconv-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * modules/iconv_open (configure.ac): Likewise.
+ * m4/ieee754-h.m4 (gl_IEEE754_H): Set GL_GENERATE_IEEE754_H instead of
+ IEEE754_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/ieee754-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/libgmp.m4 (gl_LIBGMP): Set GL_GENERATE_GMP_H instead of GMP_H. Drop
+ AC_SUBST invocation.
+ * modules/libgmp (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ (Makefile.am): Use GL_GENERATE_GMP_H.
+ * m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Set
+ GL_GENERATE_TEXTSTYLE_H instead of TEXTSTYLE_H. Drop AC_SUBST and
+ AM_CONDITIONAL invocations.
+ * modules/libtextstyle-optional (configure.ac): Invoke
+ gl_CONDITIONAL_HEADER.
+ * m4/limits-h.m4 (gl_LIMITS_H, gl_REPLACE_LIMITS_H): Set
+ GL_GENERATE_LIMITS_H instead of LIMITS_H. Drop AC_SUBST and
+ AM_CONDITIONAL invocations.
+ * modules/limits-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/monetary_h.m4 (gl_MONETARY_H): Set GL_GENERATE_MONETARY_H instead
+ of MONETARY_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/monetary (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/net_if_h.m4 (gl_HEADER_NET_IF): Set GL_GENERATE_NET_IF_H instead of
+ NET_IF_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/net_if (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/netinet_in_h.m4 (gl_HEADER_NETINET_IN): Set
+ GL_GENERATE_NETINET_IN_H instead of NETINET_IN_H. Drop AC_SUBST and
+ AM_CONDITIONAL invocations.
+ * modules/netinet_in (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/selinux-context-h.m4 (gl_HEADERS_SELINUX_CONTEXT_H): Set
+ GL_GENERATE_SELINUX_CONTEXT_H instead of SELINUX_CONTEXT_H. Drop
+ AC_SUBST and AM_CONDITIONAL invocations.
+ * m4/selinux-label-h.m4 (gl_HEADERS_SELINUX_LABEL_H): Set
+ GL_GENERATE_SELINUX_LABEL_H instead of SELINUX_LABEL_H. Drop AC_SUBST
+ and AM_CONDITIONAL invocations.
+ * modules/selinux-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/stdalign.m4 (gl_STDALIGN_H): Set GL_GENERATE_STDALIGN_H instead of
+ STDALIGN_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/stdalign (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/stdarg.m4 (gl_STDARG_H): Set GL_GENERATE_STDARG_H instead of
+ STDARG_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/stdarg (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/stdbool.m4 (gl_STDBOOL_H): Renamed from AM_STDBOOL_H. Set
+ GL_GENERATE_STDBOOL_H instead of STDBOOL_H. Drop AC_SUBST and
+ AM_CONDITIONAL invocations.
+ * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Don't require AM_STDBOOL_H.
+ * modules/stdbool (configure.ac): Invoke gl_STDBOOL_H instead of
+ AM_STDBOOL_H. Invoke gl_CONDITIONAL_HEADER.
+ * m4/stddef_h.m4 (gl_STDDEF_H): Set GL_GENERATE_STDDEF_H instead of
+ STDDEF_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/stddef (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/stdint.m4 (gl_STDINT_H): Set GL_GENERATE_STDINT_H instead of
+ STDINT_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): Update.
+ * modules/stdint (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/stdnoreturn.m4 (gl_STDNORETURN_H): Set GL_GENERATE_STDNORETURN_H
+ instead of STDNORETURN_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/stdnoreturn (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * m4/sys_socket_h.m4 (gl_SYS_SOCKET_H): Set GL_GENERATE_SYS_SOCKET_H
+ instead of SYS_SOCKET_H.
+ * m4/sysexits.m4 (gl_SYSEXITS): Set GL_GENERATE_SYSEXITS_H instead of
+ SYSEXITS_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
+ * modules/sysexits (configure.ac): Invoke gl_CONDITIONAL_HEADER.
+ * modules/sigsegv (configure.ac): Set GL_GENERATE_SIGSEGV_H instead of
+ SIGSEGV_H. Drop AC_SUBST and AM_CONDITIONAL invocations. Invoke
+ gl_CONDITIONAL_HEADER.
+
+2021-12-15 Bruno Haible <bruno@clisp.org>
+
Fix creation of build directories with non-recursive-gnulib-prefix-hack.
This is necessary for executing "make" in a VPATH build of a package
that uses prefix-gnulib-mk and a module such as alloca-opt.
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index ba2f679d8e..7e474aa681 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,4 +1,4 @@
-# alloca.m4 serial 20
+# alloca.m4 serial 21
dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
@@ -26,17 +26,15 @@ AC_DEFUN([gl_FUNC_ALLOCA],
AC_DEFINE([HAVE_ALLOCA], [1],
[Define to 1 if you have 'alloca' after including <alloca.h>,
a header that may be supplied by this distribution.])
- ALLOCA_H=alloca.h
+ GL_GENERATE_ALLOCA_H=true
else
dnl alloca exists as a library function, i.e. it is slow and probably
dnl a memory leak. Don't define HAVE_ALLOCA in this case.
- ALLOCA_H=
+ GL_GENERATE_ALLOCA_H=false
fi
else
- ALLOCA_H=alloca.h
+ GL_GENERATE_ALLOCA_H=true
fi
- AC_SUBST([ALLOCA_H])
- AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
if test $ac_cv_working_alloca_h = yes; then
HAVE_ALLOCA_H=1
diff --git a/m4/argz.m4 b/m4/argz.m4
index d587bd8c40..3959d6eb2b 100644
--- a/m4/argz.m4
+++ b/m4/argz.m4
@@ -7,7 +7,7 @@
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# serial 13 argz.m4
+# serial 14 argz.m4
AC_DEFUN([gl_FUNC_ARGZ],
[gl_PREREQ_ARGZ
@@ -27,8 +27,8 @@ AC_CHECK_TYPES([error_t],
# include <argz.h>
#endif])
-ARGZ_H=
-AC_CHECK_FUNC([argz_replace], [], [ARGZ_H=argz.h])
+GL_GENERATE_ARGZ_H=false
+AC_CHECK_FUNC([argz_replace], [], [GL_GENERATE_ARGZ_H=true])
dnl if have system argz functions, allow forced use of
dnl libltdl-supplied implementation (and default to do so
@@ -39,7 +39,7 @@ dnl provides them, yet they are broken, is cygwin
dnl releases prior to 5-May-2007 (1.5.24 and earlier)
dnl So, it's more straightforward simply to special case
dnl this for known bad systems.
-AS_IF([test -z "$ARGZ_H"],
+AS_IF([! $GL_GENERATE_ARGZ_H],
[AC_CACHE_CHECK(
[if argz actually works],
[lt_cv_sys_argz_works],
@@ -71,10 +71,7 @@ AS_IF([test -z "$ARGZ_H"],
AS_IF([test "$lt_cv_sys_argz_works" = yes],
[AC_DEFINE([HAVE_WORKING_ARGZ], [1],
[This value is set to 1 to indicate that the system argz facility works])],
- [ARGZ_H=argz.h])])
-
-AC_SUBST([ARGZ_H])
-AM_CONDITIONAL([GL_GENERATE_ARGZ_H], [test -n "$ARGZ_H"])
+ [GL_GENERATE_ARGZ_H=true])])
])
# Prerequisites of lib/argz.c.
diff --git a/m4/assert_h.m4 b/m4/assert_h.m4
index 40bb0ea0f4..d3df1f3ae2 100644
--- a/m4/assert_h.m4
+++ b/m4/assert_h.m4
@@ -8,7 +8,7 @@ dnl From Paul Eggert.
AC_DEFUN([gl_ASSERT_H],
[
- ASSERT_H=
+ GL_GENERATE_ASSERT_H=false
AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
@@ -23,9 +23,7 @@ AC_DEFUN([gl_ASSERT_H],
[gl_cv_static_assert=yes],
[gl_cv_static_assert=no])])
if test $gl_cv_static_assert = no; then
- ASSERT_H=assert.h
+ GL_GENERATE_ASSERT_H=true
gl_NEXT_HEADERS([assert.h])
fi
- AC_SUBST([ASSERT_H])
- AM_CONDITIONAL([GL_GENERATE_ASSERT_H], [test -n "$ASSERT_H"])
])
diff --git a/m4/byteswap.m4 b/m4/byteswap.m4
index 1083b4c9e2..db35b527a6 100644
--- a/m4/byteswap.m4
+++ b/m4/byteswap.m4
@@ -1,4 +1,4 @@
-# byteswap.m4 serial 4
+# byteswap.m4 serial 5
dnl Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,10 +10,8 @@ AC_DEFUN([gl_BYTESWAP],
[
dnl Prerequisites of lib/byteswap.in.h.
AC_CHECK_HEADERS([byteswap.h], [
- BYTESWAP_H=''
+ GL_GENERATE_BYTESWAP_H=false
], [
- BYTESWAP_H='byteswap.h'
+ GL_GENERATE_BYTESWAP_H=true
])
- AC_SUBST([BYTESWAP_H])
- AM_CONDITIONAL([GL_GENERATE_BYTESWAP_H], [test -n "$BYTESWAP_H"])
])
diff --git a/m4/errno_h.m4 b/m4/errno_h.m4
index 51dfe92938..7f5feabb2b 100644
--- a/m4/errno_h.m4
+++ b/m4/errno_h.m4
@@ -1,4 +1,4 @@
-# errno_h.m4 serial 13
+# errno_h.m4 serial 14
dnl Copyright (C) 2004, 2006, 2008-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -68,13 +68,11 @@ booboo
[gl_cv_header_errno_h_complete=yes])
])
if test $gl_cv_header_errno_h_complete = yes; then
- ERRNO_H=''
+ GL_GENERATE_ERRNO_H=false
else
gl_NEXT_HEADERS([errno.h])
- ERRNO_H='errno.h'
+ GL_GENERATE_ERRNO_H=true
fi
- AC_SUBST([ERRNO_H])
- AM_CONDITIONAL([GL_GENERATE_ERRNO_H], [test -n "$ERRNO_H"])
gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
gl_REPLACE_ERRNO_VALUE([ENOLINK])
gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
@@ -88,7 +86,7 @@ booboo
# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
[
- if test -n "$ERRNO_H"; then
+ if $GL_GENERATE_ERRNO_H; then
AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
AC_EGREP_CPP([yes],[
#include <errno.h>
diff --git a/m4/execinfo.m4 b/m4/execinfo.m4
index 75ab44beee..581b173a23 100644
--- a/m4/execinfo.m4
+++ b/m4/execinfo.m4
@@ -10,7 +10,7 @@ AC_DEFUN([gl_EXECINFO_H],
AC_CHECK_HEADERS_ONCE([execinfo.h])
LIB_EXECINFO=''
- EXECINFO_H='execinfo.h'
+ GL_GENERATE_EXECINFO_H=true
if test $ac_cv_header_execinfo_h = yes; then
gl_saved_libs=$LIBS
@@ -18,14 +18,10 @@ AC_DEFUN([gl_EXECINFO_H],
[test "$ac_cv_search_backtrace_symbols_fd" = "none required" ||
LIB_EXECINFO=$ac_cv_search_backtrace_symbols_fd])
LIBS=$gl_saved_libs
- test "$ac_cv_search_backtrace_symbols_fd" = no || EXECINFO_H=''
+ if test "$ac_cv_search_backtrace_symbols_fd" != no; then
+ GL_GENERATE_EXECINFO_H=false
+ fi
fi
- if test -n "$EXECINFO_H"; then
- AC_LIBOBJ([execinfo])
- fi
-
- AC_SUBST([EXECINFO_H])
AC_SUBST([LIB_EXECINFO])
- AM_CONDITIONAL([GL_GENERATE_EXECINFO_H], [test -n "$EXECINFO_H"])
])
diff --git a/m4/float_h.m4 b/m4/float_h.m4
index ba38a28901..c6a37d9096 100644
--- a/m4/float_h.m4
+++ b/m4/float_h.m4
@@ -1,4 +1,4 @@
-# float_h.m4 serial 12
+# float_h.m4 serial 13
dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,18 +8,18 @@ AC_DEFUN([gl_FLOAT_H],
[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
- FLOAT_H=
+ GL_GENERATE_FLOAT_H=false
REPLACE_FLOAT_LDBL=0
case "$host_os" in
aix* | beos* | openbsd* | mirbsd* | irix*)
- FLOAT_H=float.h
+ GL_GENERATE_FLOAT_H=true
;;
freebsd* | dragonfly*)
case "$host_cpu" in
changequote(,)dnl
i[34567]86 )
changequote([,])dnl
- FLOAT_H=float.h
+ GL_GENERATE_FLOAT_H=true
;;
x86_64 )
# On x86_64 systems, the C compiler may still be generating
@@ -33,21 +33,21 @@ changequote([,])dnl
#endif
]])],
[],
- [FLOAT_H=float.h])
+ [GL_GENERATE_FLOAT_H=true])
;;
esac
;;
linux*)
case "$host_cpu" in
powerpc*)
- FLOAT_H=float.h
+ GL_GENERATE_FLOAT_H=true
;;
esac
;;
esac
case "$host_os" in
aix* | freebsd* | dragonfly* | linux*)
- if test -n "$FLOAT_H"; then
+ if $GL_GENERATE_FLOAT_H; then
REPLACE_FLOAT_LDBL=1
fi
;;
@@ -95,14 +95,12 @@ int main ()
REPLACE_ITOLD=1
dnl We add the workaround to <float.h> but also to <math.h>,
dnl to increase the chances that the fix function gets pulled in.
- FLOAT_H=float.h
+ GL_GENERATE_FLOAT_H=true
;;
esac
- if test -n "$FLOAT_H"; then
+ if $GL_GENERATE_FLOAT_H; then
gl_NEXT_HEADERS([float.h])
fi
- AC_SUBST([FLOAT_H])
- AM_CONDITIONAL([GL_GENERATE_FLOAT_H], [test -n "$FLOAT_H"])
AC_SUBST([REPLACE_ITOLD])
])
diff --git a/m4/fnmatch_h.m4 b/m4/fnmatch_h.m4
index e9bcb66c69..0d75d6a594 100644
--- a/m4/fnmatch_h.m4
+++ b/m4/fnmatch_h.m4
@@ -1,4 +1,4 @@
-# fnmatch_h.m4 serial 7
+# fnmatch_h.m4 serial 8
dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -27,20 +27,18 @@ AC_DEFUN_ONCE([gl_FNMATCH_H],
AC_SUBST([HAVE_FNMATCH_H])
m4_ifdef([gl_POSIXCHECK],
- [FNMATCH_H=fnmatch.h],
- [FNMATCH_H=''
+ [GL_GENERATE_FNMATCH_H=true],
+ [GL_GENERATE_FNMATCH_H=false
if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
dnl Override <fnmatch.h> always, to support the C++ GNULIB_NAMESPACE.
- FNMATCH_H=fnmatch.h
+ GL_GENERATE_FNMATCH_H=true
else
if test $ac_cv_header_fnmatch_h != yes; then
dnl Provide a substitute <fnmatch.h> file.
- FNMATCH_H=fnmatch.h
+ GL_GENERATE_FNMATCH_H=true
fi
fi
])
- AC_SUBST([FNMATCH_H])
- AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
@@ -53,8 +51,7 @@ dnl Unconditionally enables the replacement of <fnmatch.h>.
AC_DEFUN([gl_REPLACE_FNMATCH_H],
[
gl_FNMATCH_H_REQUIRE_DEFAULTS
- FNMATCH_H='fnmatch.h'
- AM_CONDITIONAL([GL_GENERATE_FNMATCH_H], [test -n "$FNMATCH_H"])
+ GL_GENERATE_FNMATCH_H=true
])
# gl_FNMATCH_MODULE_INDICATOR([modulename])
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index bb95c5ea28..9b71159bc5 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 47
+# getopt.m4 serial 48
dnl Copyright (C) 2002-2006, 2008-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -21,6 +21,8 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
REPLACE_GETOPT=1
fi
])
+ GL_GENERATE_GETOPT_H=false
+ GL_GENERATE_GETOPT_CDEFS_H=false
if test $REPLACE_GETOPT = 1; then
dnl Arrange for getopt.h to be created.
gl_GETOPT_SUBSTITUTE_HEADER
@@ -374,8 +376,6 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
[Define to rpl_ if the getopt replacement functions and variables
should be used.])
- GETOPT_H=getopt.h
- GETOPT_CDEFS_H=getopt-cdefs.h
- AC_SUBST([GETOPT_H])
- AC_SUBST([GETOPT_CDEFS_H])
+ GL_GENERATE_GETOPT_H=true
+ GL_GENERATE_GETOPT_CDEFS_H=true
])
diff --git a/m4/glob_h.m4 b/m4/glob_h.m4
index 5332c814bc..62b17a7b5a 100644
--- a/m4/glob_h.m4
+++ b/m4/glob_h.m4
@@ -1,4 +1,4 @@
-# glob_h.m4 serial 8
+# glob_h.m4 serial 9
dnl Copyright (C) 2018-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -22,20 +22,18 @@ AC_DEFUN_ONCE([gl_GLOB_H],
AC_SUBST([HAVE_GLOB_H])
m4_ifdef([gl_POSIXCHECK],
- [GLOB_H=glob.h],
- [GLOB_H=''
+ [GL_GENERATE_GLOB_H=true],
+ [GL_GENERATE_GLOB_H=false
if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
dnl Override <glob.h> always, to support the C++ GNULIB_NAMESPACE.
- GLOB_H=glob.h
+ GL_GENERATE_GLOB_H=true
else
if test $ac_cv_header_glob_h != yes; then
dnl Provide a substitute <glob.h> file.
- GLOB_H=glob.h
+ GL_GENERATE_GLOB_H=true
fi
fi
])
- AC_SUBST([GLOB_H])
- AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use.
@@ -48,8 +46,7 @@ dnl Unconditionally enables the replacement of <glob.h>.
AC_DEFUN([gl_REPLACE_GLOB_H],
[
gl_GLOB_H_REQUIRE_DEFAULTS
- GLOB_H='glob.h'
- AM_CONDITIONAL([GL_GENERATE_GLOB_H], [test -n "$GLOB_H"])
+ GL_GENERATE_GLOB_H=true
])
# gl_GLOB_MODULE_INDICATOR([modulename])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 12b19dbcb4..9061efb519 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 67
+# gnulib-common.m4 serial 68
dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -879,6 +879,30 @@ AC_DEFUN([gl_CXX_ALLOW_WARNINGS],
AC_SUBST([GL_CXXFLAG_ALLOW_WARNINGS])
])
+dnl gl_CONDITIONAL_HEADER([foo.h])
+dnl takes a shell variable GL_GENERATE_FOO_H (with value true or false) as input
+dnl and produces
+dnl - an AC_SUBSTed variable FOO_H that is either a file name or empty, based
+dnl on whether GL_GENERATE_FOO_H is true or false,
+dnl - an Automake conditional GL_GENERATE_FOO_H that evaluates to the value of
+dnl the shell variable GL_GENERATE_FOO_H.
+AC_DEFUN([gl_CONDITIONAL_HEADER],
+[
+ m4_pushdef([gl_header_name], AS_TR_SH(m4_toupper($1)))
+ m4_pushdef([gl_generate_var], [GL_GENERATE_]AS_TR_SH(m4_toupper($1)))
+ m4_pushdef([gl_generate_cond], [GL_GENERATE_]AS_TR_SH(m4_toupper($1)))
+ case "$gl_generate_var" in
+ false) gl_header_name='' ;;
+ true) gl_header_name='$1' ;;
+ *) echo "*** gl_generate_var is not set correctly" 1>&2; exit 1 ;;
+ esac
+ AC_SUBST(gl_header_name)
+ AM_CONDITIONAL(gl_generate_cond, [$gl_generate_var])
+ m4_popdef([gl_generate_cond])
+ m4_popdef([gl_generate_var])
+ m4_popdef([gl_header_name])
+])
+
dnl Expands to some code for use in .c programs that, on native Windows, defines
dnl the Microsoft deprecated alias function names to the underscore-prefixed
dnl actual function names. With this macro, these function names are available
diff --git a/m4/iconv_h.m4 b/m4/iconv_h.m4
index 2940988297..bf15f3d5cd 100644
--- a/m4/iconv_h.m4
+++ b/m4/iconv_h.m4
@@ -1,4 +1,4 @@
-# iconv_h.m4 serial 15
+# iconv_h.m4 serial 16
dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,8 +8,8 @@ AC_DEFUN_ONCE([gl_ICONV_H],
[
AC_REQUIRE([gl_ICONV_H_DEFAULTS])
- dnl Execute this unconditionally, because ICONV_H may be set by other
- dnl modules, after this code is executed.
+ dnl Execute this unconditionally, because GL_GENERATE_ICONV_H may be set to
+ dnl true by other modules, after this code is executed.
gl_CHECK_NEXT_HEADERS([iconv.h])
dnl Check for declarations of anything we want to poison if the
@@ -25,8 +25,7 @@ dnl Unconditionally enables the replacement of <iconv.h>.
AC_DEFUN([gl_REPLACE_ICONV_H],
[
gl_ICONV_H_REQUIRE_DEFAULTS
- ICONV_H='iconv.h'
- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"])
+ GL_GENERATE_ICONV_H=true
])
# gl_ICONV_MODULE_INDICATOR([modulename])
@@ -60,13 +59,12 @@ AC_DEFUN([gl_ICONV_H_DEFAULTS],
REPLACE_ICONV=0; AC_SUBST([REPLACE_ICONV])
REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN])
REPLACE_ICONV_UTF=0; AC_SUBST([REPLACE_ICONV_UTF])
- ICONV_H=''; AC_SUBST([ICONV_H])
+ GL_GENERATE_ICONV_H=false
m4_ifdef([gl_POSIXCHECK],
- [ICONV_H='iconv.h'],
+ [GL_GENERATE_ICONV_H=true],
[if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
dnl Override <fnmatch.h> always, to support the C++ GNULIB_NAMESPACE.
- ICONV_H='iconv.h'
+ GL_GENERATE_ICONV_H=true
fi
])
- AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"])
])
diff --git a/m4/ieee754-h.m4 b/m4/ieee754-h.m4
index 68af3bd7eb..0712613b6f 100644
--- a/m4/ieee754-h.m4
+++ b/m4/ieee754-h.m4
@@ -10,12 +10,10 @@ AC_DEFUN([gl_IEEE754_H],
AC_REQUIRE([AC_C_BIGENDIAN])
AC_CHECK_HEADERS_ONCE([ieee754.h])
if test $ac_cv_header_ieee754_h = yes; then
- IEEE754_H=
+ GL_GENERATE_IEEE754_H=false
else
- IEEE754_H=ieee754.h
+ GL_GENERATE_IEEE754_H=true
AC_DEFINE([_GL_REPLACE_IEEE754_H], 1,
[Define to 1 if <ieee754.h> is missing.])
fi
- AC_SUBST([IEEE754_H])
- AM_CONDITIONAL([GL_GENERATE_IEEE754_H], [test -n "$IEEE754_H"])
])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
index 64b1de5c42..c446aa8277 100644
--- a/m4/inttypes.m4
+++ b/m4/inttypes.m4
@@ -1,4 +1,4 @@
-# inttypes.m4 serial 35
+# inttypes.m4 serial 36
dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -36,7 +36,7 @@ AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
AC_DEFUN([gl_INTTYPES_PRI_SCN],
[
PRIPTR_PREFIX=
- if test -n "$STDINT_H"; then
+ if $GL_GENERATE_STDINT_H; then
dnl Using the gnulib <stdint.h>. It defines intptr_t to 'long' or
dnl 'long long', depending on _WIN64.
AC_COMPILE_IFELSE(
diff --git a/m4/libgmp.m4 b/m4/libgmp.m4
index c630a19e64..a2103dde88 100644
--- a/m4/libgmp.m4
+++ b/m4/libgmp.m4
@@ -1,4 +1,4 @@
-# libgmp.m4 serial 5
+# libgmp.m4 serial 6
# Configure the GMP library or a replacement.
dnl Copyright 2020-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
@@ -59,11 +59,10 @@ AC_DEFUN([gl_LIBGMP],
[ Try specifying --with-libgmp-prefix=DIR.])])
fi])
if test $HAVE_LIBGMP = yes && test "$ac_cv_header_gmp_h" = yes; then
- GMP_H=
+ GL_GENERATE_GMP_H=false
else
- GMP_H=gmp.h
+ GL_GENERATE_GMP_H=true
fi
- AC_SUBST([GMP_H])
AM_CONDITIONAL([GL_GENERATE_MINI_GMP_H],
[test $HAVE_LIBGMP != yes])
AM_CONDITIONAL([GL_GENERATE_GMP_GMP_H],
diff --git a/m4/libtextstyle-optional.m4 b/m4/libtextstyle-optional.m4
index 2422de1528..74a5aeaf28 100644
--- a/m4/libtextstyle-optional.m4
+++ b/m4/libtextstyle-optional.m4
@@ -1,4 +1,4 @@
-# libtextstyle-optional.m4 serial 2
+# libtextstyle-optional.m4 serial 3
dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -23,12 +23,10 @@ AC_DEFUN([gl_LIBTEXTSTYLE_OPTIONAL],
[
gl_LIBTEXTSTYLE([$1])
if test $HAVE_LIBTEXTSTYLE = yes; then
- TEXTSTYLE_H=
+ GL_GENERATE_TEXTSTYLE_H=false
else
- TEXTSTYLE_H=textstyle.h
+ GL_GENERATE_TEXTSTYLE_H=true
AC_REQUIRE([AC_C_INLINE])
AC_CHECK_FUNCS_ONCE([tcdrain])
fi
- AC_SUBST([TEXTSTYLE_H])
- AM_CONDITIONAL([GL_GENERATE_TEXTSTYLE_H], [test -n "$TEXTSTYLE_H"])
])
diff --git a/m4/limits-h.m4 b/m4/limits-h.m4
index 00c9fe9e50..c82f6c6781 100644
--- a/m4/limits-h.m4
+++ b/m4/limits-h.m4
@@ -27,18 +27,15 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
[gl_cv_header_limits_width=yes],
[gl_cv_header_limits_width=no])])
if test "$gl_cv_header_limits_width" = yes; then
- LIMITS_H=
+ GL_GENERATE_LIMITS_H=false
else
- LIMITS_H=limits.h
+ GL_GENERATE_LIMITS_H=true
fi
- AC_SUBST([LIMITS_H])
- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
])
dnl Unconditionally enables the replacement of <limits.h>.
AC_DEFUN([gl_REPLACE_LIMITS_H],
[
AC_REQUIRE([gl_LIMITS_H])
- LIMITS_H='limits.h'
- AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+ GL_GENERATE_LIMITS_H=true
])
diff --git a/m4/monetary_h.m4 b/m4/monetary_h.m4
index 8ffa2af113..1f3877566f 100644
--- a/m4/monetary_h.m4
+++ b/m4/monetary_h.m4
@@ -1,4 +1,4 @@
-# monetary_h.m4 serial 8
+# monetary_h.m4 serial 9
dnl Copyright (C) 2017-2021 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,7 @@ AC_DEFUN_ONCE([gl_MONETARY_H],
dnl - C++ GNULIB_NAMESPACE support may be requested, or
dnl - the system already has a <monetary.h>.
if m4_ifdef([gl_POSIXCHECK], [true], [m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]) || test $ac_cv_header_monetary_h = yes]); then
- MONETARY_H='monetary.h'
+ GL_GENERATE_MONETARY_H=true
gl_CHECK_NEXT_HEADERS([monetary.h])
if test $ac_cv_header_monetary_h = yes; then
@@ -41,10 +41,8 @@ AC_DEFUN_ONCE([gl_MONETARY_H],
AC_REQUIRE([AC_C_RESTRICT])
else
- MONETARY_H=''
+ GL_GENERATE_MONETARY_H=false
fi
- AC_SUBST([MONETARY_H])
- AM_CONDITIONAL([GL_GENERATE_MONETARY_H], [test -n "$MONETARY_H"])
])
# gl_MONETARY_MODULE_INDICATOR([modulename])
diff --git a/m4/net_if_h.m4 b/m4/net_if_h.m4
index dfc5b6f6db..489241c422 100644
--- a/m4/net_if_h.m4
+++ b/m4/net_if_h.m4
@@ -1,4 +1,4 @@
-# net_if_h.m4 serial 1
+# net_if_h.m4 serial 2
dnl Copyright (C) 2006-2021 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,9 +15,9 @@ AC_DEFUN([gl_HEADER_NET_IF],
[gl_cv_header_net_if_h_selfcontained=no])
])
if test $gl_cv_header_net_if_h_selfcontained = yes; then
- NET_IF_H=''
+ GL_GENERATE_NET_IF_H=false
else
- NET_IF_H='net/if.h'
+ GL_GENERATE_NET_IF_H=true
AC_CHECK_HEADERS([net/if.h], [], [], [[#include <sys/socket.h>]])
gl_NEXT_HEADERS([net/if.h])
if test $ac_cv_header_net_if_h = yes; then
@@ -27,6 +27,4 @@ AC_DEFUN([gl_HEADER_NET_IF],
fi
AC_SUBST([HAVE_NET_IF_H])
fi
- AC_SUBST([NET_IF_H])
- AM_CONDITIONAL([GL_GENERATE_NET_IF_H], [test -n "$NET_IF_H"])
])
diff --git a/m4/netinet_in_h.m4 b/m4/netinet_in_h.m4
index c555596434..6579c8332a 100644
--- a/m4/netinet_in_h.m4
+++ b/m4/netinet_in_h.m4
@@ -1,4 +1,4 @@
-# netinet_in_h.m4 serial 5
+# netinet_in_h.m4 serial 6
dnl Copyright (C) 2006-2021 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,9 +14,9 @@ AC_DEFUN([gl_HEADER_NETINET_IN],
[gl_cv_header_netinet_in_h_selfcontained=no])
])
if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
- NETINET_IN_H=''
+ GL_GENERATE_NETINET_IN_H=false
else
- NETINET_IN_H='netinet/in.h'
+ GL_GENERATE_NETINET_IN_H=true
AC_CHECK_HEADERS([netinet/in.h])
gl_CHECK_NEXT_HEADERS([netinet/in.h])
if test $ac_cv_header_netinet_in_h = yes; then
@@ -26,6 +26,4 @@ AC_DEFUN([gl_HEADER_NETINET_IN],
fi
AC_SUBST([HAVE_NETINET_IN_H])
fi
- AC_SUBST([NETINET_IN_H])
- AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"])
])
diff --git a/m4/parse-datetime.m4 b/m4/parse-datetime.m4
index ebcd25e2a4..760d2ee9db 100644
--- a/m4/parse-datetime.m4
+++ b/m4/parse-datetime.m4
@@ -1,4 +1,4 @@
-# parse-datetime.m4 serial 26
+# parse-datetime.m4 serial 27
dnl Copyright (C) 2002-2006, 2008-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -42,7 +42,6 @@ AC_DEFUN([gl_PARSE_DATETIME],
gl_PROG_BISON([PARSE_DATETIME_BISON], [2.4])
dnl Prerequisites of lib/parse-datetime.h.
- AC_REQUIRE([AM_STDBOOL_H])
AC_REQUIRE([gl_TIMESPEC])
AC_REQUIRE([AC_C_RESTRICT])
diff --git a/m4/perror.m4 b/m4/perror.m4
index 9f2ac2daec..8fe60b1a81 100644
--- a/m4/perror.m4
+++ b/m4/perror.m4
@@ -1,4 +1,4 @@
-# perror.m4 serial 9
+# perror.m4 serial 10
dnl Copyright (C) 2008-2021 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,7 @@ AC_DEFUN([gl_FUNC_PERROR],
dnl since on glibc systems, strerror_r is replaced only for signature
dnl issues, and perror is just fine. Rather, we only want to
dnl replace perror if strerror_r was replaced for a content fix.
- if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then
+ if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" != false:0; then
dnl The system's perror() cannot know about the new errno values we add
dnl to <errno.h>, or any fix for strerror(0). Replace it.
REPLACE_PERROR=1
diff --git a/m4/selinux-context-h.m4 b/m4/selinux-context-h.m4
index bfe91d16d8..a1a8cfe655 100644
--- a/m4/selinux-context-h.m4
+++ b/m4/selinux-context-h.m4
@@ -1,4 +1,4 @@
-# serial 3 -*- Autoconf -*-
+# serial 4 -*- Autoconf -*-
# Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -12,11 +12,9 @@ AC_DEFUN([gl_HEADERS_SELINUX_CONTEXT_H],
AC_REQUIRE([gl_LIBSELINUX])
if test "$with_selinux" != no; then
AC_CHECK_HEADERS([selinux/context.h],
- [SELINUX_CONTEXT_H=],
- [SELINUX_CONTEXT_H=selinux/context.h])
+ [GL_GENERATE_SELINUX_CONTEXT_H=false],
+ [GL_GENERATE_SELINUX_CONTEXT_H=true])
else
- SELINUX_CONTEXT_H=selinux/context.h
+ GL_GENERATE_SELINUX_CONTEXT_H=true
fi
- AC_SUBST([SELINUX_CONTEXT_H])
- AM_CONDITIONAL([GL_GENERATE_SELINUX_CONTEXT_H], [test -n "$SELINUX_CONTEXT_H"])
])
diff --git a/m4/selinux-label-h.m4 b/m4/selinux-label-h.m4
index 4bf070f2e8..89113687b8 100644
--- a/m4/selinux-label-h.m4
+++ b/m4/selinux-label-h.m4
@@ -9,11 +9,9 @@
AC_DEFUN([gl_HEADERS_SELINUX_LABEL_H],
[
AC_REQUIRE([gl_LIBSELINUX])
- SELINUX_LABEL_H=selinux/label.h
+ GL_GENERATE_SELINUX_LABEL_H=true
if test "$with_selinux" != no; then
AC_CHECK_HEADERS([selinux/label.h],
- [SELINUX_LABEL_H=])
+ [GL_GENERATE_SELINUX_LABEL_H=false])
fi
- AC_SUBST([SELINUX_LABEL_H])
- AM_CONDITIONAL([GL_GENERATE_SELINUX_LABEL_H], [test -n "$SELINUX_LABEL_H"])
])
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index e22d7f78c0..fd57cdd47f 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -49,11 +49,8 @@ AC_DEFUN([gl_STDALIGN_H],
[gl_cv_header_working_stdalign_h=no])])
if test $gl_cv_header_working_stdalign_h = yes; then
- STDALIGN_H=''
+ GL_GENERATE_STDALIGN_H=false
else
- STDALIGN_H='stdalign.h'
+ GL_GENERATE_STDALIGN_H=true
fi
-
- AC_SUBST([STDALIGN_H])
- AM_CONDITIONAL([GL_GENERATE_STDALIGN_H], [test -n "$STDALIGN_H"])
])
diff --git a/m4/stdarg.m4 b/m4/stdarg.m4
index 0b5fb637b4..9987343ebe 100644
--- a/m4/stdarg.m4
+++ b/m4/stdarg.m4
@@ -1,4 +1,4 @@
-# stdarg.m4 serial 7
+# stdarg.m4 serial 8
dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,7 @@ dnl Provide a working va_copy in combination with <stdarg.h>.
AC_DEFUN([gl_STDARG_H],
[
- STDARG_H=''
+ GL_GENERATE_STDARG_H=false
NEXT_STDARG_H='<stdarg.h>'
AC_CACHE_CHECK([for va_copy],
[gl_cv_func_va_copy],
@@ -40,7 +40,7 @@ void (*func) (va_list, va_list) = va_copy;
], [gl_aixcc=yes], [gl_aixcc=no])
if test $gl_aixcc = yes; then
dnl Provide a substitute <stdarg.h> file.
- STDARG_H=stdarg.h
+ GL_GENERATE_STDARG_H=true
gl_NEXT_HEADERS([stdarg.h])
dnl Fallback for the case when <stdarg.h> contains only macro definitions.
if test "$gl_cv_next_stdarg_h" = '""'; then
@@ -72,7 +72,5 @@ error, bail out
fi
fi
fi
- AC_SUBST([STDARG_H])
- AM_CONDITIONAL([GL_GENERATE_STDARG_H], [test -n "$STDARG_H"])
AC_SUBST([NEXT_STDARG_H])
])
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index 3169779d43..cacb48c821 100644
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -5,11 +5,11 @@ dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
-#serial 8
+#serial 9
# Prepare for substituting <stdbool.h> if it is not supported.
-AC_DEFUN([AM_STDBOOL_H],
+AC_DEFUN([gl_STDBOOL_H],
[
AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
AC_REQUIRE([AC_CANONICAL_HOST])
@@ -22,20 +22,18 @@ AC_DEFUN([AM_STDBOOL_H],
case "$host_os" in
solaris*)
if test -z "$GCC"; then
- STDBOOL_H='stdbool.h'
+ GL_GENERATE_STDBOOL_H=true
else
- STDBOOL_H=''
+ GL_GENERATE_STDBOOL_H=false
fi
;;
*)
- STDBOOL_H=''
+ GL_GENERATE_STDBOOL_H=false
;;
esac
else
- STDBOOL_H='stdbool.h'
+ GL_GENERATE_STDBOOL_H=true
fi
- AC_SUBST([STDBOOL_H])
- AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"])
if test "$ac_cv_type__Bool" = yes; then
HAVE__BOOL=1
@@ -45,9 +43,6 @@ AC_DEFUN([AM_STDBOOL_H],
AC_SUBST([HAVE__BOOL])
])
-# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
-AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
-
# This version of the macro is needed in autoconf <= 2.68.
AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
diff --git a/m4/stddef_h.m4 b/m4/stddef_h.m4
index 1303d2e06c..0b160cde08 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,4 +1,4 @@
-# stddef_h.m4 serial 11
+# stddef_h.m4 serial 12
dnl Copyright (C) 2009-2021 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,7 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- STDDEF_H=
+ GL_GENERATE_STDDEF_H=false
dnl Test whether the type max_align_t exists and whether its alignment
dnl "is as great as is supported by the implementation in all contexts".
@@ -41,12 +41,12 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
])
if test $gl_cv_type_max_align_t = no; then
HAVE_MAX_ALIGN_T=0
- STDDEF_H=stddef.h
+ GL_GENERATE_STDDEF_H=true
fi
if test $gt_cv_c_wchar_t = no; then
HAVE_WCHAR_T=0
- STDDEF_H=stddef.h
+ GL_GENERATE_STDDEF_H=true
fi
AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
@@ -58,12 +58,10 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
[gl_cv_decl_null_works=no])])
if test $gl_cv_decl_null_works = no; then
REPLACE_NULL=1
- STDDEF_H=stddef.h
+ GL_GENERATE_STDDEF_H=true
fi
- AC_SUBST([STDDEF_H])
- AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"])
- if test -n "$STDDEF_H"; then
+ if $GL_GENERATE_STDDEF_H; then
gl_NEXT_HEADERS([stddef.h])
fi
])
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index 2eb1652d8e..61fb8ca696 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 60
+# stdint.m4 serial 61
dnl Copyright (C) 2001-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -296,7 +296,7 @@ static const char *macro_values[] =
HAVE_C99_STDINT_H=0
HAVE_SYS_BITYPES_H=0
HAVE_SYS_INTTYPES_H=0
- STDINT_H=stdint.h
+ GL_GENERATE_STDINT_H=true
case "$gl_cv_header_working_stdint_h" in
*yes)
HAVE_C99_STDINT_H=1
@@ -341,7 +341,7 @@ int32_t i32 = INT32_C (0x7fffffff);
]])],
[gl_cv_header_stdint_width=yes])])
if test "$gl_cv_header_stdint_width" = yes; then
- STDINT_H=
+ GL_GENERATE_STDINT_H=false
fi
;;
*)
@@ -364,8 +364,6 @@ int32_t i32 = INT32_C (0x7fffffff);
AC_SUBST([HAVE_C99_STDINT_H])
AC_SUBST([HAVE_SYS_BITYPES_H])
AC_SUBST([HAVE_SYS_INTTYPES_H])
- AC_SUBST([STDINT_H])
- AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
])
dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
diff --git a/m4/stdnoreturn.m4 b/m4/stdnoreturn.m4
index 207aa249b4..fe11c8abb3 100644
--- a/m4/stdnoreturn.m4
+++ b/m4/stdnoreturn.m4
@@ -15,7 +15,7 @@ AC_DEFUN([gl_STDNORETURN_H],
dnl Regardless whether a working <stdnoreturn.h> exists or not,
dnl we need our own <stdnoreturn.h>, because of the definition
dnl of _Noreturn done by gnulib-common.m4.
- STDNORETURN_H='stdnoreturn.h'
+ GL_GENERATE_STDNORETURN_H=true
;;
*)
AC_CACHE_CHECK([for working stdnoreturn.h],
@@ -43,12 +43,10 @@ AC_DEFUN([gl_STDNORETURN_H],
[gl_cv_header_working_stdnoreturn_h=yes],
[gl_cv_header_working_stdnoreturn_h=no])])
if test $gl_cv_header_working_stdnoreturn_h = yes; then
- STDNORETURN_H=''
+ GL_GENERATE_STDNORETURN_H=false
else
- STDNORETURN_H='stdnoreturn.h'
+ GL_GENERATE_STDNORETURN_H=true
fi
;;
esac
- AC_SUBST([STDNORETURN_H])
- AM_CONDITIONAL([GL_GENERATE_STDNORETURN_H], [test -n "$STDNORETURN_H"])
])
diff --git a/m4/strerror.m4 b/m4/strerror.m4
index 438ba920c4..d068a40647 100644
--- a/m4/strerror.m4
+++ b/m4/strerror.m4
@@ -1,4 +1,4 @@
-# strerror.m4 serial 22
+# strerror.m4 serial 23
dnl Copyright (C) 2002, 2007-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_STRERROR],
m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
])
- if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+ if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then
AC_CACHE_CHECK([for working strerror function],
[gl_cv_func_working_strerror],
[AC_RUN_IFELSE(
diff --git a/m4/strerror_r.m4 b/m4/strerror_r.m4
index bc40ec294b..3ec2d4eae2 100644
--- a/m4/strerror_r.m4
+++ b/m4/strerror_r.m4
@@ -1,4 +1,4 @@
-# strerror_r.m4 serial 23
+# strerror_r.m4 serial 24
dnl Copyright (C) 2002, 2007-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_STRERROR_R],
fi
if test $ac_cv_func_strerror_r = yes; then
- if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+ if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then
if test $gl_cv_func_strerror_r_posix_signature = yes; then
case "$gl_cv_func_strerror_r_works" in
dnl The system's strerror_r has bugs. Replace it.
@@ -59,7 +59,7 @@ AC_DEFUN([gl_FUNC_STRERROR_R_WORKS],
AC_CHECK_FUNCS_ONCE([strerror_r])
if test $ac_cv_func_strerror_r = yes; then
- if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+ if test "$GL_GENERATE_ERRNO_H:$REPLACE_STRERROR_0" = false:0; then
dnl The POSIX prototype is: int strerror_r (int, char *, size_t);
dnl glibc, Cygwin: char *strerror_r (int, char *, size_t);
dnl AIX 5.1, OSF/1 5.1: int strerror_r (int, char *, int);
diff --git a/m4/sys_socket_h.m4 b/m4/sys_socket_h.m4
index 5676a0d217..1f9a06f09c 100644
--- a/m4/sys_socket_h.m4
+++ b/m4/sys_socket_h.m4
@@ -1,4 +1,4 @@
-# sys_socket_h.m4 serial 28
+# sys_socket_h.m4 serial 29
dnl Copyright (C) 2005-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -22,6 +22,7 @@ AC_DEFUN_ONCE([gl_SYS_SOCKET_H],
;;
esac
+ GL_GENERATE_SYS_SOCKET_H=false
AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
[gl_cv_header_sys_socket_h_selfcontained],
[
@@ -44,7 +45,7 @@ AC_DEFUN_ONCE([gl_SYS_SOCKET_H],
[gl_cv_header_sys_socket_h_shut=no])
])
if test $gl_cv_header_sys_socket_h_shut = no; then
- SYS_SOCKET_H='sys/socket.h'
+ GL_GENERATE_SYS_SOCKET_H=true
fi
fi
fi
@@ -83,7 +84,7 @@ AC_DEFUN_ONCE([gl_SYS_SOCKET_H],
fi
if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
|| test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
- SYS_SOCKET_H='sys/socket.h'
+ GL_GENERATE_SYS_SOCKET_H=true
fi
gl_PREREQ_SYS_H_WINSOCK2
diff --git a/m4/sysexits.m4 b/m4/sysexits.m4
index d5d2254c9e..7e84ac894c 100644
--- a/m4/sysexits.m4
+++ b/m4/sysexits.m4
@@ -1,4 +1,4 @@
-# sysexits.m4 serial 6
+# sysexits.m4 serial 7
dnl Copyright (C) 2003, 2005, 2007, 2009-2021 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -32,13 +32,11 @@ AC_DEFUN([gl_SYSEXITS],
break;
}
]])],
- [SYSEXITS_H=],
- [SYSEXITS_H=sysexits.h])
+ [GL_GENERATE_SYSEXITS_H=false],
+ [GL_GENERATE_SYSEXITS_H=true])
else
HAVE_SYSEXITS_H=0
- SYSEXITS_H=sysexits.h
+ GL_GENERATE_SYSEXITS_H=true
fi
AC_SUBST([HAVE_SYSEXITS_H])
- AC_SUBST([SYSEXITS_H])
- AM_CONDITIONAL([GL_GENERATE_SYSEXITS_H], [test -n "$SYSEXITS_H"])
])
diff --git a/modules/alloca-opt b/modules/alloca-opt
index ec3250dc4e..30d0ad4e76 100644
--- a/modules/alloca-opt
+++ b/modules/alloca-opt
@@ -11,6 +11,7 @@ Depends-on:
configure.ac:
gl_FUNC_ALLOCA
+gl_CONDITIONAL_HEADER([alloca.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/argz b/modules/argz
index a20a214d48..bfa630ca5f 100644
--- a/modules/argz
+++ b/modules/argz
@@ -16,6 +16,7 @@ strstr [test -n "$ARGZ_H"]
configure.ac:
gl_FUNC_ARGZ
+gl_CONDITIONAL_HEADER([argz.h])
AC_PROG_MKDIR_P
if test -n "$ARGZ_H"; then
AC_LIBOBJ([argz])
diff --git a/modules/assert-h b/modules/assert-h
index aec3aae7d1..b5bed41ebd 100644
--- a/modules/assert-h
+++ b/modules/assert-h
@@ -11,6 +11,7 @@ include_next
configure.ac:
gl_ASSERT_H
+gl_CONDITIONAL_HEADER([assert.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/byteswap b/modules/byteswap
index 43391572f2..ef48fac2d0 100644
--- a/modules/byteswap
+++ b/modules/byteswap
@@ -9,6 +9,7 @@ Depends-on:
configure.ac:
gl_BYTESWAP
+gl_CONDITIONAL_HEADER([byteswap.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/errno b/modules/errno
index 35fe9ada9c..e8c3bede0a 100644
--- a/modules/errno
+++ b/modules/errno
@@ -10,6 +10,7 @@ include_next
configure.ac:
gl_HEADER_ERRNO_H
+gl_CONDITIONAL_HEADER([errno.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/execinfo b/modules/execinfo
index 89426bb55d..1846377796 100644
--- a/modules/execinfo
+++ b/modules/execinfo
@@ -11,7 +11,11 @@ extern-inline
configure.ac:
gl_EXECINFO_H
+gl_CONDITIONAL_HEADER([execinfo.h])
AC_PROG_MKDIR_P
+if $GL_GENERATE_EXECINFO_H; then
+ AC_LIBOBJ([execinfo])
+fi
Makefile.am:
BUILT_SOURCES += $(EXECINFO_H)
diff --git a/modules/float b/modules/float
index ff68615a2f..4dcab5a761 100644
--- a/modules/float
+++ b/modules/float
@@ -12,6 +12,7 @@ include_next
configure.ac:
gl_FLOAT_H
+gl_CONDITIONAL_HEADER([float.h])
AC_PROG_MKDIR_P
if test $REPLACE_FLOAT_LDBL = 1; then
AC_LIBOBJ([float])
diff --git a/modules/fnmatch b/modules/fnmatch
index 2cb69a7e94..37ebfe2250 100644
--- a/modules/fnmatch
+++ b/modules/fnmatch
@@ -33,6 +33,8 @@ mbsinit [test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1]
configure.ac:
gl_FUNC_FNMATCH_POSIX
+dnl Because of gl_REPLACE_FNMATCH_H:
+gl_CONDITIONAL_HEADER([fnmatch.h])
if test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1; then
AC_LIBOBJ([fnmatch])
gl_PREREQ_FNMATCH
diff --git a/modules/fnmatch-h b/modules/fnmatch-h
index cfabc8cd51..a0cca9e942 100644
--- a/modules/fnmatch-h
+++ b/modules/fnmatch-h
@@ -15,6 +15,7 @@ snippet/warn-on-use
configure.ac:
gl_FNMATCH_H
gl_FNMATCH_H_REQUIRE_DEFAULTS
+gl_CONDITIONAL_HEADER([fnmatch.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/getopt-posix b/modules/getopt-posix
index 0e8e667d5a..bac9dc57c9 100644
--- a/modules/getopt-posix
+++ b/modules/getopt-posix
@@ -22,6 +22,7 @@ snippet/arg-nonnull
configure.ac:
gl_FUNC_GETOPT_POSIX
+gl_CONDITIONAL_HEADER([getopt.h])
AC_PROG_MKDIR_P
if test $REPLACE_GETOPT = 1; then
AC_LIBOBJ([getopt])
diff --git a/modules/glob b/modules/glob
index eb1bd9e5ae..7e66b47844 100644
--- a/modules/glob
+++ b/modules/glob
@@ -35,6 +35,8 @@ malloc-posix [test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1]
configure.ac:
gl_GLOB
+dnl Because of gl_REPLACE_GLOB_H:
+gl_CONDITIONAL_HEADER([glob.h])
if test $HAVE_GLOB = 0 || test $REPLACE_GLOB = 1; then
AC_LIBOBJ([glob])
AC_LIBOBJ([globfree])
diff --git a/modules/glob-h b/modules/glob-h
index 891db9d10c..549a9bb628 100644
--- a/modules/glob-h
+++ b/modules/glob-h
@@ -19,6 +19,7 @@ sys_stat
configure.ac:
gl_GLOB_H
gl_GLOB_H_REQUIRE_DEFAULTS
+gl_CONDITIONAL_HEADER([glob.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/iconv-h b/modules/iconv-h
index 66faaed5dd..c3aed0bf49 100644
--- a/modules/iconv-h
+++ b/modules/iconv-h
@@ -14,6 +14,7 @@ snippet/warn-on-use
configure.ac:
gl_ICONV_H
gl_ICONV_H_REQUIRE_DEFAULTS
+gl_CONDITIONAL_HEADER([iconv.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/iconv_open b/modules/iconv_open
index dba45920ad..e7e7a762a8 100644
--- a/modules/iconv_open
+++ b/modules/iconv_open
@@ -25,6 +25,8 @@ unistr/u8-uctomb [test $REPLACE_ICONV_UTF = 1]
configure.ac:
gl_FUNC_ICONV_OPEN
+dnl Because of gl_REPLACE_ICONV_H:
+gl_CONDITIONAL_HEADER([iconv.h])
if test $REPLACE_ICONV_OPEN = 1; then
AC_LIBOBJ([iconv_open])
fi
diff --git a/modules/ieee754-h b/modules/ieee754-h
index 4ccf4208fa..343db6c994 100644
--- a/modules/ieee754-h
+++ b/modules/ieee754-h
@@ -9,6 +9,7 @@ Depends-on:
configure.ac:
gl_IEEE754_H
+gl_CONDITIONAL_HEADER([ieee754.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/libgmp b/modules/libgmp
index 1c347617bb..c8e4970264 100644
--- a/modules/libgmp
+++ b/modules/libgmp
@@ -11,6 +11,7 @@ Depends-on:
configure.ac:
gl_LIBGMP
+gl_CONDITIONAL_HEADER([gmp.h])
AC_PROG_MKDIR_P
if test $HAVE_LIBGMP != yes; then
AC_LIBOBJ([mini-gmp-gnulib])
@@ -19,24 +20,25 @@ fi
Makefile.am:
BUILT_SOURCES += $(GMP_H)
+if GL_GENERATE_GMP_H
if GL_GENERATE_MINI_GMP_H
# Build gmp.h as a wrapper for mini-gmp.h when using mini-gmp.
gmp.h: $(top_builddir)/config.status
$(MKDIR_P) '%reldir%'
echo '#include "mini-gmp.h"' > $@-t
mv $@-t $@
-else
+endif
if GL_GENERATE_GMP_GMP_H
# Build gmp.h as a wrapper for gmp/gmp.h.
gmp.h: $(top_builddir)/config.status
$(MKDIR_P) '%reldir%'
echo '#include <gmp/gmp.h>' > $@-t
mv $@-t $@
+endif
else
gmp.h: $(top_builddir)/config.status
rm -f $@
endif
-endif
MOSTLYCLEANFILES += gmp.h gmp.h-t
Include:
diff --git a/modules/libtextstyle-optional b/modules/libtextstyle-optional
index 342d718890..a9656803a5 100644
--- a/modules/libtextstyle-optional
+++ b/modules/libtextstyle-optional
@@ -15,6 +15,10 @@ vasprintf-posix
configure.ac:
# You need to invoke gl_LIBTEXTSTYLE_OPTIONAL yourself, possibly with arguments.
+if test -z "$GL_GENERATE_TEXTSTYLE_H"; then
+ GL_GENERATE_TEXTSTYLE_H=false
+fi
+gl_CONDITIONAL_HEADER([textstyle.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/limits-h b/modules/limits-h
index 3f5dcf9e30..14205e457d 100644
--- a/modules/limits-h
+++ b/modules/limits-h
@@ -10,6 +10,7 @@ include_next
configure.ac:
gl_LIMITS_H
+gl_CONDITIONAL_HEADER([limits.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/monetary b/modules/monetary
index 645062c68d..63d36e9209 100644
--- a/modules/monetary
+++ b/modules/monetary
@@ -14,6 +14,7 @@ snippet/warn-on-use
configure.ac:
gl_MONETARY_H
gl_MONETARY_H_REQUIRE_DEFAULTS
+gl_CONDITIONAL_HEADER([monetary.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/net_if b/modules/net_if
index 467544e4d0..092116bcb4 100644
--- a/modules/net_if
+++ b/modules/net_if
@@ -11,6 +11,7 @@ sys_socket
configure.ac:
gl_HEADER_NET_IF
+gl_CONDITIONAL_HEADER([net/if.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/netinet_in b/modules/netinet_in
index da21e0d6bd..29b26c906e 100644
--- a/modules/netinet_in
+++ b/modules/netinet_in
@@ -11,6 +11,7 @@ sys_socket
configure.ac:
gl_HEADER_NETINET_IN
+gl_CONDITIONAL_HEADER([netinet/in.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/selinux-h b/modules/selinux-h
index d0e3b29dbb..d6304e8ffb 100644
--- a/modules/selinux-h
+++ b/modules/selinux-h
@@ -21,6 +21,8 @@ configure.ac:
gl_HEADERS_SELINUX_SELINUX_H
gl_HEADERS_SELINUX_CONTEXT_H
gl_HEADERS_SELINUX_LABEL_H
+gl_CONDITIONAL_HEADER([selinux/context.h])
+gl_CONDITIONAL_HEADER([selinux/label.h])
AC_PROG_MKDIR_P
if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
AC_LIBOBJ([getfilecon])
diff --git a/modules/sigsegv b/modules/sigsegv
index fa0a1d5263..ef0a5fcd55 100644
--- a/modules/sigsegv
+++ b/modules/sigsegv
@@ -31,14 +31,13 @@ getpagesize
configure.ac:
AC_REQUIRE([gl_SIGSEGV])
if test $gl_sigsegv_uses_libsigsegv = yes; then
- SIGSEGV_H=
+ GL_GENERATE_SIGSEGV_H=false
else
- SIGSEGV_H=sigsegv.h
+ GL_GENERATE_SIGSEGV_H=true
fi
-AC_SUBST([SIGSEGV_H])
-AM_CONDITIONAL([GL_GENERATE_SIGSEGV_H], [test -n "$SIGSEGV_H"])
+gl_CONDITIONAL_HEADER([sigsegv.h])
AC_PROG_MKDIR_P
-if test -n "$SIGSEGV_H"; then
+if $GL_GENERATE_SIGSEGV_H; then
dnl Persuade glibc <sys/ucontext.h> to declare macros designating register
dnl indices: REG_RSP on x86_64, REG_ESP on i386.
dnl Persuade Solaris OpenIndiana <ucontext.h> to include <sys/regset.h>,
diff --git a/modules/stdalign b/modules/stdalign
index af25b34b88..b17c8eff19 100644
--- a/modules/stdalign
+++ b/modules/stdalign
@@ -9,6 +9,7 @@ Depends-on:
configure.ac:
gl_STDALIGN_H
+gl_CONDITIONAL_HEADER([stdalign.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/stdarg b/modules/stdarg
index f4f37abac5..5bfd500b63 100644
--- a/modules/stdarg
+++ b/modules/stdarg
@@ -15,6 +15,7 @@ gl_PROG_CC_C99
configure.ac:
gl_STDARG_H
+gl_CONDITIONAL_HEADER([stdarg.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/stdbool b/modules/stdbool
index d3f434cc55..9128b453e5 100644
--- a/modules/stdbool
+++ b/modules/stdbool
@@ -9,7 +9,8 @@ m4/stdbool.m4
Depends-on:
configure.ac:
-AM_STDBOOL_H
+gl_STDBOOL_H
+gl_CONDITIONAL_HEADER([stdbool.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/stddef b/modules/stddef
index d69b861f6b..0967bc1429 100644
--- a/modules/stddef
+++ b/modules/stddef
@@ -13,6 +13,7 @@ extensions
configure.ac:
gl_STDDEF_H
gl_STDDEF_H_REQUIRE_DEFAULTS
+gl_CONDITIONAL_HEADER([stddef.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/stdint b/modules/stdint
index ea38736bfa..bdec953df5 100644
--- a/modules/stdint
+++ b/modules/stdint
@@ -20,6 +20,9 @@ sys_types
configure.ac:
gl_STDINT_H
+gl_CONDITIONAL_HEADER([stdint.h])
+dnl Because of gl_REPLACE_LIMITS_H:
+gl_CONDITIONAL_HEADER([limits.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/stdnoreturn b/modules/stdnoreturn
index d2b9566255..963a6926db 100644
--- a/modules/stdnoreturn
+++ b/modules/stdnoreturn
@@ -10,6 +10,7 @@ snippet/_Noreturn
configure.ac:
gl_STDNORETURN_H
+gl_CONDITIONAL_HEADER([stdnoreturn.h])
AC_PROG_MKDIR_P
Makefile.am:
diff --git a/modules/sysexits b/modules/sysexits
index 715a2e55d9..a3958332a7 100644
--- a/modules/sysexits
+++ b/modules/sysexits
@@ -11,6 +11,7 @@ stdlib
configure.ac:
gl_SYSEXITS
+gl_CONDITIONAL_HEADER([sysexits.h])
AC_PROG_MKDIR_P
Makefile.am: