File Coverage

blib/lib/auto/share/dist/Alien-autoconf/bin/autoconf
Criterion Covered Total %
statement 50 80 62.5
branch 2 28 7.1
condition 11 33 33.3
subroutine 12 17 70.5
pod n/a
total 75 158 47.4


line stmt bran cond sub pod time code
1             #! /usr/local/bin/perl
2             BEGIN {
3 1     1   6044 use strict;
  1         2  
  1         46  
4 1     1   5 use warnings;
  1         2  
  1         64  
5 1     1   8 use File::Spec;
  1         2  
  1         252  
6 1     1   32 my($v,$d) = File::Spec->splitpath(File::Spec->rel2abs(__FILE__));
7 1         17 my @d = File::Spec->splitdir($d);
8 1         7 pop @d for 1..2;
9 1         20 my $dist_dir = File::Spec->catpath($v,File::Spec->catdir(@d), '');
10 1   33     36 $ENV{AUTOM4TE} ||= File::Spec->catfile($dist_dir, 'bin/autom4te');
11 1   33     59 $ENV{autom4te_perllibdir} ||= File::Spec->catdir($dist_dir, 'share/autoconf');
12 1   33     20 $ENV{AC_MACRODIR} ||= File::Spec->catdir($dist_dir, 'share/autoconf');
13 1   33     15 $ENV{AUTOCONF} ||= File::Spec->catfile($dist_dir, 'bin/autoconf');
14 1   33     27 $ENV{AUTOHEADER} ||= File::Spec->catfile($dist_dir, 'bin/autoheader');
15 1 50 33     53 $ENV{AUTOM4TE_CFG} ||= File::Spec->catfile($dist_dir, 'share/autoconf/autom4te.blib.cfg')
      33        
16             if $d[-5] eq 'lib' && $d[-6] eq 'blib';
17 1   33     74 $ENV{trailer_m4} ||= File::Spec->catdir($dist_dir, 'share/autoconf/autoconf/trailer.m4');
18             }
19             # -*- Perl -*-
20             # Generated from bin/autoconf.in; do not edit by hand.
21              
22 1         202675 eval 'case $# in 0) exec /usr/local/bin/perl -S "$0";; *) exec /usr/local/bin/perl -S "$0" "$@";; esac'
23             if 0;
24              
25             # autoconf -- create 'configure' using m4 macros.
26              
27             # Copyright (C) 1992-1994, 1996, 1999-2017, 2020-2023 Free Software
28             # Foundation, Inc.
29              
30             # This program is free software: you can redistribute it and/or modify
31             # it under the terms of the GNU General Public License as published by
32             # the Free Software Foundation, either version 3 of the License, or
33             # (at your option) any later version.
34              
35             # This program is distributed in the hope that it will be useful,
36             # but WITHOUT ANY WARRANTY; without even the implied warranty of
37             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38             # GNU General Public License for more details.
39              
40             # You should have received a copy of the GNU General Public License
41             # along with this program. If not, see .
42              
43 1     1   20 use 5.006;
  1         4  
44 1     1   17 use strict;
  1         4  
  1         41  
45 1     1   5 use warnings FATAL => 'all';
  1         2  
  1         141  
46              
47             BEGIN
48             {
49 1   50 1   33 my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '/usr/local/lib/perl5/site_perl/5.42.0/x86_64-linux/auto/share/dist/Alien-autoconf/share/autoconf';
50 1         4 unshift @INC, $pkgdatadir;
51              
52             # Override SHELL. On DJGPP SHELL may not be set to a shell
53             # that can handle redirection and quote arguments correctly,
54             # e.g.: COMMAND.COM. For DJGPP always use the shell that configure
55             # has detected.
56 1 50       34 $ENV{'SHELL'} = '/bin/bash' if ($^O eq 'dos');
57             }
58              
59 1     1   825 use Autom4te::ChannelDefs;
  1         4  
  1         158  
60 1     1   8 use Autom4te::Channels qw(msg);
  1         2  
  1         119  
61 1     1   736 use Autom4te::General;
  1         3  
  1         55232  
62              
63             # Lib files.
64 1   50     9 my $autom4te = $ENV{'AUTOM4TE'} || '/usr/local/lib/perl5/site_perl/5.42.0/x86_64-linux/auto/share/dist/Alien-autoconf/bin/autom4te';
65 1   50     5 my $trailer_m4 = $ENV{'trailer_m4'} || '/usr/local/lib/perl5/site_perl/5.42.0/x86_64-linux/auto/share/dist/Alien-autoconf/share/autoconf/autoconf/trailer.m4';
66              
67             # $HELP
68             # -----
69 1         13 $help = "Usage: $0 [OPTION]... [TEMPLATE-FILE]
70              
71             Generate a configuration script from a TEMPLATE-FILE if given, or
72             'configure.ac' if present, or else 'configure.in'. Output is sent
73             to the standard output if TEMPLATE-FILE is given, else into
74             'configure'.
75              
76             Operation modes:
77             -h, --help print this help, then exit
78             -V, --version print version number, then exit
79             -v, --verbose verbosely report processing
80             -d, --debug don't remove temporary files
81             -f, --force consider all files obsolete
82             -o, --output=FILE save output in FILE (stdout is the default)
83             -W, --warnings=CATEGORY report the warnings falling in CATEGORY
84             (comma-separated list accepted)
85              
86             " . Autom4te::ChannelDefs::usage . "
87              
88             Library directories:
89             -B, --prepend-include=DIR prepend directory DIR to search path
90             -I, --include=DIR append directory DIR to search path
91              
92             Tracing:
93             -t, --trace=MACRO[:FORMAT] report the list of calls to MACRO
94             -i, --initialization also trace Autoconf's initialization process
95              
96             In tracing mode, no configuration script is created. FORMAT defaults
97             to '\$f:\$l:\$n:\$%'; see 'autom4te --help' for information about FORMAT.
98              
99             Report bugs to .
100              
101             The full documentation for Autoconf can be read via 'info autoconf',
102             or on the Web at .
103             ";
104              
105             # $VERSION
106             # --------
107 1         3 $version = "autoconf (GNU Autoconf) 2.72
108             Copyright (C) 2023 Free Software Foundation, Inc.
109             License GPLv3+/Autoconf: GNU GPL version 3 or later
110             ,
111             This is free software: you are free to change and redistribute it.
112             There is NO WARRANTY, to the extent permitted by law.
113              
114             Written by David J. MacKenzie and Akim Demaille.
115             ";
116              
117             ## ---------- ##
118             ## Routines. ##
119             ## ---------- ##
120              
121 1         6 my $infile;
122             my $outfile;
123 1         0 my @autom4te_options;
124 1         0 my @traces;
125              
126             # parse_args ()
127             # -------------
128             # Process any command line arguments.
129             sub parse_args ()
130             {
131             getopt (
132             # Arguments passed as-is to autom4te.
133 0     0   0 'I|include=s' => sub { push @autom4te_options, '--include='.$_[1] },
134 0     0   0 'B|prepend-include=s' => sub { push @autom4te_options,
135             '--prepend-include='.$_[1] },
136 0     0   0 'W|warnings=s' => sub { push @autom4te_options,
137             '--warnings='.$_[1] },
138              
139             # Arguments processed (somewhat) in this program.
140 0     0   0 'i|initialization' => sub { push @autom4te_options, '--melt' },
141 0     0   0 't|trace=s' => sub { push @traces, '--trace='.$_[1] },
142 1     1   24 'o|output=s' => \$outfile,
143             );
144              
145             # Also pass down certain options that were processed into their own
146             # variables by Autom4te::General::getopt.
147 0 0         push @autom4te_options, '--debug' if $debug;
148 0 0         push @autom4te_options, '--force' if $force;
149 0 0         push @autom4te_options, '--verbose' if $verbose;
150              
151             # Find the input file.
152 0 0         if (@ARGV == 0)
    0          
153             {
154 0 0 0       $outfile = 'configure' if !$outfile && !@traces;
155              
156 0 0         if (-f 'configure.ac')
    0          
157             {
158 0           $infile = 'configure.ac';
159 0 0         if (-f 'configure.in')
160             {
161 0           msg 'obsolete',
162             q(both 'configure.ac' and 'configure.in' are present);
163 0           msg 'obsolete',
164             q(proceeding with 'configure.ac');
165             }
166             }
167             elsif (-f 'configure.in')
168             {
169 0           $infile = 'configure.in';
170             }
171             else
172             {
173 0           fatal 'no input file';
174             }
175             }
176             elsif (@ARGV == 1)
177             {
178 0           $infile = $ARGV[0];
179             }
180             else
181             {
182 0           fatal "invalid number of arguments.\n"
183             . "Try '$me --help' for more information.";
184             }
185              
186             # Unless already set, the output is stdout.
187 0 0         $outfile = '-' if !$outfile;
188             }
189              
190             ## -------------- ##
191             ## Main program. ##
192             ## -------------- ##
193              
194 1         6 parse_args;
195              
196             # Construct the autom4te invocation.
197             # $autom4te might contain additional command line options; word-split it
198             # exactly as the shell would.
199 0         0 my @autom4te_command = split /[ \t\n]+/, $autom4te;
200 0         0 push @autom4te_command, @autom4te_options;
201 0         0 push @autom4te_command, '--language=autoconf', "--output=$outfile", @traces;
202              
203             # Don't read trailer.m4 if we are tracing.
204             # trailer.m4 is read _before_ $infile, despite the name,
205             # because putting it afterward screws up autom4te's location tracing.
206 0 0       0 push @autom4te_command, $trailer_m4 if !@traces;
207 0         0 push @autom4te_command, $infile;
208              
209 0         0 print {*STDERR} $me,
210             ': running ',
211 0 0       0 join (" ", map { shell_quote($_) } @autom4te_command),
  0         0  
212             "\n"
213             if $verbose;
214              
215 0         0 exec {$autom4te_command[0]} @autom4te_command;
  0         0  
216              
217             ### Setup "GNU" style for perl-mode and cperl-mode.
218             ## Local Variables:
219             ## perl-indent-level: 2
220             ## perl-continued-statement-offset: 2
221             ## perl-continued-brace-offset: 0
222             ## perl-brace-offset: 0
223             ## perl-brace-imaginary-offset: 0
224             ## perl-label-offset: -2
225             ## cperl-indent-level: 2
226             ## cperl-brace-offset: 0
227             ## cperl-continued-brace-offset: 0
228             ## cperl-label-offset: -2
229             ## cperl-extra-newline-before-brace: t
230             ## cperl-merge-trailing-else: nil
231             ## cperl-continued-statement-offset: 2
232             ## End: