summaryrefslogtreecommitdiff
path: root/bin/automake.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/automake.in')
-rw-r--r--bin/automake.in449
1 files changed, 133 insertions, 316 deletions
diff --git a/bin/automake.in b/bin/automake.in
index 653340563..6621302d8 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -33,15 +33,6 @@ BEGIN
{
unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@')
unless $ENV{AUTOMAKE_UNINSTALLED};
-
- # Override SHELL. This is required on DJGPP so that system() uses
- # bash, not COMMAND.COM which doesn't quote arguments properly.
- # Other systems aren't expected to use $SHELL when Automake
- # runs, but it should be safe to drop the "if DJGPP" guard if
- # it turns up other systems need the same thing. After all,
- # if SHELL is used, ./configure's SHELL is always better than
- # the user's SHELL (which may be something like tcsh).
- $ENV{'SHELL'} = '@SHELL@' if exists $ENV{'DJDIR'};
}
use Automake::Config;
@@ -59,7 +50,6 @@ use Automake::General;
use Automake::XFile;
use Automake::Channels;
use Automake::ChannelDefs;
-use Automake::Configure_ac;
use Automake::FileUtils;
use Automake::Location;
use Automake::Condition qw/TRUE FALSE/;
@@ -216,7 +206,7 @@ my @common_files =
# is used for the --help output only.
my @common_sometimes =
qw(aclocal.m4 acconfig.h config.h.top config.h.bot configure
- configure.ac configure.in stamp-vti);
+ configure.ac stamp-vti);
# Standard directories from the GNU Coding Standards, and additional
# pkg* directories from Automake. Stored in a hash for fast member check.
@@ -241,14 +231,6 @@ my $gen_copyright = "\
# PARTICULAR PURPOSE.
";
-# These constants are returned by the lang_*_rewrite functions.
-# LANG_SUBDIR means that the resulting object file should be in a
-# subdir if the source file is. In this case the file name cannot
-# have '..' components.
-use constant LANG_IGNORE => 0;
-use constant LANG_PROCESS => 1;
-use constant LANG_SUBDIR => 2;
-
# These are used when keeping track of whether an object can be built
# by two different paths.
use constant COMPILE_LIBTOOL => 1;
@@ -288,8 +270,9 @@ my $force_missing = 0;
## Variables filled during files scanning. ##
## ---------------------------------------- ##
-# Name of the configure.ac file.
-my $configure_ac;
+# Name of the Autoconf input file. We used to support 'configure.in'
+# as well once, that that is long obsolete now.
+my $configure_ac = 'configure.ac';
# Files found by scanning configure.ac for LIBOBJS.
my %libsources = ();
@@ -702,8 +685,6 @@ register_language ('name' => 'c',
'ld' => '$(CC)',
'linker' => 'LINK',
'link' => '$(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'libtool_tag' => 'CC',
'extensions' => ['.c']);
@@ -718,8 +699,6 @@ register_language ('name' => 'cxx',
'compile' => "\$(CXX) @cpplike_flags \$(AM_CXXFLAGS) \$(CXXFLAGS)",
'ccer' => 'CXX',
'compiler' => 'CXXCOMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'libtool_tag' => 'CXX',
'lder' => 'CXXLD',
'ld' => '$(CXX)',
@@ -737,8 +716,6 @@ register_language ('name' => 'objc',
'compile' => "\$(OBJC) @cpplike_flags \$(AM_OBJCFLAGS) \$(OBJCFLAGS)",
'ccer' => 'OBJC',
'compiler' => 'OBJCCOMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'lder' => 'OBJCLD',
'ld' => '$(OBJC)',
'pure' => 1,
@@ -755,8 +732,6 @@ register_language ('name' => 'objcxx',
'compile' => "\$(OBJCXX) @cpplike_flags \$(AM_OBJCXXFLAGS) \$(OBJCXXFLAGS)",
'ccer' => 'OBJCXX',
'compiler' => 'OBJCXXCOMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'lder' => 'OBJCXXLD',
'ld' => '$(OBJCXX)',
'pure' => 1,
@@ -773,8 +748,6 @@ register_language ('name' => 'upc',
'compile' => "\$(UPC) @cpplike_flags \$(AM_UPCFLAGS) \$(UPCFLAGS)",
'ccer' => 'UPC',
'compiler' => 'UPCCOMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'lder' => 'UPCLD',
'ld' => '$(UPC)',
'pure' => 1,
@@ -790,7 +763,7 @@ register_language ('name' => 'header',
# Nothing to do.
'_finish' => sub { });
-# Vala
+# Vala.
register_language ('name' => 'vala',
'Name' => 'Vala',
'config_vars' => ['VALAC'],
@@ -798,9 +771,10 @@ register_language ('name' => 'vala',
'compile' => '$(VALAC) $(AM_VALAFLAGS) $(VALAFLAGS)',
'ccer' => 'VALAC',
'compiler' => 'VALACOMPILE',
- 'extensions' => ['.vala'],
- 'output_extensions' => sub { (my $ext = $_[0]) =~ s/vala$/c/;
- return ($ext,) },
+ 'extensions' => ['.vala', '.vapi'],
+ # Vala compilation must be handled in a special way, so
+ # nothing to do or return here.
+ 'output_extensions' => sub { },
'rule_file' => 'vala',
'_finish' => \&lang_vala_finish,
'_target_hook' => \&lang_vala_target_hook,
@@ -872,14 +846,12 @@ register_language ('name' => 'asm',
'config_vars' => ['CCAS', 'CCASFLAGS'],
'flags' => ['CCASFLAGS'],
- # Users can set AM_CCASFLAGS to include DEFS, INCLUDES,
- # or anything else required. They can also set CCAS.
- # Or simply use Preprocessed Assembler.
+ # Users can set AM_CCASFLAGS to include $(DEFS),
+ # $(INCLUDES), or anything else required. They can also
+ # set CCAS. Or simply use Preprocessed Assembler.
'compile' => '$(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)',
'ccer' => 'CCAS',
'compiler' => 'CCASCOMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'extensions' => ['.s']);
# Preprocessed Assembler.
@@ -892,8 +864,6 @@ register_language ('name' => 'cppasm',
'compile' => "\$(CCAS) @cpplike_flags \$(AM_CCASFLAGS) \$(CCASFLAGS)",
'ccer' => 'CPPAS',
'compiler' => 'CPPASCOMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'extensions' => ['.S', '.sx']);
# Fortran 77
@@ -906,8 +876,6 @@ register_language ('name' => 'f77',
'compile' => '$(F77) $(AM_FFLAGS) $(FFLAGS)',
'ccer' => 'F77',
'compiler' => 'F77COMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'libtool_tag' => 'F77',
'lder' => 'F77LD',
'ld' => '$(F77)',
@@ -924,8 +892,6 @@ register_language ('name' => 'fc',
'compile' => '$(FC) $(AM_FCFLAGS) $(FCFLAGS)',
'ccer' => 'FC',
'compiler' => 'FCCOMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'libtool_tag' => 'FC',
'lder' => 'FCLD',
'ld' => '$(FC)',
@@ -944,8 +910,6 @@ register_language ('name' => 'ppfc',
'ccer' => 'PPFC',
'compiler' => 'PPFCCOMPILE',
'compile' => "\$(FC) @cpplike_flags \$(AM_FCFLAGS) \$(FCFLAGS)",
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'libtool_tag' => 'FC',
'pure' => 1,
'extensions' => ['.F90','.F95', '.F03', '.F08']);
@@ -976,8 +940,6 @@ register_language ('name' => 'ppf77',
'ccer' => 'PPF77',
'compiler' => 'PPF77COMPILE',
'compile' => "\$(F77) @cpplike_flags \$(AM_FFLAGS) \$(FFLAGS)",
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'libtool_tag' => 'F77',
'pure' => 1,
'extensions' => ['.F']);
@@ -995,8 +957,6 @@ register_language ('name' => 'ratfor',
'compile' => '$(F77) $(AM_FFLAGS) $(FFLAGS) $(AM_RFLAGS) $(RFLAGS)',
'ccer' => 'F77',
'compiler' => 'RCOMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'libtool_tag' => 'F77',
'pure' => 1,
'extensions' => ['.r']);
@@ -1012,8 +972,6 @@ register_language ('name' => 'java',
'compile' => '$(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)',
'ccer' => 'GCJ',
'compiler' => 'GCJCOMPILE',
- 'compile_flag' => '-c',
- 'output_flag' => '-o',
'libtool_tag' => 'GCJ',
'lder' => 'GCJLD',
'ld' => '$(GCJ)',
@@ -1372,10 +1330,8 @@ sub handle_languages ()
'FPFX' => $fpfx,
'AMDEP' => $AMDEP,
'FASTDEP' => $FASTDEP,
- '-c' => $lang->compile_flag || '',
# These are not used, but they need to be defined
- # so transform() do not complain.
- SUBDIROBJ => 0,
+ # so transform() does not complain.
'DERIVED-EXT' => 'BUG',
DIST_SOURCE => 1,
VERBOSE => $verbose,
@@ -1391,27 +1347,13 @@ sub handle_languages ()
# This is not used by depend2.am.
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
- # is used, or it is not.
- #
- # In the latter case the rule is used to build objects
- # in the current directory, and dependencies always
- # go into './$(DEPDIR)/'. We can hard-code this value.
- #
- # In the former case the rule can be used to build
- # objects in sub-directories too. Dependencies should
- # go into the appropriate sub-directories, e.g.,
- # 'sub/$(DEPDIR)/'. The value of this directory
- # needs to be computed on-the-fly.
- #
- # DEPBASE holds the name of this directory, plus the
- # basename part of the object file (extensions Po, TPo,
- # Plo, TPlo will be added later as appropriate). It is
- # either hardcoded, or a shell variable ('$depbase') that
- # will be computed by the rule.
- my $depbase =
- option ('subdir-objects') ? '$$depbase' : '$(DEPDIR)/$*';
+ # Even when subdir sources are present, an inference rule
+ # like '.c.o:' can be used to build corresponding objects
+ # in the sane subdirectory too. We should be careful to also
+ # place dependency files into the appropriate subdirectory,
+ # e.g., 'sub/$(DEPDIR)/'. The value of this directory needs
+ # to be computed on-the-fly (that is done by our makefile
+ # recipes in 'depend2.am').
$output_rules .=
file_contents ($rule_file,
new Automake::Location,
@@ -1420,9 +1362,9 @@ sub handle_languages ()
'DERIVED-EXT' => $der_ext,
- DEPBASE => $depbase,
BASE => '$*',
SOURCE => '$<',
+ XSOURCE => '$<',
SOURCEFLAG => $sourceflags{$ext} || '',
OBJ => '$@',
OBJOBJ => '$@',
@@ -1430,8 +1372,7 @@ sub handle_languages ()
COMPILE => '$(' . $lang->compiler . ')',
LTCOMPILE => '$(LT' . $lang->compiler . ')',
- -o => $lang->output_flag,
- SUBDIROBJ => !! option 'subdir-objects');
+ );
}
# Now include code for each specially handled object with this
@@ -1475,15 +1416,8 @@ sub handle_languages ()
"\$(LIBTOOL) $ltverbose $libtool_tag\$($ptltflags) \$(LIBTOOLFLAGS) "
. "--mode=compile $obj_compile";
- # We _need_ '-o' for per object rules.
- my $output_flag = $lang->output_flag || '-o';
-
- my $depbase = dirname ($obj);
- $depbase = ''
- if $depbase eq '.';
- $depbase .= '/'
- unless $depbase eq '';
- $depbase .= '$(DEPDIR)/' . basename ($obj);
+ # For non-suffix rules, we must emulate a VPATH search.
+ my $xsource = "`test -f '$source' || echo '\$(srcdir)/'`$source";
$output_rules .=
file_contents ($rule_file,
@@ -1491,9 +1425,9 @@ sub handle_languages ()
%transform,
GENERIC => 0,
- DEPBASE => $depbase,
BASE => $obj,
SOURCE => $source,
+ XSOURCE => $xsource,
SOURCEFLAG => $sourceflags{$srcext} || '',
# Use $myext and not '.o' here, in case
# we are actually building a new source
@@ -1507,7 +1441,6 @@ sub handle_languages ()
SILENT => $silent,
COMPILE => $obj_compile,
LTCOMPILE => $obj_ltcompile,
- -o => $output_flag,
%file_transform);
}
@@ -1669,10 +1602,6 @@ sub handle_single_transform
next;
}
- # If the source file is in a subdirectory then the '.o' is put
- # into the current directory, unless the subdir-objects option
- # is in effect.
-
# Split file name into base and extension.
next if ! /^(?:(.*)\/)?([^\/]*)($KNOWN_EXTENSIONS_PATTERN)$/;
my $full = $_;
@@ -1716,20 +1645,24 @@ sub handle_single_transform
}
}
- # Note: computed subr call. The language rewrite function
- # should return one of the LANG_* constants. It could
- # also return a list whose first value is such a constant
- # and whose second value is a new source extension which
- # should be applied. This means this particular language
- # 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);
- # Skip this entry if we were asked not to process it.
- next if $r == LANG_IGNORE;
+ # NOTE: computed subr calls here.
+
+ # The language ignore function can ask not to preprocess
+ # a source file further.
+ my $subr_ignore = \&{'lang_' . $lang->name . '_ignore'};
+ next if defined &$subr_ignore
+ and &$subr_ignore ($directory, $base, $extension);
+ # The language rewrite function can return a new source
+ # extension which should be applied. This means this
+ # particular language generates another source file which
+ # we must then process further. This happens, for example,
+ # with yacc and lex.
+ my $subr_rewrite = \&{'lang_' . $lang->name . '_rewrite'};
+ $subr_rewrite = sub { } unless defined &$subr_rewrite;
+ my $source_extension = &$subr_rewrite ($directory, $base,
+ $extension, $obj,
+ $have_per_exec_flags,
+ $var);
# Now extract linker and other info.
$linker = $lang->linker;
@@ -1774,25 +1707,24 @@ sub handle_single_transform
# We choose the name 'DERIVED_OBJECT' to ensure (1) uniqueness,
# and (2) continuity between invocations. However, this will
# result in a name that is too long for losing systems, in some
- # situations. So we attempt to shorten automatically under
- # subdir-objects, and provide _SHORTNAME to override as a last
- # resort. If subdir-object is in effect, it's usually
- # unnecessary to use the complete 'DERIVED_OBJECT' (that is
- # often the result from %canon_reldir%/%C% usage) since objects
- # are placed next to their source file. Generally, this means
- # it is already unique within that directory (see below for an
- # exception). Thus, we try to avoid unnecessarily long file
- # names by stripping the directory components of
- # 'DERIVED_OBJECT'. This allows avoiding explicit _SHORTNAME
- # usage in many cases. EXCEPTION: If two (or more) targets in
- # different directories but with the same base name (after
- # canonicalization), using target-specific FLAGS, link the same
- # object, then this logic clashes. Thus, we don't strip if
- # this is detected.
+ # situations. So we attempt to shorten automatically, and
+ # provide _SHORTNAME to override as a last resort. If
+ # subdir-object is in effect, it's usually unnecessary to use
+ # the complete 'DERIVED_OBJECT' (that is often the result from
+ # %canon_reldir%/%C% usage) since objects are placed next to
+ # their source file. Generally, this means it is already
+ # unique within that directory (see below for an exception).
+ # Thus, we try to avoid unnecessarily long file names by
+ # stripping the directory components of 'DERIVED_OBJECT'.
+ # This allows avoiding explicit _SHORTNAME usage in many
+ # cases. EXCEPTION: If two (or more) targets in different
+ # directories but with the same base name (after
+ # canonicalization), using target-specific FLAGS, link the
+ # same object, then this logic clashes. Thus, we don't strip
+ # if this is detected.
my $dname = $derived;
if ($directory ne ''
- && option 'subdir-objects'
- && none { $dname =~ /$_$/ } @dup_shortnames)
+ && none { $dname =~ /$_$/ } @dup_shortnames)
{
# At this point, we don't clear information about what
# parts of $derived are truly file name components. We can
@@ -1831,47 +1763,14 @@ sub handle_single_transform
}
# If rewrite said it was ok, put the object into a subdir.
- if ($directory ne '')
- {
- if ($r == LANG_SUBDIR)
- {
- $object = $directory . '/' . $object;
- }
- else
- {
- # Since the next major version of automake (2.0) will
- # make the behaviour so far only activated with the
- # 'subdir-object' option mandatory, it's better if we
- # start warning users not using that option.
- # As suggested by Peter Johansson, we strive to avoid
- # the warning when it would be irrelevant, i.e., if
- # all source files sit in "current" directory.
- msg_var 'unsupported', $var,
- "source file '$full' is in a subdirectory,"
- . "\nbut option 'subdir-objects' is disabled";
- msg 'unsupported', INTERNAL, <<'EOF', uniq_scope => US_GLOBAL;
-possible forward-incompatibility.
-At least a source file is in a subdirectory, but the 'subdir-objects'
-automake option hasn't been enabled. For now, the corresponding output
-object file(s) will be placed in the top-level directory. However,
-this behaviour will change in future Automake versions: they will
-unconditionally cause object files to be placed in the same subdirectory
-of the corresponding sources.
-You are advised to start using 'subdir-objects' option throughout your
-project, to avoid future incompatibilities.
-EOF
- }
- }
+ $object = $directory . '/' . $object
+ unless $directory eq '';
# If the object file has been renamed (because per-target
# flags are used) we cannot compile the file with an
# inference rule: we need an explicit rule.
#
- # If the source is in a subdirectory and the object is in
- # the current directory, we also need an explicit rule.
- #
# If both source and object files are in a subdirectory
- # (this happens when the subdir-objects option is used),
# then the inference will work.
#
# The latter case deserves a historical note. When the
@@ -1893,7 +1792,6 @@ EOF
# with GNU make, Solaris make, Ultrix make, BSD make,
# HP-UX make, and OSF1 make successfully.
if ($renamed
- || ($directory ne '' && ! option 'subdir-objects')
# We must also use specific rules for a nodist_ source
# if its language requests it.
|| ($lang->nodist_specific && ! $transform{'DIST_SOURCE'}))
@@ -1960,6 +1858,8 @@ EOF
next;
}
+ # FIXME: this is likely an internal error now that we use
+ # FIXME: subdir-objects unconditionally ...
err_am "object '$object' created by '$full' and '$object_map{$object}'"
if (defined $object_map{$object}
&& $object_map{$object} ne $full);
@@ -2344,38 +2244,29 @@ sub handle_LIBOBJS_or_ALLOCA
# to define LIBOBJDIR and ensure the files get cleaned.
# Otherwise LIBOBJDIR can be left undefined, and the cleaning
# is achieved by 'rm -f *.$(OBJEXT)' in compile.am.
- if ($config_libobj_dir
- && $relative_dir ne $config_libobj_dir)
- {
- if (option 'subdir-objects')
- {
- # In the top-level Makefile we do not use $(top_builddir), because
- # we are already there, and since the targets are built without
- # a $(top_builddir), it helps BSD Make to match them with
- # dependencies.
- $dir = "$config_libobj_dir/"
- if $config_libobj_dir ne '.';
- $dir = backname ($relative_dir) . "/$dir"
- if $relative_dir ne '.';
- define_variable ('LIBOBJDIR', "$dir", INTERNAL);
- if ($dir && !defined $clean_files{"$dir$base.\$(OBJEXT)"})
- {
- my $dirstamp = require_build_directory ($dir);
- $output_rules .= "$dir$base.\$(OBJEXT): $dirstamp\n";
- $output_rules .= "$dir$base.lo: $dirstamp\n"
- if ($var =~ /^LT/);
- }
- # libtool might create .$(OBJEXT) as a side-effect of using
- # LTLIBOBJS or LTALLOCA.
- $clean_files{"$dir$base.\$(OBJEXT)"} = MOSTLY_CLEAN;
- $clean_files{"$dir$base.lo"} = MOSTLY_CLEAN
+ if ($config_libobj_dir && $relative_dir ne $config_libobj_dir)
+ {
+ # In the top-level Makefile we do not use $(top_builddir), because
+ # we are already there, and since the targets are built without
+ # a $(top_builddir), it helps BSD Make to match them with
+ # dependencies.
+ $dir = "$config_libobj_dir/"
+ if $config_libobj_dir ne '.';
+ $dir = backname ($relative_dir) . "/$dir"
+ if $relative_dir ne '.';
+ define_variable ('LIBOBJDIR', "$dir", INTERNAL);
+ if ($dir && !defined $clean_files{"$dir$base.\$(OBJEXT)"})
+ {
+ my $dirstamp = require_build_directory ($dir);
+ $output_rules .= "$dir$base.\$(OBJEXT): $dirstamp\n";
+ $output_rules .= "$dir$base.lo: $dirstamp\n"
if ($var =~ /^LT/);
}
- else
- {
- error ("'\$($var)' cannot be used outside '$config_libobj_dir' if"
- . " 'subdir-objects' is not set");
- }
+ # libtool might create .$(OBJEXT) as a side-effect of using
+ # LTLIBOBJS or LTALLOCA.
+ $clean_files{"$dir$base.\$(OBJEXT)"} = MOSTLY_CLEAN;
+ $clean_files{"$dir$base.lo"} = MOSTLY_CLEAN
+ if ($var =~ /^LT/);
}
return $dir;
@@ -2531,7 +2422,7 @@ sub handle_libtool ()
{
my $dir = ($item eq '.') ? '' : "$item/";
# .libs is for Unix, _libs for DOS.
- push (@libtool_rms, "\t-rm -rf ${dir}.libs ${dir}_libs");
+ push (@libtool_rms, "\t-rm -rf ${dir}.libs");
}
check_user_variables 'LIBTOOLFLAGS';
@@ -3206,15 +3097,6 @@ sub handle_texinfo_helper
my $done = 0;
my (@mostly_cleans, @texi_cleans, @maint_cleans) = ('', '', '');
- # Build a regex matching user-cleaned files.
- my $d = var 'DISTCLEANFILES';
- my $c = var 'CLEANFILES';
- my @f = ();
- push @f, $d->value_as_list_recursive (inner_expand => 1) if $d;
- push @f, $c->value_as_list_recursive (inner_expand => 1) if $c;
- @f = map { s|[^A-Za-z_0-9*\[\]\-]|\\$&|g; s|\*|[^/]*|g; $_; } @f;
- my $user_cleaned_files = '^(?:' . join ('|', @f) . ')$';
-
foreach my $texi
($info_texinfos->value_as_list_recursive (inner_expand => 1))
{
@@ -3254,6 +3136,7 @@ sub handle_texinfo_helper
# generic rules.
my $outdir = dirname ($texi) . '/';
$outdir = "" if $outdir eq './';
+ my $src_outdir = '$(srcdir)/'. $outdir;
$out_file = $outdir . $out_file;
# Until Automake 1.6.3, .info files were built in the
@@ -3344,54 +3227,22 @@ sub handle_texinfo_helper
# Consequently, starting with Automake 1.8, .info files are
# built in the source tree again. Because we still plan to
# support non-distributed .info files at some point, we
- # have a single variable ($INSRC) that controls whether
+ # have a single variable ('$insrc') that controls whether
# the current .info file must be built in the source tree
# or in the build tree. Actually this variable is switched
- # off in two cases:
- # (1) For '.info' files that appear to be cleaned; this is for
- # backward compatibility with package such as Texinfo,
- # which do things like
- # info_TEXINFOS = texinfo.txi info-stnd.texi info.texi
- # DISTCLEANFILES = texinfo texinfo-* info*.info*
- # # Do not create info files for distribution.
- # dist-info:
- # in order not to distribute .info files.
- # (2) When the undocumented option 'info-in-builddir' is given.
- # This is done to allow the developers of GCC, GDB, GNU
- # binutils and the GNU bfd library to force the '.info' files
- # to be generated in the builddir rather than the srcdir, as
- # was once done when the (now removed) 'cygnus' option was
- # given. See automake bug#11034 for more discussion.
- my $insrc = 1;
- my $soutdir = '$(srcdir)/' . $outdir;
-
- if (option 'info-in-builddir')
- {
- $insrc = 0;
- }
- elsif ($out_file =~ $user_cleaned_files)
- {
- $insrc = 0;
- msg 'obsolete', "$am_file.am", <<EOF;
-Oops!
- It appears this file (or files included by it) are triggering
- an undocumented, soon-to-be-removed automake hack.
- Future automake versions will no longer place in the builddir
- (rather than in the srcdir) the generated '.info' files that
- appear to be cleaned, by e.g. being listed in CLEANFILES or
- DISTCLEANFILES.
- If you want your '.info' files to be placed in the builddir
- rather than in the srcdir, you have to use the shiny new
- 'info-in-builddir' automake option.
-EOF
- }
-
- $outdir = $soutdir if $insrc;
+ # off when the automake option 'info-in-builddir' is given.
+ # This is done to allow the developers of GCC, GDB, GNU
+ # binutils and the GNU bfd library to force the '.info' files
+ # to be generated in the builddir rather than the srcdir, as
+ # was once done when the (now removed) 'cygnus' option was
+ # given. See automake bug#11034 for more discussion.
+ my $insrc = ! option 'info-in-builddir';
+ $outdir = $src_outdir if $insrc;
# If user specified file_TEXINFOS, then use that as explicit
# dependency list.
@texi_deps = ();
- push (@texi_deps, "${soutdir}${vtexi}") if $vtexi;
+ push (@texi_deps, "${src_outdir}${vtexi}") if $vtexi;
my $canonical = canonicalize ($infobase);
if (var ($canonical . "_TEXINFOS"))
@@ -3445,8 +3296,8 @@ EOF
new Automake::Location,
TEXI => $texi,
VTI => $vti,
- STAMPVTI => "${soutdir}stamp-$vti",
- VTEXI => "$soutdir$vtexi",
+ STAMPVTI => "${src_outdir}stamp-$vti",
+ VTEXI => "${src_outdir}$vtexi",
MDDIR => $conf_dir,
DIRSTAMP => $dirstamp);
}
@@ -3809,7 +3660,7 @@ sub handle_dist ()
{
my $archive_defined = option 'no-dist-gzip' ? 0 : 1;
$archive_defined ||=
- grep { option "dist-$_" } qw(shar zip tarZ bzip2 lzip xz);
+ grep { option "dist-$_" } qw(zip bzip2 lzip xz);
error (option 'no-dist-gzip',
"no-dist-gzip specified but no dist-* specified,\n"
. "at least one archive format must be enabled")
@@ -3993,21 +3844,13 @@ sub scan_aclocal_m4 ()
$regen_aclocal = $line =~ 'generated automatically by aclocal';
}
- my @ac_deps = ();
-
- if (set_seen ('ACLOCAL_M4_SOURCES'))
- {
- push (@ac_deps, '$(ACLOCAL_M4_SOURCES)');
- msg_var ('obsolete', 'ACLOCAL_M4_SOURCES',
- "'ACLOCAL_M4_SOURCES' is obsolete.\n"
- . "It should be safe to simply remove it");
- }
+ reject_var ('ACLOCAL_M4_SOURCES',
+ "'ACLOCAL_M4_SOURCES' is obsolete; just remove it");
# Note that it might be possible that aclocal.m4 doesn't exist but
# should be auto-generated. This case probably isn't very
# important.
-
- return ($regen_aclocal, @ac_deps);
+ return $regen_aclocal;
}
@@ -4123,10 +3966,9 @@ sub handle_configure
my $colon_infile = ':' . join (':', @inputs);
$colon_infile = '' if $colon_infile eq ":$makefile.in";
my @rewritten = rewrite_inputs_into_dependencies ($makefile, @inputs);
- my ($regen_aclocal_m4, @aclocal_m4_deps) = scan_aclocal_m4;
+ my $regen_aclocal_m4 = scan_aclocal_m4;
define_pretty_variable ('am__aclocal_m4_deps', TRUE, INTERNAL,
- @configure_deps, @aclocal_m4_deps,
- '$(top_srcdir)/' . $configure_ac);
+ @configure_deps, "\$(top_srcdir)/$configure_ac");
my @configuredeps = ('$(am__aclocal_m4_deps)', '$(CONFIGURE_DEPENDENCIES)');
push @configuredeps, '$(ACLOCAL_M4)' if -f 'aclocal.m4';
define_pretty_variable ('am__configure_deps', TRUE, INTERNAL,
@@ -5227,7 +5069,6 @@ sub scan_autoconf_traces
AC_REQUIRE_AUX_FILE => 1,
AC_SUBST_TRACE => 1,
AM_AUTOMAKE_VERSION => 1,
- AM_PROG_MKDIR_P => 0,
AM_CONDITIONAL => 2,
AM_EXTRA_RECURSIVE_TARGETS => 1,
AM_GNU_GETTEXT => 0,
@@ -5339,9 +5180,7 @@ sub scan_autoconf_traces
elsif ($macro eq 'AC_FC_SRCEXT')
{
my $suffix = $args[1];
- # These flags are used as %SOURCEFLAG% in depend2.am,
- # where the trailing space is important.
- $sourceflags{'.' . $suffix} = '$(FCFLAGS_' . $suffix . ') '
+ $sourceflags{'.' . $suffix} = '$(FCFLAGS_' . $suffix . ')'
if ($suffix eq 'f90' || $suffix eq 'f95' || $suffix eq 'f03' || $suffix eq 'f08');
}
elsif ($macro eq 'AC_INIT')
@@ -5382,14 +5221,6 @@ sub scan_autoconf_traces
$seen_automake_version = 1;
}
- elsif ($macro eq 'AM_PROG_MKDIR_P')
- {
- msg 'obsolete', $where, <<'EOF';
-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
- }
elsif ($macro eq 'AM_CONDITIONAL')
{
$configure_cond{$args[1]} = $where;
@@ -5508,8 +5339,7 @@ EOF
}
-# Check whether we use 'configure.ac' or 'configure.in'.
-# Scan it (and possibly 'aclocal.m4') for interesting things.
+# Scan 'configure.ac' (and possibly 'aclocal.m4') for interesting things.
# We must scan aclocal.m4 because there might be AC_SUBSTs and such there.
sub scan_autoconf_files ()
{
@@ -5637,48 +5467,37 @@ sub check_gnits_standards ()
#
# Functions to handle files of each language.
-# Each 'lang_X_rewrite($DIRECTORY, $BASE, $EXT)' function follows a
-# simple formula: Return value is LANG_SUBDIR if the resulting object
-# file should be in a subdir if the source file is, LANG_PROCESS if
-# file is to be dealt with, LANG_IGNORE otherwise.
-
# Much of the actual processing is handled in
# handle_single_transform. These functions exist so that
# auxiliary information can be recorded for a later cleanup pass.
# Note that the calls to these functions are computed, so don't bother
# searching for their precise names in the source.
-# This is just a convenience function that can be used to determine
-# when a subdir object should be used.
-sub lang_sub_obj ()
-{
- return option 'subdir-objects' ? LANG_SUBDIR : LANG_PROCESS;
-}
+# Header files are simply ignored.
+sub lang_header_ignore { 1; }
-# Rewrite a single header file.
-sub lang_header_rewrite
+# Vala '.vapi' are a kind of header files as well, and should
+# not be processed into compilation rules.
+sub lang_vala_ignore
{
- # Header files are simply ignored.
- return LANG_IGNORE;
+ my ($directory, $base, $ext) = @_;
+ return ($ext =~ m/\.vapi$/ ? 1 : 0);
}
# Rewrite a single Vala source file.
sub lang_vala_rewrite
{
my ($directory, $base, $ext) = @_;
-
- (my $newext = $ext) =~ s/vala$/c/;
- return (LANG_SUBDIR, $newext);
+ $ext =~ s/vala$/c/;
+ return $ext;
}
# Rewrite a single yacc/yacc++ file.
sub lang_yacc_rewrite
{
my ($directory, $base, $ext) = @_;
-
- my $r = lang_sub_obj;
- (my $newext = $ext) =~ tr/y/c/;
- return ($r, $newext);
+ $ext =~ tr/y/c/;
+ return $ext;
}
sub lang_yaccxx_rewrite { lang_yacc_rewrite (@_); };
@@ -5686,19 +5505,11 @@ sub lang_yaccxx_rewrite { lang_yacc_rewrite (@_); };
sub lang_lex_rewrite
{
my ($directory, $base, $ext) = @_;
-
- my $r = lang_sub_obj;
- (my $newext = $ext) =~ tr/l/c/;
- return ($r, $newext);
+ $ext =~ tr/l/c/;
+ return $ext;
}
sub lang_lexxx_rewrite { lang_lex_rewrite (@_); };
-# Rewrite a single Java file.
-sub lang_java_rewrite
-{
- return LANG_SUBDIR;
-}
-
# The lang_X_finish functions are called after all source file
# processing is done. Each should handle defining rules for the
# language, etc. A finish function is only called if a source file of
@@ -6787,9 +6598,7 @@ sub preprocess_file
'XZ' => !! option 'dist-xz',
'LZIP' => !! option 'dist-lzip',
'BZIP2' => !! option 'dist-bzip2',
- 'COMPRESS' => !! option 'dist-tarZ',
'GZIP' => ! option 'no-dist-gzip',
- 'SHAR' => !! option 'dist-shar',
'ZIP' => !! option 'dist-zip',
'INSTALL-INFO' => ! option 'no-installinfo',
@@ -7805,8 +7614,7 @@ sub require_build_directory
$directory_map{$cdir} = $dirstamp;
# Set a variable for the dirstamp basename.
- define_pretty_variable ('am__dirstamp', TRUE, INTERNAL,
- '$(am__leading_dot)dirstamp');
+ define_pretty_variable ('am__dirstamp', TRUE, INTERNAL, '.dirstamp');
# Directory must be removed by 'make distclean'.
$clean_files{$dirstamp} = DIST_CLEAN;
@@ -7902,9 +7710,18 @@ sub generate_makefile
}
# Catch some obsolete variables.
- msg_var ('obsolete', 'INCLUDES',
- "'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')")
- if var ('INCLUDES');
+ if (my $ovar = var ('ACLOCAL_AMFLAGS'))
+ {
+ msg_var 'obsolete', $ovar,
+ "'ACLOCAL_AMFLAGS' is deprecated; use 'AC_CONFIG_MACRO_DIRS'"
+ . " in configure.ac instead";
+ }
+ if (my $ovar = var ('INCLUDES'))
+ {
+ msg_var 'obsolete', $ovar,
+ "'INCLUDES' is deprecated; you should use 'AM_CPPFLAGS'"
+ . " (or '*_CPPFLAGS') instead"
+ }
# Must do this after reading .am file.
define_variable ('subdir', $relative_dir, INTERNAL);
@@ -8351,7 +8168,7 @@ parse_WARNINGS;
# Parse command line.
parse_arguments;
-$configure_ac = require_configure_ac;
+fatal "$configure_ac is required" unless -f $configure_ac;
# Do configure.ac scan only once.
scan_autoconf_files;