X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=modules%2Fgetopt-posix;h=b82d6b27cdbaa1cd6fe2515a28f00bda321d8cea;hb=7ef6c64e210ac0979d7e8ac69bc5b5208c2405ab;hp=6b20f15462c5d4e9591b6a86e11560a7fb8e17ed;hpb=bd8cfad4eb68e459d9fd24144df7a106765f8c09;p=gnulib.git diff --git a/modules/getopt-posix b/modules/getopt-posix index 6b20f1546..b82d6b27c 100644 --- a/modules/getopt-posix +++ b/modules/getopt-posix @@ -9,23 +9,40 @@ lib/getopt_int.h m4/getopt.m4 Depends-on: -gettext-h unistd extensions +include_next +snippet/arg-nonnull +gettext-h [test $REPLACE_GETOPT = 1] configure.ac: gl_FUNC_GETOPT_POSIX +if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT + dnl Arrange for unistd.h to include getopt.h. + GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT=1 +fi +AC_SUBST([GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT]) Makefile.am: BUILT_SOURCES += $(GETOPT_H) # We need the following in order to create when the system # doesn't have one that works with the given compiler. -getopt.h: getopt.in.h - rm -f $@-t $@ +getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/getopt.in.h; \ - } > $@-t + sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \ + -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + < $(srcdir)/getopt.in.h; \ + } > $@-t && \ mv -f $@-t $@ MOSTLYCLEANFILES += getopt.h getopt.h-t @@ -33,7 +50,7 @@ Include: License: -LGPL +LGPLv2+ Maintainer: all, glibc