automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 3/4] [ng] cleanup: get rid of 'Automake::Configure_


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 3/4] [ng] cleanup: get rid of 'Automake::Configure_ac' module
Date: Fri, 25 May 2012 17:51:01 +0200

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.

* automake.in (Automake::Configure_ac): Drop this import.
(Main code): Check the existence of configure.ac directly, instead
of calling the noe-removed 'require_configure_ac' function.
* aclocal.in: Likewise.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 Makefile.am                  |    1 -
 aclocal.in                   |    4 +-
 automake.in                  |    3 +-
 lib/Automake/Configure_ac.pm |  107 ------------------------------------------
 4 files changed, 3 insertions(+), 112 deletions(-)
 delete mode 100644 lib/Automake/Configure_ac.pm

diff --git a/Makefile.am b/Makefile.am
index 60d5ab7..4cfdd10 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -189,7 +189,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 f3b6e6a..28e2218 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -35,7 +35,6 @@ use strict;
 
 use Automake::Config;
 use Automake::General;
-use Automake::Configure_ac;
 use Automake::Channels;
 use Automake::ChannelDefs;
 use Automake::XFile;
@@ -1038,7 +1037,8 @@ sub parse_ACLOCAL_PATH ()
 parse_WARNINGS;                    # Parse the WARNINGS environment variable.
 parse_arguments;
 parse_ACLOCAL_PATH;
-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 5ba22f7..eeafd29 100644
--- a/automake.in
+++ b/automake.in
@@ -144,7 +144,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/;
@@ -8007,7 +8006,7 @@ parse_WARNINGS;
 # Parse command line.
 parse_arguments;
 
-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 address@hidden         #
-###############################################################
-
-package Automake::Configure_ac;
-
-use 5.006;
-use strict;
-use Exporter;
-use Automake::Channels;
-use Automake::ChannelDefs;
-
-use vars qw (@ISA @EXPORT);
-
address@hidden = qw (Exporter);
address@hidden = 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:
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]