summaryrefslogtreecommitdiff
path: root/modules/getopt-posix
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-12-16 13:13:27 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-12-16 13:14:19 -0800
commitadcaaa85ea3aafe56e0a5e539d787e11585e3b01 (patch)
tree160ffc053103d39e639598f00abef23859b40e9e /modules/getopt-posix
parent88f5ae75df708299b72129da8255d8d03b6b19a5 (diff)
downloadgnulib-adcaaa85ea3aafe56e0a5e539d787e11585e3b01.tar.gz
getopt-posix,
* modules/getopt-posix (getopt.h, getopt-cdefs.h): Build only if GL_GENERATE_GETOPT_H.
Diffstat (limited to 'modules/getopt-posix')
-rw-r--r--modules/getopt-posix5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/getopt-posix b/modules/getopt-posix
index bac9dc57c9..b9caa6a471 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