From cbd8f5bbcc81ffe6c84bd6439c9a22976867e4ad Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Wed, 3 Feb 2021 14:02:30 +0000 Subject: libctf: require a Tcl capable of try/catch to run tests The run_native_host_cmd implementation in testsuite/lib/ctf-lib.exp uses try/catch, which are new in Tcl 8.6. Require a Tcl that knows that try exists, as suggested by Jan Beulich. libctf/ChangeLog 2021-02-03 Nick Alcock * configure.ac (EXPECT): Check for, in order to define... (TCL_TRY): ... this, if Tcl supports try/catch. * Makefile.am (TCL_TRY): Run the testsuite only if set. * configure: Regenerated. * Makefile.in: Likewise. --- libctf/Makefile.in | 84 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 36 deletions(-) (limited to 'libctf/Makefile.in') diff --git a/libctf/Makefile.in b/libctf/Makefile.in index 17a9a7f..7e0dd09 100644 --- a/libctf/Makefile.in +++ b/libctf/Makefile.in @@ -330,6 +330,9 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ + +# Setup the testing framework, if you have one +EXPECT = expect FGREP = @FGREP@ GENCAT = @GENCAT@ GMSGFMT = @GMSGFMT@ @@ -468,31 +471,28 @@ libctf_la_LIBADD = ../bfd/libbfd.la $(libctf_nobfd_la_LIBADD) libctf_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=0 libctf_la_LDFLAGS = $(libctf_nobfd_la_LDFLAGS) libctf_la_SOURCES = $(libctf_nobfd_la_SOURCES) ctf-open-bfd.c - -# Setup the testing framework, if you have one -EXPECT = expect RUNTEST = runtest RUNTESTFLAGS = -CC_FOR_TARGET = ` \ - if [ -f $$r/../gcc/xgcc ] ; then \ - if [ -f $$r/../newlib/Makefile ] ; then \ - echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \ - else \ - echo $$r/../gcc/xgcc -B$$r/../gcc/; \ - fi; \ - else \ - if [ "@host@" = "@target@" ] ; then \ - echo $(CC); \ - else \ - echo gcc | sed '$(transform)'; \ - fi; \ - fi` +@TCL_TRY_TRUE@CC_FOR_TARGET = ` \ +@TCL_TRY_TRUE@ if [ -f $$r/../gcc/xgcc ] ; then \ +@TCL_TRY_TRUE@ if [ -f $$r/../newlib/Makefile ] ; then \ +@TCL_TRY_TRUE@ echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \ +@TCL_TRY_TRUE@ else \ +@TCL_TRY_TRUE@ echo $$r/../gcc/xgcc -B$$r/../gcc/; \ +@TCL_TRY_TRUE@ fi; \ +@TCL_TRY_TRUE@ else \ +@TCL_TRY_TRUE@ if [ "@host@" = "@target@" ] ; then \ +@TCL_TRY_TRUE@ echo $(CC); \ +@TCL_TRY_TRUE@ else \ +@TCL_TRY_TRUE@ echo gcc | sed '$(transform)'; \ +@TCL_TRY_TRUE@ fi; \ +@TCL_TRY_TRUE@ fi` # development.sh is used to determine -Werror default. -CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh -EXTRA_DEJAGNU_SITE_CONFIG = development.exp -DISTCLEANFILES = site.exp development.exp +@TCL_TRY_TRUE@CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh +@TCL_TRY_TRUE@EXTRA_DEJAGNU_SITE_CONFIG = development.exp +@TCL_TRY_TRUE@DISTCLEANFILES = site.exp development.exp all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -995,6 +995,18 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +@TCL_TRY_FALSE@check-DEJAGNU: site.exp +@TCL_TRY_FALSE@ srcdir='$(srcdir)'; export srcdir; \ +@TCL_TRY_FALSE@ EXPECT=$(EXPECT); export EXPECT; \ +@TCL_TRY_FALSE@ if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \ +@TCL_TRY_FALSE@ exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \ +@TCL_TRY_FALSE@ if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ +@TCL_TRY_FALSE@ then :; else exit_status=1; fi; \ +@TCL_TRY_FALSE@ done; \ +@TCL_TRY_FALSE@ else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\ +@TCL_TRY_FALSE@ fi; \ +@TCL_TRY_FALSE@ exit $$exit_status site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) @echo 'Making a new site.exp file ...' @echo '## these variables are automatically generated by make ##' >site.tmp @@ -1327,22 +1339,22 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES .PRECIOUS: Makefile -check-DEJAGNU: site.exp development.exp - srcroot=`cd $(srcdir) && pwd`; export srcroot; \ - r=`pwd`; export r; \ - LC_ALL=C; export LC_ALL; \ - EXPECT=$(EXPECT); export EXPECT; \ - runtest=$(RUNTEST); \ - if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ - $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \ - CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS) -I$(INCDIR) -I$(srcdir) -I$(builddir) -I$(builddir)/../bfd $(ZLIBINC)" \ - CC_FOR_HOST="$(CC)" LIBS="$(libctf_nobfd_la_LIBADD) $(LIBS)" $(RUNTESTFLAGS); \ - else echo "WARNING: could not find \`runtest'" 1>&2; :;\ - fi - -development.exp: $(BFDDIR)/development.sh - $(EGREP) "(development|experimental)=" $(BFDDIR)/development.sh \ - | $(AWK) -F= '{ print "set " $$1 " " $$2 }' > $@ +@TCL_TRY_TRUE@check-DEJAGNU: site.exp development.exp +@TCL_TRY_TRUE@ srcroot=`cd $(srcdir) && pwd`; export srcroot; \ +@TCL_TRY_TRUE@ r=`pwd`; export r; \ +@TCL_TRY_TRUE@ LC_ALL=C; export LC_ALL; \ +@TCL_TRY_TRUE@ EXPECT=$(EXPECT); export EXPECT; \ +@TCL_TRY_TRUE@ runtest=$(RUNTEST); \ +@TCL_TRY_TRUE@ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ +@TCL_TRY_TRUE@ $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \ +@TCL_TRY_TRUE@ CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS) -I$(INCDIR) -I$(srcdir) -I$(builddir) -I$(builddir)/../bfd $(ZLIBINC)" \ +@TCL_TRY_TRUE@ CC_FOR_HOST="$(CC)" LIBS="$(libctf_nobfd_la_LIBADD) $(LIBS)" $(RUNTESTFLAGS); \ +@TCL_TRY_TRUE@ else echo "WARNING: could not find \`runtest'" 1>&2; :;\ +@TCL_TRY_TRUE@ fi + +@TCL_TRY_TRUE@development.exp: $(BFDDIR)/development.sh +@TCL_TRY_TRUE@ $(EGREP) "(development|experimental)=" $(BFDDIR)/development.sh \ +@TCL_TRY_TRUE@ | $(AWK) -F= '{ print "set " $$1 " " $$2 }' > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. -- cgit v1.1