use Automake::Location;
use Automake::Condition qw/TRUE FALSE/;
use Automake::DisjConditions;
+use Automake::Options;
use Automake::Version;
use Automake::Variable;
use Automake::VarDef;
my $EXEC_DIR_PATTERN =
'^(?:bin|sbin|libexec|sysconf|localstate|lib|pkglib|.*exec.*)' . "\$";
-# Constants to define the "strictness" level.
-use constant FOREIGN => 0;
-use constant GNU => 1;
-use constant GNITS => 2;
-
# Values for AC_CANONICAL_*
use constant AC_CANONICAL_HOST => 1;
use constant AC_CANONICAL_SYSTEM => 2;
# TRUE if we should always generate Makefile.in.
my $force_generation = 1;
-# Strictness level as set on command line.
-my $default_strictness = GNU;
-
-# Name of strictness level, as set on command line.
-my $default_strictness_name = 'gnu';
-
# From the Perl manual.
my $symlink_exists = (eval 'symlink ("", "");', $@ eq '');
# All .P files.
my %dep_files;
-# Strictness levels.
-my $strictness;
-my $strictness_name;
-
-# Automake options.
-# Values are the Automake::Location of the definition, except
-# for 'ansi2knr' whose value is a pair [filename, Location].
-my %options; # From AUTOMAKE_OPTIONS
-my %global_options; # From AM_INIT_AUTOMAKE or the command line.
-
# This is a list of all targets to run during "make dist".
my @dist_targets;
@suffixes = ();
- Automake::Variable::reset ();
+ Automake::Options::reset;
+ Automake::Variable::reset;
%targets = ();
%target_source = ();
%dep_files = ();
- $strictness = $default_strictness;
- $strictness_name = $default_strictness_name;
-
- %options = ();
-
@dist_targets = ();
%de_ansi_files = ();
################################################################
-# $BOOL
-# process_option_list (\%OPTIONS, $WHERE, @OPTIONS)
-# -------------------------------------------------
-# Process a list of options. Return 1 on error, 0 otherwise.
-# \%OPTIONS is the hash to fill with options data, $WHERE is
-# the location where @OPTIONS occured.
-sub process_option_list (\%$@)
-{
- my ($options, $where, @list) = @_;
-
- foreach (@list)
- {
- $options->{$_} = $where;
- if ($_ eq 'gnits' || $_ eq 'gnu' || $_ eq 'foreign')
- {
- &set_strictness ($_);
- }
- elsif (/^(.*\/)?ansi2knr$/)
- {
- # An option like "../lib/ansi2knr" is allowed. With no
- # path prefix, we assume the required programs are in this
- # directory. We save the actual option for later.
- $options->{'ansi2knr'} = [$_, $where];
- }
- elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
- || $_ eq 'dist-shar' || $_ eq 'dist-zip'
- || $_ eq 'dist-tarZ' || $_ eq 'dist-bzip2'
- || $_ eq 'no-dist-gzip'
- || $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
- || $_ eq 'readme-alpha' || $_ eq 'check-news'
- || $_ eq 'subdir-objects' || $_ eq 'nostdinc'
- || $_ eq 'no-exeext' || $_ eq 'no-define'
- || $_ eq 'std-options'
- || $_ eq 'cygnus' || $_ eq 'no-dependencies')
- {
- # Explicitly recognize these.
- }
- elsif (/^\d+\.\d+(?:\.\d+)?[a-z]?(?:-[A-Za-z0-9]+)?$/)
- {
- # Got a version number.
- if (Automake::Version::check ($VERSION, $&))
- {
- error ($where, "require Automake $_, but have $VERSION",
- uniq_scope => US_GLOBAL);
- return 1;
- }
- }
- elsif (/^(?:--warnings=|-W)(.*)$/)
- {
- foreach my $cat (split (',', $1))
- {
- msg 'unsupported', $where, "unknown warning category `$cat'"
- if switch_warning $cat;
- }
- }
- else
- {
- error ($where, "option `$_' not recognized",
- uniq_scope => US_GLOBAL);
- return 1;
- }
- }
-}
# Handle AUTOMAKE_OPTIONS variable. Return 1 on error, 0 otherwise.
sub handle_options
{
- %options = %global_options;
-
my $var = var ('AUTOMAKE_OPTIONS');
if ($var)
{
# FIXME: We should disallow conditional definitions of AUTOMAKE_OPTIONS.
- if (process_option_list (%options,
- $var->rdef (TRUE)->location,
+ if (process_option_list ($var->rdef (TRUE)->location,
$var->value_as_list_recursive (TRUE)))
{
return 1;
if ($strictness == GNITS)
{
- $options{'readme-alpha'} = 1;
- $options{'std-options'} = 1;
- $options{'check-news'} = 1;
+ set_option ('readme-alpha', INTERNAL);
+ set_option ('std-options', INTERNAL);
+ set_option ('check-news', INTERNAL);
}
return 0;
# Check for automatic de-ANSI-fication.
$extension = '$U' . $extension
- if $options{'ansi2knr'};
+ if option 'ansi2knr';
$get_object_extension_was_run = 1;
# Call finish function for each language that was used.
sub handle_languages
{
- if (! $options{'no-dependencies'})
+ if (! option 'no-dependencies')
{
# Include auto-dep code. Don't include it if DEP_FILES would
# be empty.
my $fpfx = ($pfx eq '') ? 'CC' : $pfx;
my ($AMDEP, $FASTDEP) =
- ($options{'no-dependencies'} || $lang->autodep eq 'no')
+ (option 'no-dependencies' || $lang->autodep eq 'no')
? ('FALSE', 'FALSE') : ('AMDEP', "am__fastdep$fpfx");
my %transform = ('EXT' => $ext,
=> (count_files_for_language ($lang->name) > 1));
# Generate the appropriate rules for this extension.
- if (((! $options{'no-dependencies'}) && $lang->autodep ne 'no')
+ if (((! option 'no-dependencies') && $lang->autodep ne 'no')
|| defined $lang->compile)
{
# Some C compilers don't support -c -o. Use it only if really
$output_flag = '-o'
if (! $output_flag
&& $lang->name eq 'c'
- && $options{'subdir-objects'});
+ && option 'subdir-objects');
# Compute a possible derived extension.
# This is not used by depend2.am.
my $obj_sans_ext = substr ($object, 0,
- length ($this_obj_ext));
my $full_ansi = $full;
- if ($lang->ansi && $options{'ansi2knr'})
+ if ($lang->ansi && option 'ansi2knr')
{
$full_ansi =~ s/$KNOWN_EXTENSIONS_PATTERN$/\$U$&/;
$obj_sans_ext .= '$U';
# .deps directory is created.
push (@dep_list,
require_build_directory ($directory . '/$(DEPDIR)'))
- unless $options{'no-dependencies'};
+ unless option 'no-dependencies';
}
&pretty_print_rule ($object . ':', "\t", @dep_list)
# Boilerplate.
my $default_includes = '';
- if (! $options{'nostdinc'})
+ if (! option 'nostdinc')
{
$default_includes = ' -I. -I$(srcdir)';
$output_rules .= "$coms$rules";
# Check for automatic de-ANSI-fication.
- if ($options{'ansi2knr'})
+ if (option 'ansi2knr')
{
- my ($ansi2knr_filename, $ansi2knr_where) = @{$options{'ansi2knr'}};
+ my ($ansi2knr_filename, $ansi2knr_where) = @{option 'ansi2knr'};
my $ansi2knr_dir = '';
require_variables ($ansi2knr_where, "option `ansi2knr' is used",
$texinfodir = ('$(srcdir)/'
. dirname (variable_value ('TEXINFO_TEX')));
}
- elsif ($options{'cygnus'})
+ elsif (option 'cygnus')
{
$texinfodir = '$(top_srcdir)/../texinfo';
define_variable ('TEXINFO_TEX', "$texinfodir/texinfo.tex", INTERNAL);
push (@dist_targets, 'dist-info');
- if (! $options{'no-installinfo'})
+ if (! option 'no-installinfo')
{
# Make sure documentation is made and installed first. Use
# $(INFO_DEPS), not 'info', because otherwise recursive makes
# Do some error checking. Note that this file is not required
# when in Cygnus mode; instead we defined TEXINFO_TEX explicitly
# up above.
- if ($need_texi_file && ! $options{'no-texinfo.tex'})
+ if ($need_texi_file && ! option 'no-texinfo.tex')
{
if ($need_texi_file > 1)
{
MANS => "@mans");
push (@all, '$(MANS)')
- unless $options{'no-installman'};
+ unless option 'no-installman';
}
# Handle DATA variables.
# `make dist' isn't used in a Cygnus-style tree.
# Omit the rules so that people don't try to use them.
- return if $options{'cygnus'};
+ return if option 'cygnus';
# At least one of the archive formats must be enabled.
if ($relative_dir eq '.')
{
- my $archive_defined = $options{'no-dist-gzip'} ? 0 : 1;
+ my $archive_defined = option 'no-dist-gzip' ? 0 : 1;
$archive_defined ||=
- grep { $options{"dist-$_"} } ('shar', 'zip', 'tarZ', 'bzip2');
- error ($options{'no-dist-gzip'},
+ grep { option "dist-$_" } ('shar', 'zip', 'tarZ', 'bzip2');
+ error (option 'no-dist-gzip',
"no-dist-gzip specified but no dist-* specified, "
. "at least one archive format must be enabled")
unless $archive_defined;
'MAKEFILE-IN' => $infile,
'MAKEFILE-IN-DEPS' => "@include_stack",
'MAKEFILE-AM' => $amfile,
- STRICTNESS => $global_options{'cygnus'}
+ STRICTNESS => global_option 'cygnus'
? 'cygnus' : $strictness_name,
- 'USE-DEPS' => $global_options{'no-dependencies'}
+ 'USE-DEPS' => global_option 'no-dependencies'
? ' --ignore-deps' : '',
'MAKEFILE-AM-SOURCES' => "$input$colon_infile",
'REGEN-ACLOCAL-M4' => $regen_aclocal_m4,
}
# In --cygnus mode, check doesn't depend on all.
- if ($options{'cygnus'})
+ if (option 'cygnus')
{
# Just run the local check rules.
pretty_print_rule ('check-am:', "\t\t", @check);
reject_target ('install-info-local',
"`install-info-local' target defined but "
. "`no-installinfo' option not in use")
- unless $options{'no-installinfo'};
+ unless option 'no-installinfo';
# Install the -local hooks.
foreach (keys %dependencies)
# Handle TESTS variable and other checks.
sub handle_tests
{
- if ($options{'dejagnu'})
+ if (option 'dejagnu')
{
&handle_tests_dejagnu;
}
# Handle some of the minor options.
sub handle_minor_options
{
- if ($options{'readme-alpha'})
+ if (option 'readme-alpha')
{
if ($relative_dir eq '.')
{
elsif (defined $args[1])
{
exit $exit_code
- if (process_option_list (%global_options, $where,
- split (' ', $args[1])));
+ if (process_global_option_list ($where,
+ split (' ', $args[1])));
}
}
elsif ($macro eq 'AM_MAINTAINER_MODE')
# Set up for Cygnus mode.
sub check_cygnus
{
- return unless $options{'cygnus'};
+ my $cygnus = option 'cygnus';
+ return unless $cygnus;
- &set_strictness ('foreign');
- $options{'no-installinfo'} = $options{'cygnus'};
- $options{'no-dependencies'} = $options{'cygnus'};
+ set_strictness ('foreign');
+ set_option ('no-installinfo', $cygnus);
+ set_option ('no-dependencies', $cygnus);
err_ac "`AM_MAINTAINER_MODE' required when --cygnus specified"
if !$seen_maint_mode;
for my $opt ('no-installman', 'no-installinfo')
{
- msg ('error-gnu', $options{$opt},
+ msg ('error-gnu', option $opt,
"option `$opt' disallowed by GNU standards")
- if $options{$opt};
+ if option $opt;
}
}
# when a subdir object should be used.
sub lang_sub_obj
{
- return $options{'subdir-objects'} ? LANG_SUBDIR : LANG_PROCESS;
+ return option 'subdir-objects' ? LANG_SUBDIR : LANG_PROCESS;
}
# Rewrite a single C source file.
{
my ($directory, $base, $ext) = @_;
- if ($options{'ansi2knr'} && $base =~ /_$/)
+ if (option 'ansi2knr' && $base =~ /_$/)
{
# FIXME: include line number in error.
err_am "C source file `$base.c' would be deleted by ansi2knr rules";
}
my $r = LANG_PROCESS;
- if ($options{'subdir-objects'})
+ if (option 'subdir-objects')
{
$r = LANG_SUBDIR;
$base = $directory . '/' . $base
}
}
- if ($options{'ansi2knr'} && keys %de_ansi_files)
+ if (option 'ansi2knr' && keys %de_ansi_files)
{
# Make all _.c files depend on their corresponding .c files.
my @objects;
&& $target_name{$noexe}{$cond} ne $target)
{
# The no-exeext option enables this feature.
- if (! $options{'no-exeext'})
+ if (! option 'no-exeext')
{
msg ('obsolete', $targets{$noexe}{$cond},
"deprecated feature: target `$noexe' overrides "
my $command =
"s/$IGNORE_PATTERN//gm;"
. transform (%transform,
- 'CYGNUS' => defined $options{'cygnus'},
+ 'CYGNUS' => !! option 'cygnus',
'MAINTAINER-MODE'
=> $seen_maint_mode ? subst ('MAINTAINER_MODE_TRUE') : '',
- 'BZIP2' => $options{'dist-bzip2'} || 0,
- 'COMPRESS' => $options{'dist-tarZ'} || 0,
- 'GZIP' => $options{'no-dist-gzip'} ? 0 : 1,
- 'SHAR' => $options{'dist-shar'} || 0,
- 'ZIP' => $options{'dist-zip'} || 0,
+ 'BZIP2' => !! option 'dist-bzip2',
+ 'COMPRESS' => !! option 'dist-tarZ',
+ 'GZIP' => ! option 'no-dist-gzip',
+ 'SHAR' => !! option 'dist-shar',
+ 'ZIP' => !! option 'dist-zip',
- 'INSTALL-INFO' => !$options{'no-installinfo'},
- 'INSTALL-MAN' => !$options{'no-installman'},
- 'CK-NEWS' => $options{'check-news'} || 0,
+ 'INSTALL-INFO' => ! option 'no-installinfo',
+ 'INSTALL-MAN' => ! option 'no-installman',
+ 'CK-NEWS' => !! option 'check-news',
'SUBDIRS' => !! var ('SUBDIRS'),
'TOPDIR' => backname ($relative_dir),
# If so, with install-exec? (or install-data?).
my $exec_p = ($nodir_name =~ /$EXEC_DIR_PATTERN/o);
- my $check_options_p = $install_p
- && defined $options{'std-options'};
+ my $check_options_p = $install_p && !! option 'std-options';
# Use the location of the currently processed variable as context.
$where->push_context ("while processing `$one_name'");
################################################################
-# Set strictness.
-sub set_strictness
-{
- $strictness_name = $_[0];
-
- Automake::ChannelDefs::set_strictness ($strictness_name);
-
- if ($strictness_name eq 'gnu')
- {
- $strictness = GNU;
- }
- elsif ($strictness_name eq 'gnits')
- {
- $strictness = GNITS;
- }
- elsif ($strictness_name eq 'foreign')
- {
- $strictness = FOREIGN;
- }
- else
- {
- prog_error "level `$strictness_name' not recognized\n";
- }
-}
################################################################
'libdir:s' => \$libdir,
'gnu' => sub { set_strictness ('gnu'); },
'gnits' => sub { set_strictness ('gnits'); },
- 'cygnus' => sub { $global_options{'cygnus'} = $cli_where; },
+ 'cygnus' => sub { set_global_option ('cygnus', $cli_where); },
'foreign' => sub { set_strictness ('foreign'); },
- 'include-deps' => sub { delete $global_options{'no-dependencies'}; },
- 'i|ignore-deps' => sub { $global_options{'no-dependencies'}
- = $cli_where; },
+ 'include-deps' => sub { unset_global_option ('no-dependencies'); },
+ 'i|ignore-deps' => sub { set_global_option ('no-dependencies',
+ $cli_where); },
'no-force' => sub { $force_generation = 0; },
'f|force-missing' => \$force_missing,
'o|output-dir:s' => \$output_directory,
push (@input_files, $input);
$output_files{$input} = join (':', ($local, @rest));
}
-
- # Take global strictness from whatever we currently have set.
- $default_strictness = $strictness;
- $default_strictness_name = $strictness_name;
}
################################################################
--- /dev/null
+# Copyright (C) 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+package Automake::Options;
+
+use strict;
+use Exporter;
+use Automake::Config;
+use Automake::ChannelDefs;
+use Automake::Channels;
+use Automake::Version;
+
+use vars qw (@ISA @EXPORT);
+
+@ISA = qw (Exporter);
+@EXPORT = qw (option global_option
+ set_option set_global_option
+ unset_option unset_global_option
+ process_option_list process_global_option_list
+ set_strictness $strictness $strictness_name
+ &FOREIGN &GNU &GNITS);
+
+=head1 NAME
+
+Automake::Options - keep track of Automake options
+
+=head1 SYNOPSIS
+
+ use Automake::Options;
+
+ # Option lookup and setting.
+ $opt = option 'name';
+ $opt = global_option 'name';
+ set_option 'name', 'value';
+ set_global_option 'name', 'value';
+ unset_option 'name';
+ unset_global_option 'name';
+
+ # Batch option setting.
+ process_option_list $location, @names;
+ process_global_option_list $location, @names;
+
+ # Strictness lookup and setting.
+ set_strictness 'foreign';
+ set_strictness 'gnu';
+ set_strictness 'gnits';
+ if ($strictness >= GNU) { ... }
+ print "$strictness_name\n";
+
+=head1 DESCRIPTION
+
+This packages manages Automake's options and strictness settings.
+Options can be either local or global. Local options are set using an
+C<AUTOMAKE_OPTIONS> variable in a F<Makefile.am> and apply only to
+this F<Makefile.am>. Global options are set from the command line or
+passed as an argument to C<AM_INIT_AUTOMAKE>, they apply to all
+F<Makefile.am>s.
+
+=cut
+
+# Values are the Automake::Location of the definition, except
+# for 'ansi2knr' whose value is a pair [filename, Location].
+use vars '%_options'; # From AUTOMAKE_OPTIONS
+use vars '%_global_options'; # from AM_INIT_AUTOMAKE or the command line.
+
+=head2 Constants
+
+=over 4
+
+=item FOREIGN
+
+=item GNU
+
+=item GNITS
+
+Strictness constants used as values for C<$strictness>.
+
+=back
+
+=cut
+
+# Constants to define the "strictness" level.
+use constant FOREIGN => 0;
+use constant GNU => 1;
+use constant GNITS => 2;
+
+=head2 Variables
+
+=over 4
+
+=item C<$strictness>
+
+The current stricness. One of C<FOREIGN>, C<GNU>, or C<GNITS>.
+
+=item C<$strictness_name>
+
+The current stricness name. One of C<'foreign'>, C<'gnu'>, or C<'gnits'>.
+
+=back
+
+=cut
+
+# Strictness levels.
+use vars qw ($strictness $strictness_name);
+
+# Strictness level as set on command line.
+use vars qw ($_default_strictness $_default_strictness_name);
+
+
+=head2 Functions
+
+=over 4
+
+=item C<Automake::Options::reset>
+
+Reset the options variables for the next F<Makefile.am>.
+
+In other words, this gets rid of all local options in use by the
+previous F<Makefile.am>.
+
+=cut
+
+sub reset ()
+{
+ %_options = %_global_options;
+ # The first time we are run,
+ # remember the current setting as the default.
+ if (defined $_default_strictness)
+ {
+ $strictness = $_default_strictness;
+ $strictness_name = $_default_strictness_name;
+ }
+ else
+ {
+ $_default_strictness = $strictness;
+ $_default_strictness_name = $strictness_name;
+ }
+}
+
+=item C<$value = option ($name)>
+
+=item C<$value = global_option ($name)>
+
+Query the state of an option. If the option is unset, this
+returns the empty list. Otherwise it returns the option's value,
+as set by C<set_option> or C<set_global_option>.
+
+Not that C<global_option> should be used only when it is
+important to make sure an option hasn't been set locally.
+Otherwise C<option> should be the standard function to
+check for options (be they global or local).
+
+=cut
+
+sub option ($)
+{
+ my ($name) = @_;
+ return () unless defined $_options{$name};
+ return $_options{$name};
+}
+
+sub global_option ($)
+{
+ my ($name) = @_;
+ return () unless defined $_global_options{$name};
+ return $_global_options{$name};
+}
+
+=item C<set_option ($name, $value)>
+
+=item C<set_global_option ($name, $value)>
+
+Set an option. By convention, C<$value> is usually the location
+of the option definition.
+
+=cut
+
+sub set_option ($$)
+{
+ my ($name, $value) = @_;
+ $_options{$name} = $value;
+}
+
+sub set_global_option ($$)
+{
+ my ($name, $value) = @_;
+ $_global_options{$name} = $value;
+}
+
+
+=item C<unset_option ($name)>
+
+=item C<unset_global_option ($name)>
+
+Unset an option.
+
+=cut
+
+sub unset_option ($)
+{
+ my ($name) = @_;
+ delete $_options{$name};
+}
+
+sub unset_global_option ($)
+{
+ my ($name) = @_;
+ delete $_global_options{$name};
+}
+
+
+=item C<process_option_list ($where, @options)>
+
+=item C<process_global_option_list ($where, @options)>
+
+Process Automake's option lists. C<@options> should be a list of
+words, as they occur in C<AUTOMAKE_OPTIONS> or C<AM_INIT_AUTOMAKE>.
+
+Return 1 on error, 0 otherwise.
+
+=cut
+
+# $BOOL
+# _process_option_list (\%OPTIONS, $WHERE, @OPTIONS)
+# -------------------------------------------------
+# Process a list of options. Return 1 on error, 0 otherwise.
+# \%OPTIONS is the hash to fill with options data, $WHERE is
+# the location where @OPTIONS occured.
+sub _process_option_list (\%$@)
+{
+ my ($options, $where, @list) = @_;
+
+ foreach (@list)
+ {
+ $options->{$_} = $where;
+ if ($_ eq 'gnits' || $_ eq 'gnu' || $_ eq 'foreign')
+ {
+ set_strictness ($_);
+ }
+ elsif (/^(.*\/)?ansi2knr$/)
+ {
+ # An option like "../lib/ansi2knr" is allowed. With no
+ # path prefix, we assume the required programs are in this
+ # directory. We save the actual option for later.
+ $options->{'ansi2knr'} = [$_, $where];
+ }
+ elsif ($_ eq 'no-installman' || $_ eq 'no-installinfo'
+ || $_ eq 'dist-shar' || $_ eq 'dist-zip'
+ || $_ eq 'dist-tarZ' || $_ eq 'dist-bzip2'
+ || $_ eq 'no-dist-gzip'
+ || $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
+ || $_ eq 'readme-alpha' || $_ eq 'check-news'
+ || $_ eq 'subdir-objects' || $_ eq 'nostdinc'
+ || $_ eq 'no-exeext' || $_ eq 'no-define'
+ || $_ eq 'std-options'
+ || $_ eq 'cygnus' || $_ eq 'no-dependencies')
+ {
+ # Explicitly recognize these.
+ }
+ elsif (/^\d+\.\d+(?:\.\d+)?[a-z]?(?:-[A-Za-z0-9]+)?$/)
+ {
+ # Got a version number.
+ if (Automake::Version::check ($VERSION, $&))
+ {
+ error ($where, "require Automake $_, but have $VERSION",
+ uniq_scope => US_GLOBAL);
+ return 1;
+ }
+ }
+ elsif (/^(?:--warnings=|-W)(.*)$/)
+ {
+ foreach my $cat (split (',', $1))
+ {
+ msg 'unsupported', $where, "unknown warning category `$cat'"
+ if switch_warning $cat;
+ }
+ }
+ else
+ {
+ error ($where, "option `$_' not recognized",
+ uniq_scope => US_GLOBAL);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+sub process_option_list ($@)
+{
+ my ($where, @list) = @_;
+ return _process_option_list (%_options, $where, @list);
+}
+
+sub process_global_option_list ($@)
+{
+ my ($where, @list) = @_;
+ return _process_option_list (%_global_options, $where, @list);
+}
+
+=item C<set_strictness ($name)>
+
+Set the current strictness level.
+C<$name> should be one of C<'foreign'>, C<'gnu'>, or C<'gnits'>.
+
+=cut
+
+# Set strictness.
+sub set_strictness ($)
+{
+ $strictness_name = $_[0];
+
+ Automake::ChannelDefs::set_strictness ($strictness_name);
+
+ if ($strictness_name eq 'gnu')
+ {
+ $strictness = GNU;
+ }
+ elsif ($strictness_name eq 'gnits')
+ {
+ $strictness = GNITS;
+ }
+ elsif ($strictness_name eq 'foreign')
+ {
+ $strictness = FOREIGN;
+ }
+ else
+ {
+ prog_error "level `$strictness_name' not recognized\n";
+ }
+}
+
+1;
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End: