2 getopt() function: process command line arguments.
21 gettext-h [test $REPLACE_GETOPT = 1]
26 gl_CONDITIONAL_HEADER([getopt.h])
27 gl_CONDITIONAL_HEADER([getopt-cdefs.h])
29 gl_CONDITIONAL([GL_COND_OBJ_GETOPT], [test $REPLACE_GETOPT = 1])
30 AM_COND_IF([GL_COND_OBJ_GETOPT], [
31 dnl Define the substituted variable GNULIB_UNISTD_H_GETOPT to 1.
32 gl_UNISTD_H_REQUIRE_DEFAULTS
33 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_GETOPT], [1])
35 gl_UNISTD_MODULE_INDICATOR([getopt-posix])
38 BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H)
40 # We need the following in order to create <getopt.h> when the system
41 # doesn't have one that works with the given compiler.
42 if GL_GENERATE_GETOPT_H
43 getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
44 @NMD@ $(AM_V_GEN)$(MKDIR_P) '%reldir%'
45 $(gl_V_at)$(SED_HEADER_STDOUT) \
46 -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
47 -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \
48 -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
49 -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
50 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
51 -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \
52 -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
53 $(srcdir)/getopt.in.h > $@-t
56 getopt.h: $(top_builddir)/config.status
60 if GL_GENERATE_GETOPT_CDEFS_H
61 getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
62 $(AM_V_GEN)$(SED_HEADER_STDOUT) \
63 -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
64 $(srcdir)/getopt-cdefs.in.h > $@-t
67 getopt-cdefs.h: $(top_builddir)/config.status
71 MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t
74 lib_SOURCES += getopt.c getopt1.c