Now that we unconditionally assume the Autoconf input is named "configure.ac", it's easier and clearer to inline the checks on the existence of such a file directly in the automake and aclocal scripts.
This change is basically a backport of the 'v1.12-327-gee6d72a' commit from Automake-NG. * lib/Automake/Variable.pm (Automake::Configure_ac): Drop this import. ($configure_ac): Define to "configure.ac", unconditionally. * automake.in: Likewise. Also, in main code, check the existence of 'configure.ac' directly, instead of calling the now-removed 'require_configure_ac' function. * aclocal.in: Likewise. Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com> --- Makefile.am | 1 - aclocal.in | 9 ++-- automake.in | 8 ++-- lib/Automake/Configure_ac.pm | 107 ------------------------------------------- lib/Automake/Variable.pm | 7 +-- 5 files changed, 10 insertions(+), 122 deletions(-) delete mode 100644 lib/Automake/Configure_ac.pm diff --git a/Makefile.am b/Makefile.am index 7ad0e1f..1dc5188 100644 --- a/Makefile.am +++ b/Makefile.am @@ -182,7 +182,6 @@ dist_perllib_DATA = \ lib/Automake/ChannelDefs.pm \ lib/Automake/Channels.pm \ lib/Automake/Condition.pm \ - lib/Automake/Configure_ac.pm \ lib/Automake/DisjConditions.pm \ lib/Automake/FileUtils.pm \ lib/Automake/General.pm \ diff --git a/aclocal.in b/aclocal.in index d38ac22..0352f5e 100644 --- a/aclocal.in +++ b/aclocal.in @@ -36,7 +36,6 @@ use strict; use Automake::Config; use Automake::General; -use Automake::Configure_ac; use Automake::Channels; use Automake::ChannelDefs; use Automake::XFile; @@ -81,8 +80,9 @@ my @diff_command; # --dry-run my $dry_run = 0; -# configure.ac -my $configure_ac; +# Name of the Autoconf input file. We used to support 'configure.in' +# as well once, that that is long obsolete now. +my $configure_ac = 'configure.ac'; # Output file name. my $output_file = 'aclocal.m4'; @@ -1130,7 +1130,8 @@ sub parse_ACLOCAL_PATH () parse_WARNINGS; # Parse the WARNINGS environment variable. parse_arguments; parse_ACLOCAL_PATH; -$configure_ac = require_configure_ac; + +fatal "$configure_ac is required" unless -f $configure_ac; # We may have to rerun aclocal if some file have been installed, but # it should not happen more than once. The reason we must run again diff --git a/automake.in b/automake.in index 68e9339..3253f7f 100644 --- a/automake.in +++ b/automake.in @@ -136,7 +136,6 @@ use Automake::General; use Automake::XFile; use Automake::Channels; use Automake::ChannelDefs; -use Automake::Configure_ac; use Automake::FileUtils; use Automake::Location; use Automake::Condition qw/TRUE FALSE/; @@ -303,8 +302,9 @@ my $force_missing = 0; ## Variables filled during files scanning. ## ## ---------------------------------------- ## -# Name of the configure.ac file. -my $configure_ac; +# Name of the Autoconf input file. We used to support 'configure.in' +# as well once, that that is long obsolete now. +my $configure_ac = 'configure.ac'; # Files found by scanning configure.ac for LIBOBJS. my %libsources = (); @@ -8274,7 +8274,7 @@ parse_WARNINGS; # Parse command line. parse_arguments; -$configure_ac = require_configure_ac; +fatal "$configure_ac is required" unless -f $configure_ac; # Do configure.ac scan only once. scan_autoconf_files; diff --git a/lib/Automake/Configure_ac.pm b/lib/Automake/Configure_ac.pm deleted file mode 100644 index e53913a..0000000 --- a/lib/Automake/Configure_ac.pm +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright (C) 2003-2012 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -############################################################### -# The main copy of this file is in Automake's git repository. # -# Updates should be sent to automake-patches@gnu.org. # -############################################################### - -package Automake::Configure_ac; - -use 5.006; -use strict; -use Exporter; -use Automake::Channels; -use Automake::ChannelDefs; - -use vars qw (@ISA @EXPORT); - -@ISA = qw (Exporter); -@EXPORT = qw (&find_configure_ac &require_configure_ac); - -=head1 NAME - -Automake::Configure_ac - Locate configure.ac or configure.in. - -=head1 SYNOPSIS - - use Automake::Configure_ac; - - # Try to locate configure.in or configure.ac in the current - # directory. It may be absent. Complain if both files exist. - my $file_name = find_configure_ac; - - # Likewise, but bomb out if the file does not exist. - my $file_name = require_configure_ac; - - # Likewise, but in $dir. - my $file_name = find_configure_ac ($dir); - my $file_name = require_configure_ac ($dir); - -=over 4 - -=back - -=head2 Functions - -=over 4 - -=item C<$configure_ac = find_configure_ac ([$directory])> - -Find a F<configure.ac> or F<configure.in> file in C<$directory>, -defaulting to the current directory. Complain if both files are present. -Return the name of the file found, or the former if neither is present. - -=cut - -sub find_configure_ac (;@) -{ - my ($directory) = @_; - $directory ||= '.'; - return File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.ac')); -} - - -=item C<$configure_ac = require_configure_ac ([$directory])> - -Like C<find_configure_ac>, but fail if neither is present. - -=cut - -sub require_configure_ac (;$) -{ - my $res = find_configure_ac (@_); - fatal "'configure.ac' is required" unless -f $res; - return $res -} - -1; - -### Setup "GNU" style for perl-mode and cperl-mode. -## Local Variables: -## perl-indent-level: 2 -## perl-continued-statement-offset: 2 -## perl-continued-brace-offset: 0 -## perl-brace-offset: 0 -## perl-brace-imaginary-offset: 0 -## perl-label-offset: -2 -## cperl-indent-level: 2 -## cperl-brace-offset: 0 -## cperl-continued-brace-offset: 0 -## cperl-label-offset: -2 -## cperl-extra-newline-before-brace: t -## cperl-merge-trailing-else: nil -## cperl-continued-statement-offset: 2 -## End: diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index d4d230f..43f1cd1 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -21,7 +21,6 @@ use Carp; use Automake::Channels; use Automake::ChannelDefs; -use Automake::Configure_ac; use Automake::Item; use Automake::VarDef; use Automake::Condition qw (TRUE FALSE); @@ -193,8 +192,7 @@ my %_ac_macro_for_var = YACC => 'AC_PROG_YACC', ); -# The name of the configure.ac file. -my $configure_ac; +my $configure_ac = 'configure.ac'; # Variables that can be overridden without complaint from -Woverride my %_silent_variable_override = @@ -1133,9 +1131,6 @@ sub require_variables ($$$@) my $res = 0; $reason .= ' but ' unless $reason eq ''; - $configure_ac = find_configure_ac - unless defined $configure_ac; - VARIABLE: foreach my $var (@vars) { -- 1.8.0.1.409.g252f922