+2000-03-21 Akim Demaille <akim@epita.fr>
+
+ Fix a bug: some macros (e.g., AC_REVISION, AC_COPYRIGHT etc.) can
+ be used before AC_INIT, but they do require it. But then, the
+ argument of the explicit AC_INIT call is lost.
+
+ * acgeneral.m4 (AC_CONFIG_SRCDIR): New macro.
+ (_AC_INIT_SRCDIR): Adjust.
+ (_AC_INIT): Pass your argument to AC_CONFIG_SRCDIR.
+
2000-03-21 Akim Demaille <akim@epita.fr>
* tests/semantics.m4 (AC_PATH_PROG, AC_PATH_PROGS): New tests.
[AC_DIVERT([DEFAULTS], [ac_default_prefix=$1])])
-# _AC_INIT_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
-# --------------------------------------------
-# Compute `srcdir'. UNIQUE-FILE-IN-SOURCE-DIR is
-# a filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is
-# correct.
+# AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
+# ---------------------------------------------
+# UNIQUE-FILE-IN-SOURCE-DIR is a filename unique to this package,
+# relative to the directory that configure is in, which we can look
+# for to find out if srcdir is correct.
+AC_DEFUN([AC_CONFIG_SRCDIR],
+[AC_DIVERT([DEFAULTS], [ac_unique_file="$1"])])
+
+
+# _AC_INIT_SRCDIR
+# ---------------
+# Compute `srcdir' based on `$ac_unique_file'.
define([_AC_INIT_SRCDIR],
[AC_DIVERT_PUSH([INIT_PARSE_ARGS])dnl
ac_confdir=`echo "$ac_prog" | sed 's%/[[^/][^/]]*$%%'`
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
- if test ! -r $srcdir/$1; then
+ if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r $srcdir/$1; then
+if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
AC_MSG_ERROR(cannot find sources in $ac_confdir or ..)
else
])# _AC_INIT_PREPARE
-# _AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
-# -------------------------------------
+# _AC_INIT
+# --------
# Include the user macro files, prepare the diversions, and output the
# preamble of the `configure' script.
define([_AC_INIT],
_AC_INIT_DEFAULTS()dnl
AC_DIVERT_POP()dnl to NORMAL
_AC_INIT_PARSE_ARGS
-_AC_INIT_SRCDIR([$1])
+_AC_INIT_SRCDIR
_AC_INIT_HELP
_AC_INIT_VERSION
_AC_INIT_PREPARE
dnl into a diversion prepared by _AC_INIT_VERSION.
AC_DIVERT([NOTICE],
[# Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf ]AC_ACVERSION[.])dnl
+@%:@ Generated by Autoconf AC_ACVERSION.])dnl
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
# AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
# ------------------------------------
# Wrapper around _AC_INIT which guarantees _AC_INIT is expanded only
# once.
-AC_DEFUN([AC_INIT], [AC_EXPAND_ONCE([_AC_INIT($@)])])
+# Note that the order is important: first initialize, then set the
+# AC_CONFIG_SRCDIR.
+AC_DEFUN([AC_INIT],
+[AC_EXPAND_ONCE([_AC_INIT()])dnl
+ifval([$1], [AC_CONFIG_SRCDIR([$1])])dnl
+])
## ----------------------------- ##
# This section handles about all the preparation aspects for
-# `config.status': registering the configuration files, the headers, the
-# links, and the commands `config.status' will run. There is a little
-# mixture though of things actually handled by `configure', such as
-# running the `configure' in the sub directories. Minor detail.
+# `config.status': registering the configuration files, the headers,
+# the links, and the commands `config.status' will run. There is a
+# little mixture though of things actually handled by `configure',
+# such as running the `configure' in the sub directories. Minor
+# detail.
#
# There are two kinds of commands:
#
# Honorable members of this family are AC_CONFIG_FILES,
# AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS. Bad boys
# are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with
-# arguments. False members are AC_CONFIG_SUBDIRS and AC_CONFIG_AUX_DIR.
-# Cousins are AC_CONFIG_COMMANDS_PRE and AC_CONFIG_COMMANDS_POST.
+# arguments. False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS
+# and AC_CONFIG_AUX_DIR. Cousins are AC_CONFIG_COMMANDS_PRE and
+# AC_CONFIG_COMMANDS_POST.
[AC_DIVERT([DEFAULTS], [ac_default_prefix=$1])])
-# _AC_INIT_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
-# --------------------------------------------
-# Compute `srcdir'. UNIQUE-FILE-IN-SOURCE-DIR is
-# a filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is
-# correct.
+# AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
+# ---------------------------------------------
+# UNIQUE-FILE-IN-SOURCE-DIR is a filename unique to this package,
+# relative to the directory that configure is in, which we can look
+# for to find out if srcdir is correct.
+AC_DEFUN([AC_CONFIG_SRCDIR],
+[AC_DIVERT([DEFAULTS], [ac_unique_file="$1"])])
+
+
+# _AC_INIT_SRCDIR
+# ---------------
+# Compute `srcdir' based on `$ac_unique_file'.
define([_AC_INIT_SRCDIR],
[AC_DIVERT_PUSH([INIT_PARSE_ARGS])dnl
ac_confdir=`echo "$ac_prog" | sed 's%/[[^/][^/]]*$%%'`
test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
srcdir=$ac_confdir
- if test ! -r $srcdir/$1; then
+ if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r $srcdir/$1; then
+if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
AC_MSG_ERROR(cannot find sources in $ac_confdir or ..)
else
])# _AC_INIT_PREPARE
-# _AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
-# -------------------------------------
+# _AC_INIT
+# --------
# Include the user macro files, prepare the diversions, and output the
# preamble of the `configure' script.
define([_AC_INIT],
_AC_INIT_DEFAULTS()dnl
AC_DIVERT_POP()dnl to NORMAL
_AC_INIT_PARSE_ARGS
-_AC_INIT_SRCDIR([$1])
+_AC_INIT_SRCDIR
_AC_INIT_HELP
_AC_INIT_VERSION
_AC_INIT_PREPARE
dnl into a diversion prepared by _AC_INIT_VERSION.
AC_DIVERT([NOTICE],
[# Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf ]AC_ACVERSION[.])dnl
+@%:@ Generated by Autoconf AC_ACVERSION.])dnl
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
# AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
# ------------------------------------
# Wrapper around _AC_INIT which guarantees _AC_INIT is expanded only
# once.
-AC_DEFUN([AC_INIT], [AC_EXPAND_ONCE([_AC_INIT($@)])])
+# Note that the order is important: first initialize, then set the
+# AC_CONFIG_SRCDIR.
+AC_DEFUN([AC_INIT],
+[AC_EXPAND_ONCE([_AC_INIT()])dnl
+ifval([$1], [AC_CONFIG_SRCDIR([$1])])dnl
+])
## ----------------------------- ##
# This section handles about all the preparation aspects for
-# `config.status': registering the configuration files, the headers, the
-# links, and the commands `config.status' will run. There is a little
-# mixture though of things actually handled by `configure', such as
-# running the `configure' in the sub directories. Minor detail.
+# `config.status': registering the configuration files, the headers,
+# the links, and the commands `config.status' will run. There is a
+# little mixture though of things actually handled by `configure',
+# such as running the `configure' in the sub directories. Minor
+# detail.
#
# There are two kinds of commands:
#
# Honorable members of this family are AC_CONFIG_FILES,
# AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS. Bad boys
# are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with
-# arguments. False members are AC_CONFIG_SUBDIRS and AC_CONFIG_AUX_DIR.
-# Cousins are AC_CONFIG_COMMANDS_PRE and AC_CONFIG_COMMANDS_POST.
+# arguments. False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS
+# and AC_CONFIG_AUX_DIR. Cousins are AC_CONFIG_COMMANDS_PRE and
+# AC_CONFIG_COMMANDS_POST.