* lib/py-compile: Add --destdir switch to py-compile that takes a
[platform/upstream/automake.git] / aclocal.in
1 #!@PERL@ -w
2 # -*- perl -*-
3 # @configure_input@
4
5 eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
6     if 0;
7
8 # aclocal - create aclocal.m4 by scanning configure.ac
9
10 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
11 #           Free Software Foundation, Inc.
12
13 # This program is free software; you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation; either version 2, or (at your option)
16 # any later version.
17
18 # This program is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 # GNU General Public License for more details.
22
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 # 02111-1307, USA.
27
28 # Written by Tom Tromey <tromey@redhat.com>, and
29 # Alexandre Duret-Lutz <adl@gnu.org>.
30
31 BEGIN
32 {
33   my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
34   unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
35 }
36
37 use strict;
38
39 use Automake::Config;
40 use Automake::General;
41 use Automake::Configure_ac;
42 use Automake::Channels;
43 use Automake::ChannelDefs;
44 use Automake::XFile;
45 use Automake::FileUtils;
46 use File::Basename;
47 use File::stat;
48 use Cwd;
49
50 # Some globals.
51
52 # Include paths for searching macros.  We search macros in this order:
53 # user-supplied directories first, then the directory containing the
54 # automake macros, and finally the system-wide directories for
55 # third-party macro.  @user_includes can be augmented with -I.
56 # @system_includes can be augmented with the `dirlist' file.  Also
57 # --acdir will reset both @automake_includes and @system_includes.
58 my @user_includes = ();
59 my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
60 my @system_includes = ('@datadir@/aclocal');
61
62 # configure.ac or configure.in.
63 my $configure_ac;
64
65 # Output file name.
66 my $output_file = 'aclocal.m4';
67
68 # Modification time of the youngest dependency.
69 my $greatest_mtime = 0;
70
71 # Option --force.
72 my $force_output = 0;
73
74 # Which macros have been seen.
75 my %macro_seen = ();
76
77 # Remember the order into which we scanned the files.
78 # It's important to output the contents of aclocal.m4 in the opposite order.
79 # (Definitions in first files we have scanned should override those from
80 # later files.  So they must appear last in the output.)
81 my @file_order = ();
82
83 # Map macro names to file names.
84 my %map = ();
85
86 # Ditto, but records the last definition of each macro as returned by --trace.
87 my %map_traced_defs = ();
88
89 # Map file names to file contents.
90 my %file_contents = ();
91
92 # Map file names to file types.
93 my %file_type = ();
94 use constant FT_USER => 1;
95 use constant FT_AUTOMAKE => 2;
96 use constant FT_SYSTEM => 3;
97
98 # Map file names to included files (transitively closed).
99 my %file_includes = ();
100
101 # Matches a macro definition.
102 #   AC_DEFUN([macroname], ...)
103 # or
104 #   AC_DEFUN(macroname, ...)
105 # When macroname is `['-quoted , we accept any character in the name,
106 # except `]'.  Otherwise macroname stops on the first `]', `,', `)',
107 # or `\n' encountered.
108 my $ac_defun_rx =
109   "(?:A[CU]_DEFUN|AC_DEFUN_ONCE)\\((?:\\[([^]]+)\\]|([^],)\n]+))";
110
111 # Matches an AC_REQUIRE line.
112 my $ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
113
114 # Matches an m4_include line
115 my $m4_include_rx = "(?:m4_)?s?include\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
116
117 \f
118 ################################################################
119
120 # Check macros in acinclude.m4.  If one is not used, warn.
121 sub check_acinclude ()
122 {
123   foreach my $key (keys %map)
124     {
125       # FIXME: should print line number of acinclude.m4.
126       msg ('syntax', "warning: macro `$key' defined in "
127            . "acinclude.m4 but never used")
128         if $map{$key} eq 'acinclude.m4' && ! exists $macro_seen{$key};
129     }
130 }
131
132 ################################################################
133
134 # scan_m4_dirs($TYPE, @DIRS)
135 # --------------------------
136 # Scan all M4 files installed in @DIRS for new macro definitions.
137 # Register each file as of type $TYPE (one of the FT_* constants).
138 sub scan_m4_dirs ($@)
139 {
140   my ($type, @dirlist) = @_;
141
142   foreach my $m4dir (@dirlist)
143     {
144       if (! opendir (DIR, $m4dir))
145         {
146           fatal "couldn't open directory `$m4dir': $!";
147         }
148
149       # We reverse the directory contents so that foo2.m4 gets
150       # used in preference to foo1.m4.
151       foreach my $file (reverse sort grep (! /^\./, readdir (DIR)))
152         {
153           # Only examine .m4 files.
154           next unless $file =~ /\.m4$/;
155
156           # Skip some files when running out of srcdir.
157           next if $file eq 'aclocal.m4';
158
159           my $fullfile = File::Spec->canonpath ("$m4dir/$file");
160             &scan_file ($type, $fullfile, 'aclocal');
161         }
162       closedir (DIR);
163     }
164 }
165
166 # Scan all the installed m4 files and construct a map.
167 sub scan_m4_files ()
168 {
169   # First, scan configure.ac.  It may contain macro definitions,
170   # or may include other files that define macros.
171   &scan_file (FT_USER, $configure_ac, 'aclocal');
172
173   # Then, scan acinclude.m4 if it exists.
174   if (-f 'acinclude.m4')
175     {
176       &scan_file (FT_USER, 'acinclude.m4', 'aclocal');
177     }
178
179   # Finally, scan all files in our search paths.
180   scan_m4_dirs (FT_USER, @user_includes);
181   scan_m4_dirs (FT_AUTOMAKE, @automake_includes);
182   scan_m4_dirs (FT_SYSTEM, @system_includes);
183
184   # Construct a new function that does the searching.  We use a
185   # function (instead of just evaluating $search in the loop) so that
186   # "die" is correctly and easily propagated if run.
187   my $search = "sub search {\nmy \$found = 0;\n";
188   foreach my $key (reverse sort keys %map)
189     {
190       $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key
191                   . '"); $found = 1; }' . "\n");
192     }
193   $search .= "return \$found;\n};\n";
194   eval $search;
195   prog_error "$@\n search is $search" if $@;
196 }
197
198 ################################################################
199
200 # Add a macro to the output.
201 sub add_macro ($)
202 {
203   my ($macro) = @_;
204
205   # Ignore unknown required macros.  Either they are not really
206   # needed (e.g., a conditional AC_REQUIRE), in which case aclocal
207   # should be quiet, or they are needed and Autoconf itself will
208   # complain when we trace for macro usage later.
209   return unless defined $map{$macro};
210
211   verb "saw macro $macro";
212   $macro_seen{$macro} = 1;
213   &add_file ($map{$macro});
214 }
215
216 # scan_configure_dep ($file)
217 # --------------------------
218 # Scan a configure dependency (configure.ac, or separate m4 files)
219 # for uses of know macros and AC_REQUIREs of possibly unknown macros.
220 # Recursively scan m4_included files.
221 my %scanned_configure_dep = ();
222 sub scan_configure_dep ($)
223 {
224   my ($file) = @_;
225   # Do not scan a file twice.
226   return ()
227     if exists $scanned_configure_dep{$file};
228   $scanned_configure_dep{$file} = 1;
229
230   my $mtime = mtime $file;
231   $greatest_mtime = $mtime if $greatest_mtime < $mtime;
232
233   my $contents = exists $file_contents{$file} ?
234     $file_contents{$file} : contents $file;
235
236   my $line = 0;
237   my @rlist = ();
238   my @ilist = ();
239   foreach (split ("\n", $contents))
240     {
241       ++$line;
242       # Remove comments from current line.
243       s/\bdnl\b.*$//;
244       s/\#.*$//;
245
246       while (/$m4_include_rx/go)
247         {
248           push (@ilist, $1 || $2);
249         }
250
251       while (/$ac_require_rx/go)
252         {
253           push (@rlist, $1 || $2);
254         }
255
256       # The search function is constructed dynamically by
257       # scan_m4_files.  The last parenthetical match makes sure we
258       # don't match things that look like macro assignments or
259       # AC_SUBSTs.
260       if (! &search && /(^|\s+)(AM_[A-Z0-9_]+)($|[^\]\)=A-Z0-9_])/)
261         {
262           # Macro not found, but AM_ prefix found.
263           # Make this just a warning, because we do not know whether
264           # the macro is actually used (it could be called conditionally).
265           msg ('unsupported', "$file:$line",
266                "warning: macro `$2' not found in library");
267         }
268     }
269
270   add_macro ($_) foreach (@rlist);
271   my $dirname = dirname $file;
272   &scan_configure_dep (File::Spec->rel2abs ($_, $dirname)) foreach (@ilist);
273 }
274
275 # add_file ($FILE)
276 # ----------------
277 # Add $FILE to output.
278 my %file_added = ();            # files which have already been added.
279 sub add_file ($)
280 {
281   my ($file) = @_;
282
283   # Only add a file once.
284   return if ($file_added{$file});
285   $file_added{$file} = 1;
286
287   scan_configure_dep $file;
288 }
289
290 # Point to the documentation for underquoted AC_DEFUN only once.
291 my $underquoted_manual_once = 0;
292
293 # scan_file ($TYPE, $FILE, $WHERE)
294 # -------------------------
295 # Scan a single M4 file ($FILE), and all files it includes.
296 # Return the list of included files.
297 # $TYPE is one of FT_USER, FT_AUTOMAKE, or FT_SYSTEM, depending
298 # on where the file comes from.
299 # $WHERE is the location to use in the diagnostic if the file
300 # does not exist.
301 sub scan_file ($$$)
302 {
303   my ($type, $file, $where) = @_;
304   my $base = dirname $file;
305
306   # Do not scan the same file twice.
307   return @{$file_includes{$file}} if exists $file_includes{$file};
308   # Prevent potential infinite recursion (if two files include each other).
309   return () if exists $file_contents{$file};
310
311   unshift @file_order, $file;
312
313   $file_type{$file} = $type;
314
315   fatal "$where: file `$file' does not exist" if ! -e $file;
316
317   my $fh = new Automake::XFile $file;
318   my $contents = '';
319   my @inc_files = ();
320   my %inc_lines = ();
321   while ($_ = $fh->getline)
322     {
323       # Ignore `##' lines.
324       next if /^##/;
325
326       $contents .= $_;
327       my $line = $_;
328
329       while ($line =~ /$ac_defun_rx/go)
330         {
331           if (! defined $1)
332             {
333               msg ('syntax', "$file:$.", "warning: underquoted definition of $2"
334                    . "\n  run info '(automake)Extending aclocal'\n"
335                    . "  or see http://sources.redhat.com/automake/"
336                    . "automake.html#Extending-aclocal")
337                 unless $underquoted_manual_once;
338               $underquoted_manual_once = 1;
339             }
340           my $macro = $1 || $2;
341           if (! defined $map{$macro})
342             {
343               verb "found macro $macro in $file: $.";
344               $map{$macro} = $file;
345             }
346           else
347             {
348               # Note: we used to give an error here if we saw a
349               # duplicated macro.  However, this turns out to be
350               # extremely unpopular.  It causes actual problems which
351               # are hard to work around, especially when you must
352               # mix-and-match tool versions.
353               verb "ignoring macro $macro in $file: $.";
354             }
355         }
356
357       while ($line =~ /$m4_include_rx/go)
358         {
359           my $ifile = $1 || $2;
360           # m4_include is relative to the directory of the file which
361           # perform the include, but we want paths relative to the
362           # directory where aclocal is run.  Do not use
363           # File::Spec->rel2abs, because we want to store relative
364           # paths (they might be used later of aclocal outputs an
365           # m4_include for this file, or if the user itself includes
366           # this file).
367           $ifile = "$base/$ifile"
368             unless $base eq '.' || File::Spec->file_name_is_absolute ($ifile);
369           push (@inc_files, $ifile);
370           $inc_lines{$ifile} = $.;
371         }
372     }
373   $file_contents{$file} = $contents;
374
375   # For some reason I don't understand, it does not work
376   # to do `map { scan_file ($_, ...) } @inc_files' below.
377   # With Perl 5.8.2 it undefines @inc_files.
378   my @copy = @inc_files;
379   my @all_inc_files = (@inc_files,
380                        map { scan_file ($type, $_,
381                                         "$file:$inc_lines{$_}") } @copy);
382   $file_includes{$file} = \@all_inc_files;
383   return @all_inc_files;
384 }
385
386 # strip_redundant_includes (%FILES)
387 # ---------------------------------
388 # Each key in %FILES is a file that must be present in the output.
389 # However some of these files might already include other files in %FILES,
390 # so there is no point in including them another time.
391 # This removes items of %FILES which are already included by another file.
392 sub strip_redundant_includes (%)
393 {
394   my %files = @_;
395   # Files at the end of @file_order should override those at the beginning,
396   # so it is important to preserve these trailing files.  We can remove
397   # a file A if it is going to be output before a file B that includes
398   # file A, not the converse.
399   foreach my $file (reverse @file_order)
400     {
401       next unless exists $files{$file};
402       foreach my $ifile (@{$file_includes{$file}})
403         {
404           next unless exists $files{$ifile};
405           delete $files{$ifile};
406           verb "$ifile is already included by $file";
407         }
408     }
409   return %files;
410 }
411
412 sub trace_used_macros ()
413 {
414   my %files = map { $map{$_} => 1 } keys %macro_seen;
415   $files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
416   %files = strip_redundant_includes %files;
417   # configure.ac is implicitly included.
418   delete $files{$configure_ac};
419
420   my $traces = ($ENV{AUTOM4TE} || 'autom4te');
421   $traces .= " --language Autoconf-without-aclocal-m4 ";
422   # All candidate files.
423   $traces .= join (' ', grep { exists $files{$_} } @file_order) . " ";
424   # All candidate macros.
425   $traces .= join (' ',
426                    (map { "--trace='$_:\$f::\$n::\$1'" } ('AC_DEFUN',
427                                                           'AC_DEFUN_ONCE',
428                                                           'AU_DEFUN')),
429                    # Do not trace $1 for all other macros as we do
430                    # not need it and it might contains harmful
431                    # characters (like newlines).
432                    (map { "--trace='$_:\$f::\$n'" } (keys %macro_seen)));
433
434   verb "running $traces $configure_ac";
435
436   my $tracefh = new Automake::XFile ("$traces $configure_ac |");
437
438   my %traced = ();
439
440   while ($_ = $tracefh->getline)
441     {
442       chomp;
443       my ($file, $macro, $arg1) = split (/::/);
444
445       $traced{$macro} = 1 if exists $macro_seen{$macro};
446
447       $map_traced_defs{$arg1} = $file
448         if ($macro eq 'AC_DEFUN'
449             || $macro eq 'AC_DEFUN_ONCE'
450             || $macro eq 'AU_DEFUN');
451     }
452
453   $tracefh->close;
454
455   return %traced;
456 }
457
458 sub scan_configure ()
459 {
460   # Make sure we include acinclude.m4 if it exists.
461   if (-f 'acinclude.m4')
462     {
463       add_file ('acinclude.m4');
464     }
465   scan_configure_dep ($configure_ac);
466 }
467
468 ################################################################
469
470 # Write output.
471 sub write_aclocal ($@)
472 {
473   my ($output_file, @macros) = @_;
474   my $output = '';
475
476   my %files = ();
477   # Get the list of files containing definitions for the macros used.
478   # (Filter out unused macro definitions with $map_traced_defs.  This
479   # can happen when an Autoconf macro is conditionally defined:
480   # aclocal sees the potential definition, but this definition is
481   # actually never processed and the Autoconf implementation is used
482   # instead.)
483   for my $m (@macros)
484     {
485       $files{$map{$m}} = 1
486         if (exists $map_traced_defs{$m}
487             && $map{$m} eq $map_traced_defs{$m});
488     }
489   # Always include acinclude.m4, even if it does not appear to be used.
490   $files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
491   # Do not explicitly include a file that is already indirectly included.
492   %files = strip_redundant_includes %files;
493   # Never include configure.ac :)
494   delete $files{$configure_ac};
495
496   for my $file (grep { exists $files{$_} } @file_order)
497     {
498       # Check the time stamp of this file, and of all files it includes.
499       for my $ifile ($file, @{$file_includes{$file}})
500         {
501           my $mtime = mtime $ifile;
502           $greatest_mtime = $mtime if $greatest_mtime < $mtime;
503         }
504
505       # If the file to add looks like outside the project, copy it
506       # to the output.  The regex catches filenames starting with
507       # things like `/', `\', or `c:\'.
508       if ($file_type{$file} != FT_USER
509           || $file =~ m,^(?:\w:)?[\\/],)
510         {
511           $output .= $file_contents{$file} . "\n";
512         }
513       else
514         {
515           # Otherwise, simply include the file.
516           $output .= "m4_include([$file])\n";
517         }
518     }
519
520   # Nothing to output?!
521   # FIXME: Shouldn't we diagnose this?
522   return if ! length ($output);
523
524   # We used to print `# $output_file generated automatically etc.'  But
525   # this creates spurious differences when using autoreconf.  Autoreconf
526   # creates aclocal.m4t and then rename it to aclocal.m4, but the
527   # rebuild rules generated by Automake create aclocal.m4 directly --
528   # this would gives two ways to get the same file, with a different
529   # name in the header.
530   $output = "# generated automatically by aclocal $VERSION -*- Autoconf -*-
531
532 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
533 # Free Software Foundation, Inc.
534 # This file is free software; the Free Software Foundation
535 # gives unlimited permission to copy and/or distribute it,
536 # with or without modifications, as long as this notice is preserved.
537
538 # This program is distributed in the hope that it will be useful,
539 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
540 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
541 # PARTICULAR PURPOSE.
542
543 $output";
544
545   # We try not to update $output_file unless necessary, because
546   # doing so invalidate Autom4te's cache and therefore slows down
547   # tools called after aclocal.
548   #
549   # We need to overwrite $output_file in the following situations.
550   #   * The --force option is in use.
551   #   * One of the dependencies is younger.
552   #     (Not updating $output_file in this situation would cause
553   #     make to call aclocal in loop.)
554   #   * The contents of the current file are different from what
555   #     we have computed.
556   if (!$force_output
557       && $greatest_mtime < mtime ($output_file)
558       && $output eq contents ($output_file))
559     {
560       verb "$output_file unchanged";
561       return;
562     }
563
564   verb "writing $output_file";
565
566   my $out = new Automake::XFile "> $output_file";
567   print $out $output;
568   return;
569 }
570
571 ################################################################
572
573 # Print usage and exit.
574 sub usage ($)
575 {
576   my ($status) = @_;
577
578   print "Usage: aclocal [OPTIONS] ...
579
580 Generate `aclocal.m4' by scanning `configure.ac' or `configure.in'
581
582 Options:
583       --acdir=DIR           directory holding config files (for debugging)
584       --force               always update output file
585       --help                print this help, then exit
586   -I DIR                    add directory to search list for .m4 files
587       --output=FILE         put output in FILE (default aclocal.m4)
588       --print-ac-dir        print name of directory holding m4 files, then exit
589       --verbose             don't be silent
590       --version             print version number, then exit
591   -W, --warnings=CATEGORY   report the warnings falling in CATEGORY
592
593 Warning categories include:
594   `syntax'        dubious syntactic constructs (default)
595   `unsupported'   unknown macros (default)
596   `all'           all the warnings (default)
597   `no-CATEGORY'   turn off warnings in CATEGORY
598   `none'          turn off all the warnings
599   `error'         treat warnings as errors
600
601 Report bugs to <bug-automake\@gnu.org>.\n";
602
603   exit $status;
604 }
605
606 # Print version and exit.
607 sub version()
608 {
609   print <<EOF;
610 aclocal (GNU $PACKAGE) $VERSION
611 Written by Tom Tromey <tromey\@redhat.com>
612        and Alexandre Duret-Lutz <adl\@gnu.org>.
613
614 Copyright (C) 2004 Free Software Foundation, Inc.
615 This is free software; see the source for copying conditions.  There is NO
616 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
617 EOF
618   exit 0;
619 }
620
621 # Parse command line.
622 sub parse_arguments ()
623 {
624   my $print_and_exit = 0;
625
626   my %cli_options =
627     (
628      'acdir=s'          => sub # Setting --acdir overrides both the
629                              { # automake (versioned) directory and the
630                                # public (unversioned) system directory.
631                                @automake_includes = ();
632                                @system_includes = ($_[1])
633                              },
634      'force'            => \$force_output,
635      'I=s'              => \@user_includes,
636      'output=s'         => \$output_file,
637      'print-ac-dir'     => \$print_and_exit,
638      'verbose'          => sub { setup_channel 'verb', silent => 0; },
639      'W|warnings=s'     => \&parse_warnings,
640      );
641   use Getopt::Long;
642   Getopt::Long::config ("bundling", "pass_through");
643
644   # See if --version or --help is used.  We want to process these before
645   # anything else because the GNU Coding Standards require us to
646   # `exit 0' after processing these options, and we can't guarantee this
647   # if we treat other options first.  (Handling other options first
648   # could produce error diagnostics, and in this condition it is
649   # confusing if aclocal does `exit 0'.)
650   my %cli_options_1st_pass =
651     (
652      'version' => \&version,
653      'help'    => sub { usage(0); },
654      # Recognize all other options (and their arguments) but do nothing.
655      map { $_ => sub {} } (keys %cli_options)
656      );
657   my @ARGV_backup = @ARGV;
658   Getopt::Long::GetOptions %cli_options_1st_pass
659     or exit 1;
660   @ARGV = @ARGV_backup;
661
662   # Now *really* process the options.  This time we know that --help
663   # and --version are not present, but we specify them nonetheless so
664   # that ambiguous abbreviation are diagnosed.
665   Getopt::Long::GetOptions %cli_options, 'version' => sub {}, 'help' => sub {}
666     or exit 1;
667
668   if (@ARGV)
669     {
670       my %argopts;
671       for my $k (keys %cli_options)
672         {
673           if ($k =~ /(.*)=s$/)
674             {
675               map { $argopts{(length ($_) == 1)
676                              ? "-$_" : "--$_" } = 1; } (split (/\|/, $1));
677             }
678         }
679       if (exists $argopts{$ARGV[0]})
680         {
681           fatal ("option `$ARGV[0]' requires an argument\n"
682                  . "Try `$0 --help' for more information.");
683         }
684       else
685         {
686           fatal ("unrecognized option `$ARGV[0]'\n"
687                  . "Try `$0 --help' for more information.");
688         }
689     }
690
691   if ($print_and_exit)
692     {
693       print "@system_includes\n";
694       exit 0;
695     }
696
697   if (! -d $system_includes[0])
698     {
699       # By default $(datadir)/aclocal doesn't exist.  We don't want to
700       # get an error in the case where we are searching the default
701       # directory and it hasn't been created.  (We know
702       # @system_includes has its default value if @automake_includes
703       # is not empty, because --acdir is the only way to change this.)
704       @system_includes = () if @automake_includes;
705     }
706   else
707     {
708       # Finally, adds any directory listed in the `dirlist' file.
709       if (open (DIRLIST, "$system_includes[0]/dirlist"))
710         {
711           while (<DIRLIST>)
712             {
713               # Ignore '#' lines.
714               next if /^#/;
715               # strip off newlines and end-of-line comments
716               s/\s*\#.*$//;
717               chomp;
718               push (@system_includes, $_) if -d $_;
719             }
720           close (DIRLIST);
721         }
722     }
723 }
724
725 ################################################################
726
727 parse_WARNINGS;             # Parse the WARNINGS environment variable.
728 parse_arguments;
729 $configure_ac = require_configure_ac;
730 scan_m4_files;
731 scan_configure;
732 if (! $exit_code)
733   {
734     my %macro_traced = trace_used_macros;
735     write_aclocal ($output_file, keys %macro_traced);
736   }
737 check_acinclude;
738
739 exit $exit_code;
740
741 ### Setup "GNU" style for perl-mode and cperl-mode.
742 ## Local Variables:
743 ## perl-indent-level: 2
744 ## perl-continued-statement-offset: 2
745 ## perl-continued-brace-offset: 0
746 ## perl-brace-offset: 0
747 ## perl-brace-imaginary-offset: 0
748 ## perl-label-offset: -2
749 ## cperl-indent-level: 2
750 ## cperl-brace-offset: 0
751 ## cperl-continued-brace-offset: 0
752 ## cperl-label-offset: -2
753 ## cperl-extra-newline-before-brace: t
754 ## cperl-merge-trailing-else: nil
755 ## cperl-continued-statement-offset: 2
756 ## End: