From ef61186b2bc115999a8345c04e9ea997d00910ef Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 8 May 2001 11:00:11 +0000 Subject: [PATCH] * automake.in (&handle_tests_dejagnu): Don't define EXPECT and RUNTEST. * dejagnu.am: Do it. (site.exp): Use `if'. --- ChangeLog | 7 ++++++ automake.in | 11 +++------ dejagnu.am | 62 ++++++++++++++++++++++++++++++++--------------- lib/am/dejagnu.am | 62 ++++++++++++++++++++++++++++++++--------------- 4 files changed, 95 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index e187a248..21d94f5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-05-08 Akim Demaille + + * automake.in (&handle_tests_dejagnu): Don't define EXPECT and + RUNTEST. + * dejagnu.am: Do it. + (site.exp): Use `if'. + 2001-05-08 Akim Demaille * automake.in: Formatting changes. diff --git a/automake.in b/automake.in index 06873fb6..701b0f66 100755 --- a/automake.in +++ b/automake.in @@ -4132,13 +4132,7 @@ sub handle_tests_dejagnu { push (@check_tests, 'check-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'); - &define_program_variable ('RUNTEST', 'src', 'dejagnu', 'runtest'); - - # Only create site.exp rule if user hasn't already written - # one. + # Only create site.exp rule if user hasn't already written one. $output_rules .= &file_contents ('dejagnu', ('SITE-EXP' => ! &target_defined ('site.exp'), @@ -6415,6 +6409,9 @@ sub define_compiler_variable if $seen_libtool; } + +# define_program_variable ($VAR, $WHATDIR, $SUBDIR, $PROGRAM, $OVERRIDE) +# ---------------------------------------------------------------------- # Define a variable that represents a program to run. If in Cygnus # mode, the program is searched for in the build (or source) tree. # Otherwise no searching is done at all. Arguments are: diff --git a/dejagnu.am b/dejagnu.am index 9b8fe400..f836a295 100644 --- a/dejagnu.am +++ b/dejagnu.am @@ -25,6 +25,26 @@ DEJATOOL = $(PACKAGE) ## Default flags to pass to dejagnu. The user can override this. RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +## In Cygnus mode, these are found in the build tree. +## Otherwise they are looked for in $PATH. +if %?CYGNUS% +EXPECT = `if test -f $(top_builddir)/../expect/expect; then \ + echo $(top_builddir)/../expect/expect; \ + else \ + echo expect; \ + fi` + +RUNTEST = `if test -f $(top_srcdir)/../dejagnu/runtest; then \ + echo $(top_srcdir)/../dejagnu/runtest; \ + else \ + echo runtest; \ + fi` +else ! %?CYGNUS% +EXPECT = expect +RUNTEST = runtest +endif ! %?CYGNUS% + + .PHONY: check-DEJAGNU check-DEJAGNU: site.exp ## Life is easiest with an absolute srcdir, so do that. @@ -54,23 +74,25 @@ check-DEJAGNU: 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 +if %?SITE-EXP? +site.exp: Makefile + @echo 'Making a new site.exp file...' + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set tool $(DEJATOOL)' >>site.tmp + @echo 'set srcdir $(srcdir)' >>site.tmp + @echo "set objdir `pwd`" >>site.tmp +?BUILD? @echo 'set build_alias $(build_alias)' >>site.tmp +?BUILD? @echo 'set build_triplet $(build_triplet)' >>site.tmp +?HOST? @echo 'set host_alias $(host_alias)' >>site.tmp +?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp +?TARGET? @echo 'set target_alias $(target_alias)' >>site.tmp +?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp + @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp + @test ! -f site.exp || \ + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @-rm -f site.bak + @test ! -f site.exp || mv site.exp site.bak + @mv site.tmp site.exp +endif %?SITE-EXP? diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am index 9b8fe400..f836a295 100644 --- a/lib/am/dejagnu.am +++ b/lib/am/dejagnu.am @@ -25,6 +25,26 @@ DEJATOOL = $(PACKAGE) ## Default flags to pass to dejagnu. The user can override this. RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +## In Cygnus mode, these are found in the build tree. +## Otherwise they are looked for in $PATH. +if %?CYGNUS% +EXPECT = `if test -f $(top_builddir)/../expect/expect; then \ + echo $(top_builddir)/../expect/expect; \ + else \ + echo expect; \ + fi` + +RUNTEST = `if test -f $(top_srcdir)/../dejagnu/runtest; then \ + echo $(top_srcdir)/../dejagnu/runtest; \ + else \ + echo runtest; \ + fi` +else ! %?CYGNUS% +EXPECT = expect +RUNTEST = runtest +endif ! %?CYGNUS% + + .PHONY: check-DEJAGNU check-DEJAGNU: site.exp ## Life is easiest with an absolute srcdir, so do that. @@ -54,23 +74,25 @@ check-DEJAGNU: 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 +if %?SITE-EXP? +site.exp: Makefile + @echo 'Making a new site.exp file...' + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set tool $(DEJATOOL)' >>site.tmp + @echo 'set srcdir $(srcdir)' >>site.tmp + @echo "set objdir `pwd`" >>site.tmp +?BUILD? @echo 'set build_alias $(build_alias)' >>site.tmp +?BUILD? @echo 'set build_triplet $(build_triplet)' >>site.tmp +?HOST? @echo 'set host_alias $(host_alias)' >>site.tmp +?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp +?TARGET? @echo 'set target_alias $(target_alias)' >>site.tmp +?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp + @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp + @test ! -f site.exp || \ + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @-rm -f site.bak + @test ! -f site.exp || mv site.exp site.bak + @mv site.tmp site.exp +endif %?SITE-EXP? -- 2.43.5