elsif (/[0-9]+\.?[0-9]+/)
{
# Got a version number. Is the syntax too strict?
+ local ($num_version);
+ ($num_version = $VERSION) =~ tr/0-9//d;
if ($VERSION < $_)
{
&am_line_error ('AUTOMAKE_OPTIONS',
{
push (@check, 'check-DEJAGNU');
push (@phony, 'check-DEJAGNU');
- $output_rules .= &file_contents ('dejagnu');
+ $output_rules .= &file_contents ('dejagnu') . "\n";
+ $output_rules .= ("site.exp: Makefile\n"
+ . "\t\@echo 'Making a new site.exp file...'\n"
+ . "\t-\@rm -f site.bak\n"
+ . "\t-\@mv site.exp site.bak\n"
+ . "\t\@echo '## these variables are automatically generated by make ##' > site.exp\n"
+ . "\t\@echo '# Do not edit here. If you wish to override these values' >> site.exp\n"
+ . "\t\@echo '# edit the last section' >> site.exp\n"
+ . "\t\@echo 'set tool \$(DEJATOOL)' >> site.exp\n"
+ . "\t\@echo 'set srcdir \$(srcdir)' >> site.exp\n"
+ . "\t\@echo 'set objdir \`pwd\`' >> site.exp\n");
+
+ # Extra stuff for AC_CANONICAL_*
+ local (@whatlist) = ();
+ if ($seen_canonical)
+ {
+ push (@whatlist, 'host')
+ }
+
+ # Extra stuff only for AC_CANONICAL_SYSTEM.
+ if ($seen_canonical == $AC_CANONICAL_SYSTEM)
+ {
+ push (@whatlist, 'target', 'build');
+ }
+
+ local ($c1, $c2);
+ foreach $c1 (@whatlist)
+ {
+ foreach $c2 ('alias', 'triplet')
+ {
+ $output_rules .= "\t\@echo 'set ${c1}_${c2} \$(${c1}_${c2})' >> site.exp\n";
+ }
+ }
+
+ $output_rules .= ("\t\@echo '## All variables above are generated by configure. Do Not Edit ##' >> site.exp\n"
+ . "\t-\@sed '1,/^## All variables above are.*##/ d' site.bak >> site.exp\n");
}
- elsif (&variable_defined ('TESTS'))
+
+ if (&variable_defined ('TESTS'))
{
push (@check, 'check-TESTS');
push (@phony, 'check-TESTS');
}
}
- $seen_canonical = 1 if /AC_CANONICAL_(HOST|SYSTEM)/;
+ # Handle AC_CANONICAL_*. Always allow upgrading to
+ # AC_CANONICAL_SYSTEM, but never downgrading.
+ $seen_canonical = $AC_CANONICAL_HOST
+ if ! $seen_canonical && /AC_CANONICAL_HOST/;
+ $seen_canonical = $AC_CANONICAL_SYSTEM if /AC_CANONICAL_SYSTEM/;
+
$seen_canonical = 1 if /AC_CHECK_TOOL/;
$seen_path_xtra = 1 if /AC_PATH_XTRA/;
('s/\@top_builddir\@/' . $build_rx . '/g',
'header-vars');
+ # Generate some useful variables when AC_CANONICAL_* used.
+ if ($seen_canonical)
+ {
+ $header_vars .= ('host_alias = @host_alias@' . "\n"
+ . 'host_triplet = @host@' . "\n");
+ if ($seen_canonical == $AC_CANONICAL_SYSTEM)
+ {
+ $header_vars .= ('build_alias = @build_alias@' . "\n"
+ . 'build_triplet = @build@' . "\n");
+ $header_vars .= ('target_alias = @target_alias@' . "\n"
+ . 'target_triplet = @target@' . "\n");
+ }
+ }
+
open (AM_FILE, $amfile) || die "automake: couldn't open \`$amfile': $!\n";
print "automake: reading $amfile\n" if $verbose;
sub initialize_global_constants
{
+ # Values for AC_CANONICAL_*
+ $AC_CANONICAL_HOST = 1;
+ $AC_CANONICAL_SYSTEM = 2;
+
# Associative array of standard directory names. Entry is TRUE if
# corresponding directory should be installed during
# 'install-exec' phase.
"README", "THANKS", "TODO", "NEWS", "COPYING", "COPYING.LIB",
"INSTALL", "ABOUT-NLS", "ChangeLog", "configure", "configure.in",
"config.guess", "config.sub", "AUTHORS", "BACKLOG", "ABOUT-GNU",
- "libversion.in", "mdate-sh", "mkinstalldirs", "install-sh"
+ "libversion.in", "mdate-sh", "mkinstalldirs", "install-sh",
+ 'texinfo.tex'
);
# Commonly used files we auto-include, but only sometimes.
@common_sometimes =
(
- "version.texi", "aclocal.m4", "acconfig.h", "config.h.top",
+ "aclocal.m4", "acconfig.h", "config.h.top",
"config.h.bot", "stamp-h.in", "ansi2knr.c",
"ansi2knr.1", 'stamp-vti'
);