Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
* automake.in (&handle_tests_dejagnu): Move the definition of a
default `site.exp' into...
* dejagnu.am (site.exp): here.
Use DOS compliant file names.
Index: automake.in
--- automake.in Sun, 18 Feb 2001 15:37:35 +0100 akim (am/f/39_automake.i 1.46 755)
+++ automake.in Sun, 18 Feb 2001 16:08:06 +0100 akim (am/f/39_automake.i 1.46 755)
@@ -3901,8 +3901,6 @@ sub handle_tests_dejagnu
{
push (@check_tests, 'check-DEJAGNU');
- $output_rules .= &file_contents ('dejagnu');
-
# In Cygnus mode, these are found in the build tree.
# Otherwise they are looked for in $PATH.
&define_program_variable ('EXPECT', 'build', 'expect', 'expect');
@@ -3910,49 +3908,13 @@ sub handle_tests_dejagnu
# Only create site.exp rule if user hasn't already written
# one.
- if (! &target_defined ('site.exp'))
- {
- # Note that in the rule we don't directly generate
- # site.exp to avoid the possibility of a corrupted
- # site.exp if make is interrupted. Jim Meyering has some
- # useful text on this topic.
- $output_rules .= ("site.exp: Makefile\n"
- . "\t\@echo 'Making a new site.exp file...'\n"
- . "\t\@test ! -f site.bak || rm -f site.bak\n"
- . "\t\@echo '## these variables are automatically generated
by make ##' > \$\@-t\n"
- . "\t\@echo '# Do not edit here. If you wish to override
these values' >> \$\@-t\n"
- . "\t\@echo '# edit the last section' >> \$\@-t\n"
- . "\t\@echo 'set tool \$(DEJATOOL)' >> \$\@-t\n"
- . "\t\@echo 'set srcdir \$(srcdir)' >> \$\@-t\n"
- . "\t\@echo 'set objdir' \`pwd\` >> \$\@-t\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})' >>
\$\@-t\n";
- }
- }
-
- $output_rules .= ("\t\@echo '## All variables above are generated by
configure. Do Not Edit ##' >> \$\@-t\n"
- . "\t\@test ! -f site.exp || sed '1,/^## All variables
above are.*##/ d' site.exp >> \$\@-t\n"
- . "\t\@test ! -f site.exp || mv site.exp site.bak\n"
- . "\t\@mv \$\@-t site.exp\n");
- }
+ $output_rules .=
+ &file_contents ('dejagnu',
+ &transform_cond
+ ('SITE-EXP' => ! &target_defined ('site.exp'),
+ 'BUILD' => $seen_canonical == $AC_CANONICAL_SYSTEM,
+ 'HOST' => $seen_canonical,
+ 'TARGET' => $seen_canonical == $AC_CANONICAL_SYSTEM));
}
Index: dejagnu.am
--- dejagnu.am Fri, 09 Feb 2001 04:37:00 +0100 akim (am/g/45_dejagnu.am 1.5 644)
+++ dejagnu.am Sun, 18 Feb 2001 16:04:40 +0100 akim (am/g/45_dejagnu.am 1.5 644)
@@ -1,5 +1,5 @@
## automake - create Makefile.in from Makefile.am
-## Copyright 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+## Copyright 1994, 1995, 1996, 1997, 2000, 2001 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
@@ -45,3 +45,32 @@
done; \
else echo "WARNING: could not find \`runtest'" 1>&2; :;\
fi
+
+
+## ------------------- ##
+## Building site.exp. ##
+## ------------------- ##
+
+## Note that in the rule we don't directly generate site.exp to avoid
+## the possibility of a corrupted site.exp if make is interrupted.
+## Jim Meyering has some useful text on this topic.
+?SITE-EXP?site.exp: Makefile
+?SITE-EXP? @echo 'Making a new site.exp file...'
+?SITE-EXP? @echo '## these variables are automatically generated by make ##'
+>site.tmp
+?SITE-EXP? @echo '# Do not edit here. If you wish to override these values'
+>>site.tmp
+?SITE-EXP? @echo '# edit the last section' >>site.tmp
+?SITE-EXP? @echo 'set tool $(DEJATOOL)' >>site.tmp
+?SITE-EXP? @echo 'set srcdir $(srcdir)' >>site.tmp
+?SITE-EXP? @echo "set objdir `pwd`" >>site.tmp
+?SITE-EXP??BUILD? @echo 'set build_alias $(build_alias)' >>site.tmp
+?SITE-EXP??BUILD? @echo 'set build_triplet $(build_triplet)' >>site.tmp
+?SITE-EXP??HOST? @echo 'set host_alias $(host_alias)' >>site.tmp
+?SITE-EXP??HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp
+?SITE-EXP??TARGET? @echo 'set target_alias $(target_alias)' >>site.tmp
+?SITE-EXP??TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp
+?SITE-EXP? @echo '## All variables above are generated by configure. Do Not
+Edit ##' >>site.tmp
+?SITE-EXP? @test ! -f site.exp || \
+?SITE-EXP? sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
+?SITE-EXP? @-rm -f site.bak
+?SITE-EXP? @test ! -f site.exp || mv site.exp site.bak
+?SITE-EXP? @mv site.tmp site.exp
Index: tests/defs
--- tests/defs Wed, 31 Jan 2001 00:08:51 +0100 akim (am/f/2_defs 1.2 644)
+++ tests/defs Sun, 18 Feb 2001 15:55:50 +0100 akim (am/f/2_defs 1.2 644)
@@ -27,6 +27,7 @@
# Build appropriate environment in test directory. Eg create
# configure.in, touch all necessary files, etc.
cat > configure.in << 'END'
+AC_INIT
AM_INIT_AUTOMAKE(nonesuch, nonesuch)
PACKAGE=nonesuch
VERSION=nonesuch
Index: tests/dejagnu.test
--- tests/dejagnu.test Sat, 13 Jan 2001 18:11:09 +0100 akim (am/d/28_dejagnu.te 1.1
775)
+++ tests/dejagnu.test Sun, 18 Feb 2001 15:54:26 +0100 akim (am/d/28_dejagnu.te 1.1
+775)
@@ -13,4 +13,5 @@
$AUTOMAKE || exit 1
-grep '^check-TESTS' Makefile.in && grep '^check-DEJAGNU' Makefile.in
+grep '^check-TESTS' Makefile.in
+grep '^check-DEJAGNU' Makefile.in