]> Savannah Git Hosting - gnulib.git/commitdiff
getopt-posix: Fix compilation failure in testdirs.
authorBruno Haible <bruno@clisp.org>
Fri, 3 Jan 2020 13:27:29 +0000 (14:27 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 3 Jan 2020 13:27:29 +0000 (14:27 +0100)
* lib/unistd.in.h: Include <getopt-cdefs.h> and <getopt-pfx-core.h> only
when the gnulib module 'getopt-posix' is enabled.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETOPT_POSIX.
* modules/getopt-posix (configure.ac): Set GNULIB_GETOPT_POSIX as a
module indicator.
* modules/unistd (Makefile.am): Substitute GNULIB_GETOPT_POSIX.

ChangeLog
lib/unistd.in.h
m4/unistd_h.m4
modules/getopt-posix
modules/unistd

index a37ece9636e8bcc0e3f3ca561a3fedc347316b00..0fb2e1c3bc908efa5a4b07284178f2f97cdb2028 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2020-01-03  Bruno Haible  <bruno@clisp.org>
+
+       getopt-posix: Fix compilation failure in testdirs.
+       * lib/unistd.in.h: Include <getopt-cdefs.h> and <getopt-pfx-core.h> only
+       when the gnulib module 'getopt-posix' is enabled.
+       * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETOPT_POSIX.
+       * modules/getopt-posix (configure.ac): Set GNULIB_GETOPT_POSIX as a
+       module indicator.
+       * modules/unistd (Makefile.am): Substitute GNULIB_GETOPT_POSIX.
+
 2020-01-03  Bruno Haible  <bruno@clisp.org>
 
        doc: Mention the 64-bit inode number problem.
index ecf8fbe17c55a1c630bb5ffc050029e6afd10f57..6db7ff241502769edd4e16532b9f5274cc6a69d8 100644 (file)
 
 
 /* Get getopt(), optarg, optind, opterr, optopt.  */
-#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
+#if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
 # include <getopt-cdefs.h>
 # include <getopt-pfx-core.h>
 #endif
index 7453866df842179cb2a5f8cdc1f5efb37b9523a3..ea2bb016dbbb36039d27cb6ebb339df927e8981e 100644 (file)
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 76
+# unistd_h.m4 serial 77
 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -84,6 +84,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   GNULIB_GETHOSTNAME=0;          AC_SUBST([GNULIB_GETHOSTNAME])
   GNULIB_GETLOGIN=0;             AC_SUBST([GNULIB_GETLOGIN])
   GNULIB_GETLOGIN_R=0;           AC_SUBST([GNULIB_GETLOGIN_R])
+  GNULIB_GETOPT_POSIX=0;         AC_SUBST([GNULIB_GETOPT_POSIX])
   GNULIB_GETPAGESIZE=0;          AC_SUBST([GNULIB_GETPAGESIZE])
   GNULIB_GETPASS=0;              AC_SUBST([GNULIB_GETPASS])
   GNULIB_GETUSERSHELL=0;         AC_SUBST([GNULIB_GETUSERSHELL])
index 5ee7bfd6cd18883ffcd4787bdeb92980f7c235dd..cbcfff592e5337e5aa0e87c1efb5d3c693830ead 100644 (file)
@@ -29,6 +29,7 @@ if test $REPLACE_GETOPT = 1; then
   GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT=1
 fi
 AC_SUBST([GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT])
+gl_UNISTD_MODULE_INDICATOR([getopt-posix])
 
 Makefile.am:
 BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H)
index b68029d185ae5d5f9e0bb62230a366967e0d4c45..3c28f36ca5f44494faac10f6cb3f6ea3f15ab269 100644 (file)
@@ -59,6 +59,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
              -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
              -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
+             -e 's/@''GNULIB_GETOPT_POSIX''@/$(GNULIB_GETOPT_POSIX)/g' \
              -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
              -e 's/@''GNULIB_GETPASS''@/$(GNULIB_GETPASS)/g' \
              -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \