[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.13.1b-84
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.13.1b-84-g9829cf2 |
Date: |
Sat, 16 Feb 2013 19:00:53 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=9829cf24dad4310de0dbfbc3732f6c439b8e6931
The branch, maint has been updated
via 9829cf24dad4310de0dbfbc3732f6c439b8e6931 (commit)
via 57b72c4b8e8d5521b0a83aaa445276c2155dc64e (commit)
via e7b9d315e6bcb3a3c86042dc5fd58e6f4461ed2d (commit)
via 283ded7f5b9b7ad97300293cd65f3f1b48c21115 (commit)
via 6d9e9dd453944cd86ddc530a131bd338f4734638 (commit)
from f637fc39a65cac7eb7050359e6c352a235f64528 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
HACKING | 5 +-
Makefile.am | 14 +-
aclocal.in | 22 +--
automake.in | 752 +++++++++++++++++++------------------------
bootstrap.sh | 11 +-
lib/Automake/Language.pm | 122 +++++++
lib/gen-perl-protos | 36 ++
maintainer/syntax-checks.mk | 19 +-
8 files changed, 522 insertions(+), 459 deletions(-)
create mode 100644 lib/Automake/Language.pm
create mode 100755 lib/gen-perl-protos
diff --git a/HACKING b/HACKING
index 8f51ff4..a4f89bd 100644
--- a/HACKING
+++ b/HACKING
@@ -96,11 +96,8 @@
default), and other portions using the GNU style (cperl-mode's
default). Write new code using GNU style.
-* Don't use & for function calls, unless required.
+* Don't use & for function calls, unless really required.
The use of & prevents prototypes from being checked.
- Just as above, don't change massively all the code to strip the
- &, just convert the old code as you work on it, and write new
- code without.
============================================================================
= Working with git
diff --git a/Makefile.am b/Makefile.am
index fa3dd3f..2e05561 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -96,13 +96,18 @@ uninstall-hook:
# $(datadir) or other do_subst'ituted variables change.
automake: automake.in
aclocal: aclocal.in
-automake aclocal: Makefile
- $(AM_V_at)rm -f $@ address@hidden
- $(AM_V_GEN)address@hidden; $(do_subst) <$(srcdir)/address@hidden
>address@hidden
+automake aclocal: Makefile lib/gen-perl-protos
+ $(AM_V_GEN)rm -f $@ address@hidden address@hidden \
+## Common substitutions.
+ && address@hidden && $(do_subst) <$(srcdir)/$$in >address@hidden \
+## Auto-compute prototypes of perl subroutines.
+ && $(PERL) -w $(srcdir)/lib/gen-perl-protos address@hidden >
address@hidden \
+ && mv -f address@hidden address@hidden \
## We can't use '$(generated_file_finalize)' here, because currently
## Automake contains occurrences of unexpanded @substitutions@ in
## comments, and that is perfectly legit.
- $(AM_V_at)chmod a+x,a-w address@hidden && mv -f address@hidden $@
+ && chmod a+x,a-w address@hidden && mv -f address@hidden $@
+EXTRA_DIST += lib/gen-perl-protos
# The master location for INSTALL is lib/INSTALL.
# This is where "make fetch" will install new versions.
@@ -188,6 +193,7 @@ dist_perllib_DATA = \
lib/Automake/Getopt.pm \
lib/Automake/Item.pm \
lib/Automake/ItemDef.pm \
+ lib/Automake/Language.pm \
lib/Automake/Location.pm \
lib/Automake/Options.pm \
lib/Automake/Rule.pm \
diff --git a/aclocal.in b/aclocal.in
index b51c09d..9e4ab79 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -169,27 +169,7 @@ my $erase_me;
# Prototypes for all subroutines.
-sub unlink_tmp (;$);
-sub xmkdir_p ($);
-sub check_acinclude ();
-sub reset_maps ();
-sub install_file ($$);
-sub list_compare (address@hidden@);
-sub scan_m4_dirs ($$@);
-sub scan_m4_files ();
-sub add_macro ($);
-sub scan_configure_dep ($);
-sub add_file ($);
-sub scan_file ($$$);
-sub strip_redundant_includes (%);
-sub trace_used_macros ();
-sub scan_configure ();
-sub write_aclocal ($@);
-sub usage ($);
-sub version ();
-sub handle_acdir_option ($$);
-sub parse_arguments ();
-sub parse_ACLOCAL_PATH ();
+#! Prototypes here will automatically be generated by the build system.
################################################################
diff --git a/automake.in b/automake.in
index 4bb9687..d4c25c4 100644
--- a/automake.in
+++ b/automake.in
@@ -25,7 +25,9 @@ eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S
"$0" "$@";; esac'
# Perl reimplementation by Tom Tromey <address@hidden>, and
# Alexandre Duret-Lutz <address@hidden>.
-package Language;
+package Automake;
+
+use strict;
BEGIN
{
@@ -43,93 +45,6 @@ BEGIN
$ENV{'SHELL'} = '@SHELL@' if exists $ENV{'DJDIR'};
}
-use Class::Struct ();
-Class::Struct::struct (
- # Short name of the language (c, f77...).
- 'name' => "\$",
- # Nice name of the language (C, Fortran 77...).
- 'Name' => "\$",
-
- # List of configure variables which must be defined.
- 'config_vars' => '@',
-
- # 'pure' is '1' or ''. A 'pure' language is one where, if
- # all the files in a directory are of that language, then we
- # do not require the C compiler or any code to call it.
- 'pure' => "\$",
-
- 'autodep' => "\$",
-
- # Name of the compiling variable (COMPILE).
- 'compiler' => "\$",
- # Content of the compiling variable.
- 'compile' => "\$",
- # Flag to require compilation without linking (-c).
- 'compile_flag' => "\$",
- 'extensions' => '@',
- # A subroutine to compute a list of possible extensions of
- # the product given the input extensions.
- # (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo'))
- 'output_extensions' => "\$",
- # A list of flag variables used in 'compile'.
- # (defaults to [])
- 'flags' => "@",
-
- # Any tag to pass to libtool while compiling.
- 'libtool_tag' => "\$",
-
- # The file to use when generating rules for this language.
- # The default is 'depend2'.
- 'rule_file' => "\$",
-
- # Name of the linking variable (LINK).
- 'linker' => "\$",
- # Content of the linking variable.
- 'link' => "\$",
-
- # Name of the compiler variable (CC).
- 'ccer' => "\$",
-
- # Name of the linker variable (LD).
- 'lder' => "\$",
- # Content of the linker variable ($(CC)).
- 'ld' => "\$",
-
- # Flag to specify the output file (-o).
- 'output_flag' => "\$",
- '_finish' => "\$",
-
- # This is a subroutine which is called whenever we finally
- # determine the context in which a source file will be
- # compiled.
- '_target_hook' => "\$",
-
- # If TRUE, nodist_ sources will be compiled using specific rules
- # (i.e. not inference rules). The default is FALSE.
- 'nodist_specific' => "\$");
-
-
-sub finish ($)
-{
- my ($self) = @_;
- if (defined $self->_finish)
- {
- &{$self->_finish} (@_);
- }
-}
-
-sub target_hook ($$$$%)
-{
- my ($self) = @_;
- if (defined $self->_target_hook)
- {
- &{$self->_target_hook} (@_);
- }
-}
-
-package Automake;
-
-use strict;
use Automake::Config;
BEGIN
{
@@ -156,10 +71,18 @@ use Automake::VarDef;
use Automake::Rule;
use Automake::RuleDef;
use Automake::Wrap 'makefile_wrap';
+use Automake::Language;
use File::Basename;
use File::Spec;
use Carp;
+## ----------------------- ##
+## Subroutine prototypes. ##
+## ----------------------- ##
+
+#! Prototypes here will automatically be generated by the build system.
+
+
## ----------- ##
## Constants. ##
## ----------- ##
@@ -341,7 +264,7 @@ my %ac_config_files_location = ();
my %ac_config_files_condition = ();
# Directory to search for configure-required files. This
-# will be computed by &locate_aux_dir and can be set using
+# will be computed by locate_aux_dir() and can be set using
# AC_CONFIG_AUX_DIR in configure.ac.
# $CONFIG_AUX_DIR is the 'raw' directory, valid only in the source-tree.
my $config_aux_dir = '';
@@ -615,16 +538,9 @@ Automake::Variable::hook ('SUFFIXES',
\&var_SUFFIXES_trigger);
################################################################
-## --------------------------------- ##
-## Forward subroutine declarations. ##
-## --------------------------------- ##
-sub register_language (%);
-sub file_contents_internal ($$$%);
-sub define_files_variable (address@hidden);
-
-# &initialize_per_input ()
-# ------------------------
+# initialize_per_input ()
+# -----------------------
# (Re)-Initialize per-Makefile.am variables.
sub initialize_per_input ()
{
@@ -1032,7 +948,7 @@ register_language ('name' => 'java',
# Uncategorized errors about the current Makefile.am.
sub err_am ($;%)
{
- msg_am ('error', @_);
+ msg_am ('error', shift, @_);
}
# err_ac ($MESSAGE, [%OPTIONS])
@@ -1040,7 +956,7 @@ sub err_am ($;%)
# Uncategorized errors about configure.ac.
sub err_ac ($;%)
{
- msg_ac ('error', @_);
+ msg_ac ('error', shift, @_);
}
# msg_am ($CHANNEL, $MESSAGE, [%OPTIONS])
@@ -1079,8 +995,8 @@ sub subst ($)
# $BACKPATH
-# &backname ($RELDIR)
-# --------------------
+# backname ($RELDIR)
+# -------------------
# If I "cd $RELDIR", then to come back, I should "cd $BACKPATH".
# For instance 'src/foo' => '../..'.
# Works with non strictly increasing paths, i.e., 'src/../lib' => '..'.
@@ -1230,7 +1146,7 @@ sub handle_silent ()
# Handle AUTOMAKE_OPTIONS variable. Return 1 on error, 0 otherwise.
-sub handle_options
+sub handle_options ()
{
my $var = var ('AUTOMAKE_OPTIONS');
if ($var)
@@ -1303,7 +1219,7 @@ sub check_user_variables (@)
}
# Call finish function for each language that was used.
-sub handle_languages
+sub handle_languages ()
{
if (! option 'no-dependencies')
{
@@ -1312,10 +1228,10 @@ sub handle_languages
if (keys %extension_seen && keys %dep_files)
{
# Set location of depcomp.
- &define_variable ('depcomp',
- "\$(SHELL) $am_config_aux_dir/depcomp",
- INTERNAL);
- &define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL);
+ define_variable ('depcomp',
+ "\$(SHELL) $am_config_aux_dir/depcomp",
+ INTERNAL);
+ define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL);
require_conf_file ("$am_file.am", FOREIGN, 'depcomp');
@@ -1338,15 +1254,15 @@ sub handle_languages
# Compute the set of directories to remove in distclean-depend.
my @depdirs = uniq (map { dirname ($_) } @deplist);
- $output_rules .= &file_contents ('depend',
- new Automake::Location,
- DEPDIRS => "@depdirs");
+ $output_rules .= file_contents ('depend',
+ new Automake::Location,
+ DEPDIRS => "@depdirs");
}
}
else
{
- &define_variable ('depcomp', '', INTERNAL);
- &define_variable ('am__depfiles_maybe', '', INTERNAL);
+ define_variable ('depcomp', '', INTERNAL);
+ define_variable ('am__depfiles_maybe', '', INTERNAL);
}
my %done;
@@ -1381,7 +1297,7 @@ sub handle_languages
'FASTDEP' => $FASTDEP,
'-c' => $lang->compile_flag || '',
# These are not used, but they need to be defined
- # so &transform do not complain.
+ # so transform() do not complain.
SUBDIROBJ => 0,
'DERIVED-EXT' => 'BUG',
DIST_SOURCE => 1,
@@ -1404,7 +1320,7 @@ sub handle_languages
# Compute a possible derived extension.
# This is not used by depend2.am.
- my $der_ext = (&{$lang->output_extensions} ($ext))[0];
+ my $der_ext = ($lang->output_extensions->($ext))[0];
# When we output an inference rule like '.c.o:' we
# have two cases to consider: either subdir-objects
@@ -1574,7 +1490,7 @@ sub handle_languages
if ($needs_c)
{
- &define_compiler_variable ($languages{'c'})
+ define_compiler_variable ($languages{'c'})
unless defined $done{$languages{'c'}};
define_linker_variable ($languages{'c'});
}
@@ -1610,7 +1526,7 @@ sub append_exeext (&$)
# mentioned. This is a separate function (as opposed to being inlined
# in handle_source_transform) because it isn't always appropriate to
# do this check.
-sub check_libobjs_sources
+sub check_libobjs_sources ($$)
{
my ($one_file, $unxformed) = @_;
@@ -1709,13 +1625,13 @@ sub handle_single_transform ($$$$$%)
# language function.
my $aggregate = 'AM';
- $extension = &derive_suffix ($extension, $obj);
+ $extension = derive_suffix ($extension, $obj);
my $lang;
if ($extension_map{$extension} &&
($lang = $languages{$extension_map{$extension}}))
{
# Found the language, so see what it says.
- &saw_extension ($extension);
+ saw_extension ($extension);
# Do we have per-executable flags for this executable?
my $have_per_exec_flags = 0;
@@ -1955,7 +1871,7 @@ EOF
unshift (@files, $object);
# Distribute derived sources unless the source they are
# derived from is not.
- &push_dist_common ($object)
+ push_dist_common ($object)
unless ($topparent =~ /^(?:nobase_)?nodist_/);
next;
}
@@ -2010,7 +1926,7 @@ EOF
unless option 'no-dependencies';
}
- &pretty_print_rule ($object . ':', "\t", @dep_list)
+ pretty_print_rule ($object . ':', "\t", @dep_list)
if scalar @dep_list > 0;
}
@@ -2140,7 +2056,7 @@ sub handle_source_transform ($$$$%)
}
if ($needlinker)
{
- $linker ||= &resolve_linker (%linkers_used);
+ $linker ||= resolve_linker (%linkers_used);
}
my @keys = sort keys %used_pfx;
@@ -2180,7 +2096,7 @@ sub handle_source_transform ($$$$%)
$default_source = '$(srcdir)/' . $default_source;
}
- &define_variable ($one_file . "_SOURCES", $default_source, $where);
+ define_variable ($one_file . "_SOURCES", $default_source, $where);
push (@sources, $default_source);
push (@dist_sources, $default_source);
@@ -2190,7 +2106,7 @@ sub handle_source_transform ($$$$%)
$one_file . '_SOURCES',
$one_file, $obj,
$default_source, %transform);
- $linker ||= &resolve_linker (%linkers_used);
+ $linker ||= resolve_linker (%linkers_used);
define_pretty_variable ($one_file . '_OBJECTS', TRUE, $where, @result);
}
else
@@ -2217,7 +2133,7 @@ sub handle_source_transform ($$$$%)
# transformed name of object being built, or empty string if no object
# name of _LDADD/_LIBADD-type variable to examine
# Returns 1 if LIBOBJS seen, 0 otherwise.
-sub handle_lib_objects
+sub handle_lib_objects ($$)
{
my ($xname, $varname) = @_;
@@ -2349,8 +2265,8 @@ sub handle_LIBOBJS ($$$)
{
if ($iter =~ /\.[cly]$/)
{
- &saw_extension ($&);
- &saw_extension ('.c');
+ saw_extension ($&);
+ saw_extension ('.c');
}
if ($iter =~ /\.h$/)
@@ -2383,11 +2299,11 @@ sub handle_ALLOCA ($$$)
$var->requires_variables ("address@hidden@ used", $lt . 'ALLOCA');
$dep_files{$dir . '$(DEPDIR)/alloca.P' . $myobjext} = 1;
require_libsource_with_macro ($cond, $var, FOREIGN, 'alloca.c');
- &saw_extension ('.c');
+ saw_extension ('.c');
}
# Canonicalize the input parameter
-sub canonicalize
+sub canonicalize ($)
{
my ($string) = @_;
$string =~ tr/A-Za-z0-9_\@/_/c;
@@ -2397,11 +2313,11 @@ sub canonicalize
# Canonicalize a name, and check to make sure the non-canonical name
# is never used. Returns canonical name. Arguments are name and a
# list of suffixes to check for.
-sub check_canonical_spelling
+sub check_canonical_spelling ($@)
{
my ($name, @suffixes) = @_;
- my $xname = &canonicalize ($name);
+ my $xname = canonicalize ($name);
if ($xname ne $name)
{
foreach my $xt (@suffixes)
@@ -2461,11 +2377,11 @@ sub handle_compile ()
}
my ($coms, $vars, $rules) =
- &file_contents_internal (1, "$libdir/am/compile.am",
- new Automake::Location,
- ('DEFAULT_INCLUDES' => $default_includes,
- 'MOSTLYRMS' => join ("\n", @mostly_rms),
- 'DISTRMS' => join ("\n", @dist_rms)));
+ file_contents_internal (1, "$libdir/am/compile.am",
+ new Automake::Location,
+ 'DEFAULT_INCLUDES' => $default_includes,
+ 'MOSTLYRMS' => join ("\n", @mostly_rms),
+ 'DISTRMS' => join ("\n", @dist_rms));
$output_vars .= $vars;
$output_rules .= "$coms$rules";
}
@@ -2473,7 +2389,7 @@ sub handle_compile ()
# handle_libtool ()
# -----------------
# Handle libtool rules.
-sub handle_libtool
+sub handle_libtool ()
{
return unless var ('LIBTOOL');
@@ -2494,24 +2410,24 @@ sub handle_libtool
check_user_variables 'LIBTOOLFLAGS';
# Output the libtool compilation rules.
- $output_rules .= &file_contents ('libtool',
- new Automake::Location,
+ $output_rules .= file_contents ('libtool',
+ new Automake::Location,
LTRMS => join ("\n", @libtool_rms));
}
# handle_programs ()
# ------------------
# Handle C programs.
-sub handle_programs
+sub handle_programs ()
{
- my @proglist = &am_install_var ('progs', 'PROGRAMS',
- 'bin', 'sbin', 'libexec', 'pkglibexec',
- 'noinst', 'check');
+ my @proglist = am_install_var ('progs', 'PROGRAMS',
+ 'bin', 'sbin', 'libexec', 'pkglibexec',
+ 'noinst', 'check');
return if ! @proglist;
$must_handle_compiled_objects = 1;
my $seen_global_libobjs =
- var ('LDADD') && &handle_lib_objects ('', 'LDADD');
+ var ('LDADD') && handle_lib_objects ('', 'LDADD');
foreach my $pair (@proglist)
{
@@ -2523,30 +2439,30 @@ sub handle_programs
$known_programs{$one_file} = $where;
# Canonicalize names and check for misspellings.
- my $xname = &check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS',
- '_SOURCES', '_OBJECTS',
- '_DEPENDENCIES');
+ my $xname = check_canonical_spelling ($one_file, '_LDADD', '_LDFLAGS',
+ '_SOURCES', '_OBJECTS',
+ '_DEPENDENCIES');
$where->push_context ("while processing program '$one_file'");
$where->set (INTERNAL->get);
- my $linker = &handle_source_transform ($xname, $one_file, $obj, $where,
- NONLIBTOOL => 1, LIBTOOL => 0);
+ my $linker = handle_source_transform ($xname, $one_file, $obj, $where,
+ NONLIBTOOL => 1, LIBTOOL => 0);
if (var ($xname . "_LDADD"))
{
- $seen_libobjs = &handle_lib_objects ($xname, $xname . '_LDADD');
+ $seen_libobjs = handle_lib_objects ($xname, $xname . '_LDADD');
}
else
{
# User didn't define prog_LDADD override. So do it.
- &define_variable ($xname . '_LDADD', '$(LDADD)', $where);
+ define_variable ($xname . '_LDADD', '$(LDADD)', $where);
# This does a bit too much work. But we need it to
# generate _DEPENDENCIES when appropriate.
if (var ('LDADD'))
{
- $seen_libobjs = &handle_lib_objects ($xname, 'LDADD');
+ $seen_libobjs = handle_lib_objects ($xname, 'LDADD');
}
}
@@ -2558,7 +2474,7 @@ sub handle_programs
set_seen ($xname . '_LDFLAGS');
# Determine program to use for link.
- my($xlink, $vlink) = &define_per_target_linker_variable ($linker,
$xname);
+ my($xlink, $vlink) = define_per_target_linker_variable ($linker, $xname);
$vlink = verbose_flag ($vlink || 'GEN');
# If the resulting program lies in a subdirectory,
@@ -2567,24 +2483,24 @@ sub handle_programs
$libtool_clean_directories{dirname ($one_file)} = 1;
- $output_rules .= &file_contents ('program',
- $where,
- PROGRAM => $one_file,
- XPROGRAM => $xname,
- XLINK => $xlink,
- VERBOSE => $vlink,
- DIRSTAMP => $dirstamp,
- EXEEXT => '$(EXEEXT)');
+ $output_rules .= file_contents ('program',
+ $where,
+ PROGRAM => $one_file,
+ XPROGRAM => $xname,
+ XLINK => $xlink,
+ VERBOSE => $vlink,
+ DIRSTAMP => $dirstamp,
+ EXEEXT => '$(EXEEXT)');
if ($seen_libobjs || $seen_global_libobjs)
{
if (var ($xname . '_LDADD'))
{
- &check_libobjs_sources ($xname, $xname . '_LDADD');
+ check_libobjs_sources ($xname, $xname . '_LDADD');
}
elsif (var ('LDADD'))
{
- &check_libobjs_sources ($xname, 'LDADD');
+ check_libobjs_sources ($xname, 'LDADD');
}
}
}
@@ -2594,10 +2510,10 @@ sub handle_programs
# handle_libraries ()
# -------------------
# Handle libraries.
-sub handle_libraries
+sub handle_libraries ()
{
- my @liblist = &am_install_var ('libs', 'LIBRARIES',
- 'lib', 'pkglib', 'noinst', 'check');
+ my @liblist = am_install_var ('libs', 'LIBRARIES',
+ 'lib', 'pkglib', 'noinst', 'check');
return if ! @liblist;
$must_handle_compiled_objects = 1;
@@ -2610,9 +2526,9 @@ sub handle_libraries
$var->requires_variables ('library used', 'RANLIB');
}
- &define_variable ('AR', 'ar', INTERNAL);
- &define_variable ('ARFLAGS', 'cru', INTERNAL);
- &define_verbose_tagvar ('AR');
+ define_variable ('AR', 'ar', INTERNAL);
+ define_variable ('ARFLAGS', 'cru', INTERNAL);
+ define_verbose_tagvar ('AR');
foreach my $pair (@liblist)
{
@@ -2639,27 +2555,27 @@ sub handle_libraries
my $obj = '.$(OBJEXT)';
# Canonicalize names and check for misspellings.
- my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES',
- '_OBJECTS', '_DEPENDENCIES',
- '_AR');
+ my $xlib = check_canonical_spelling ($onelib, '_LIBADD', '_SOURCES',
+ '_OBJECTS', '_DEPENDENCIES',
+ '_AR');
if (! var ($xlib . '_AR'))
{
- &define_variable ($xlib . '_AR', '$(AR) $(ARFLAGS)', $where);
+ define_variable ($xlib . '_AR', '$(AR) $(ARFLAGS)', $where);
}
# Generate support for conditional object inclusion in
# libraries.
if (var ($xlib . '_LIBADD'))
{
- if (&handle_lib_objects ($xlib, $xlib . '_LIBADD'))
+ if (handle_lib_objects ($xlib, $xlib . '_LIBADD'))
{
$seen_libobjs = 1;
}
}
else
{
- &define_variable ($xlib . "_LIBADD", '', $where);
+ define_variable ($xlib . "_LIBADD", '', $where);
}
reject_var ($xlib . '_LDADD',
@@ -2669,8 +2585,8 @@ sub handle_libraries
set_seen ($xlib . '_DEPENDENCIES');
set_seen ('EXTRA_' . $xlib . '_DEPENDENCIES');
- &handle_source_transform ($xlib, $onelib, $obj, $where,
- NONLIBTOOL => 1, LIBTOOL => 0);
+ handle_source_transform ($xlib, $onelib, $obj, $where,
+ NONLIBTOOL => 1, LIBTOOL => 0);
# If the resulting library lies in a subdirectory,
# make sure this directory will exist.
@@ -2678,19 +2594,19 @@ sub handle_libraries
my $verbose = verbose_flag ('AR');
my $silent = silent_flag ();
- $output_rules .= &file_contents ('library',
- $where,
- VERBOSE => $verbose,
- SILENT => $silent,
- LIBRARY => $onelib,
- XLIBRARY => $xlib,
- DIRSTAMP => $dirstamp);
+ $output_rules .= file_contents ('library',
+ $where,
+ VERBOSE => $verbose,
+ SILENT => $silent,
+ LIBRARY => $onelib,
+ XLIBRARY => $xlib,
+ DIRSTAMP => $dirstamp);
if ($seen_libobjs)
{
if (var ($xlib . '_LIBADD'))
{
- &check_libobjs_sources ($xlib, $xlib . '_LIBADD');
+ check_libobjs_sources ($xlib, $xlib . '_LIBADD');
}
}
@@ -2707,10 +2623,10 @@ sub handle_libraries
# handle_ltlibraries ()
# ---------------------
# Handle shared libraries.
-sub handle_ltlibraries
+sub handle_ltlibraries ()
{
- my @liblist = &am_install_var ('ltlib', 'LTLIBRARIES',
- 'noinst', 'lib', 'pkglib', 'check');
+ my @liblist = am_install_var ('ltlib', 'LTLIBRARIES',
+ 'noinst', 'lib', 'pkglib', 'check');
return if ! @liblist;
$must_handle_compiled_objects = 1;
@@ -2812,9 +2728,9 @@ sub handle_ltlibraries
my $obj = '.lo';
# Canonicalize names and check for misspellings.
- my $xlib = &check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS',
- '_SOURCES', '_OBJECTS',
- '_DEPENDENCIES');
+ my $xlib = check_canonical_spelling ($onelib, '_LIBADD', '_LDFLAGS',
+ '_SOURCES', '_OBJECTS',
+ '_DEPENDENCIES');
# Check that the library fits the standard naming convention.
my $libname_rx = '^lib.*\.la';
@@ -2861,25 +2777,25 @@ sub handle_ltlibraries
# libraries.
if (var ($xlib . '_LIBADD'))
{
- if (&handle_lib_objects ($xlib, $xlib . '_LIBADD'))
+ if (handle_lib_objects ($xlib, $xlib . '_LIBADD'))
{
$seen_libobjs = 1;
}
}
else
{
- &define_variable ($xlib . "_LIBADD", '', $where);
+ define_variable ($xlib . "_LIBADD", '', $where);
}
reject_var ("${xlib}_LDADD",
"use '${xlib}_LIBADD', not '${xlib}_LDADD'");
- my $linker = &handle_source_transform ($xlib, $onelib, $obj, $where,
- NONLIBTOOL => 0, LIBTOOL => 1);
+ my $linker = handle_source_transform ($xlib, $onelib, $obj, $where,
+ NONLIBTOOL => 0, LIBTOOL => 1);
# Determine program to use for link.
- my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xlib);
+ my($xlink, $vlink) = define_per_target_linker_variable ($linker, $xlib);
$vlink = verbose_flag ($vlink || 'GEN');
my $rpathvar = "am_${xlib}_rpath";
@@ -2924,19 +2840,19 @@ sub handle_ltlibraries
my $dirname = dirname $onelib;
$libtool_clean_directories{$dirname} = 1;
- $output_rules .= &file_contents ('ltlibrary',
- $where,
- LTLIBRARY => $onelib,
- XLTLIBRARY => $xlib,
- RPATH => $rpath,
- XLINK => $xlink,
- VERBOSE => $vlink,
- DIRSTAMP => $dirstamp);
+ $output_rules .= file_contents ('ltlibrary',
+ $where,
+ LTLIBRARY => $onelib,
+ XLTLIBRARY => $xlib,
+ RPATH => $rpath,
+ XLINK => $xlink,
+ VERBOSE => $vlink,
+ DIRSTAMP => $dirstamp);
if ($seen_libobjs)
{
if (var ($xlib . '_LIBADD'))
{
- &check_libobjs_sources ($xlib, $xlib . '_LIBADD');
+ check_libobjs_sources ($xlib, $xlib . '_LIBADD');
}
}
@@ -2977,14 +2893,14 @@ sub check_typos ()
# Handle scripts.
-sub handle_scripts
+sub handle_scripts ()
{
# NOTE we no longer automatically clean SCRIPTS, because it is
# useful to sometimes distribute scripts verbatim. This happens
# e.g. in Automake itself.
- &am_install_var ('-candist', 'scripts', 'SCRIPTS',
- 'bin', 'sbin', 'libexec', 'pkglibexec', 'pkgdata',
- 'noinst', 'check');
+ am_install_var ('-candist', 'scripts', 'SCRIPTS',
+ 'bin', 'sbin', 'libexec', 'pkglibexec', 'pkgdata',
+ 'noinst', 'check');
}
@@ -2995,8 +2911,8 @@ sub handle_scripts
## ------------------------ ##
# ($OUTFILE, $VFILE)
-# &scan_texinfo_file ($FILENAME)
-# ------------------------------
+# scan_texinfo_file ($FILENAME)
+# -----------------------------
# $OUTFILE - name of the info file produced by $FILENAME.
# $VFILE - name of the version.texi file used (undef if none).
sub scan_texinfo_file ($)
@@ -3500,7 +3416,7 @@ sub handle_texinfo ()
# Handle any man pages.
-sub handle_man_pages
+sub handle_man_pages ()
{
reject_var 'MANS', "'MANS' is an anachronism; use 'man_MANS'";
@@ -3534,7 +3450,7 @@ sub handle_man_pages
$trans_sect_vars{$varname} = 1;
}
- &push_dist_common ($varname)
+ push_dist_common ($varname)
if $pfx eq 'dist_';
}
}
@@ -3569,7 +3485,7 @@ sub handle_man_pages
{
$trans_vars{$varname} = 1;
}
- &push_dist_common ($varname)
+ push_dist_common ($varname)
if $pfx eq 'dist_';
}
}
@@ -3613,18 +3529,18 @@ sub handle_man_pages
@unsorted_deps = (keys %notrans_vars, keys %trans_vars,
keys %notrans_this_sect, keys %trans_this_sect);
my @deps = sort @unsorted_deps;
- $output_rules .= &file_contents ('mans',
- new Automake::Location,
- SECTION => $section,
- DEPS => "@deps",
- NOTRANS_MANS => $notrans_mans,
- NOTRANS_SECT_LIST =>
"@notrans_sect_list",
- HAVE_NOTRANS => $have_notrans,
- NOTRANS_LIST => "@notrans_list",
- TRANS_MANS => $trans_mans,
- TRANS_SECT_LIST => "@trans_sect_list",
- HAVE_TRANS => $have_trans,
- TRANS_LIST => "@trans_list");
+ $output_rules .= file_contents ('mans',
+ new Automake::Location,
+ SECTION => $section,
+ DEPS => "@deps",
+ NOTRANS_MANS => $notrans_mans,
+ NOTRANS_SECT_LIST =>
"@notrans_sect_list",
+ HAVE_NOTRANS => $have_notrans,
+ NOTRANS_LIST => "@notrans_list",
+ TRANS_MANS => $trans_mans,
+ TRANS_SECT_LIST => "@trans_sect_list",
+ HAVE_TRANS => $have_trans,
+ TRANS_LIST => "@trans_list");
}
@unsorted_deps = (keys %notrans_vars, keys %trans_vars,
@@ -3639,16 +3555,16 @@ sub handle_man_pages
}
# Handle DATA variables.
-sub handle_data
+sub handle_data ()
{
- &am_install_var ('-noextra', '-candist', 'data', 'DATA',
- 'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf',
- 'ps', 'sysconf', 'sharedstate', 'localstate',
- 'pkgdata', 'lisp', 'noinst', 'check');
+ am_install_var ('-noextra', '-candist', 'data', 'DATA',
+ 'data', 'dataroot', 'doc', 'dvi', 'html', 'pdf',
+ 'ps', 'sysconf', 'sharedstate', 'localstate',
+ 'pkgdata', 'lisp', 'noinst', 'check');
}
# Handle TAGS.
-sub handle_tags
+sub handle_tags ()
{
my @config;
foreach my $spec (@config_headers)
@@ -3670,7 +3586,7 @@ sub handle_tags
if (rvar('am__tagged_files')->value_as_list_recursive
|| var ('ETAGS_ARGS') || var ('SUBDIRS'))
{
- $output_rules .= &file_contents ('tags', new Automake::Location);
+ $output_rules .= file_contents ('tags', new Automake::Location);
set_seen 'TAGS_DEPENDENCIES';
}
else
@@ -3779,7 +3695,7 @@ sub handle_dist ()
if ($relative_dir eq '.'
&& $config_aux_dir_set_in_configure_ac)
{
- if (! &is_make_dir ($config_aux_dir))
+ if (! is_make_dir ($config_aux_dir))
{
$check_aux = 1;
}
@@ -3790,14 +3706,14 @@ sub handle_dist ()
# The file might be absent, but if it can be built it's ok.
|| rule $cfile)
{
- &push_dist_common ($cfile);
+ push_dist_common ($cfile);
}
# Don't use 'elsif' here because a file might meaningfully
# appear in both directories.
if ($check_aux && dir_has_case_matching_file ($config_aux_dir, $cfile))
{
- &push_dist_common ("$config_aux_dir/$cfile")
+ push_dist_common ("$config_aux_dir/$cfile")
}
}
@@ -3825,7 +3741,7 @@ sub handle_dist ()
# Files to distributed. Don't use ->value_as_list_recursive
# as it recursively expands '$(dist_pkgdata_DATA)' etc.
my @dist_common = split (' ', rvar ('DIST_COMMON')->variable_value);
- @dist_common = uniq @dist_common;
+ @dist_common = uniq (@dist_common);
variable_delete 'DIST_COMMON';
define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common);
@@ -3846,10 +3762,10 @@ sub handle_dist ()
my $flm = option ('filename-length-max');
my $filename_filter = $flm ? '.' x $flm->[1] : '';
- $output_rules .= &file_contents ('distdir',
- new Automake::Location,
- %transform,
- FILENAME_FILTER => $filename_filter);
+ $output_rules .= file_contents ('distdir',
+ new Automake::Location,
+ %transform,
+ FILENAME_FILTER => $filename_filter);
}
@@ -3909,8 +3825,8 @@ sub check_directories_in_var ($)
skip_ac_subst => 1);
}
-# &handle_subdirs ()
-# ------------------
+# handle_subdirs ()
+# -----------------
# Handle subdirectories.
sub handle_subdirs ()
{
@@ -3924,14 +3840,14 @@ sub handle_subdirs ()
check_directories_in_var $dsubdirs
if $dsubdirs;
- $output_rules .= &file_contents ('subdirs', new Automake::Location);
+ $output_rules .= file_contents ('subdirs', new Automake::Location);
rvar ('RECURSIVE_TARGETS')->rdef (TRUE)->{'pretty'} = VAR_SORTED; # Gross!
}
# ($REGEN, @DEPENDENCIES)
-# &scan_aclocal_m4
-# ----------------
+# scan_aclocal_m4
+# ---------------
# If aclocal.m4 creation is automated, return the list of its dependencies.
sub scan_aclocal_m4 ()
{
@@ -3942,7 +3858,7 @@ sub scan_aclocal_m4 ()
if (-f 'aclocal.m4')
{
- &define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL);
+ define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL);
my $aclocal = new Automake::XFile "< aclocal.m4";
my $line = $aclocal->getline;
@@ -3982,13 +3898,13 @@ sub substitute_ac_subst_variables_worker($)
sub substitute_ac_subst_variables ($)
{
my ($text) = @_;
- $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
+ $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
return $text;
}
# @DEPENDENCIES
-# &prepend_srcdir (@INPUTS)
-# -------------------------
+# prepend_srcdir (@INPUTS)
+# ------------------------
# Prepend $(srcdir) or $(top_srcdir) to all @INPUTS. The idea is that
# if an input file has a directory part the same as the current
# directory, then the directory part is simply replaced by $(srcdir).
@@ -4061,8 +3977,8 @@ sub rewrite_inputs_into_dependencies ($@)
-# &handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS)
-# ------------------------------------------------------------------
+# handle_configure ($MAKEFILE_AM, $MAKEFILE_IN, $MAKEFILE, @INPUTS)
+# -----------------------------------------------------------------
# Handle remaking and configure stuff.
# We need the name of the input file, to do proper remaking rules.
sub handle_configure ($$$@)
@@ -4108,7 +4024,7 @@ sub handle_configure ($$$@)
if ($relative_dir eq '.')
{
- &push_dist_common ('acconfig.h')
+ push_dist_common ('acconfig.h')
if -f 'acconfig.h';
}
@@ -4127,7 +4043,7 @@ sub handle_configure ($$$@)
# directory and the header's directory doesn't have a
# Makefile, then we also want to build the header.
if ($relative_dir eq $config_h_dir
- || ($relative_dir eq '.' && ! &is_make_dir ($config_h_dir)))
+ || ($relative_dir eq '.' && ! is_make_dir ($config_h_dir)))
{
my ($cn_sans_dir, $stamp_dir);
if ($relative_dir eq $config_h_dir)
@@ -4274,7 +4190,7 @@ sub handle_configure ($$$@)
my $fd = dirname ($file);
if ($fd ne $relative_dir)
{
- if ($relative_dir eq '.' && ! &is_make_dir ($fd))
+ if ($relative_dir eq '.' && ! is_make_dir ($fd))
{
$local = $file;
}
@@ -4329,7 +4245,7 @@ sub handle_configure ($$$@)
my $fd = dirname ($link);
if ($fd ne $relative_dir)
{
- if ($relative_dir eq '.' && ! &is_make_dir ($fd))
+ if ($relative_dir eq '.' && ! is_make_dir ($fd))
{
$local = $link;
}
@@ -4357,7 +4273,7 @@ sub handle_configure ($$$@)
# At the top-level ('.') we also distribute files whose
# directory does not have a Makefile.
if (($fd eq $relative_dir)
- || ($relative_dir eq '.' && ! &is_make_dir ($fd)))
+ || ($relative_dir eq '.' && ! is_make_dir ($fd)))
{
# The following will distribute $file as a side-effect when
# it is appropriate (i.e., when $file is not already an output).
@@ -4375,19 +4291,19 @@ sub handle_configure ($$$@)
}
# Handle C headers.
-sub handle_headers
+sub handle_headers ()
{
- my @r = &am_install_var ('-defaultdist', 'header', 'HEADERS', 'include',
- 'oldinclude', 'pkginclude',
- 'noinst', 'check');
+ my @r = am_install_var ('-defaultdist', 'header', 'HEADERS', 'include',
+ 'oldinclude', 'pkginclude',
+ 'noinst', 'check');
foreach (@r)
{
next unless $_->[1] =~ /\..*$/;
- &saw_extension ($&);
+ saw_extension ($&);
}
}
-sub handle_gettext
+sub handle_gettext ()
{
return if ! $seen_gettext || $relative_dir ne '.';
@@ -4444,7 +4360,7 @@ sub handle_gettext
}
# Handle footer elements.
-sub handle_footer
+sub handle_footer ()
{
reject_rule ('.SUFFIXES',
"use variable 'SUFFIXES', not target '.SUFFIXES'");
@@ -4482,7 +4398,7 @@ sub handle_footer
# Generate 'make install' rules.
sub handle_install ()
{
- $output_rules .= &file_contents
+ $output_rules .= file_contents
('install',
new Automake::Location,
maybe_BUILT_SOURCES => (set_seen ('BUILT_SOURCES')
@@ -4518,8 +4434,8 @@ sub handle_all ($)
push (@all, "all-local")
if user_phony_rule "all-local";
- &pretty_print_rule ("all-am:", "\t\t", @all);
- &depend ('.PHONY', 'all-am', 'all');
+ pretty_print_rule ("all-am:", "\t\t", @all);
+ depend ('.PHONY', 'all-am', 'all');
# Output 'all'.
@@ -4575,7 +4491,7 @@ sub handle_user_recursion ()
# associated 'foo-local' rule; we define it as an empty rule by
# default, so that the user can transparently extend it in his
# own Makefile.am.
- pretty_print_rule ("$target-local:");
+ pretty_print_rule ("$target-local:", '', '');
# $target-recursive might as well be undefined, so do not add
# it here; it's taken care of in subdirs.am anyway.
depend (".PHONY", "$target-am", "$target-local");
@@ -4583,8 +4499,8 @@ sub handle_user_recursion ()
}
-# &do_check_merge_target ()
-# -------------------------
+# do_check_merge_target ()
+# ------------------------
# Handle check merge target specially.
sub do_check_merge_target ()
{
@@ -4662,7 +4578,7 @@ sub handle_clean ($)
push @{$rms{$when}}, "\t-$rm\n";
}
- $output_rules .= &file_contents
+ $output_rules .= file_contents
('clean',
new Automake::Location,
MOSTLYCLEAN_RMS => join ('', sort @{$rms{&MOSTLY_CLEAN}}),
@@ -4674,10 +4590,9 @@ sub handle_clean ($)
}
-# &target_cmp ($A, $B)
-# --------------------
-# Subroutine for &handle_factored_dependencies to let '.PHONY' and
-# other '.TARGETS' be last.
+# Subroutine for handle_factored_dependencies() to let '.PHONY' and
+# other '.TARGETS' be last. This is meant to be used as a comparison
+# subroutine passed to the sort built-int.
sub target_cmp
{
return 0 if $a eq $b;
@@ -4693,10 +4608,10 @@ sub target_cmp
}
-# &handle_factored_dependencies ()
-# --------------------------------
+# handle_factored_dependencies ()
+# -------------------------------
# Handle everything related to gathered targets.
-sub handle_factored_dependencies
+sub handle_factored_dependencies ()
{
# Reject bad hooks.
foreach my $utarg ('uninstall-data-local', 'uninstall-data-hook',
@@ -4773,7 +4688,7 @@ sub handle_factored_dependencies
foreach my $cond (@undefined_conds)
{
my $condstr = $cond->subst_string;
- &pretty_print_rule ("$condstr$_:", "$condstr\t", @uniq_deps);
+ pretty_print_rule ("$condstr$_:", "$condstr\t", @uniq_deps);
$output_rules .= $actions{$_} if defined $actions{$_};
$output_rules .= "\n";
}
@@ -4781,15 +4696,15 @@ sub handle_factored_dependencies
}
-# &handle_tests_dejagnu ()
-# ------------------------
-sub handle_tests_dejagnu
+# handle_tests_dejagnu ()
+# -----------------------
+sub handle_tests_dejagnu ()
{
push (@check_tests, 'check-DEJAGNU');
$output_rules .= file_contents ('dejagnu', new Automake::Location);
}
-sub handle_per_suffix_test
+sub handle_per_suffix_test ($%)
{
my ($test_suffix, %transform) = @_;
my ($pfx, $generic, $am_exeext);
@@ -4853,11 +4768,11 @@ sub is_valid_test_extension ($)
}
# Handle TESTS variable and other checks.
-sub handle_tests
+sub handle_tests ()
{
if (option 'dejagnu')
{
- &handle_tests_dejagnu;
+ handle_tests_dejagnu;
}
else
{
@@ -4872,9 +4787,9 @@ sub handle_tests
{
push (@check_tests, 'check-TESTS');
my $check_deps = "@check";
- $output_rules .= &file_contents ('check', new Automake::Location,
- SERIAL_TESTS => !! option 'serial-tests',
- CHECK_DEPS => $check_deps);
+ $output_rules .= file_contents ('check', new Automake::Location,
+ SERIAL_TESTS => !! option 'serial-tests',
+ CHECK_DEPS => $check_deps);
# Tests that are known programs should have $(EXEEXT) appended.
# For matching purposes, we need to adjust XFAIL_TESTS as well.
@@ -4987,10 +4902,10 @@ sub handle_tests
}
# Handle Emacs Lisp.
-sub handle_emacs_lisp
+sub handle_emacs_lisp ()
{
- my @elfiles = &am_install_var ('-candist', 'lisp', 'LISP',
- 'lisp', 'noinst');
+ my @elfiles = am_install_var ('-candist', 'lisp', 'LISP',
+ 'lisp', 'noinst');
return if ! @elfiles;
@@ -5008,23 +4923,23 @@ sub handle_emacs_lisp
}
# Handle Python
-sub handle_python
+sub handle_python ()
{
- my @pyfiles = &am_install_var ('-defaultdist', 'python', 'PYTHON',
- 'noinst');
+ my @pyfiles = am_install_var ('-defaultdist', 'python', 'PYTHON',
+ 'noinst');
return if ! @pyfiles;
require_variables ($pyfiles[0][0], "Python sources seen", TRUE, 'PYTHON');
require_conf_file ($pyfiles[0][0], FOREIGN, 'py-compile');
- &define_variable ('py_compile', "$am_config_aux_dir/py-compile", INTERNAL);
+ define_variable ('py_compile', "$am_config_aux_dir/py-compile", INTERNAL);
}
# Handle Java.
-sub handle_java
+sub handle_java ()
{
- my @sourcelist = &am_install_var ('-candist',
- 'java', 'JAVA',
- 'noinst', 'check');
+ my @sourcelist = am_install_var ('-candist',
+ 'java', 'JAVA',
+ 'noinst', 'check');
return if ! @sourcelist;
my @prefixes = am_primary_prefixes ('JAVA', 1,
@@ -5065,7 +4980,7 @@ sub handle_java
# Handle some of the minor options.
-sub handle_minor_options
+sub handle_minor_options ()
{
if (option 'readme-alpha')
{
@@ -5090,8 +5005,8 @@ sub handle_minor_options
################################################################
# ($OUTPUT, @INPUTS)
-# &split_config_file_spec ($SPEC)
-# -------------------------------
+# split_config_file_spec ($SPEC)
+# ------------------------------
# Decode the Autoconf syntax for config files (files, headers, links
# etc.).
sub split_config_file_spec ($)
@@ -5128,8 +5043,8 @@ sub locate_am (@)
my %make_list;
-# &scan_autoconf_config_files ($WHERE, $CONFIG-FILES)
-# ---------------------------------------------------
+# scan_autoconf_config_files ($WHERE, $CONFIG-FILES)
+# --------------------------------------------------
# Study $CONFIG-FILES which is the first argument to AC_CONFIG_FILES
# (or AC_OUTPUT).
sub scan_autoconf_config_files ($$)
@@ -5170,8 +5085,8 @@ sub scan_autoconf_config_files ($$)
}
-# &scan_autoconf_traces ($FILENAME)
-# ---------------------------------
+# scan_autoconf_traces ($FILENAME)
+# --------------------------------
sub scan_autoconf_traces ($)
{
my ($filename) = @_;
@@ -5476,8 +5391,8 @@ EOF
}
-# &scan_autoconf_files ()
-# -----------------------
+# scan_autoconf_files ()
+# ----------------------
# Check whether we use 'configure.ac' or 'configure.in'.
# Scan it (and possibly 'aclocal.m4') for interesting things.
# We must scan aclocal.m4 because there might be AC_SUBSTs and such there.
@@ -5563,7 +5478,7 @@ sub scan_autoconf_files ()
################################################################
# Do any extra checking for GNU standards.
-sub check_gnu_standards
+sub check_gnu_standards ()
{
if ($relative_dir eq '.')
{
@@ -5595,7 +5510,7 @@ sub check_gnu_standards
}
# Do any extra checking for GNITS standards.
-sub check_gnits_standards
+sub check_gnits_standards ()
{
if ($relative_dir eq '.')
{
@@ -5621,7 +5536,7 @@ sub check_gnits_standards
# This is just a convenience function that can be used to determine
# when a subdir object should be used.
-sub lang_sub_obj
+sub lang_sub_obj ()
{
return option 'subdir-objects' ? LANG_SUBDIR : LANG_PROCESS;
}
@@ -5647,7 +5562,7 @@ sub lang_yacc_rewrite
{
my ($directory, $base, $ext) = @_;
- my $r = &lang_sub_obj;
+ my $r = lang_sub_obj;
(my $newext = $ext) =~ tr/y/c/;
return ($r, $newext);
}
@@ -5658,7 +5573,7 @@ sub lang_lex_rewrite
{
my ($directory, $base, $ext) = @_;
- my $r = &lang_sub_obj;
+ my $r = lang_sub_obj;
(my $newext = $ext) =~ tr/l/c/;
return ($r, $newext);
}
@@ -5770,7 +5685,7 @@ sub lang_vala_finish_target ($$)
# Add output rules to invoke valac and create stamp file as a witness
# to handle multiple outputs. This function is called after all source
# file processing is done.
-sub lang_vala_finish
+sub lang_vala_finish ()
{
my ($self) = @_;
@@ -5788,7 +5703,7 @@ sub lang_vala_finish
# The built .c files should be cleaned only on maintainer-clean
# as the .c files are distributed. This function is called for each
# .vala source file.
-sub lang_vala_target_hook
+sub lang_vala_target_hook ($$$$%)
{
my ($self, $aggregate, $output, $input, %transform) = @_;
@@ -5797,7 +5712,7 @@ sub lang_vala_target_hook
# This is a yacc helper which is called whenever we have decided to
# compile a yacc file.
-sub lang_yacc_target_hook
+sub lang_yacc_target_hook ($$$$%)
{
my ($self, $aggregate, $output, $input, %transform) = @_;
@@ -5856,9 +5771,9 @@ sub lang_yacc_target_hook
. "address@hidden test ! -f \$@; then \$(MAKE) \$(AM_MAKEFLAGS)
$output; else :; fi\n";
}
# Distribute the generated file, unless its .y source was
- # listed in a nodist_ variable. (&handle_source_transform
+ # listed in a nodist_ variable. (handle_source_transform()
# will set DIST_SOURCE.)
- &push_dist_common ($header)
+ push_dist_common ($header)
if $transform{'DIST_SOURCE'};
# The GNU rules say that yacc/lex output files should be removed
@@ -5873,7 +5788,7 @@ sub lang_yacc_target_hook
# This is a lex helper which is called whenever we have decided to
# compile a lex file.
-sub lang_lex_target_hook
+sub lang_lex_target_hook ($$$$%)
{
my ($self, $aggregate, $output, $input, %transform) = @_;
# The GNU rules say that yacc/lex output files should be removed
@@ -5884,17 +5799,17 @@ sub lang_lex_target_hook
}
# This is a helper for both lex and yacc.
-sub yacc_lex_finish_helper
+sub yacc_lex_finish_helper ()
{
return if defined $language_scratch{'lex-yacc-done'};
$language_scratch{'lex-yacc-done'} = 1;
# FIXME: for now, no line number.
require_conf_file ($configure_ac, FOREIGN, 'ylwrap');
- &define_variable ('YLWRAP', "$am_config_aux_dir/ylwrap", INTERNAL);
+ define_variable ('YLWRAP', "$am_config_aux_dir/ylwrap", INTERNAL);
}
-sub lang_yacc_finish
+sub lang_yacc_finish ()
{
return if defined $language_scratch{'yacc-done'};
$language_scratch{'yacc-done'} = 1;
@@ -5905,7 +5820,7 @@ sub lang_yacc_finish
}
-sub lang_lex_finish
+sub lang_lex_finish ()
{
return if defined $language_scratch{'lex-done'};
$language_scratch{'lex-done'} = 1;
@@ -5918,7 +5833,7 @@ sub lang_lex_finish
# precedence. This is lame, but something has to have global
# knowledge in order to eliminate the conflict. Add more linkers as
# required.
-sub resolve_linker
+sub resolve_linker (%)
{
my (%linkers) = @_;
@@ -5930,7 +5845,7 @@ sub resolve_linker
}
# Called to indicate that an extension was used.
-sub saw_extension
+sub saw_extension ($)
{
my ($ext) = @_;
$extension_seen{$ext} = 1;
@@ -5956,7 +5871,7 @@ sub register_language (%)
$option{'nodist_specific'} = 0
unless defined $option{'nodist_specific'};
- my $lang = new Language (%option);
+ my $lang = new Automake::Language (%option);
# Fill indexes.
$extension_map{$_} = $lang->name foreach @{$lang->extensions};
@@ -5982,7 +5897,7 @@ sub register_language (%)
# Update the $suffix_rule map.
foreach my $suffix (@{$lang->extensions})
{
- foreach my $dest (&{$lang->output_extensions} ($suffix))
+ foreach my $dest ($lang->output_extensions->($suffix))
{
register_suffix_rule (INTERNAL, $suffix, $dest);
}
@@ -6012,9 +5927,9 @@ sub derive_suffix ($$)
################################################################
# Pretty-print something and append to output_rules.
-sub pretty_print_rule
+sub pretty_print_rule ($$@)
{
- $output_rules .= &makefile_wrap (@_);
+ $output_rules .= makefile_wrap (shift, shift, @_);
}
@@ -6152,8 +6067,8 @@ sub cond_stack_endif ($$$)
## ------------------------ ##
-# &define_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
-# -----------------------------------------------------
+# define_pretty_variable ($VAR, $COND, $WHERE, @VALUE)
+# ----------------------------------------------------
# Like define_variable, but the value is a list, and the variable may
# be defined conditionally. The second argument is the condition
# under which the value should be defined; this should be the empty
@@ -6223,14 +6138,14 @@ sub define_compiler_variable ($)
my $libtool_tag = '';
$libtool_tag = '--tag=' . $lang->libtool_tag . ' '
if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag};
- &define_variable ($var, $value, INTERNAL);
+ define_variable ($var, $value, INTERNAL);
if (var ('LIBTOOL'))
{
my $verbose = define_verbose_libtool ();
- &define_variable ("LT$var",
- "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS)
"
- . "\$(LIBTOOLFLAGS) --mode=compile $value",
- INTERNAL);
+ define_variable ("LT$var",
+ "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS)"
+ . " \$(LIBTOOLFLAGS) --mode=compile $value",
+ INTERNAL);
}
define_verbose_tagvar ($lang->ccer || 'GEN');
}
@@ -6247,7 +6162,7 @@ sub define_linker_variable ($)
$libtool_tag = '--tag=' . $lang->libtool_tag . ' '
if $lang->libtool_tag && exists $libtool_tags{$lang->libtool_tag};
# CCLD = $(CC).
- &define_variable ($lang->lder, $lang->ld, INTERNAL);
+ define_variable ($lang->lder, $lang->ld, INTERNAL);
# CCLINK = $(CCLD) blah blah...
my $link = '';
if (var ('LIBTOOL'))
@@ -6256,9 +6171,9 @@ sub define_linker_variable ($)
$link = "\$(LIBTOOL) $verbose $libtool_tag\$(AM_LIBTOOLFLAGS) "
. "\$(LIBTOOLFLAGS) --mode=link ";
}
- &define_variable ($lang->linker, $link . $lang->link, INTERNAL);
- &define_variable ($lang->compiler, $lang);
- &define_verbose_tagvar ($lang->lder || 'GEN');
+ define_variable ($lang->linker, $link . $lang->link, INTERNAL);
+ define_variable ($lang->compiler, $lang, INTERNAL);
+ define_verbose_tagvar ($lang->lder || 'GEN');
}
sub define_per_target_linker_variable ($$)
@@ -6305,14 +6220,14 @@ sub define_per_target_linker_variable ($$)
return ($lang->linker, $lang->lder)
if $link_command eq $orig_command;
- &define_variable ("${target}_LINK", $link_command, INTERNAL);
+ define_variable ("${target}_LINK", $link_command, INTERNAL);
return ("${target}_LINK", $lang->lder);
}
################################################################
-# &check_trailing_slash ($WHERE, $LINE)
-# -------------------------------------
+# check_trailing_slash ($WHERE, $LINE)
+# ------------------------------------
# Return 1 iff $LINE ends with a slash.
# Might modify $LINE.
sub check_trailing_slash ($\$)
@@ -6330,8 +6245,8 @@ sub check_trailing_slash ($\$)
}
-# &read_am_file ($AMFILE, $WHERE)
-# -------------------------------
+# read_am_file ($AMFILE, $WHERE)
+# ------------------------------
# Read Makefile.am and set up %contents. Simultaneously copy lines
# from Makefile.am into $output_trailer, or define variables as
# appropriate. NOTE we put rules in the trailer section. We want
@@ -6585,7 +6500,7 @@ sub read_am_file ($$)
$path = $relative_dir . "/" . $path if $relative_dir ne '.';
}
$where->push_context ("'$path' included from here");
- &read_am_file ($path, $where);
+ read_am_file ($path, $where);
$where->pop_context;
}
else
@@ -6622,7 +6537,7 @@ sub read_am_file ($$)
# ----------------------------
# A helper for read_main_am_file which initializes configure variables
# and variables from header-vars.am.
-sub define_standard_variables
+sub define_standard_variables ()
{
my $saved_output_vars = $output_vars;
my ($comments, undef, $rules) =
@@ -6631,7 +6546,7 @@ sub define_standard_variables
foreach my $var (sort keys %configure_vars)
{
- &define_configure_variable ($var);
+ define_configure_variable ($var);
}
$output_vars .= $comments . $rules;
@@ -6655,10 +6570,10 @@ sub read_main_am_file ($$)
# We want to predefine as many variables as possible. This lets
# the user set them with '+=' in Makefile.am.
- &define_standard_variables;
+ define_standard_variables;
# Read user file, which might override some of our values.
- &read_am_file ($amfile, new Automake::Location);
+ read_am_file ($amfile, new Automake::Location);
}
@@ -6666,10 +6581,10 @@ sub read_main_am_file ($$)
################################################################
# $FLATTENED
-# &flatten ($STRING)
-# ------------------
+# flatten ($STRING)
+# -----------------
# Flatten the $STRING and return the result.
-sub flatten
+sub flatten ($)
{
$_ = shift;
@@ -6799,8 +6714,8 @@ sub preprocess_file ($%)
# @PARAGRAPHS
-# &make_paragraphs ($MAKEFILE, [%TRANSFORM])
-# ------------------------------------------
+# make_paragraphs ($MAKEFILE, [%TRANSFORM])
+# -----------------------------------------
# Load a $MAKEFILE, apply the %TRANSFORM, and return it as a list of
# paragraphs.
sub make_paragraphs ($%)
@@ -6845,8 +6760,8 @@ sub make_paragraphs ($%)
# ($COMMENT, $VARIABLES, $RULES)
-# &file_contents_internal ($IS_AM, $FILE, $WHERE, [%TRANSFORM])
-# -------------------------------------------------------------
+# file_contents_internal ($IS_AM, $FILE, $WHERE, [%TRANSFORM])
+# ------------------------------------------------------------
# Return contents of a file from $libdir/am, automatically skipping
# macros or rules which are already known. $IS_AM iff the caller is
# reading an Automake file (as opposed to the user's Makefile.am).
@@ -6944,7 +6859,7 @@ sub file_contents_internal ($$$%)
my ($targets, $dependencies) = ($1, $2);
# Remove the escaped new lines.
# I don't know why, but I have to use a tmp $flat_deps.
- my $flat_deps = &flatten ($dependencies);
+ my $flat_deps = flatten ($dependencies);
my @deps = split (' ', $flat_deps);
foreach (split (' ', $targets))
@@ -6968,7 +6883,7 @@ sub file_contents_internal ($$$%)
# Output only if not in FALSE.
if (defined $dependencies{$_} && $cond != FALSE)
{
- &depend ($_, @deps);
+ depend ($_, @deps);
register_action ($_, $actions);
}
else
@@ -7038,8 +6953,8 @@ sub file_contents_internal ($$$%)
# $CONTENTS
-# &file_contents ($BASENAME, $WHERE, [%TRANSFORM])
-# ------------------------------------------------
+# file_contents ($BASENAME, $WHERE, [%TRANSFORM])
+# -----------------------------------------------
# Return contents of a file from $libdir/am, automatically skipping
# macros or rules which are already known.
sub file_contents ($$%)
@@ -7053,8 +6968,8 @@ sub file_contents ($$%)
# @PREFIX
-# &am_primary_prefixes ($PRIMARY, $CAN_DIST, @PREFIXES)
-# -----------------------------------------------------
+# am_primary_prefixes ($PRIMARY, $CAN_DIST, @PREFIXES)
+# ----------------------------------------------------
# Find all variable prefixes that are used for install directories. A
# prefix 'zar' qualifies iff:
#
@@ -7143,7 +7058,7 @@ sub am_primary_prefixes ($$@)
# up into multiple functions.
#
# Usage is: am_install_var (OPTION..., file, HOW, where...)
-sub am_install_var
+sub am_install_var (@)
{
my (@args) = @_;
@@ -7247,11 +7162,12 @@ sub am_install_var
}
else
{
- # Strip any $(EXEEXT) suffix the user might have added, or this
- # will confuse &handle_source_transform and
&check_canonical_spelling.
+ # Strip any $(EXEEXT) suffix the user might have added,
+ # or this will confuse handle_source_transform() and
+ # check_canonical_spelling().
# We'll add $(EXEEXT) back later anyway.
- # Do it here rather than in handle_programs so the uniquifying at
the
- # end of this function works.
+ # Do it here rather than in handle_programs so the
+ # uniquifying at the end of this function works.
${$locvals}[1] =~ s/\$\(EXEEXT\)$//
if $primary eq 'PROGRAMS';
@@ -7295,18 +7211,17 @@ sub am_install_var
# Singular form of $PRIMARY.
(my $one_primary = $primary) =~ s/S$//;
- $output_rules .= &file_contents ($file, $where,
- PRIMARY => $primary,
- ONE_PRIMARY => $one_primary,
- DIR => $X,
- NDIR => $nodir_name,
- BASE => $strip_subdir,
-
- EXEC => $exec_p,
- INSTALL => $install_p,
- DIST => $dist_p,
- DISTVAR => $distvar,
- 'CK-OPTS' => $check_options_p);
+ $output_rules .= file_contents ($file, $where,
+ PRIMARY => $primary,
+ ONE_PRIMARY => $one_primary,
+ DIR => $X,
+ NDIR => $nodir_name,
+ BASE => $strip_subdir,
+ EXEC => $exec_p,
+ INSTALL => $install_p,
+ DIST => $dist_p,
+ DISTVAR => $distvar,
+ 'CK-OPTS' => $check_options_p);
}
# The JAVA variable is used as the name of the Java interpreter.
@@ -7349,7 +7264,7 @@ sub am_install_var
my %make_dirs = ();
my $make_dirs_set = 0;
-sub is_make_dir
+sub is_make_dir ($)
{
my ($dir) = @_;
if (! $make_dirs_set)
@@ -7400,10 +7315,10 @@ sub locate_aux_dir ()
}
-# &push_required_file ($DIR, $FILE, $FULLFILE)
-# --------------------------------------------------
+# push_required_file ($DIR, $FILE, $FULLFILE)
+# -------------------------------------------------
# Push the given file onto DIST_COMMON.
-sub push_required_file
+sub push_required_file ($$$)
{
my ($dir, $file, $fullfile) = @_;
@@ -7437,7 +7352,7 @@ sub push_required_file
$am_config_libobj_dir =~ s|/*$||;
push_dist_common ("$am_config_libobj_dir/$file");
}
- elsif ($relative_dir eq '.' && ! &is_make_dir ($dir))
+ elsif ($relative_dir eq '.' && ! is_make_dir ($dir))
{
# If we are doing the topmost directory, and the file is in a
# subdir which does not have a Makefile, then we distribute it
@@ -7487,8 +7402,8 @@ sub push_required_file
# than once.
my %required_file_not_found = ();
-# &required_file_check_or_copy ($WHERE, $DIRECTORY, $FILE)
-# --------------------------------------------------------
+# required_file_check_or_copy ($WHERE, $DIRECTORY, $FILE)
+# -------------------------------------------------------
# Verify that the file must exist in $DIRECTORY, or install it.
sub required_file_check_or_copy ($$$)
{
@@ -7596,8 +7511,8 @@ sub required_file_check_or_copy ($$$)
}
-# &require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, $QUEUE, @FILES)
-# ----------------------------------------------------------------------
+# require_file_internal ($WHERE, $MYSTRICT, $DIRECTORY, $QUEUE, @FILES)
+# ---------------------------------------------------------------------
# Verify that the file must exist in $DIRECTORY, or install it.
# $MYSTRICT is the strictness level at which this file becomes required.
# Worker threads may queue up the action to be serialized by the master,
@@ -7625,16 +7540,16 @@ sub require_file_internal ($$$@)
}
}
-# &require_file ($WHERE, $MYSTRICT, @FILES)
-# -----------------------------------------
+# require_file ($WHERE, $MYSTRICT, @FILES)
+# ----------------------------------------
sub require_file ($$@)
{
my ($where, $mystrict, @files) = @_;
require_file_internal ($where, $mystrict, $relative_dir, 0, @files);
}
-# &require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
-# -----------------------------------------------------------
+# require_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
+# ----------------------------------------------------------
sub require_file_with_macro ($$$@)
{
my ($cond, $macro, $mystrict, @files) = @_;
@@ -7642,8 +7557,8 @@ sub require_file_with_macro ($$$@)
require_file ($macro->rdef ($cond)->location, $mystrict, @files);
}
-# &require_libsource_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
-# ----------------------------------------------------------------
+# require_libsource_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
+# ---------------------------------------------------------------
# Require an AC_LIBSOURCEd file. If AC_CONFIG_LIBOBJ_DIR was called, it
# must be in that directory. Otherwise expect it in the current directory.
sub require_libsource_with_macro ($$$@)
@@ -7661,9 +7576,9 @@ sub require_libsource_with_macro ($$$@)
}
}
-# &queue_required_file_check_or_copy ($QUEUE, $KEY, $DIR, $WHERE,
+# queue_required_file_check_or_copy ($QUEUE, $KEY, $DIR, $WHERE,
# $MYSTRICT, @FILES)
-# ---------------------------------------------------------------
+# --------------------------------------------------------------
sub queue_required_file_check_or_copy ($$$$@)
{
my ($queue, $key, $dir, $where, $mystrict, @files) = @_;
@@ -7679,8 +7594,8 @@ sub queue_required_file_check_or_copy ($$$$@)
$queue->enqueue ($key, $dir, @serial_loc, $mystrict, 0 + @files, @files);
}
-# &require_queued_file_check_or_copy ($QUEUE)
-# -------------------------------------------
+# require_queued_file_check_or_copy ($QUEUE)
+# ------------------------------------------
sub require_queued_file_check_or_copy ($)
{
my ($queue) = @_;
@@ -7712,8 +7627,8 @@ sub require_queued_file_check_or_copy ($)
}
}
-# &require_conf_file ($WHERE, $MYSTRICT, @FILES)
-# ----------------------------------------------
+# require_conf_file ($WHERE, $MYSTRICT, @FILES)
+# ---------------------------------------------
# Looks in configuration path, as specified by AC_CONFIG_AUX_DIR.
sub require_conf_file ($$@)
{
@@ -7724,8 +7639,8 @@ sub require_conf_file ($$@)
}
-# &require_conf_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
-# ----------------------------------------------------------------
+# require_conf_file_with_macro ($COND, $MACRO, $MYSTRICT, @FILES)
+# ---------------------------------------------------------------
sub require_conf_file_with_macro ($$$@)
{
my ($cond, $macro, $mystrict, @files) = @_;
@@ -7735,8 +7650,8 @@ sub require_conf_file_with_macro ($$$@)
################################################################
-# &require_build_directory ($DIRECTORY)
-# -------------------------------------
+# require_build_directory ($DIRECTORY)
+# ------------------------------------
# Emit rules to create $DIRECTORY if needed, and return
# the file that any target requiring this directory should be made
# dependent upon.
@@ -7776,8 +7691,8 @@ sub require_build_directory ($)
return $dirstamp;
}
-# &require_build_directory_maybe ($FILE)
-# --------------------------------------
+# require_build_directory_maybe ($FILE)
+# -------------------------------------
# If $FILE lies in a subdirectory, emit a rule to create this
# directory and return the file that $FILE should be made
# dependent upon. Otherwise, just return the empty string.
@@ -7799,7 +7714,7 @@ sub require_build_directory_maybe ($)
################################################################
# Push a list of files onto dist_common.
-sub push_dist_common
+sub push_dist_common (@)
{
prog_error "push_dist_common run after handle_dist"
if $handle_dist_run;
@@ -7829,8 +7744,8 @@ sub generate_makefile ($$)
# $OUTPUT is encoded. If it contains a ":" then the first element
# is the real output file, and all remaining elements are input
# files. We don't scan or otherwise deal with these input files,
- # other than to mark them as dependencies. See
- # &scan_autoconf_files for details.
+ # other than to mark them as dependencies. See the subroutine
+ # 'scan_autoconf_files' for details.
my ($makefile, @inputs) = split (/:/, $output_files{$makefile_in});
$relative_dir = dirname ($makefile);
@@ -7886,9 +7801,9 @@ sub generate_makefile ($$)
handle_silent;
- # These must be run after all the sources are scanned. They
- # use variables defined by &handle_libraries, &handle_ltlibraries,
- # or &handle_programs.
+ # These must be run after all the sources are scanned. They use
+ # variables defined by handle_libraries(), handle_ltlibraries(),
+ # or handle_programs().
handle_compile;
handle_languages;
handle_libtool;
@@ -7999,6 +7914,9 @@ sub generate_makefile ($$)
# Helper function for usage().
sub print_autodist_files (@)
{
+ # NOTE: we need to call our 'uniq' function with the leading '&'
+ # here, because otherwise perl complains that "Unquoted string
+ # 'uniq' may clash with future reserved word".
my @lcomm = sort (&uniq (@_));
my @four;
@@ -8091,8 +8009,8 @@ General help using GNU software:
<http://www.gnu.org/gethelp/>.
}
-# &version ()
-# -----------
+# version ()
+# ----------
# Print version information
sub version ()
{
@@ -8146,7 +8064,7 @@ sub parse_arguments ()
set_global_option ('no-dependencies', $cli_where) if $ignore_deps;
for my $warning (@warnings)
{
- &parse_warnings ('-W', $warning);
+ parse_warnings ('-W', $warning);
}
return unless @ARGV;
@@ -8214,7 +8132,7 @@ sub handle_makefiles_serial ()
# get_number_of_threads ()
# ------------------------
# Logic for deciding how many worker threads to use.
-sub get_number_of_threads
+sub get_number_of_threads ()
{
my $nthreads = $ENV{'AUTOMAKE_JOBS'} || 0;
diff --git a/bootstrap.sh b/bootstrap.sh
index 93bf3fd..541280e 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -95,14 +95,15 @@ dosubst ()
dosubst automake-$APIVERSION/Automake/Config.in \
automake-$APIVERSION/Automake/Config.pm
-# Create temporary replacement for aclocal.
-dosubst aclocal.in aclocal.tmp
-
# Overwrite amversion.m4.
dosubst m4/amversion.in m4/amversion.m4
-# Create temporary replacement for automake.
-dosubst automake.in automake.tmp
+# Create temporary replacement for aclocal and automake.
+for p in aclocal automake; do
+ dosubst $p.in $p.tmp
+ $PERL -w lib/gen-perl-protos $p.tmp > $p.tmp2
+ mv -f $p.tmp2 $p.tmp
+done
# Create required makefile snippets.
$PERL ./gen-testsuite-part > t/testsuite-part.tmp
diff --git a/lib/Automake/Language.pm b/lib/Automake/Language.pm
new file mode 100644
index 0000000..a678e1e
--- /dev/null
+++ b/lib/Automake/Language.pm
@@ -0,0 +1,122 @@
+# Copyright (C) 2013 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, see <http://www.gnu.org/licenses/>.
+
+package Automake::Language;
+
+use 5.006;
+use strict;
+
+use Class::Struct ();
+Class::Struct::struct (
+ # Short name of the language (c, f77...).
+ 'name' => "\$",
+ # Nice name of the language (C, Fortran 77...).
+ 'Name' => "\$",
+
+ # List of configure variables which must be defined.
+ 'config_vars' => '@',
+
+ # 'pure' is '1' or ''. A 'pure' language is one where, if
+ # all the files in a directory are of that language, then we
+ # do not require the C compiler or any code to call it.
+ 'pure' => "\$",
+
+ 'autodep' => "\$",
+
+ # Name of the compiling variable (COMPILE).
+ 'compiler' => "\$",
+ # Content of the compiling variable.
+ 'compile' => "\$",
+ # Flag to require compilation without linking (-c).
+ 'compile_flag' => "\$",
+ 'extensions' => '@',
+ # A subroutine to compute a list of possible extensions of
+ # the product given the input extensions.
+ # (defaults to a subroutine which returns ('.$(OBJEXT)', '.lo'))
+ 'output_extensions' => "\$",
+ # A list of flag variables used in 'compile'.
+ # (defaults to [])
+ 'flags' => "@",
+
+ # Any tag to pass to libtool while compiling.
+ 'libtool_tag' => "\$",
+
+ # The file to use when generating rules for this language.
+ # The default is 'depend2'.
+ 'rule_file' => "\$",
+
+ # Name of the linking variable (LINK).
+ 'linker' => "\$",
+ # Content of the linking variable.
+ 'link' => "\$",
+
+ # Name of the compiler variable (CC).
+ 'ccer' => "\$",
+
+ # Name of the linker variable (LD).
+ 'lder' => "\$",
+ # Content of the linker variable ($(CC)).
+ 'ld' => "\$",
+
+ # Flag to specify the output file (-o).
+ 'output_flag' => "\$",
+ '_finish' => "\$",
+
+ # This is a subroutine which is called whenever we finally
+ # determine the context in which a source file will be
+ # compiled.
+ '_target_hook' => "\$",
+
+ # If TRUE, nodist_ sources will be compiled using specific rules
+ # (i.e. not inference rules). The default is FALSE.
+ 'nodist_specific' => "\$");
+
+
+sub finish ($)
+{
+ my ($self) = @_;
+ if (defined $self->_finish)
+ {
+ &{$self->_finish} (@_);
+ }
+}
+
+sub target_hook ($$$$%)
+{
+ my ($self) = @_;
+ if (defined $self->_target_hook)
+ {
+ $self->_target_hook->(@_);
+ }
+}
+
+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:
diff --git a/lib/gen-perl-protos b/lib/gen-perl-protos
new file mode 100755
index 0000000..9e73d8d
--- /dev/null
+++ b/lib/gen-perl-protos
@@ -0,0 +1,36 @@
+#!/usr/bin/env perl
+#
+# Copyright (C) 2013 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 3, 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, see <http://www.gnu.org/licenses/>.
+
+use warnings;
+use strict;
+
+my @lines = <>;
+my @protos = map { /^(sub \w+\s*\(.*\))/ ? ("$1;") : () } @lines;
+
+while (defined ($_ = shift @lines))
+ {
+ if (/^#!.* prototypes/i)
+ {
+ print "# BEGIN AUTOMATICALLY GENERATED PROTOTYPES\n";
+ print join ("\n", sort @protos) . "\n";
+ print "# END AUTOMATICALLY GENERATED PROTOTYPES\n";
+ }
+ else
+ {
+ print;
+ }
+ }
diff --git a/maintainer/syntax-checks.mk b/maintainer/syntax-checks.mk
index e7e2fc0..878789f 100644
--- a/maintainer/syntax-checks.mk
+++ b/maintainer/syntax-checks.mk
@@ -86,19 +86,22 @@ sc_at_in_texi
automake_diff_no = 8
aclocal_diff_no = 9
sc_diff_automake sc_diff_aclocal: sc_diff_% :
- @set +e; tmp=$*-diffs.tmp; \
- diff -u $(srcdir)/$*.in $* > $$tmp; test $$? -eq 1 || exit 1; \
- added=`grep -v '^+++ ' $$tmp | grep -c '^+'` || exit 1; \
- removed=`grep -v '^--- ' $$tmp | grep -c '^-'` || exit 1; \
- test $$added,$$removed = $($*_diff_no),$($*_diff_no) \
+ @set +e; \
+ in=$*-in.tmp out=$*-out.tmp diffs=$*-diffs.tmp \
+ && sed '/^#!.*[pP]rototypes/d' $(srcdir)/$*.in > $$in \
+ && sed '/^# BEGIN.* PROTO/,/^# END.* PROTO/d' $* > $$out \
+ && { diff -u $$in $$out > $$diffs; test $$? -eq 1; } \
+ && added=`grep -v '^+++ ' $$diffs | grep -c '^+'` \
+ && removed=`grep -v '^--- ' $$diffs | grep -c '^-'` \
+ && test $$added,$$removed = $($*_diff_no),$($*_diff_no) \
|| { \
echo "Found unexpected diffs between $*.in and $*"; \
echo "Lines added: $$added" ; \
echo "Lines removed: $$removed"; \
- cat $$tmp >&2; \
+ cat $$diffs; \
exit 1; \
- } >&1; \
- rm -f $$tmp
+ } >&2; \
+ rm -f $$in $$out $$diffs
## Expect no instances of '${...}'. However, $${...} is ok, since that
## is a shell construct, not a Makefile construct.
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.13.1b-84-g9829cf2,
Stefano Lattarini <=