changeset 39790:794c87b16901

glob-h: Revert Paul Eggert's revert. * m4/glob_h.m4: Revert to previous state. * modules/glob-h: Likewise.
author Bruno Haible <bruno@clisp.org>
date Sat, 18 Aug 2018 21:31:30 +0200
parents d14c2a5d9404
children e57100ecba99
files ChangeLog m4/glob_h.m4 modules/glob-h
diffstat 3 files changed, 29 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Aug 18 00:54:35 2018 -0700
+++ b/ChangeLog	Sat Aug 18 21:31:30 2018 +0200
@@ -1,3 +1,9 @@
+2018-08-18  Bruno Haible  <bruno@clisp.org>
+
+	glob-h: Revert Paul Eggert's revert.
+	* m4/glob_h.m4: Revert to previous state.
+	* modules/glob-h: Likewise.
+
 2018-08-18  Paul Eggert  <eggert@cs.ucla.edu>
 
 	glob-h: always build glob.h
--- a/m4/glob_h.m4	Sat Aug 18 00:54:35 2018 -0700
+++ b/m4/glob_h.m4	Sat Aug 18 21:31:30 2018 +0200
@@ -1,4 +1,4 @@
-# glob_h.m4 serial 2
+# glob_h.m4 serial 3
 dnl Copyright (C) 2018 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,22 @@
   fi
   AC_SUBST([HAVE_GLOB_H])
 
+  m4_ifdef([gl_POSIXCHECK],
+    [GLOB_H=glob.h],
+    [GLOB_H=''
+     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
+     else
+       if test $ac_cv_header_glob_h != yes; then
+         dnl Provide a substitute <glob.h> file.
+         GLOB_H=glob.h
+       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.
   gl_WARN_ON_USE_PREPARE([[#include <glob.h>
--- a/modules/glob-h	Sat Aug 18 00:54:35 2018 -0700
+++ b/modules/glob-h	Sat Aug 18 21:31:30 2018 +0200
@@ -20,9 +20,10 @@
 gl_GLOB_H
 
 Makefile.am:
-BUILT_SOURCES += glob.h
+BUILT_SOURCES += $(GLOB_H)
 
 # We need the following in order to create <glob.h>.
+if GL_GENERATE_GLOB_H
 glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
@@ -43,6 +44,10 @@
 	      < $(srcdir)/glob.in.h; \
 	} > $@-t && \
 	mv $@-t $@
+else
+glob.h: $(top_builddir)/config.status
+	rm -f $@
+endif
 MOSTLYCLEANFILES += glob.h glob.h-t
 
 Include: