mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-11 13:51:04 +08:00
general: deprecate 'configure.in' as autoconf input
It has been years since that has been deprecated in the documentation, in favour of 'configure.ac': Previous versions of Autoconf promoted the name configure.in, which is somewhat ambiguous (the tool needed to process this file is not described by its extension), and introduces a slight confusion with config.h.in and so on (for which '.in' means "to be processed by configure"). Using configure.ac is now preferred. It's now time to start giving runtime warning about the use of 'configure.in', so that support for it can be removed in future versions of autoconf/automake. * lib/Autom4te/Configure_ac.pm: Issue a warning in the 'obsolete' category if 'configure.in' is detected. Since this module is synced from Automake, this change is to be backported there (and will be soon). * doc/autoconf.texi: Update. * tests/tools.at: Adjust to avoid spurious failures. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
This commit is contained in:
parent
7fbb553727
commit
560f16b52d
2
NEWS
2
NEWS
@ -2,6 +2,8 @@ GNU Autoconf NEWS - User visible changes.
|
||||
|
||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||
|
||||
** The use of the long-deprecated name 'configure.in' for the autoconf
|
||||
input file now elicits a warning in the 'obsolete' category.
|
||||
|
||||
* Noteworthy changes in release 2.69 (2012-04-24) [stable]
|
||||
|
||||
|
@ -1004,10 +1004,9 @@ a file called @file{config.log} containing any messages produced by
|
||||
compilers, to help debugging if @command{configure} makes a mistake.
|
||||
@end itemize
|
||||
|
||||
@cindex @file{configure.in}
|
||||
@cindex @file{configure.ac}
|
||||
To create a @command{configure} script with Autoconf, you need to write an
|
||||
Autoconf input file @file{configure.ac} (or @file{configure.in}) and run
|
||||
To create a @command{configure} script with Autoconf, you need
|
||||
to write an Autoconf input file @file{configure.ac} and run
|
||||
@command{autoconf} on it. If you write your own feature tests to
|
||||
supplement those that come with Autoconf, you might also write files
|
||||
called @file{aclocal.m4} and @file{acsite.m4}. If you use a C header
|
||||
@ -1095,12 +1094,14 @@ Programming}. The @command{autoscan} program can give you a good start
|
||||
in writing @file{configure.ac} (@pxref{autoscan Invocation}, for more
|
||||
information).
|
||||
|
||||
@cindex @file{configure.in}
|
||||
Previous versions of Autoconf promoted the name @file{configure.in},
|
||||
which is somewhat ambiguous (the tool needed to process this file is not
|
||||
described by its extension), and introduces a slight confusion with
|
||||
@file{config.h.in} and so on (for which @samp{.in} means ``to be
|
||||
processed by @command{configure}''). Using @file{configure.ac} is now
|
||||
preferred.
|
||||
preferred, while the use of @file{configure.in} will cause warnings
|
||||
from @command{autoconf}.
|
||||
|
||||
@menu
|
||||
* Shell Script Compiler:: Autoconf as solution of a problem
|
||||
|
@ -75,19 +75,21 @@ sub find_configure_ac (;@)
|
||||
my $configure_in =
|
||||
File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.in'));
|
||||
|
||||
if (-f $configure_ac)
|
||||
if (-f $configure_in)
|
||||
{
|
||||
if (-f $configure_in)
|
||||
msg ('obsolete', "autoconf input should be named 'configure.ac'," .
|
||||
" not 'configure.in'");
|
||||
if (-f $configure_ac)
|
||||
{
|
||||
msg ('unsupported',
|
||||
"'$configure_ac' and '$configure_in' both present.\n"
|
||||
. "proceeding with '$configure_ac'");
|
||||
return $configure_ac
|
||||
}
|
||||
return $configure_ac
|
||||
}
|
||||
elsif (-f $configure_in)
|
||||
{
|
||||
return $configure_in;
|
||||
else
|
||||
{
|
||||
return $configure_in;
|
||||
}
|
||||
}
|
||||
return $configure_ac;
|
||||
}
|
||||
@ -102,8 +104,7 @@ Like C<find_configure_ac>, but fail if neither is present.
|
||||
sub require_configure_ac (;$)
|
||||
{
|
||||
my $res = find_configure_ac (@_);
|
||||
fatal "'configure.ac' or 'configure.in' is required"
|
||||
unless -f $res;
|
||||
fatal "'configure.ac' is required" unless -f $res;
|
||||
return $res
|
||||
}
|
||||
|
||||
|
@ -1135,7 +1135,7 @@ AT_SETUP([autoupdating with aclocal and m4@&t@_include])
|
||||
AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
|
||||
|
||||
mkdir m4 aclocal
|
||||
AT_DATA([configure.in],
|
||||
AT_DATA([configure.ac],
|
||||
[[AC_INIT(x,0)
|
||||
AC_UNCHANGED_MACRO
|
||||
AC_OLD_MACRO
|
||||
@ -1169,7 +1169,7 @@ AT_CHECK([automake --version || exit 77], [], [stdout], [ignore])
|
||||
AT_CHECK([[grep '[1-9]\.[0-9]' stdout || exit 77]], [], [ignore])
|
||||
AT_CHECK([test ! -f $HOME/.autom4te.cfg || exit 77], [], [ignore], [ignore])
|
||||
|
||||
AT_DATA([configure.in],
|
||||
AT_DATA([configure.ac],
|
||||
[[AC_INIT(GNU foo, 1.0)
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
@ -1294,9 +1294,9 @@ do
|
||||
export TMPDIR
|
||||
|
||||
# skip if we cannot create such a file or directory
|
||||
AT_CHECK([mkdir "$dir" "$TMPDIR" && touch "$file.in" || exit 77])
|
||||
AT_CHECK([mkdir "$dir" "$TMPDIR" && touch "$file.ac" || exit 77])
|
||||
|
||||
cat >"$file.in" <<'END'
|
||||
cat >"$file.ac" <<'END'
|
||||
[AC_INIT(x,0)
|
||||
m4@&t@_include([foo.m4])
|
||||
AC_CONFIG_HEADERS([config.h:config.hin])
|
||||
@ -1307,20 +1307,20 @@ END
|
||||
[AC_DEFUN([AC_MACRO], [echo hi])]
|
||||
END
|
||||
|
||||
AT_CHECK_AUTOHEADER([-B "$dir" "$file.in"])
|
||||
AT_CHECK_AUTOHEADER([--force -I "$dir" "$file.in"])
|
||||
AT_CHECK_AUTOUPDATE([-B "$dir" "$file.in"])
|
||||
AT_CHECK_AUTOUPDATE([--force -I "$dir" "$file.in"])
|
||||
AT_CHECK_AUTOUPDATE([-B "$dir" - < "$file.in"], [], [ignore])
|
||||
AT_CHECK_AUTOCONF([-B "$dir" -o "$file" "$file.in"])
|
||||
AT_CHECK_AUTOCONF([-I "$dir" -o "$file" "$file.in"])
|
||||
AT_CHECK_AUTOHEADER([-B "$dir" "$file.ac"])
|
||||
AT_CHECK_AUTOHEADER([--force -I "$dir" "$file.ac"])
|
||||
AT_CHECK_AUTOUPDATE([-B "$dir" "$file.ac"])
|
||||
AT_CHECK_AUTOUPDATE([--force -I "$dir" "$file.ac"])
|
||||
AT_CHECK_AUTOUPDATE([-B "$dir" - < "$file.ac"], [], [ignore])
|
||||
AT_CHECK_AUTOCONF([-B "$dir" -o "$file" "$file.ac"])
|
||||
AT_CHECK_AUTOCONF([-I "$dir" -o "$file" "$file.ac"])
|
||||
# In autoconf, these exercise a slightly different code path:
|
||||
AT_CHECK_AUTOCONF([--prepend-include="$dir" -o "$file" "$file.in"])
|
||||
AT_CHECK_AUTOCONF([--include="$dir" -o "$file" "$file.in"])
|
||||
AT_CHECK_AUTOCONF([--prepend-include="$dir" -o "$file" "$file.ac"])
|
||||
AT_CHECK_AUTOCONF([--include="$dir" -o "$file" "$file.ac"])
|
||||
AT_CHECK([autoscan -B "$dir"], [], [], [ignore])
|
||||
AT_CHECK([autoscan --force -I "$dir"], [], [], [ignore])
|
||||
# autoreconf requires a sane input file name. Also, disable aclocal.
|
||||
mv -f "$file.in" configure.in
|
||||
mv -f "$file.ac" configure.ac
|
||||
AT_DATA([aclocal.m4])
|
||||
AT_CHECK([autoreconf -B "$dir"])
|
||||
AT_CHECK([autoreconf --force -I "$dir"])
|
||||
|
Loading…
Reference in New Issue
Block a user