if 0;
# automake - create Makefile.in from Makefile.am
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-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
BEGIN
{
- my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
- unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+ @Automake::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
+ unless @Automake::perl_libdirs;
+ unshift @INC, @Automake::perl_libdirs;
# Override SHELL. This is required on DJGPP so that system() uses
# bash, not COMMAND.COM which doesn't quote arguments properly.
(qw(ABOUT-GNU ABOUT-NLS AUTHORS BACKLOG COPYING COPYING.DOC COPYING.LIB
COPYING.LESSER ChangeLog INSTALL NEWS README THANKS TODO
ar-lib compile config.guess config.rpath
- config.sub depcomp elisp-comp install-sh libversion.in mdate-sh
+ config.sub depcomp install-sh libversion.in mdate-sh
missing mkinstalldirs py-compile texinfo.tex ylwrap),
@libtool_files, @libtool_sometimes);
# Files found by scanning configure.ac for LIBOBJS.
my %libsources = ();
-# Names used in AC_CONFIG_HEADER call.
+# Names used in AC_CONFIG_HEADERS call.
my @config_headers = ();
# Names used in AC_CONFIG_LINKS call.
# List of files in AC_CONFIG_FILES/AC_OUTPUT without Makefile.am's,
# and their outputs.
my @other_input_files = ();
-# Where each AC_CONFIG_FILES/AC_OUTPUT/AC_CONFIG_LINK/AC_CONFIG_HEADER appears.
-# The keys are the files created by these macros.
+# Where each AC_CONFIG_FILES/AC_OUTPUT/AC_CONFIG_LINK/AC_CONFIG_HEADERS
+# appears. The keys are the files created by these macros.
my %ac_config_files_location = ();
# The condition under which AC_CONFIG_FOOS appears.
my %ac_config_files_condition = ();
# Whether AM_GNU_GETTEXT_INTL_SUBDIR has been seen.
my $seen_gettext_intl = 0;
+# The arguments of the AM_EXTRA_RECURSIVE_TARGETS call (if any).
+my @extra_recursive_targets = ();
+
# Lists of tags supported by Libtool.
my %libtool_tags = ();
# 1 if Libtool uses LT_SUPPORTED_TAG. If it does, then it also
'install-ps-am' => 1,
'install-info-am' => 1,
'installcheck-am' => 1,
- 'uninstall-am' => 1,
-
- 'install-man' => 1,
+ 'uninstall-am' => 1,
+ 'tags-am' => 1,
+ 'ctags-am' => 1,
+ 'cscopelist-am' => 1,
+ 'install-man' => 1,
);
# Queue to push require_conf_file requirements to.
################################################################
-# 'silent-rules' mode handling functions.
+# Silent rules handling functions.
# verbose_var (NAME)
# ------------------
-# The public variable stem used to implement 'silent-rules'.
+# The public variable stem used to implement silent rules.
sub verbose_var ($)
{
my ($name) = @_;
# verbose_private_var (NAME)
# --------------------------
-# The naming policy for the private variables for 'silent-rules'.
+# The naming policy for the private variables for silent rules.
sub verbose_private_var ($)
{
my ($name) = @_;
# define_verbose_var (NAME, VAL-IF-SILENT, [VAL-IF-VERBOSE])
# ----------------------------------------------------------
-# For 'silent-rules' mode, setup VAR and dispatcher, to expand to
-# VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to empty)
-# if not.
+# For silent rules, setup VAR and dispatcher, to expand to
+# VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to
+# empty) if not.
sub define_verbose_var ($$;$)
{
my ($name, $silent_val, $verbose_val) = @_;
my $pvar = verbose_private_var ($name);
my $silent_var = $pvar . '_0';
my $verbose_var = $pvar . '_1';
- if (option 'silent-rules')
- {
- # For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V)
- # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY).
- # For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead.
- # See AM_SILENT_RULES in m4/silent.m4.
- define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
- define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)', INTERNAL);
- Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE,
- $silent_val, '', INTERNAL, VAR_ASIS)
- if (! vardef ($silent_var, TRUE));
- Automake::Variable::define ($verbose_var, VAR_AUTOMAKE, '', TRUE,
- $verbose_val, '', INTERNAL, VAR_ASIS)
- if (! vardef ($verbose_var, TRUE));
-}
+ # For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V)
+ # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY).
+ # For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead.
+ # See AM_SILENT_RULES in m4/silent.m4.
+ define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
+ define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)',
+ INTERNAL);
+ Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE,
+ $silent_val, '', INTERNAL, VAR_ASIS)
+ if (! vardef ($silent_var, TRUE));
+ Automake::Variable::define ($verbose_var, VAR_AUTOMAKE, '', TRUE,
+ $verbose_val, '', INTERNAL, VAR_ASIS)
+ if (! vardef ($verbose_var, TRUE));
}
# Above should not be needed in the general automake code.
sub verbose_flag ($)
{
my ($name) = @_;
- return '$(' . verbose_var ($name) . ')'
- if (option 'silent-rules');
- return '';
+ return '$(' . verbose_var ($name) . ')';
}
sub verbose_nodep_flag ($)
{
my ($name) = @_;
- return '$(' . verbose_var ($name) . subst ('am__nodep') . ')'
- if (option 'silent-rules');
- return '';
+ return '$(' . verbose_var ($name) . subst ('am__nodep') . ')';
}
# silent_flag
# define_verbose_tagvar (NAME)
# ----------------------------
-# Engage the needed 'silent-rules' machinery for tag NAME.
+# Engage the needed silent rules machinery for tag NAME.
sub define_verbose_tagvar ($)
{
my ($name) = @_;
- if (option 'silent-rules')
- {
- define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;');
- }
+ define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;');
}
# define_verbose_texinfo
# ----------------------
-# Engage the needed 'silent-rules' machinery for assorted texinfo commands.
+# Engage the needed silent rules machinery for assorted texinfo commands.
sub define_verbose_texinfo ()
{
my @tagvars = ('DVIPS', 'MAKEINFO', 'INFOHTML', 'TEXI2DVI', 'TEXI2PDF');
# define_verbose_libtool
# ----------------------
-# Engage the needed 'silent-rules' machinery for 'libtool --silent'.
+# Engage the needed silent rules machinery for 'libtool --silent'.
sub define_verbose_libtool ()
{
define_verbose_var ('lt', '--silent');
sub handle_silent ()
{
- return unless option 'silent-rules';
# Define "$(AM_V_P)", expanding to a shell conditional that can be
# used in make recipes to determine whether we are being run in
# silent mode or not. The choice of the name derives from the LISP
# also "the '-P' convention" in the Jargon File); we do so for lack
# of a better convention.
define_verbose_var ('P', 'false', ':');
- # *Always* provide the user with 'AM_V_GEN' for 'silent-rules' mode.
+ # *Always* provide the user with '$(AM_V_GEN)', unconditionally.
define_verbose_tagvar ('GEN');
define_verbose_var ('at', '@');
}
return 1 if process_option_list (@options);
}
- # Override portability-recursive warning.
- switch_warning ('no-portability-recursive')
- if option 'silent-rules';
-
if ($strictness == GNITS)
{
set_option ('readme-alpha', INTERNAL);
{
# Include auto-dep code. Don't include it if DEP_FILES would
# be empty.
- if (&saw_sources_p (0) && keys %dep_files)
+ if (keys %extension_seen && keys %dep_files)
{
# Set location of depcomp.
&define_variable ('depcomp',
# generates another source file which we must then process
# further.
my $subr = \&{'lang_' . $lang->name . '_rewrite'};
+ defined &$subr or $subr = \&lang_sub_obj;
my ($r, $source_extension)
= &$subr ($directory, $base, $extension,
$obj, $have_per_exec_flags, $var);
msg_var ('unsupported', $ext_var, $ext_var->name . " can assume at most one value")
if $default_source_ext =~ /[\t ]/;
(my $default_source = $unxformed) =~ s,(\.[^./\\]*)?$,$default_source_ext,;
+ # TODO: Remove this backward-compatibility hack in Automake 2.0.
if ($old_default_source ne $default_source
&& !$ext_var
&& (rule $old_default_source
my($xlink, $vlink) = &define_per_target_linker_variable ($linker, $xname);
$vlink = verbose_flag ($vlink || 'GEN');
- # If the resulting program lies into a subdirectory,
- # make sure this directory will exist.
+ # If the resulting program lies in a subdirectory,
+ # ensure that the directory exists before we need it.
my $dirstamp = require_build_directory_maybe ($one_file);
$libtool_clean_directories{dirname ($one_file)} = 1;
&handle_source_transform ($xlib, $onelib, $obj, $where,
NONLIBTOOL => 1, LIBTOOL => 0);
- # If the resulting library lies into a subdirectory,
+ # If the resulting library lies in a subdirectory,
# make sure this directory will exist.
my $dirstamp = require_build_directory_maybe ($onelib);
my $verbose = verbose_flag ('AR');
}
}
- # If the resulting library lies into a subdirectory,
+ # If the resulting library lies in a subdirectory,
# make sure this directory will exist.
my $dirstamp = require_build_directory_maybe ($onelib);
## Handling Texinfo files. ##
## ------------------------ ##
-# ($OUTFILE, $VFILE, @CLEAN_FILES)
+# ($OUTFILE, $VFILE)
# &scan_texinfo_file ($FILENAME)
# ------------------------------
# $OUTFILE - name of the info file produced by $FILENAME.
# $VFILE - name of the version.texi file used (undef if none).
-# @CLEAN_FILES - list of byproducts (indexes etc.)
sub scan_texinfo_file ($)
{
my ($filename) = @_;
- # Some of the following extensions are always created, no matter
- # whether indexes are used or not. Other (like cps, fns, ... pgs)
- # are only created when they are used. We used to scan $FILENAME
- # for their use, but that is not enough: they could be used in
- # included files. We can't scan included files because we don't
- # know the include path. Therefore we always erase these files, no
- # matter whether they are used or not.
- #
- # (tmp is only created if an @macro is used and a certain e-TeX
- # feature is not available.)
- my %clean_suffixes =
- map { $_ => 1 } (qw(aux log toc tmp
- cp cps
- fn fns
- ky kys
- vr vrs
- tp tps
- pg pgs)); # grep 'new.*index' texinfo.tex
-
my $texi = new Automake::XFile "< $filename";
verb "reading $filename";
next if $outfile;
$outfile = $1;
- if ($outfile =~ /\.([^.]+)$/ && $1 ne 'info')
+ if (index ($outfile, '.') < 0)
+ {
+ msg 'obsolete', "$filename:$.",
+ "use of suffix-less info files is discouraged"
+ }
+ elsif ($outfile !~ /\.info$/)
{
error ("$filename:$.",
"output '$outfile' has unrecognized extension");
{
$vfile = $1;
}
-
- # Try to find new or unused indexes.
-
- # Creating a new category of index.
- elsif (/^\@def(code)?index (\w+)/)
- {
- $clean_suffixes{$2} = 1;
- $clean_suffixes{"$2s"} = 1;
- }
-
- # Merging an index into an another.
- elsif (/^\@syn(code)?index (\w+) (\w+)/)
- {
- delete $clean_suffixes{"$2s"};
- $clean_suffixes{"$3s"} = 1;
- }
-
}
if (! $outfile)
return;
}
- my $infobase = basename ($filename);
- $infobase =~ s/\.te?xi(nfo)?$//;
- return ($outfile, $vfile,
- map { "$infobase.$_" } (sort keys %clean_suffixes));
+ return ($outfile, $vfile);
}
# extension).
my $generic_info = ($generic && $dsfx) ? 1 : 0;
- # If the resulting file lie into a subdirectory,
+ # If the resulting file lies in a subdirectory,
# make sure this directory will exist.
my $dirstamp = require_build_directory_maybe ($dest);
($info_texinfos->value_as_list_recursive (inner_expand => 1))
{
my $infobase = $texi;
- $infobase =~ s/\.(txi|texinfo|texi)$//;
-
- if ($infobase eq $texi)
+ if ($infobase =~ s/\.texi$//)
+ {
+ 1; # Nothing more to do.
+ }
+ elsif ($infobase =~ s/\.(txi|texinfo)$//)
+ {
+ msg_var 'obsolete', $info_texinfos,
+ "suffix '.$1' for Texinfo files is discouraged;" .
+ " use '.texi' instead";
+ }
+ else
{
# FIXME: report line number.
err_am "texinfo file '$texi' has unrecognized extension";
# If 'version.texi' is referenced by input file, then include
# automatic versioning capability.
- my ($out_file, $vtexi, @clean_files) =
+ my ($out_file, $vtexi) =
scan_texinfo_file ("$relative_dir/$texi")
or next;
- push (@mostly_cleans, @clean_files);
+ # Directory of auxiliary files and build by-products used by texi2dvi
+ # and texi2pdf.
+ push @mostly_cleans, "$infobase.t2d";
+ push @mostly_cleans, "$infobase.t2p";
# If the Texinfo source is in a subdirectory, create the
# resulting info in this subdirectory. If it is in the current
$texinfodir = ('$(srcdir)/'
. dirname (variable_value ('TEXINFO_TEX')));
}
- elsif (option 'cygnus')
- {
- $texinfodir = '$(top_srcdir)/../texinfo';
- define_variable ('TEXINFO_TEX', "$texinfodir/texinfo.tex", INTERNAL);
- }
elsif ($config_aux_dir_set_in_configure_ac)
{
$texinfodir = $am_config_aux_dir;
# Handle TAGS.
sub handle_tags
{
- my @tag_deps = ();
- my @ctag_deps = ();
- my @cscope_deps = ();
- if (var ('SUBDIRS'))
- {
- $output_rules .= ("tags-recursive:\n"
- . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n"
- # Never fail here if a subdir fails; it
- # isn't important.
- . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
- . " && \$(MAKE) \$(AM_MAKEFLAGS) tags); \\\n"
- . "\tdone\n");
- push (@tag_deps, 'tags-recursive');
- &depend ('.PHONY', 'tags-recursive');
- &depend ('.MAKE', 'tags-recursive');
-
- $output_rules .= ("ctags-recursive:\n"
- . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n"
- # Never fail here if a subdir fails; it
- # isn't important.
- . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
- . " && \$(MAKE) \$(AM_MAKEFLAGS) ctags); \\\n"
- . "\tdone\n");
- push (@ctag_deps, 'ctags-recursive');
- &depend ('.PHONY', 'ctags-recursive');
- &depend ('.MAKE', 'ctags-recursive');
-
- $output_rules .= ("cscopelist-recursive:\n"
- . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n"
- # Never fail here if a subdir fails; it
- # isn't important.
- . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
- . " && \$(MAKE) \$(AM_MAKEFLAGS) cscopelist); \\\n"
- . "\tdone\n");
- push (@cscope_deps, 'cscopelist-recursive');
- &depend ('.PHONY', 'cscopelist-recursive');
- &depend ('.MAKE', 'cscopelist-recursive');
- }
-
- if (&saw_sources_p (1)
- || var ('ETAGS_ARGS')
- || @tag_deps)
- {
- my @config;
- foreach my $spec (@config_headers)
- {
- my ($out, @ins) = split_config_file_spec ($spec);
- foreach my $in (@ins)
- {
- # If the config header source is in this directory,
- # require it.
- push @config, basename ($in)
- if $relative_dir eq dirname ($in);
- }
- }
- $output_rules .= &file_contents ('tags',
- new Automake::Location,
- CONFIG => "@config",
- TAGSDIRS => "@tag_deps",
- CTAGSDIRS => "@ctag_deps",
- CSCOPEDIRS => "@cscope_deps");
+ my @config;
+ foreach my $spec (@config_headers)
+ {
+ my ($out, @ins) = split_config_file_spec ($spec);
+ foreach my $in (@ins)
+ {
+ # If the config header source is in this directory,
+ # require it.
+ push @config, basename ($in)
+ if $relative_dir eq dirname ($in);
+ }
+ }
+
+ define_variable ('am__tagged_files',
+ '$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)'
+ . "@config", INTERNAL);
+ if (rvar('am__tagged_files')->value_as_list_recursive
+ || var ('ETAGS_ARGS') || var ('SUBDIRS'))
+ {
+ $output_rules .= &file_contents ('tags', new Automake::Location);
set_seen 'TAGS_DEPENDENCIES';
- }
- elsif (reject_var ('TAGS_DEPENDENCIES',
- "it doesn't make sense to define 'TAGS_DEPENDENCIES'"
- . " without\nsources or 'ETAGS_ARGS'"))
- {
- }
+ }
else
- {
+ {
+ reject_var ('TAGS_DEPENDENCIES',
+ "it doesn't make sense to define 'TAGS_DEPENDENCIES'"
+ . " without\nsources or 'ETAGS_ARGS'");
# Every Makefile must define some sort of TAGS rule.
# Otherwise, it would be possible for a top-level "make TAGS"
- # to fail because some subdirectory failed.
- $output_rules .= "tags: TAGS\nTAGS:\n\n";
- # Ditto ctags and cscope.
- $output_rules .= "ctags: CTAGS\nCTAGS:\n\n";
- $output_rules .= "cscope cscopelist:\n\n";
- }
+ # to fail because some subdirectory failed. Ditto ctags and
+ # cscope.
+ $output_rules .=
+ "tags TAGS:\n\n" .
+ "ctags CTAGS:\n\n" .
+ "cscope cscopelist:\n\n";
+ }
}
}
-# $BOOLEAN
-# &for_dist_common ($A, $B)
-# -------------------------
-# Subroutine for &handle_dist: sort files to dist.
-#
-# We put README first because it then becomes easier to make a
-# Usenet-compliant shar file (in these, README must be first).
-#
-# FIXME: do more ordering of files here.
-sub for_dist_common
-{
- return 0
- if $a eq $b;
- return -1
- if $a eq 'README';
- return 1
- if $b eq 'README';
- return $a cmp $b;
-}
-
# handle_dist
# -----------
# Handle 'dist' target.
# 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 (sort for_dist_common (@dist_common));
+ @dist_common = uniq @dist_common;
variable_delete 'DIST_COMMON';
define_pretty_variable ('DIST_COMMON', TRUE, INTERNAL, @dist_common);
define_pretty_variable ('am__configure_deps', TRUE, INTERNAL,
@configuredeps);
- my $automake_options = '--' . (global_option 'cygnus' ? 'cygnus' : $strictness_name)
- . (global_option 'no-dependencies' ? ' --ignore-deps' : '');
+ my $automake_options = '--' . $strictness_name .
+ (global_option 'no-dependencies' ? ' --ignore-deps' : '');
$output_rules .= file_contents
('configure',
file_contents ('remake-hdr',
new Automake::Location,
FILES => "@files",
+ 'FIRST-HDR' => ($hdr_index == 1),
CONFIG_H => $cn_sans_dir,
CONFIG_HIN => $ins[0],
CONFIG_H_DEPS => "@ins",
# Distribute and define mkinstalldirs only if it is already present
# in the package, for backward compatibility (some people may still
# use $(mkinstalldirs)).
+ # TODO: start warning about this in Automake 1.14, and have
+ # TODO: Automake 2.0 drop it (and the mkinstalldirs script
+ # TODO: as well).
my $mkidpath = "$config_aux_dir/mkinstalldirs";
if (-f $mkidpath)
{
}
}
+# Generate helper targets for user recursion, where needed.
+sub handle_user_recursion ()
+{
+ return unless @extra_recursive_targets;
+
+ define_pretty_variable ('am__extra_recursive_targets', TRUE, INTERNAL,
+ map { "$_-recursive" } @extra_recursive_targets);
+ my $aux = var ('SUBDIRS') ? 'recursive' : 'am';
+ foreach my $target (@extra_recursive_targets)
+ {
+ # This allows the default target's rules to be overridden in
+ # Makefile.am.
+ user_phony_rule ($target);
+ depend ("$target", "$target-$aux");
+ depend ("$target-am", "$target-local");
+ # Every user-defined recursive target 'foo' *must* have a valid
+ # 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:");
+ # $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");
+ }
+}
+
# &do_check_merge_target ()
# -------------------------
push @check_tests, 'check-local'
if user_phony_rule 'check-local';
- # In --cygnus mode, check doesn't depend on all.
- if (option 'cygnus')
- {
- # Just run the local check rules.
- pretty_print_rule ('check-am:', "\t\t", @check);
- }
- else
+ # The check target must depend on the local equivalent of
+ # 'all', to ensure all the primary targets are built. Then it
+ # must build the local check rules.
+ $output_rules .= "check-am: all-am\n";
+ if (@check)
{
- # The check target must depend on the local equivalent of
- # 'all', to ensure all the primary targets are built. Then it
- # must build the local check rules.
- $output_rules .= "check-am: all-am\n";
- if (@check)
- {
- pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ",
- @check);
- depend ('.MAKE', 'check-am');
- }
+ pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ", @check);
+ depend ('.MAKE', 'check-am');
}
+
if (@check_tests)
{
pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ",
sub handle_per_suffix_test
{
my ($test_suffix, %transform) = @_;
- my ($pfx, $generic, $parallel_tests_option, $am_exeext);
- prog_error ("called with 'parallel-tests' option not set")
- unless $parallel_tests_option = option 'parallel-tests';
+ my ($pfx, $generic, $am_exeext);
if ($test_suffix eq '')
{
$pfx = '';
: 'FALSE';
}
# The "test driver" program, deputed to handle tests protocol used by
- # test scripts. By default, it's assumed that no protocol is used,
- # so we fall back to the old "parallel-tests" behaviour, implemented
- # by the 'test-driver' auxiliary script.
+ # test scripts. By default, it's assumed that no protocol is used, so
+ # we fall back to the old behaviour, implemented by the 'test-driver'
+ # auxiliary script.
if (! var "${pfx}LOG_DRIVER")
{
- require_conf_file ($parallel_tests_option->{position}, FOREIGN,
- 'test-driver');
+ require_conf_file ("parallel-tests", FOREIGN, 'test-driver');
define_variable ("${pfx}LOG_DRIVER",
"\$(SHELL) $am_config_aux_dir/test-driver",
INTERNAL);
push (@check_tests, 'check-TESTS');
my $check_deps = "@check";
$output_rules .= &file_contents ('check', new Automake::Location,
- COLOR => !! option 'color-tests',
- PARALLEL_TESTS => !! option 'parallel-tests',
+ SERIAL_TESTS => !! option 'serial-tests',
CHECK_DEPS => $check_deps);
# Tests that are known programs should have $(EXEEXT) appended.
append_exeext { exists $known_programs{$_[0]} } 'XFAIL_TESTS'
if (var ('XFAIL_TESTS'));
- if (my $parallel_tests = option 'parallel-tests')
+ if (! option 'serial-tests')
{
define_variable ('TEST_SUITE_LOG', 'test-suite.log', INTERNAL);
my $suff = '.test';
if ($val =~ /(\$\((top_)?srcdir\))\//o)
{
msg ('error', $subvar->rdef ($cond)->location,
- "parallel-tests: using '$1' in TESTS is currently broken: '$val'");
+ "using '$1' in TESTS is currently broken: '$val'");
}
foreach my $test_suffix (@test_suffixes)
require_variables ($elfiles[0][0], "Emacs Lisp sources seen", TRUE,
'EMACS', 'lispdir');
- require_conf_file ($elfiles[0][0], FOREIGN, 'elisp-comp');
- &define_variable ('elisp_comp', "$am_config_aux_dir/elisp-comp", INTERNAL);
}
# Handle Python
# Handle $local:$input syntax.
my ($local, @rest) = split (/:/);
@rest = ("$local.in",) unless @rest;
- # Keep in sync with 'conffile-leading-dot.test'.
+ # Keep in sync with test 'conffile-leading-dot.sh'.
msg ('unsupported', $where,
"omit leading './' from config file names such as '$local';"
. "\nremake rules might be subtly broken otherwise")
AC_REQUIRE_AUX_FILE => 1,
AC_SUBST_TRACE => 1,
AM_AUTOMAKE_VERSION => 1,
- AM_PROG_MKDIR_P => 0, # FIXME: to be removed in 1.13
+ AM_PROG_MKDIR_P => 0,
AM_CONDITIONAL => 2,
+ AM_EXTRA_RECURSIVE_TARGETS => 1,
AM_GNU_GETTEXT => 0,
AM_GNU_GETTEXT_INTL_SUBDIR => 0,
AM_INIT_AUTOMAKE => 0,
AM_MAINTAINER_MODE => 0,
AM_PROG_AR => 0,
AM_PROG_CC_C_O => 0,
- AM_SILENT_RULES => 0,
_AM_SUBST_NOTMAKE => 1,
_AM_COND_IF => 1,
_AM_COND_ELSE => 1,
$seen_automake_version = 1;
}
- elsif ($macro eq 'AM_PROG_MKDIR_P') # FIXME: to be removed in 1.13
+ elsif ($macro eq 'AM_PROG_MKDIR_P')
{
msg 'obsolete', $where, <<'EOF';
-The 'AM_PROG_MKDIR_P' macro is deprecated, and will soon be removed.
+The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
EOF
{
$configure_cond{$args[1]} = $where;
}
+ elsif ($macro eq 'AM_EXTRA_RECURSIVE_TARGETS')
+ {
+ # Empty leading/trailing fields might be produced by split,
+ # hence the grep is really needed.
+ push @extra_recursive_targets,
+ grep (/./, (split /\s+/, $args[1]));
+ }
elsif ($macro eq 'AM_GNU_GETTEXT')
{
$seen_gettext = $where;
{
msg 'obsolete', $where, <<'EOF';
AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated. For more info, see:
-http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation
+http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
EOF
$package_version = $args[2];
$package_version_location = $where;
{
$seen_cc_c_o = $where;
}
- elsif ($macro eq 'AM_SILENT_RULES')
- {
- set_global_option ('silent-rules', $where);
- }
elsif ($macro eq '_AM_COND_IF')
{
cond_stack_if ('', $args[1], $where);
################################################################
-# Set up for Cygnus mode.
-sub check_cygnus
-{
- my $cygnus = option 'cygnus';
- return unless $cygnus;
-
- # This feature is deprecated, will be removed in the next
- # Automake major release.
- msg 'obsolete', $cygnus->get,
- "support for Cygnus-style trees is deprecated";
-
- set_strictness ('foreign');
- set_option ('no-installinfo', $cygnus);
- set_option ('no-dependencies', $cygnus);
- set_option ('no-dist', $cygnus);
-
- err_ac "'AM_MAINTAINER_MODE' required when --cygnus specified"
- if !$seen_maint_mode;
-}
-
# Do any extra checking for GNU standards.
sub check_gnu_standards
{
return $r;
}
-# Rewrite a single C++ source file.
-sub lang_cxx_rewrite
-{
- return &lang_sub_obj;
-}
-
# Rewrite a single header file.
sub lang_header_rewrite
{
return (LANG_SUBDIR, $newext);
}
-# Rewrite a single yacc file.
+# Rewrite a single yacc/yacc++ file.
sub lang_yacc_rewrite
{
my ($directory, $base, $ext) = @_;
(my $newext = $ext) =~ tr/y/c/;
return ($r, $newext);
}
+sub lang_yaccxx_rewrite { lang_yacc_rewrite (@_); };
-# Rewrite a single yacc++ file.
-sub lang_yaccxx_rewrite
-{
- my ($directory, $base, $ext) = @_;
-
- my $r = &lang_sub_obj;
- (my $newext = $ext) =~ tr/y/c/;
- return ($r, $newext);
-}
-
-# Rewrite a single lex file.
+# Rewrite a single lex/lex++ file.
sub lang_lex_rewrite
{
my ($directory, $base, $ext) = @_;
(my $newext = $ext) =~ tr/l/c/;
return ($r, $newext);
}
-
-# Rewrite a single lex++ file.
-sub lang_lexxx_rewrite
-{
- my ($directory, $base, $ext) = @_;
-
- my $r = &lang_sub_obj;
- (my $newext = $ext) =~ tr/l/c/;
- return ($r, $newext);
-}
-
-# Rewrite a single assembly file.
-sub lang_asm_rewrite
-{
- return &lang_sub_obj;
-}
-
-# Rewrite a single preprocessed assembly file.
-sub lang_cppasm_rewrite
-{
- return &lang_sub_obj;
-}
-
-# Rewrite a single Fortran 77 file.
-sub lang_f77_rewrite
-{
- return &lang_sub_obj;
-}
-
-# Rewrite a single Fortran file.
-sub lang_fc_rewrite
-{
- return &lang_sub_obj;
-}
-
-# Rewrite a single preprocessed Fortran file.
-sub lang_ppfc_rewrite
-{
- return &lang_sub_obj;
-}
-
-# Rewrite a single preprocessed Fortran 77 file.
-sub lang_ppf77_rewrite
-{
- return &lang_sub_obj;
-}
-
-# Rewrite a single ratfor file.
-sub lang_ratfor_rewrite
-{
- return &lang_sub_obj;
-}
-
-# Rewrite a single Objective C file.
-sub lang_objc_rewrite
-{
- return &lang_sub_obj;
-}
-
-# Rewrite a single Objective C++ file.
-sub lang_objcxx_rewrite
-{
- return &lang_sub_obj;
-}
-
-# Rewrite a single Unified Parallel C file.
-sub lang_upc_rewrite
-{
- return &lang_sub_obj;
-}
+sub lang_lexxx_rewrite { lang_lex_rewrite (@_); };
# Rewrite a single Java file.
sub lang_java_rewrite
sub saw_extension
{
my ($ext) = @_;
- if (! defined $extension_seen{$ext})
- {
- $extension_seen{$ext} = 1;
- }
- else
- {
- ++$extension_seen{$ext};
- }
-}
-
-# Return the number of files seen for a given language. Knows about
-# special cases we care about. FIXME: this is hideous. We need
-# something that involves real language objects. For instance yacc
-# and yaccxx could both derive from a common yacc class which would
-# know about the strange ylwrap requirement. (Or better yet we could
-# just not support legacy yacc!)
-sub count_files_for_language
-{
- my ($name) = @_;
-
- my @names;
- if ($name eq 'yacc' || $name eq 'yaccxx')
- {
- @names = ('yacc', 'yaccxx');
- }
- elsif ($name eq 'lex' || $name eq 'lexxx')
- {
- @names = ('lex', 'lexxx');
- }
- else
- {
- @names = ($name);
- }
-
- my $r = 0;
- foreach $name (@names)
- {
- my $lang = $languages{$name};
- foreach my $ext (@{$lang->extensions})
- {
- $r += $extension_seen{$ext}
- if defined $extension_seen{$ext};
- }
- }
-
- return $r
-}
-
-# Called to ask whether source files have been seen . If HEADERS is 1,
-# headers can be included.
-sub saw_sources_p
-{
- my ($headers) = @_;
-
- # count all the sources
- my $count = 0;
- foreach my $val (values %extension_seen)
- {
- $count += $val;
- }
-
- if (!$headers)
- {
- $count -= count_files_for_language ('header');
- }
-
- return $count > 0;
+ $extension_seen{$ext} = 1;
}
-
# register_language (%ATTRIBUTE)
# ------------------------------
# Register a single language.
# Update the pattern of known extensions.
accept_extensions (@{$lang->extensions});
- # Upate the $suffix_rule map.
+ # Update the suffix rules map.
foreach my $suffix (@{$lang->extensions})
{
foreach my $dest (&{$lang->output_extensions} ($suffix))
{
my ($source_ext, $obj) = @_;
- while (! $extension_map{$source_ext}
- && $source_ext ne $obj
- && exists $suffix_rules->{$source_ext}
- && exists $suffix_rules->{$source_ext}{$obj})
+ while (!$extension_map{$source_ext} && $source_ext ne $obj)
{
- $source_ext = $suffix_rules->{$source_ext}{$obj}[0];
+ my $new_source_ext = next_in_suffix_chain ($source_ext, $obj);
+ last if not defined $new_source_ext;
+ $source_ext = $new_source_ext;
}
return $source_ext;
# otherwise OSF make will implicitly copy the included
# file in the build tree during "make distdir" to satisfy
# the dependency.
- # (subdircond2.test and subdircond3.test will fail.)
+ # (subdir-am-cond.sh and subdir-ac-cond.sh will fail)
push_dist_common ("\$\(top_srcdir\)/$path");
}
else
# otherwise OSF make will implicitly copy the included
# file in the build tree during "make distdir" to satisfy
# the dependency.
- # (subdircond2.test and subdircond3.test will fail.)
+ # (subdir-am-cond.sh and subdir-ac-cond.sh will fail)
push_dist_common ("\$\(srcdir\)/$path");
$path = $relative_dir . "/" . $path if $relative_dir ne '.';
}
# - replaces %KEY% with $VAL,
# - enables/disables ?KEY? and ?!KEY?,
# - replaces %?KEY% with TRUE or FALSE.
-# - replaces %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE% with
-# IFTRUE / IFFALSE, as appropriate.
sub transform ($$)
{
my ($token, $transform) = @_;
{
return transform_token ($token, $transform, $1);
}
- # %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE%.
- elsif ($token =~ /^%([\w\-]+)(?:\?([^?:%]+))?(?::([^?:%]+))?%$/)
- {
- return transform_token ($token, $transform, $1) ? ($2 || '') : ($3 || '');
- }
# %?KEY%.
elsif ($token =~ /^%\?([\w\-]+)%$/)
{
# Complete %transform with global options.
# Note that %transform goes last, so it overrides global options.
- %transform = ('CYGNUS' => !! option 'cygnus',
- 'MAINTAINER-MODE'
+ %transform = ( 'MAINTAINER-MODE'
=> $seen_maint_mode ? subst ('MAINTAINER_MODE_TRUE') : '',
'XZ' => !! option 'dist-xz',
'INSTALL-INFO' => ! option 'no-installinfo',
'INSTALL-MAN' => ! option 'no-installman',
- 'HAVE-MANS' => !! var ('MANS'),
'CK-NEWS' => !! option 'check-news',
'SUBDIRS' => !! var ('SUBDIRS'),
# Substitute Automake template tokens.
s/(?: % \?? [\w\-]+ %
- | % [\w\-]+ (?:\?[^?:%]+)? (?::[^?:%]+)? %
| \? !? [\w\-]+ \?
)/transform($&, \%transform)/gex;
# transform() may have added some ##%-comments to strip.
}
# This is needed to allow a construct in a non-top-level Makefile.am
# to require a file in the build-aux directory (see at least the test
- # script 'test-driver-is-distributed.test'). This is related to the
+ # script 'test-driver-is-distributed.sh'). This is related to the
# automake bug#9546. Note that the use of $config_aux_dir instead
# of $am_config_aux_dir here is deliberate and necessary.
elsif ($dir eq $config_aux_dir)
if var 'DIST_SUBDIRS' && ! var 'SUBDIRS';
# Check first, because we might modify some state.
- check_cygnus;
check_gnu_standards;
check_gnits_standards;
handle_data;
handle_headers;
handle_subdirs;
+ handle_user_recursion;
handle_tags;
handle_minor_options;
# Must come after handle_programs so that %known_programs is up-to-date.
--include-deps enable dependency tracking code
Flavors:
- --cygnus assume program is part of Cygnus-style tree
--foreign set strictness to foreign
--gnits set strictness to gnits
--gnu set strictness to gnu
sub parse_arguments ()
{
my $strict = 'gnu';
- my $cygnus = 0;
my $ignore_deps = 0;
my @warnings = ();
'gnu' => sub { $strict = 'gnu'; },
'gnits' => sub { $strict = 'gnits'; },
'foreign' => sub { $strict = 'foreign'; },
- 'cygnus' => \$cygnus,
'include-deps' => sub { $ignore_deps = 0; },
'i|ignore-deps' => sub { $ignore_deps = 1; },
'no-force' => sub { $force_generation = 0; },
set_strictness ($strict);
my $cli_where = new Automake::Location;
- set_global_option ('cygnus', $cli_where) if $cygnus;
set_global_option ('no-dependencies', $cli_where) if $ignore_deps;
for my $warning (@warnings)
{