From d059bd2b1bc4d3ec09eabb238f9eb28c7a2fddff Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 3 Jan 2020 14:27:29 +0100 Subject: [PATCH] getopt-posix: Fix compilation failure in testdirs. * lib/unistd.in.h: Include and 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 | 10 ++++++++++ lib/unistd.in.h | 2 +- m4/unistd_h.m4 | 3 ++- modules/getopt-posix | 1 + modules/unistd | 1 + 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a37ece9636..0fb2e1c3bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2020-01-03 Bruno Haible + + getopt-posix: Fix compilation failure in testdirs. + * lib/unistd.in.h: Include and 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 doc: Mention the 64-bit inode number problem. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index ecf8fbe17c..6db7ff2415 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -141,7 +141,7 @@ /* 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 # include #endif diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index 7453866df8..ea2bb016db 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -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]) diff --git a/modules/getopt-posix b/modules/getopt-posix index 5ee7bfd6cd..cbcfff592e 100644 --- a/modules/getopt-posix +++ b/modules/getopt-posix @@ -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) diff --git a/modules/unistd b/modules/unistd index b68029d185..3c28f36ca5 100644 --- a/modules/unistd +++ b/modules/unistd @@ -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' \ -- 2.39.5