summaryrefslogtreecommitdiff
path: root/lib/Automake/Configure_ac.pm
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2003-06-02 23:35:00 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2003-06-02 23:35:00 +0000
commit9f02b686c685da8630fbb86eac63cf1293f24310 (patch)
tree1cd2690a4fcd3d1d8dc16a9ae03427150fdfb0e0 /lib/Automake/Configure_ac.pm
parent6735518ef1192a010961ca590f0ed361f97dc8a2 (diff)
downloadautomake-9f02b686c685da8630fbb86eac63cf1293f24310.tar.gz
* alocal.in: Use Automake::Configure_ac.
($configure_ac): Delete. (scan_configure): Adjust use of find_configure_ac; * automake.in: Use Automake::Configure_ac. ($configure_ac): Delete. (scan_autoconf_files): Adjust use of find_configure_ac; * lib/Automake/Configure_ac.pm: New file. * lib/Automake/General.pm (find_configure_ac): Delete. Now replaced by Automake::Configure_ac::search_configure_ac. * lib/Automake/Makefile.am (dist_perllib_DATA): Add Configure_ac.pm. * lib/Automake/Variable.pm: Use Automake::Configure_ac. (require_variables): Adjust use of $configure_ac.
Diffstat (limited to 'lib/Automake/Configure_ac.pm')
-rw-r--r--lib/Automake/Configure_ac.pm95
1 files changed, 95 insertions, 0 deletions
diff --git a/lib/Automake/Configure_ac.pm b/lib/Automake/Configure_ac.pm
new file mode 100644
index 000000000..52d40b865
--- /dev/null
+++ b/lib/Automake/Configure_ac.pm
@@ -0,0 +1,95 @@
+# Copyright (C) 2003 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+package Automake::Configure_ac;
+
+use strict;
+use Exporter;
+use Automake::Channels;
+use Automake::ChannelDefs;
+
+use vars qw (@ISA @EXPORT);
+
+@ISA = qw (Exporter);
+@EXPORT = qw ($configure_ac &search_configure_ac &find_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 $filename = search_configure_ac;
+
+ # Likewise, but bomb out if the file does not exist.
+ my $filename = find_configure_ac;
+
+In both cases, the name of the file found is also put in the
+C<$configure_ac> global variable.
+
+=cut
+
+use vars '$configure_ac';
+
+sub search_configure_ac ()
+{
+ if (-f 'configure.ac')
+ {
+ if (-f 'configure.in')
+ {
+ msg ('unsupported',
+ "`configure.ac' and `configure.in' both present.\n"
+ . "proceeding with `configure.ac'.");
+ }
+ $configure_ac = 'configure.ac';
+ }
+ elsif (-f 'configure.in')
+ {
+ $configure_ac = 'configure.in';
+ }
+ return $configure_ac;
+}
+
+sub find_configure_ac ()
+{
+ fatal "`configure.ac' or `configure.in' is required"
+ unless search_configure_ac;
+ return $configure_ac;
+}
+
+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: