# HG changeset patch # User Bruno Haible # Date 1304852747 -7200 # Node ID 9ac32f9b5582fc5a07e2693a8d57036bb9fd75af # Parent 87792dbdedee997a57f00d9007769919d3c6e280 getopt: Move AC_LIBOBJ invocations to module description. * m4/getopt.m4 (gl_REPLACE_GETOPT): Remove macro. (gl_FUNC_GETOPT): Inline it here. Move AC_LIBOBJ and gl_PREREQ_GETOPT invocations from here... * modules/getopt-gnu (configure.ac): ... to here. * modules/getopt-posix (configure.ac): ... and here. (Depends-on): Update condition. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-05-08 Bruno Haible + + getopt: Move AC_LIBOBJ invocations to module description. + * m4/getopt.m4 (gl_REPLACE_GETOPT): Remove macro. + (gl_FUNC_GETOPT): Inline it here. Move AC_LIBOBJ and gl_PREREQ_GETOPT + invocations from here... + * modules/getopt-gnu (configure.ac): ... to here. + * modules/getopt-posix (configure.ac): ... and here. + (Depends-on): Update condition. + 2011-05-08 Bruno Haible getopt, argp: Respect rules for use of AC_LIBOBJ. diff --git a/m4/getopt.m4 b/m4/getopt.m4 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -23,7 +23,10 @@ []) ]) if test $REPLACE_GETOPT = 1; then - gl_REPLACE_GETOPT + dnl Arrange for getopt.h to be created. + gl_GETOPT_SUBSTITUTE_HEADER + dnl Arrange for unistd.h to include getopt.h. + GNULIB_UNISTD_H_GETOPT=1 fi ]) @@ -37,19 +40,6 @@ AC_REQUIRE([gl_FUNC_GETOPT_POSIX]) ]) -# Request the gnulib implementation of the getopt functions unconditionally. -AC_DEFUN([gl_REPLACE_GETOPT], -[ - dnl Arrange for getopt.h to be created. - gl_GETOPT_SUBSTITUTE_HEADER - dnl Arrange for unistd.h to include getopt.h. - GNULIB_UNISTD_H_GETOPT=1 - dnl Arrange to compile the getopt implementation. - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) - gl_PREREQ_GETOPT -]) - # emacs' configure.in uses this. AC_DEFUN([gl_GETOPT_IFELSE], [ diff --git a/modules/getopt-gnu b/modules/getopt-gnu --- a/modules/getopt-gnu +++ b/modules/getopt-gnu @@ -9,6 +9,11 @@ configure.ac: gl_FUNC_GETOPT_GNU +if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT +fi gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) Makefile.am: diff --git a/modules/getopt-posix b/modules/getopt-posix --- a/modules/getopt-posix +++ b/modules/getopt-posix @@ -13,10 +13,15 @@ extensions include_next arg-nonnull -gettext-h [test $GNULIB_UNISTD_H_GETOPT = 1] +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 +fi Makefile.am: BUILT_SOURCES += $(GETOPT_H)