* aclocal.in (%file_type, FT_USER, FT_AUTOMAKE_SYSTEM): New variables.
[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 # Which files have been seen.
78 my %file_seen = ();
79
80 # Remember the order into which we scanned the files.
81 # It's important to output the contents of aclocal.m4 in the opposite order.
82 # (Definitions in first files we have scanned should override those from
83 # later files.  So they must appear last in the output.)
84 my @file_order = ();
85
86 # Map macro names to file names.
87 my %map = ();
88
89 # Ditto, but records the last definition of each macro as returned by --trace.
90 my %map_traced_defs = ();
91
92 # Map file names to file contents.
93 my %file_contents = ();
94
95 # Map file names to file types.
96 my %file_type = ();
97 use constant FT_USER => 1;
98 use constant FT_AUTOMAKE => 2;
99 use constant FT_SYSTEM => 3;
100
101 # Map file names to included files (transitively closed).
102 my %file_includes = ();
103
104 # Matches a macro definition.
105 #   AC_DEFUN([macroname], ...)
106 # or
107 #   AC_DEFUN(macroname, ...)
108 # When macroname is `['-quoted , we accept any character in the name,
109 # except `]'.  Otherwise macroname stops on the first `]', `,', `)',
110 # or `\n' encountered.
111 my $ac_defun_rx =
112   "(?:A[CU]_DEFUN|AC_DEFUN_ONCE)\\((?:\\[([^]]+)\\]|([^],)\n]+))";
113
114 # Matches an AC_REQUIRE line.
115 my $ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
116
117 # Matches an m4_include line
118 my $m4_include_rx = "(?:m4_)?s?include\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
119
120 \f
121 ################################################################
122
123 # Check macros in acinclude.m4.  If one is not used, warn.
124 sub check_acinclude ()
125 {
126   foreach my $key (keys %map)
127     {
128       # FIXME: should print line number of acinclude.m4.
129       msg ('syntax', "warning: macro `$key' defined in "
130            . "acinclude.m4 but never used")
131         if $map{$key} eq 'acinclude.m4' && ! exists $macro_seen{$key};
132     }
133 }
134
135 ################################################################
136
137 # scan_m4_dirs($TYPE, @DIRS)
138 # --------------------------
139 # Scan all M4 files installed in @DIRS for new macro definitions.
140 # Register each file as of type $TYPE (one of the FT_* constants).
141 sub scan_m4_dirs ($@)
142 {
143   my ($type, @dirlist) = @_;
144
145   foreach my $m4dir (@dirlist)
146     {
147       if (! opendir (DIR, $m4dir))
148         {
149           fatal "couldn't open directory `$m4dir': $!";
150         }
151
152       # We reverse the directory contents so that foo2.m4 gets
153       # used in preference to foo1.m4.
154       foreach my $file (reverse sort grep (! /^\./, readdir (DIR)))
155         {
156           # Only examine .m4 files.
157           next unless $file =~ /\.m4$/;
158
159           # Skip some files when running out of srcdir.
160           next if $file eq 'aclocal.m4';
161
162           my $fullfile = File::Spec->canonpath ("$m4dir/$file");
163             &scan_file ($type, $fullfile, 'aclocal');
164         }
165       closedir (DIR);
166     }
167 }
168
169 # Scan all the installed m4 files and construct a map.
170 sub scan_m4_files ()
171 {
172   # First, scan configure.ac.  It may contain macro definitions,
173   # or may include other files that define macros.
174   &scan_file (FT_USER, $configure_ac, 'aclocal');
175
176   # Then, scan acinclude.m4 if it exists.
177   if (-f 'acinclude.m4')
178     {
179       &scan_file (FT_USER, 'acinclude.m4', 'aclocal');
180     }
181
182   # Finally, scan all files in our search paths.
183   scan_m4_dirs (FT_USER, @user_includes);
184   scan_m4_dirs (FT_AUTOMAKE, @automake_includes);
185   scan_m4_dirs (FT_SYSTEM, @system_includes);
186
187   # Construct a new function that does the searching.  We use a
188   # function (instead of just evaluating $search in the loop) so that
189   # "die" is correctly and easily propagated if run.
190   my $search = "sub search {\nmy \$found = 0;\n";
191   foreach my $key (reverse sort keys %map)
192     {
193       $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key
194                   . '"); $found = 1; }' . "\n");
195     }
196   $search .= "return \$found;\n};\n";
197   eval $search;
198   prog_error "$@\n search is $search" if $@;
199 }
200
201 ################################################################
202
203 # Add a macro to the output.
204 sub add_macro ($)
205 {
206   my ($macro) = @_;
207
208   # Ignore unknown required macros.  Either they are not really
209   # needed (e.g., a conditional AC_REQUIRE), in which case aclocal
210   # should be quiet, or they are needed and Autoconf itself will
211   # complain when we trace for macro usage later.
212   return unless defined $map{$macro};
213
214   verb "saw macro $macro";
215   $macro_seen{$macro} = 1;
216   &add_file ($map{$macro});
217 }
218
219 # scan_configure_dep ($file)
220 # --------------------------
221 # Scan a configure dependency (configure.ac, or separate m4 files)
222 # for uses of know macros and AC_REQUIREs of possibly unknown macros.
223 # Recursively scan m4_included files.
224 my %scanned_configure_dep = ();
225 sub scan_configure_dep ($)
226 {
227   my ($file) = @_;
228   # Do not scan a file twice.
229   return ()
230     if exists $scanned_configure_dep{$file};
231   $scanned_configure_dep{$file} = 1;
232
233   my $mtime = mtime $file;
234   $greatest_mtime = $mtime if $greatest_mtime < $mtime;
235
236   my $contents = exists $file_contents{$file} ?
237     $file_contents{$file} : contents $file;
238
239   my $line = 0;
240   my @rlist = ();
241   my @ilist = ();
242   foreach (split ("\n", $contents))
243     {
244       ++$line;
245       # Remove comments from current line.
246       s/\bdnl\b.*$//;
247       s/\#.*$//;
248
249       while (/$m4_include_rx/go)
250         {
251           push (@ilist, $1 || $2);
252         }
253
254       while (/$ac_require_rx/go)
255         {
256           push (@rlist, $1 || $2);
257         }
258
259       # The search function is constructed dynamically by
260       # scan_m4_files.  The last parenthetical match makes sure we
261       # don't match things that look like macro assignments or
262       # AC_SUBSTs.
263       if (! &search && /(^|\s+)(AM_[A-Z0-9_]+)($|[^\]\)=A-Z0-9_])/)
264         {
265           # Macro not found, but AM_ prefix found.
266           # Make this just a warning, because we do not know whether
267           # the macro is actually used (it could be called conditionally).
268           msg ('unsupported', "$file:$line",
269                "warning: macro `$2' not found in library");
270         }
271     }
272
273   add_macro ($_) foreach (@rlist);
274   my $dirname = dirname $file;
275   &scan_configure_dep (File::Spec->rel2abs ($_, $dirname)) foreach (@ilist);
276 }
277
278 # Add a file to output.
279 sub add_file ($)
280 {
281   my ($file) = @_;
282
283   # Only add a file once.
284   return if ($file_seen{$file});
285   $file_seen{$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 "\
610 aclocal (GNU $PACKAGE) $VERSION
611 Written by Tom Tromey <tromey\@redhat.com>
612        and Alexandre Duret-Lutz <adl\@gnu.org>
613 Copyright (C) 2004 Free Software Foundation, Inc.
614 This is free software; see the source for copying conditions.  There is NO
615 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.";
616   exit 0;
617 }
618
619 # Parse command line.
620 sub parse_arguments ()
621 {
622   my $print_and_exit = 0;
623
624   my %cli_options =
625     (
626      'acdir=s'          => sub # Setting --acdir overrides both the
627                              { # automake (versioned) directory and the
628                                # public (unversioned) system directory.
629                                @automake_includes = ();
630                                @system_includes = ($_[1])
631                              },
632      'force'            => \$force_output,
633      'I=s'              => \@user_includes,
634      'output=s'         => \$output_file,
635      'print-ac-dir'     => \$print_and_exit,
636      'verbose'          => sub { setup_channel 'verb', silent => 0; },
637      'W|warnings:s'     => \&parse_warnings,
638      );
639   use Getopt::Long;
640   Getopt::Long::config ("bundling", "pass_through");
641
642   # See if --version or --help is used.  We want to process these before
643   # anything else because the GNU Coding Standards require us to
644   # `exit 0' after processing these options, and we can't guarantee this
645   # if we treat other options first.  (Handling other options first
646   # could produce error diagnostics, and in this condition it is
647   # confusing if aclocal does `exit 0'.)
648   my %cli_options_1st_pass =
649     (
650      'version' => \&version,
651      'help'    => sub { usage(0); },
652      # Recognize all other options (and their arguments) but do nothing.
653      map { $_ => sub {} } (keys %cli_options)
654      );
655   my @ARGV_backup = @ARGV;
656   Getopt::Long::GetOptions %cli_options_1st_pass
657     or exit 1;
658   @ARGV = @ARGV_backup;
659
660   # Now *really* process the options.  This time we know
661   # that --help and --version are not present.
662   Getopt::Long::GetOptions %cli_options
663     or exit 1;
664
665   if (@ARGV)
666     {
667       fatal ("unrecognized option `$ARGV[0]'\n"
668              . "Try `$0 --help' for more information.");
669     }
670
671   if ($print_and_exit)
672     {
673       print "@system_includes\n";
674       exit 0;
675     }
676
677   if (! -d $system_includes[0])
678     {
679       # By default $(datadir)/aclocal doesn't exist.  We don't want to
680       # get an error in the case where we are searching the default
681       # directory and it hasn't been created.  (We know
682       # @system_includes has its default value if @automake_includes
683       # is not empty, because --acdir is the only way to change this.)
684       @system_includes = () if @automake_includes;
685     }
686   else
687     {
688       # Finally, adds any directory listed in the `dirlist' file.
689       if (open (DIRLIST, "$system_includes[0]/dirlist"))
690         {
691           while (<DIRLIST>)
692             {
693               # Ignore '#' lines.
694               next if /^#/;
695               # strip off newlines and end-of-line comments
696               s/\s*\#.*$//;
697               chomp;
698               push (@system_includes, $_) if -d $_;
699             }
700           close (DIRLIST);
701         }
702     }
703 }
704
705 ################################################################
706
707 parse_WARNINGS;             # Parse the WARNINGS environment variable.
708 parse_arguments;
709 $configure_ac = require_configure_ac;
710 scan_m4_files;
711 scan_configure;
712 if (! $exit_code)
713   {
714     my %macro_traced = trace_used_macros;
715     write_aclocal ($output_file, keys %macro_traced);
716   }
717 check_acinclude;
718
719 exit $exit_code;
720
721 ### Setup "GNU" style for perl-mode and cperl-mode.
722 ## Local Variables:
723 ## perl-indent-level: 2
724 ## perl-continued-statement-offset: 2
725 ## perl-continued-brace-offset: 0
726 ## perl-brace-offset: 0
727 ## perl-brace-imaginary-offset: 0
728 ## perl-label-offset: -2
729 ## cperl-indent-level: 2
730 ## cperl-brace-offset: 0
731 ## cperl-continued-brace-offset: 0
732 ## cperl-label-offset: -2
733 ## cperl-extra-newline-before-brace: t
734 ## cperl-merge-trailing-else: nil
735 ## cperl-continued-statement-offset: 2
736 ## End: