gnulib-tool.py: Make --megatest behaviour more similar to shell impl.
[gnulib.git] / modules / getopt-posix
blob6305e83c8ab40467d3da491071fb286c2c3082ea
1 Description:
2 getopt() function: process command line arguments.
4 Files:
5 lib/getopt.c
6 lib/getopt1.c
7 lib/getopt.in.h
8 lib/getopt-cdefs.in.h
9 lib/getopt-core.h
10 lib/getopt-ext.h
11 lib/getopt-pfx-core.h
12 lib/getopt-pfx-ext.h
13 lib/getopt_int.h
14 m4/getopt.m4
16 Depends-on:
17 unistd
18 extensions
19 include_next
20 gen-header
21 gettext-h       [test $REPLACE_GETOPT = 1]
22 snippet/arg-nonnull
24 configure.ac:
25 gl_FUNC_GETOPT_POSIX
26 gl_CONDITIONAL_HEADER([getopt.h])
27 gl_CONDITIONAL_HEADER([getopt-cdefs.h])
28 AC_PROG_MKDIR_P
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])
37 Makefile.am:
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
54         $(AM_V_at)mv $@-t $@
55 else
56 getopt.h: $(top_builddir)/config.status
57         rm -f $@
58 endif
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
65         $(AM_V_at)mv $@-t $@
66 else
67 getopt-cdefs.h: $(top_builddir)/config.status
68         rm -f $@
69 endif
71 MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t
73 if GL_COND_OBJ_GETOPT
74 lib_SOURCES += getopt.c getopt1.c
75 endif
77 Include:
78 <unistd.h>
80 License:
81 LGPLv2+
83 Maintainer:
84 all, glibc