Reorder macros.
authorBruno Haible <bruno@clisp.org>
Wed, 12 Aug 2009 17:37:21 +0000 (19:37 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 12 Aug 2009 17:37:21 +0000 (19:37 +0200)
ChangeLog
m4/getopt.m4

index 1f797cc..46b79a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-08-12  Bruno Haible  <bruno@clisp.org>
 
+       * m4/getopt.m4: Reorder macros.
+       (gl_GETOPT): Inline gl_GETOPT_SUBSTITUTE.
+       (gl_GETOPT_SUBSTITUTE): Remove macro.
+
+2009-08-12  Bruno Haible  <bruno@clisp.org>
+
        Ensure that getopt() gets declared by <unistd.h>.
        * lib/unistd.in.h: Conditionally include getopt.h.
        * m4/getopt.m4 (gl_GETOPT_SUBSTITUTE): Require gl_UNISTD_H_DEFAULTS.
index 66164c7..9ad305f 100644 (file)
@@ -1,4 +1,4 @@
-# getopt.m4 serial 17
+# getopt.m4 serial 18
 dnl Copyright (C) 2002-2006, 2008-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,29 +8,30 @@ dnl with or without modifications, as long as this notice is preserved.
 # rather than vanilla POSIX getopt.  This means your code should
 # always include <getopt.h> for the getopt prototypes.
 
-AC_DEFUN([gl_GETOPT_SUBSTITUTE],
+# This is gnulib's entry-point.
+AC_DEFUN([gl_GETOPT],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  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
+  gl_GETOPT_IFELSE([
+    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_SUBSTITUTE_HEADER],
+AC_DEFUN([gl_GETOPT_IFELSE],
 [
-  GETOPT_H=getopt.h
-  AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
-    [Define to rpl_ if the getopt replacement functions and variables
-     should be used.])
-  AC_SUBST([GETOPT_H])
+  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
+  AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
 ])
 
+# Determine whether to replace the entire getopt facility.
 AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 [
   gl_replace_getopt=
@@ -77,15 +78,15 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 ])
 
 # emacs' configure.in uses this.
-AC_DEFUN([gl_GETOPT_IFELSE],
+AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 [
-  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
-  AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
+  GETOPT_H=getopt.h
+  AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
+    [Define to rpl_ if the getopt replacement functions and variables
+     should be used.])
+  AC_SUBST([GETOPT_H])
 ])
 
-# This is gnulib's entry-point.
-AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
-
 # Prerequisites of lib/getopt*.
 # emacs' configure.in uses this.
 AC_DEFUN([gl_PREREQ_GETOPT],