From 964972933623c754cec5d929bc6d722e6b247174 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Fri, 1 Jun 2012 19:15:29 +0200 Subject: [PATCH] maint: 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. See also, in the Autoconf repository, commit 'v2.69-4-g560f16b' of 2012-05-23, "general: deprecate 'configure.in' as autoconf input". * lib/Automake/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). * t/help.sh: Adjust. * t/configure.sh: Adjust and enhance. Signed-off-by: Stefano Lattarini --- lib/Automake/Configure_ac.pm | 19 ++++++++++--------- t/configure.sh | 5 +++++ t/help.sh | 2 -- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/Automake/Configure_ac.pm b/lib/Automake/Configure_ac.pm index 53e62a5..fcaf0f7 100644 --- a/lib/Automake/Configure_ac.pm +++ b/lib/Automake/Configure_ac.pm @@ -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, 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 } diff --git a/t/configure.sh b/t/configure.sh index cedba55..b8e3d0b 100755 --- a/t/configure.sh +++ b/t/configure.sh @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Diagnose if the autoconf input is named configure.in. # Diagnose if both configure.in and configure.ac are present, prefer # configure.ac. @@ -51,4 +52,8 @@ AUTOMAKE_run -Wno-error grep 'configure\.ac.*configure\.in.*both present' stderr grep 'proceeding.*configure\.ac' stderr +mv -f configure.ac configure.in +AUTOMAKE_fails +grep "autoconf input.*'configure.ac', not 'configure.in'" stderr + : diff --git a/t/help.sh b/t/help.sh index 2f7c2d1..ae91877 100755 --- a/t/help.sh +++ b/t/help.sh @@ -38,9 +38,7 @@ $AUTOMAKE --help $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 $FGREP configure.ac stderr -$FGREP configure.in stderr AUTOMAKE_fails $FGREP configure.ac stderr -$FGREP configure.in stderr : -- 2.7.4