Reword the copyright notices to match what's suggested in GPLv3.
[automake/plouj.git] / lib / Automake / Configure_ac.pm
blob855e2dbdce240cd1ca1694ba3fd454f054877f61
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 3, or (at your option)
6 # any later version.
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;
23 use strict;
24 use Exporter;
25 use Automake::Channels;
26 use Automake::ChannelDefs;
28 use vars qw (@ISA @EXPORT);
30 @ISA = qw (Exporter);
31 @EXPORT = qw (&find_configure_ac &require_configure_ac);
33 =head1 NAME
35 Automake::Configure_ac - Locate configure.ac or configure.in.
37 =head1 SYNOPSIS
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);
52 =cut
54 sub find_configure_ac (;@)
56 my ($directory) = @_;
57 $directory ||= '.';
58 my $configure_ac =
59 File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.ac'));
60 my $configure_in =
61 File::Spec->canonpath (File::Spec->catfile ($directory, 'configure.in'));
63 if (-f $configure_ac)
65 if (-f $configure_in)
67 msg ('unsupported',
68 "`$configure_ac' and `$configure_in' both present.\n"
69 . "proceeding with `$configure_ac'.");
71 return $configure_ac
73 elsif (-f $configure_in)
75 return $configure_in;
77 return $configure_ac;
81 sub require_configure_ac (;$)
83 my $res = find_configure_ac (@_);
84 fatal "`configure.ac' or `configure.in' is required"
85 unless -f $res;
86 return $res
91 ### Setup "GNU" style for perl-mode and cperl-mode.
92 ## Local Variables:
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
106 ## End: