changeset 11813:c26f42c45dd6

Reorder macros.
author Bruno Haible <bruno@clisp.org>
date Wed, 12 Aug 2009 19:37:21 +0200
parents 9db809f9b38f
children f14d02bacc00
files ChangeLog m4/getopt.m4
diffstat 2 files changed, 29 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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>.
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -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 @@
 # 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 @@
 ])
 
 # 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],