From e89a3632a50acb099258f785ed31f421b7eaf1ce Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 21 Feb 2001 08:28:02 +0000 Subject: [PATCH] * automake.in (&handle_tests_dejagnu): Move the definition of a default `site.exp' into... * dejagnu.am (site.exp): here. Use DOS compliant file names. --- ChangeLog | 8 +++++++ automake.in | 52 +++++++--------------------------------------- dejagnu.am | 31 ++++++++++++++++++++++++++- lib/am/dejagnu.am | 31 ++++++++++++++++++++++++++- tests/defs | 1 + tests/dejagnu.test | 3 ++- 6 files changed, 78 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99add2ea..35bc71b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-02-21 Akim Demaille + + * automake.in (&handle_tests_dejagnu): Move the definition of a + default `site.exp' into... + * dejagnu.am (site.exp): here. + Use DOS compliant file names. + + 2001-02-21 Akim Demaille * automake.in (&dist_cmp): New. diff --git a/automake.in b/automake.in index b3ff1ecc..4fb8d5c5 100755 --- a/automake.in +++ b/automake.in @@ -3909,8 +3909,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'); @@ -3918,49 +3916,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)); } diff --git a/dejagnu.am b/dejagnu.am index b8ae10d6..9b8fe400 100644 --- a/dejagnu.am +++ b/dejagnu.am @@ -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 @@ check-DEJAGNU: site.exp 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 diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am index b8ae10d6..9b8fe400 100644 --- a/lib/am/dejagnu.am +++ b/lib/am/dejagnu.am @@ -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 @@ check-DEJAGNU: site.exp 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 diff --git a/tests/defs b/tests/defs index 11f2f8ff..24a0f750 100644 --- a/tests/defs +++ b/tests/defs @@ -27,6 +27,7 @@ cd ./testSubDir # 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 diff --git a/tests/dejagnu.test b/tests/dejagnu.test index 140ec07b..55459fde 100755 --- a/tests/dejagnu.test +++ b/tests/dejagnu.test @@ -13,4 +13,5 @@ END $AUTOMAKE || exit 1 -grep '^check-TESTS' Makefile.in && grep '^check-DEJAGNU' Makefile.in +grep '^check-TESTS' Makefile.in +grep '^check-DEJAGNU' Makefile.in -- 2.43.5