+2000-07-07 Akim Demaille <akim@epita.fr>
+
+ AC_REVISION must not AC_REQUIRE AC_INIT, it leaves the diversions
+ in a messy state. Don't even try to emulate AC_REQUIRE: just
+ introduce a diversion just for AC_REVISION, and let the magic
+ happen.
+ Fixes Autoconf PR/134, from Raja R Harinath.
+
+ * acgeneral.m4 (_AC_DIVERT(REVISION)): New diversion.
+ (AC_REVISION): Don't require AC_INIT, dump in your diversion.
+ (_AC_INIT): Delete, inline its body in...
+ (AC_INIT): here.
+ (_AC_INIT_NOTICE, _AC_INIT_COPYRIGHT): New macros so that...
+ (AC_INIT): be more uniform.
+ (AC_INIT, AC_REVISION, AC_COPYRIGHT): `define', don't AC_DEFUN.
+
2000-07-07 Martin Wilck <martin@tropos.de>
* aclang.m4 (AC_F77_LIBRARY_LDFLAGS): Keep -lm, if a Fortran
#
# - BINSH
# AC_REQUIRE'd #! /bin/sh line
+# - REVISION
+# Sent by AC_REVISION
# - NOTICE
# copyright notice(s)
# - DEFAULTS
define([_AC_DIVERT(KILL)], -1)
define([_AC_DIVERT(BINSH)], 0)
-define([_AC_DIVERT(NOTICE)], 1)
-define([_AC_DIVERT(DEFAULTS)], 2)
-define([_AC_DIVERT(INIT_PARSE_ARGS)], 3)
+define([_AC_DIVERT(REVISION)], 1)
+define([_AC_DIVERT(NOTICE)], 2)
+define([_AC_DIVERT(DEFAULTS)], 3)
+define([_AC_DIVERT(INIT_PARSE_ARGS)], 4)
define([_AC_DIVERT(HELP_BEGIN)], 10)
define([_AC_DIVERT(HELP_CANON)], 11)
# would have be to use m4_quote to force an evaluation:
#
# patsubst(m4_quote($1), [^], [# ])
-AC_DEFUN([AC_COPYRIGHT],
+define([AC_COPYRIGHT],
[AC_DIVERT([NOTICE],
[patsubst([
$1], [^], [@%:@ ])])dnl
AC_DIVERT([VERSION_BEGIN],
[
$1])dnl
-])# _AC_INIT_COPYRIGHT
+])# AC_COPYRIGHT
# AC_REVISION(REVISION-INFO)
# --------------------------
-# The quote in the comment below is just to cope with font-lock-mode
+# The second quote in the translit is just to cope with font-lock-mode
# which sees the opening of a string.
-AC_DEFUN([AC_REVISION],
-[AC_REQUIRE([AC_INIT])dnl
-AC_DIVERT([BINSH], [@%:@ From configure.in translit([$1], $")])dnl "
+define([AC_REVISION],
+[AC_DIVERT([REVISION], [@%:@ From configure.in translit([$1], $"")])dnl
])
])# _AC_INIT_PREPARE
-# _AC_INIT
-# --------
-# Include the user macro files, prepare the diversions, and output the
-# preamble of the `configure' script.
-define([_AC_INIT],
-[AC_DIVERT([BINSH], [@%:@! /bin/sh])
-_AC_INIT_DEFAULTS()dnl
-AC_DIVERT_POP()dnl to BODY
-_AC_INIT_PARSE_ARGS
-_AC_INIT_SRCDIR
-_AC_INIT_HELP
-_AC_INIT_VERSION
-_AC_INIT_PREPARE
-dnl AC_COPYRIGHT must be called after _AC_INIT_VERSION, since it dumps
-dnl into a diversion prepared by _AC_INIT_VERSION.
-AC_DIVERT([NOTICE],
+# _AC_INIT_NOTICE
+# ---------------
+define([_AC_INIT_NOTICE],
+[AC_DIVERT([NOTICE],
[# Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by Autoconf AC_ACVERSION.])dnl
-AC_COPYRIGHT(
+])
+
+
+# _AC_INIT_COPYRIGHT
+# ------------------
+define([_AC_INIT_COPYRIGHT],
+[AC_COPYRIGHT(
[Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.])dnl
-])# _AC_INIT
+])
# AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
# AC_INIT([PACKAGE, VERSION, [BUG-REPORT])
# ----------------------------------------
-# Wrapper around _AC_INIT which guarantees _AC_INIT is expanded only
-# once.
+# Include the user macro files, prepare the diversions, and output the
+# preamble of the `configure' script.
# Note that the order is important: first initialize, then set the
# AC_CONFIG_SRCDIR.
-AC_DEFUN([AC_INIT],
+define([AC_INIT],
[ifval([$2], [_AC_INIT_PACKAGE($@)])dnl
-AC_EXPAND_ONCE([_AC_INIT()])dnl
+AC_DIVERT([BINSH], [@%:@! /bin/sh])
+_AC_INIT_DEFAULTS()dnl
+AC_DIVERT_POP()dnl to BODY
+_AC_INIT_PARSE_ARGS
+_AC_INIT_SRCDIR
+_AC_INIT_HELP
+_AC_INIT_VERSION
+_AC_INIT_PREPARE
+dnl _AC__INIT_COPYRIGHT must be called after _AC_INIT_VERSION, since
+dnl it dumps into a diversion prepared by _AC_INIT_VERSION.
+_AC_INIT_NOTICE
+_AC_INIT_COPYRIGHT
ifval([$2], , [ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
])
#
# - BINSH
# AC_REQUIRE'd #! /bin/sh line
+# - REVISION
+# Sent by AC_REVISION
# - NOTICE
# copyright notice(s)
# - DEFAULTS
define([_AC_DIVERT(KILL)], -1)
define([_AC_DIVERT(BINSH)], 0)
-define([_AC_DIVERT(NOTICE)], 1)
-define([_AC_DIVERT(DEFAULTS)], 2)
-define([_AC_DIVERT(INIT_PARSE_ARGS)], 3)
+define([_AC_DIVERT(REVISION)], 1)
+define([_AC_DIVERT(NOTICE)], 2)
+define([_AC_DIVERT(DEFAULTS)], 3)
+define([_AC_DIVERT(INIT_PARSE_ARGS)], 4)
define([_AC_DIVERT(HELP_BEGIN)], 10)
define([_AC_DIVERT(HELP_CANON)], 11)
# would have be to use m4_quote to force an evaluation:
#
# patsubst(m4_quote($1), [^], [# ])
-AC_DEFUN([AC_COPYRIGHT],
+define([AC_COPYRIGHT],
[AC_DIVERT([NOTICE],
[patsubst([
$1], [^], [@%:@ ])])dnl
AC_DIVERT([VERSION_BEGIN],
[
$1])dnl
-])# _AC_INIT_COPYRIGHT
+])# AC_COPYRIGHT
# AC_REVISION(REVISION-INFO)
# --------------------------
-# The quote in the comment below is just to cope with font-lock-mode
+# The second quote in the translit is just to cope with font-lock-mode
# which sees the opening of a string.
-AC_DEFUN([AC_REVISION],
-[AC_REQUIRE([AC_INIT])dnl
-AC_DIVERT([BINSH], [@%:@ From configure.in translit([$1], $")])dnl "
+define([AC_REVISION],
+[AC_DIVERT([REVISION], [@%:@ From configure.in translit([$1], $"")])dnl
])
])# _AC_INIT_PREPARE
-# _AC_INIT
-# --------
-# Include the user macro files, prepare the diversions, and output the
-# preamble of the `configure' script.
-define([_AC_INIT],
-[AC_DIVERT([BINSH], [@%:@! /bin/sh])
-_AC_INIT_DEFAULTS()dnl
-AC_DIVERT_POP()dnl to BODY
-_AC_INIT_PARSE_ARGS
-_AC_INIT_SRCDIR
-_AC_INIT_HELP
-_AC_INIT_VERSION
-_AC_INIT_PREPARE
-dnl AC_COPYRIGHT must be called after _AC_INIT_VERSION, since it dumps
-dnl into a diversion prepared by _AC_INIT_VERSION.
-AC_DIVERT([NOTICE],
+# _AC_INIT_NOTICE
+# ---------------
+define([_AC_INIT_NOTICE],
+[AC_DIVERT([NOTICE],
[# Guess values for system-dependent variables and create Makefiles.
@%:@ Generated by Autoconf AC_ACVERSION.])dnl
-AC_COPYRIGHT(
+])
+
+
+# _AC_INIT_COPYRIGHT
+# ------------------
+define([_AC_INIT_COPYRIGHT],
+[AC_COPYRIGHT(
[Copyright (C) 1992, 93, 94, 95, 96, 98, 99, 2000
Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.])dnl
-])# _AC_INIT
+])
# AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
# AC_INIT([PACKAGE, VERSION, [BUG-REPORT])
# ----------------------------------------
-# Wrapper around _AC_INIT which guarantees _AC_INIT is expanded only
-# once.
+# Include the user macro files, prepare the diversions, and output the
+# preamble of the `configure' script.
# Note that the order is important: first initialize, then set the
# AC_CONFIG_SRCDIR.
-AC_DEFUN([AC_INIT],
+define([AC_INIT],
[ifval([$2], [_AC_INIT_PACKAGE($@)])dnl
-AC_EXPAND_ONCE([_AC_INIT()])dnl
+AC_DIVERT([BINSH], [@%:@! /bin/sh])
+_AC_INIT_DEFAULTS()dnl
+AC_DIVERT_POP()dnl to BODY
+_AC_INIT_PARSE_ARGS
+_AC_INIT_SRCDIR
+_AC_INIT_HELP
+_AC_INIT_VERSION
+_AC_INIT_PREPARE
+dnl _AC__INIT_COPYRIGHT must be called after _AC_INIT_VERSION, since
+dnl it dumps into a diversion prepared by _AC_INIT_VERSION.
+_AC_INIT_NOTICE
+_AC_INIT_COPYRIGHT
ifval([$2], , [ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
])