1 # Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2, or (at your option)
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ###############################################################
17 # The main copy of this file is in Automake's CVS repository. #
18 # Updates should be sent to automake-patches@gnu.org. #
19 ###############################################################
21 package Automake::Configure_ac;
25 use Automake::Channels;
26 use Automake::ChannelDefs;
28 use vars qw (@ISA @EXPORT);
31 @EXPORT = qw (&find_configure_ac &require_configure_ac);
35 Automake::Configure_ac - Locate configure.ac or configure.in.
39 use Automake::Configure_ac;
41 # Try to locate configure.in or configure.ac in the current
42 # directory. It may be absent. Complain if both files exist.
43 my $file_name = find_configure_ac;
45 # Likewise, but bomb out if the file does not exist.
46 my $file_name = require_configure_ac;
48 # Likewise, but in $dir.
49 my $file_name = find_configure_ac ($dir);
50 my $file_name = require_configure_ac ($dir);
54 sub find_configure_ac (;@)
59 File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.ac'));
61 File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.in'));
68 "`$configure_ac' and `$configure_in' both present.\n"
69 . "proceeding with `$configure_ac'.");
73 elsif (-f $configure_in)
81 sub require_configure_ac (;$)
83 my $res = find_configure_ac (@_);
84 fatal "`configure.ac' or `configure.in' is required"
91 ### Setup "GNU" style for perl-mode and cperl-mode.
93 ## perl-indent-level: 2
94 ## perl-continued-statement-offset: 2
95 ## perl-continued-brace-offset: 0
96 ## perl-brace-offset: 0
97 ## perl-brace-imaginary-offset: 0
98 ## perl-label-offset: -2
99 ## cperl-indent-level: 2
100 ## cperl-brace-offset: 0
101 ## cperl-continued-brace-offset: 0
102 ## cperl-label-offset: -2
103 ## cperl-extra-newline-before-brace: t
104 ## cperl-merge-trailing-else: nil
105 ## cperl-continued-statement-offset: 2