# Most important AC_CANONICAL_* macro seen so far.
my $seen_canonical = 0;
-# Location of that macro.
-my $canonical_location;
# Where AM_MAINTAINER_MODE appears.
my $seen_maint_mode;
## ------------------------------------------ ##
# Basename and relative dir of the input file.
-my $am_file_name;
my $am_relative_dir;
-
# Same but wrt Makefile.in.
-my $in_file_name;
my $relative_dir;
-# Relative path to the top directory.
-my $topsrcdir;
-
# Greatest timestamp of the output's dependencies (excluding
# configure's dependencies).
my $output_deps_greatest_timestamp;
{
reset_local_duplicates ();
- $am_file_name = undef;
$am_relative_dir = undef;
-
- $in_file_name = undef;
$relative_dir = undef;
- $topsrcdir = undef;
$output_deps_greatest_timestamp = 0;
# 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 = "$topsrcdir/$dir" if $relative_dir ne '.';
+ $dir = "$config_libobj_dir/"
+ if $config_libobj_dir ne '.';
+ $dir = backname ($relative_dir) . "/$dir"
+ if $relative_dir ne '.';
define_variable ('LIBOBJDIR', "$dir", INTERNAL);
$clean_files{"\$($var)"} = MOSTLY_CLEAN;
# If LTLIBOBJS is used, we must also clear LIBOBJS (which might
if ($seen_canonical <= AC_CANONICAL_BUILD)
{
$seen_canonical = AC_CANONICAL_BUILD;
- $canonical_location = $where;
}
}
elsif ($macro eq 'AC_CANONICAL_HOST')
if ($seen_canonical <= AC_CANONICAL_HOST)
{
$seen_canonical = AC_CANONICAL_HOST;
- $canonical_location = $where;
}
}
elsif ($macro eq 'AC_CANONICAL_TARGET')
{
$seen_canonical = AC_CANONICAL_TARGET;
- $canonical_location = $where;
}
elsif ($macro eq 'AC_CONFIG_AUX_DIR')
{
}
# Read main am file.
-sub read_main_am_file
+sub read_main_am_file ($$)
{
- my ($amfile) = @_;
+ my ($amfile, $infile) = @_;
# This supports the strange variable tricks we are about to play.
prog_error ("variable defined before read_main_am_file\n" . variables_dump ())
# Generate copyright header for generated Makefile.in.
# We do discard the output of predefined variables, handled below.
- $output_vars = ("# $in_file_name generated by automake "
- . $VERSION . " from $am_file_name.\n");
+ $output_vars = ("# " . basename ($infile) . " generated by automake "
+ . $VERSION . " from " . basename ($amfile) . ".\n");
$output_vars .= '# ' . subst ('configure_input') . "\n";
$output_vars .= $gen_copyright;
# we have processed AUTOMAKE_OPTIONS.
buffer_messages ('warning');
- # Name of input file ("Makefile.am") and output file
- # ("Makefile.in"). These have no directory components.
- $am_file_name = basename ($makefile_am);
- $in_file_name = basename ($makefile_in);
-
# $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,
$relative_dir = dirname ($makefile);
$am_relative_dir = dirname ($makefile_am);
- $topsrcdir = backname ($relative_dir);
- read_main_am_file ($makefile_am);
+ read_main_am_file ($makefile_am, $makefile_in);
if (handle_options)
{
# Process buffered warnings.