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  <nick.alcock@oracle.com>

	* 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.
This commit is contained in:
Nick Alcock
2021-02-03 14:02:30 +00:00
parent 9514861402
commit cbd8f5bbcc
5 changed files with 137 additions and 37 deletions

73
libctf/configure vendored
View File

@@ -636,6 +636,9 @@ am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
VERSION_FLAGS
TCL_TRY_FALSE
TCL_TRY_TRUE
EXPECT
CTF_LIBADD
SHARED_LDFLAGS
NEED_CTF_QSORT_R_FALSE
@@ -11539,7 +11542,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11542 "configure"
#line 11545 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11645,7 +11648,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11648 "configure"
#line 11651 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13391,6 +13394,68 @@ fi
# Extract the first word of "expect", so it can be a program name with args.
set dummy expect; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_EXPECT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $EXPECT in
[\\/]* | ?:[\\/]*)
ac_cv_path_EXPECT="$EXPECT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_EXPECT="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
EXPECT=$ac_cv_path_EXPECT
if test -n "$EXPECT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPECT" >&5
$as_echo "$EXPECT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl supporting try/catch" >&5
$as_echo_n "checking for Tcl supporting try/catch... " >&6; }
if ${ac_cv_libctf_tcl_try+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_libctf_tcl_try=`if test -z $EXPECT; then echo no; else $EXPECT << EOF
if [llength [info commands try]] then { puts yes } else { puts no }
EOF
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}" = yes; then
TCL_TRY_TRUE=
TCL_TRY_FALSE='#'
else
TCL_TRY_TRUE='#'
TCL_TRY_FALSE=
fi
# Use a version script, if possible, or an -export-symbols-regex otherwise.
VERSION_FLAGS='-export-symbols-regex ctf_.*'
if $LD --help 2>&1 | grep -- --version-script >/dev/null; then
@@ -13552,6 +13617,10 @@ if test -z "${NEED_CTF_QSORT_R_TRUE}" && test -z "${NEED_CTF_QSORT_R_FALSE}"; th
as_fn_error $? "conditional \"NEED_CTF_QSORT_R\" 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
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0