Unless I'm missing something, the "Move .h file names out of the *.m4 files" patch omitted an "if GL_GENERATE_GEOPT_H" in getopt-posix. I installed the attached to finish this part up. Please feel free to revert if I messed up.
diff --git a/ChangeLog b/ChangeLog
index e1be947a3..6fee602cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2021-12-16  Paul Eggert  <egg...@cs.ucla.edu>
 
+	getopt-posix: omit unnessary building of getopt.h
+	* modules/getopt-posix (getopt.h, getopt-cdefs.h):
+	Build only if GL_GENERATE_GETOPT_H.
+
 	stdint: omit duplicate gl_CONFIGURE_HEADER calls
 	* modules/stdint (configure.ac): Omit
 	‘gl_CONDITIONAL_HEADER([limits.h])’, since stdint depends on
diff --git a/modules/getopt-posix b/modules/getopt-posix
index bac9dc57c..b9caa6a47 100644
--- a/modules/getopt-posix
+++ b/modules/getopt-posix
@@ -38,6 +38,7 @@ BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H)
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
+if GL_GENERATE_GETOPT_H
 getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	$(MKDIR_P) '%reldir%' && \
@@ -60,6 +61,10 @@ getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
 	      < $(srcdir)/getopt-cdefs.in.h; \
 	} > $@-t && \
 	mv -f $@-t $@
+else
+getopt.h getopt-cdefs.h: $(top_builddir)/config.status
+	rm -f $@
+endif
 
 MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t
 

Reply via email to