* m4/argp.m4 (gl_ARGP): Don't invoke gl_REPLACE_GETOPT.
(gl_REPLACE_GETOPT_ALWAYS): New macro.
* m4/getopt.m4 (gl_FUNC_GETOPT_POSIX): Test whether
gl_REPLACE_GETOPT_ALWAYS is defined. Set REPLACE_GETOPT.
+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.
+ * m4/getopt.m4 (gl_FUNC_GETOPT_POSIX): Test whether
+ gl_REPLACE_GETOPT_ALWAYS is defined. Set REPLACE_GETOPT.
+
2011-05-08 Bruno Haible <bruno@clisp.org>
getlogin_r: Move AC_LIBOBJ invocations to module description.
-# argp.m4 serial 11
+# argp.m4 serial 12
dnl Copyright (C) 2003-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- dnl argp-parse.c depends on GNU getopt internals, therefore use GNU getopt
- dnl always.
- gl_REPLACE_GETOPT
- dnl Note: gl_REPLACE_GETOPT does AC_LIBOBJ([getopt]), AC_LIBOBJ([getopt1]).
AC_CHECK_DECL([program_invocation_name],
[AC_DEFINE([HAVE_DECL_PROGRAM_INVOCATION_NAME], [1],
AC_CHECK_FUNCS_ONCE([flockfile funlockfile])
AC_CHECK_HEADERS_ONCE([features.h linewrap.h])
])
+
+dnl argp-parse.c depends on GNU getopt internals, therefore use GNU getopt
+dnl always.
+AC_DEFUN([gl_REPLACE_GETOPT_ALWAYS], [])
-# getopt.m4 serial 34
+# getopt.m4 serial 35
dnl Copyright (C) 2002-2006, 2008-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[
m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
- gl_GETOPT_IFELSE([
+ dnl Other modules can request the gnulib implementation of the getopt
+ dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
+ dnl argp.m4 does this.
+ m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
+ gl_GETOPT_IFELSE([], [])
+ REPLACE_GETOPT=1
+ ], [
+ REPLACE_GETOPT=0
+ gl_GETOPT_IFELSE([
+ REPLACE_GETOPT=1
+ ],
+ [])
+ ])
+ if test $REPLACE_GETOPT = 1; then
gl_REPLACE_GETOPT
- ],
- [])
+ fi
])
# Request a POSIX compliant getopt function with GNU extensions (such as
])
# Request the gnulib implementation of the getopt functions unconditionally.
-# argp.m4 uses this.
AC_DEFUN([gl_REPLACE_GETOPT],
[
dnl Arrange for getopt.h to be created.