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.
This commit is contained in:
Akim Demaille 2000-03-21 12:33:37 +00:00
parent 700c767833
commit e77251e421
3 changed files with 76 additions and 40 deletions

View File

@ -1,3 +1,13 @@
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.

View File

@ -801,12 +801,18 @@ AC_DEFUN(AC_PREFIX_DEFAULT,
[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
@ -818,13 +824,13 @@ if test -z "$srcdir"; then
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
@ -1394,8 +1400,8 @@ AC_DIVERT_POP()dnl
])# _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],
@ -1405,7 +1411,7 @@ AC_DIVERT([BINSH], [@%:@! /bin/sh])
_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
@ -1413,20 +1419,25 @@ 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],
[# 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
])
## ----------------------------- ##
@ -3261,10 +3272,11 @@ AC_DEFUN([AC_CHECK_TYPE],
# 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:
#
@ -3311,8 +3323,9 @@ AC_DEFUN([AC_CHECK_TYPE],
# 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.

View File

@ -801,12 +801,18 @@ AC_DEFUN(AC_PREFIX_DEFAULT,
[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
@ -818,13 +824,13 @@ if test -z "$srcdir"; then
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
@ -1394,8 +1400,8 @@ AC_DIVERT_POP()dnl
])# _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],
@ -1405,7 +1411,7 @@ AC_DIVERT([BINSH], [@%:@! /bin/sh])
_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
@ -1413,20 +1419,25 @@ 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],
[# 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
])
## ----------------------------- ##
@ -3261,10 +3272,11 @@ AC_DEFUN([AC_CHECK_TYPE],
# 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:
#
@ -3311,8 +3323,9 @@ AC_DEFUN([AC_CHECK_TYPE],
# 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.