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