From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2103) id 3C45E385438F; Thu, 12 Jan 2023 15:39:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C45E385438F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673537979; bh=uQEtvFCi1XgxHuIkxCyooprroUIF6RdNevM7ZkGDiwM=; h=From:To:Subject:Date:From; b=L32Ru0l5eA4kJdKqZ/GLay35PRuMoUNa+hp6iikgN/T89AW71A3q1bdhpof9OyJ+o zra7TrUs66q0P61h9TK6qqGAB/Hkp22aHCy7vUZoqLvTNXNFoQz4HkWux3d0vtIqxp 5sUS3LPJ9iRqceatc5hZkvOHGlrMYeC/G5tZjrgI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Nick Alcock To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] libctf: skip the testsuite from inside dejagnu X-Act-Checkin: binutils-gdb X-Git-Author: Nick Alcock X-Git-Refname: refs/heads/master X-Git-Oldrev: 5e8b4bbcc8593e1f1f81c4fd3562d637a07ee0cc X-Git-Newrev: e2dc08c6f0642ca2c94e91997a8d4e971bea9971 Message-Id: <20230112153939.3C45E385438F@sourceware.org> Date: Thu, 12 Jan 2023 15:39:39 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3De2dc08c6f064= 2ca2c94e91997a8d4e971bea9971 commit e2dc08c6f0642ca2c94e91997a8d4e971bea9971 Author: Nick Alcock Date: Mon Nov 14 14:17:55 2022 +0000 libctf: skip the testsuite from inside dejagnu =20 The libctf testsuite uses Tcl try/catch to trap run_output errors. This is only supported in reasonably recent Tcls, so we detect the lack of try/catch and suppress the testsuite via an Automake conditional in its absence. =20 But this turns out not to work: Automake produces a check-DEJAGNU target regardless of the value of this conditional and sticks it in an unconditionally-executed part of the makefile, so the testsuite gets executed anyway, and fails with a nasty-looking syntax error. We can't disable it by taking "dejagnu" out of AUTOMAKE_OPTIONS, because if you do that Automake stops you using RUNTEST, RUNTESTFLAGS and other variables users would expect to work. =20 So move to disabling the testsuite from inside the testsuite itself, importing the value of the former Automake conditional as a Tcl variable and exiting very early in default.exp if it's false. =20 * configure.ac (TCL_TRY): No longer an Automake conditional. Rename to... (HAVE_TCL_TRY): ... this. * Makefile.am: Drop TCL_TRY. (development.exp): Set have_tcl_try. * testsuite/config/default.exp: Exit if have_tcl_try is false. =20 * configure: Regenerated. * Makefile.in: Likewise. Diff: --- libctf/Makefile.am | 3 +- libctf/Makefile.in | 95 ++++++++++++++++-----------------= ---- libctf/configure | 21 +++----- libctf/configure.ac | 7 ++- libctf/testsuite/config/default.exp | 5 ++ 5 files changed, 61 insertions(+), 70 deletions(-) diff --git a/libctf/Makefile.am b/libctf/Makefile.am index c4809f70bae..c959b09e492 100644 --- a/libctf/Makefile.am +++ b/libctf/Makefile.am @@ -72,7 +72,6 @@ EXPECT =3D expect RUNTEST =3D runtest RUNTESTFLAGS =3D =20 -if TCL_TRY CC_FOR_TARGET =3D ` \ if [ -f $$r/../gcc/xgcc ] ; then \ if [ -f $$r/../newlib/Makefile ] ; then \ @@ -105,6 +104,7 @@ check-DEJAGNU: site.exp development.exp development.exp: $(BFDDIR)/development.sh $(AM_V_GEN)$(EGREP) "(development|experimental)=3D" $(BFDDIR)/development= .sh \ | $(AWK) -F=3D '{ print "set " $$1 " " $$2 }' > $@ + echo "set have_tcl_try @HAVE_TCL_TRY@" >> $@ =20 # development.sh is used to determine -Werror default. CONFIG_STATUS_DEPENDENCIES =3D $(BFDDIR)/development.sh @@ -112,6 +112,5 @@ CONFIG_STATUS_DEPENDENCIES =3D $(BFDDIR)/development.sh EXTRA_DEJAGNU_SITE_CONFIG =3D development.exp =20 DISTCLEANFILES +=3D site.exp development.exp -endif =20 include doc/local.mk diff --git a/libctf/Makefile.in b/libctf/Makefile.in index f2b852e3fae..c6cb55c9768 100644 --- a/libctf/Makefile.in +++ b/libctf/Makefile.in @@ -127,10 +127,9 @@ build_triplet =3D @build@ host_triplet =3D @host@ target_triplet =3D @target@ @NEED_CTF_QSORT_R_TRUE@am__append_1 =3D ctf-qsort_r.c -@TCL_TRY_TRUE@am__append_2 =3D site.exp development.exp -@BUILD_INFO_TRUE@am__append_3 =3D doc/ctf-spec.texi -@BUILD_INFO_TRUE@am__append_4 =3D texput.log -@BUILD_INFO_TRUE@am__append_5 =3D doc/ctf-spec.info +@BUILD_INFO_TRUE@am__append_2 =3D doc/ctf-spec.texi +@BUILD_INFO_TRUE@am__append_3 =3D texput.log +@BUILD_INFO_TRUE@am__append_4 =3D doc/ctf-spec.info subdir =3D . ACLOCAL_M4 =3D $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps =3D $(top_srcdir)/../bfd/acinclude.m4 \ @@ -312,7 +311,7 @@ DVIS =3D doc/ctf-spec.dvi PDFS =3D doc/ctf-spec.pdf PSS =3D doc/ctf-spec.ps HTMLS =3D doc/ctf-spec.html -TEXINFOS =3D $(am__append_3) +TEXINFOS =3D $(am__append_2) TEXI2DVI =3D texi2dvi TEXI2PDF =3D $(TEXI2DVI) --pdf --batch MAKEINFOHTML =3D $(MAKEINFO) --html @@ -407,6 +406,7 @@ FGREP =3D @FGREP@ GENCAT =3D @GENCAT@ GMSGFMT =3D @GMSGFMT@ GREP =3D @GREP@ +HAVE_TCL_TRY =3D @HAVE_TCL_TRY@ INCINTL =3D @INCINTL@ INSTALL =3D @INSTALL@ INSTALL_DATA =3D @INSTALL_DATA@ @@ -522,9 +522,9 @@ ACLOCAL_AMFLAGS =3D -I .. -I ../config -I ../bfd AUTOMAKE_OPTIONS =3D dejagnu foreign info-in-builddir no-texinfo.tex =20 # Variables that we might accumulate conditionally or in subdirs. -info_TEXINFOS =3D $(am__append_3) -DISTCLEANFILES =3D $(am__append_2) $(am__append_4) -MAINTAINERCLEANFILES =3D $(am__append_5) +info_TEXINFOS =3D $(am__append_2) +DISTCLEANFILES =3D site.exp development.exp $(am__append_3) +MAINTAINERCLEANFILES =3D $(am__append_4) =20 # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is # -I../zlib, unless we were configured with --with-system-zlib, in which @@ -559,25 +559,25 @@ libctf_la_LDFLAGS =3D $(libctf_ldflags_nover) @VERSIO= N_FLAGS@ libctf_la_SOURCES =3D $(libctf_nobfd_la_SOURCES) ctf-open-bfd.c RUNTEST =3D runtest RUNTESTFLAGS =3D=20 -@TCL_TRY_TRUE@CC_FOR_TARGET =3D ` \ -@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/../n= ewlib/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@" =3D "@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` +CC_FOR_TARGET =3D ` \ + if [ -f $$r/../gcc/xgcc ] ; then \ + if [ -f $$r/../newlib/Makefile ] ; then \ + echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-inc= lude -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \ + else \ + echo $$r/../gcc/xgcc -B$$r/../gcc/; \ + fi; \ + else \ + if [ "@host@" =3D "@target@" ] ; then \ + echo $(CC); \ + else \ + echo gcc | sed '$(transform)'; \ + fi; \ + fi` =20 =20 # development.sh is used to determine -Werror default. -@TCL_TRY_TRUE@CONFIG_STATUS_DEPENDENCIES =3D $(BFDDIR)/development.sh -@TCL_TRY_TRUE@EXTRA_DEJAGNU_SITE_CONFIG =3D development.exp +CONFIG_STATUS_DEPENDENCIES =3D $(BFDDIR)/development.sh +EXTRA_DEJAGNU_SITE_CONFIG =3D development.exp @BUILD_INFO_TRUE@AM_MAKEINFOFLAGS =3D --no-split all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -1235,18 +1235,6 @@ 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=3D'$(srcdir)'; export srcdir; \ -@TCL_TRY_FALSE@ EXPECT=3D$(EXPECT); export EXPECT; \ -@TCL_TRY_FALSE@ if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; th= en \ -@TCL_TRY_FALSE@ exit_status=3D0; l=3D'$(DEJATOOL)'; for tool in $$l; do \ -@TCL_TRY_FALSE@ if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS= ) $(RUNTESTFLAGS); \ -@TCL_TRY_FALSE@ then :; else exit_status=3D1; 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.t= mp @@ -1685,23 +1673,24 @@ uninstall-am: uninstall-dvi-am uninstall-html-am \ .PRECIOUS: Makefile =20 =20 -@TCL_TRY_TRUE@check-DEJAGNU: site.exp development.exp -@TCL_TRY_TRUE@ srcroot=3D`cd $(srcdir) && pwd`; export srcroot; \ -@TCL_TRY_TRUE@ r=3D`pwd`; export r; \ -@TCL_TRY_TRUE@ LC_ALL=3DC; export LC_ALL; \ -@TCL_TRY_TRUE@ EXPECT=3D$(EXPECT); export EXPECT; \ -@TCL_TRY_TRUE@ runtest=3D$(RUNTEST); \ -@TCL_TRY_TRUE@ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then= \ -@TCL_TRY_TRUE@ $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsui= te \ -@TCL_TRY_TRUE@ CC=3D"$(CC)" CC_FOR_TARGET=3D"$(CC_FOR_TARGET)" \ -@TCL_TRY_TRUE@ CFLAGS=3D"$(CFLAGS) -I$(INCDIR) -I$(srcdir) -I$(builddir) = -I$(builddir)/../bfd $(ZLIBINC)" \ -@TCL_TRY_TRUE@ LIBS=3D"$(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@ $(AM_V_GEN)$(EGREP) "(development|experimental)=3D" $(BFDDI= R)/development.sh \ -@TCL_TRY_TRUE@ | $(AWK) -F=3D '{ print "set " $$1 " " $$2 }' > $@ +check-DEJAGNU: site.exp development.exp + srcroot=3D`cd $(srcdir) && pwd`; export srcroot; \ + r=3D`pwd`; export r; \ + LC_ALL=3DC; export LC_ALL; \ + EXPECT=3D$(EXPECT); export EXPECT; \ + runtest=3D$(RUNTEST); \ + if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ + $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \ + CC=3D"$(CC)" CC_FOR_TARGET=3D"$(CC_FOR_TARGET)" \ + CFLAGS=3D"$(CFLAGS) -I$(INCDIR) -I$(srcdir) -I$(builddir) -I$(builddir)/= ../bfd $(ZLIBINC)" \ + LIBS=3D"$(libctf_nobfd_la_LIBADD) $(LIBS)" $(RUNTESTFLAGS); \ + else echo "WARNING: could not find \`runtest'" 1>&2; :;\ + fi + +development.exp: $(BFDDIR)/development.sh + $(AM_V_GEN)$(EGREP) "(development|experimental)=3D" $(BFDDIR)/development= .sh \ + | $(AWK) -F=3D '{ print "set " $$1 " " $$2 }' > $@ + echo "set have_tcl_try @HAVE_TCL_TRY@" >> $@ =20 @BUILD_INFO_TRUE@html-local: doc/ctf-spec/index.html @BUILD_INFO_TRUE@doc/ctf-spec/index.html: doc/ctf-spec.texi doc/$(am__dirs= tamp) diff --git a/libctf/configure b/libctf/configure index 17463a74cca..c22f7dffd2c 100755 --- a/libctf/configure +++ b/libctf/configure @@ -637,8 +637,7 @@ LTLIBOBJS LIBOBJS VERSION_FLAGS_NOBFD VERSION_FLAGS -TCL_TRY_FALSE -TCL_TRY_TRUE +HAVE_TCL_TRY EXPECT CTF_LIBADD SHARED_LDFLAGS @@ -11632,7 +11631,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11635 "configure" +#line 11634 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -11738,7 +11737,7 @@ else lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 lt_status=3D$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11741 "configure" +#line 11740 "configure" #include "confdefs.h" =20 #if HAVE_DLFCN_H @@ -14975,12 +14974,10 @@ fi` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libctf_tcl_try" >&5 $as_echo "$ac_cv_libctf_tcl_try" >&6; } - if test "${ac_cv_libctf_tcl_try}" =3D yes; then - TCL_TRY_TRUE=3D - TCL_TRY_FALSE=3D'#' -else - TCL_TRY_TRUE=3D'#' - TCL_TRY_FALSE=3D + +HAVE_TCL_TRY=3Dfalse +if test "${ac_cv_libctf_tcl_try}" =3D "yes"; then + HAVE_TCL_TRY=3Dtrue fi =20 =20 @@ -15208,10 +15205,6 @@ if test -z "${BUILD_INFO_TRUE}" && test -z "${BUIL= D_INFO_FALSE}"; then as_fn_error $? "conditional \"BUILD_INFO\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${TCL_TRY_TRUE}" && test -z "${TCL_TRY_FALSE}"; then - as_fn_error $? "conditional \"TCL_TRY\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi =20 : "${CONFIG_STATUS=3D./config.status}" ac_write_fail=3D0 diff --git a/libctf/configure.ac b/libctf/configure.ac index a0148a4c328..1d0cf4d0fa5 100644 --- a/libctf/configure.ac +++ b/libctf/configure.ac @@ -241,7 +241,12 @@ if @<:@llength @<:@info commands try@:>@@:>@ then { pu= ts yes } else { puts no } EOF fi` ]) -AM_CONDITIONAL(TCL_TRY, test "${ac_cv_libctf_tcl_try}" =3D yes) + +HAVE_TCL_TRY=3Dfalse +if test "${ac_cv_libctf_tcl_try}" =3D "yes"; then + HAVE_TCL_TRY=3Dtrue +fi +AC_SUBST(HAVE_TCL_TRY) =20 # Use a version script, if possible, or an -export-symbols-regex otherwise. decommented_version_script=3D diff --git a/libctf/testsuite/config/default.exp b/libctf/testsuite/config/= default.exp index 4bac9c4281c..357c4ee57f1 100644 --- a/libctf/testsuite/config/default.exp +++ b/libctf/testsuite/config/default.exp @@ -21,6 +21,11 @@ # Written by Jeffrey Wheat (cassidy@cygnus.com) # =20 +# Don't run anything if Tcl is too old to have try / catch. +if { ! $have_tcl_try } { + log_and_exit +} + if ![info exists ld] then { set ld [findfile $base_dir/../ld/ld-new $base_dir/../ld/ld-new [transf= orm ld]] }