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, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 ###############################################################
19 # The main copy of this file is in Automake's CVS repository. #
20 # Updates should be sent to automake-patches@gnu.org. #
21 ###############################################################
23 package Automake::Configure_ac;
27 use Automake::Channels;
28 use Automake::ChannelDefs;
30 use vars qw (@ISA @EXPORT);
33 @EXPORT = qw (&find_configure_ac &require_configure_ac);
37 Automake::Configure_ac - Locate configure.ac or configure.in.
41 use Automake::Configure_ac;
43 # Try to locate configure.in or configure.ac in the current
44 # directory. It may be absent. Complain if both files exist.
45 my $file_name = find_configure_ac;
47 # Likewise, but bomb out if the file does not exist.
48 my $file_name = require_configure_ac;
50 # Likewise, but in $dir.
51 my $file_name = find_configure_ac ($dir);
52 my $file_name = require_configure_ac ($dir);
56 sub find_configure_ac (;@)
61 File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.ac'));
63 File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.in'));
70 "`$configure_ac' and `$configure_in' both present.\n"
71 . "proceeding with `$configure_ac'.");
75 elsif (-f $configure_in)
83 sub require_configure_ac (;$)
85 my $res = find_configure_ac (@_);
86 fatal "`configure.ac' or `configure.in' is required"
93 ### Setup "GNU" style for perl-mode and cperl-mode.
95 ## perl-indent-level: 2
96 ## perl-continued-statement-offset: 2
97 ## perl-continued-brace-offset: 0
98 ## perl-brace-offset: 0
99 ## perl-brace-imaginary-offset: 0
100 ## perl-label-offset: -2
101 ## cperl-indent-level: 2
102 ## cperl-brace-offset: 0
103 ## cperl-continued-brace-offset: 0
104 ## cperl-label-offset: -2
105 ## cperl-extra-newline-before-brace: t
106 ## cperl-merge-trailing-else: nil
107 ## cperl-continued-statement-offset: 2