From e97aef06cc1a15e527c00cfa7c4e2f2466a9922f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 12 Aug 2009 19:37:21 +0200 Subject: [PATCH] Reorder macros. --- ChangeLog | 6 ++++++ m4/getopt.m4 | 45 +++++++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f797cc1b7..46b79a9bb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-12 Bruno Haible + + * m4/getopt.m4: Reorder macros. + (gl_GETOPT): Inline gl_GETOPT_SUBSTITUTE. + (gl_GETOPT_SUBSTITUTE): Remove macro. + 2009-08-12 Bruno Haible Ensure that getopt() gets declared by . diff --git a/m4/getopt.m4 b/m4/getopt.m4 index 66164c7abd..9ad305f41d 100644 --- 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 @@ dnl with or without modifications, as long as this notice is preserved. # rather than vanilla POSIX getopt. This means your code should # always include 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], -- 2.30.2