getopt: Move AC_LIBOBJ invocations to module description.
authorBruno Haible <bruno@clisp.org>
Sun, 8 May 2011 11:05:47 +0000 (13:05 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Jun 2011 22:06:07 +0000 (00:06 +0200)
* 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.

ChangeLog
m4/getopt.m4
modules/getopt-gnu
modules/getopt-posix

index 5db6ffe..b1c66fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-05-08  Bruno Haible  <bruno@clisp.org>
 
+       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  <bruno@clisp.org>
+
        getopt, argp: Respect rules for use of AC_LIBOBJ.
        * m4/argp.m4 (gl_ARGP): Don't invoke gl_REPLACE_GETOPT.
        (gl_REPLACE_GETOPT_ALWAYS): New macro.
index 4ad52fd..4d8450f 100644 (file)
@@ -23,7 +23,10 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
     [])
   ])
   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_DEFUN([gl_FUNC_GETOPT_GNU],
   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],
 [
index 92b37dd..3e5876a 100644 (file)
@@ -9,6 +9,11 @@ getopt-posix
 
 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:
index c99f8a4..5da0b47 100644 (file)
@@ -13,10 +13,15 @@ unistd
 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)