Skip to content

Commit 76126a7

Browse files
committed
Set LD_LIBRARY_PATH to Tcl build area for native TCLSH_NATIVE
1 parent 2e9e76a commit 76126a7

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

‎configure‎

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9815,19 +9815,52 @@ printf '%s\n' "$found" >&6; }
98159815
{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking $TCLSH_PROG for Tcl 9" >&5
98169816
printf %s "checking $TCLSH_PROG for Tcl 9... " >&6; }
98179817

9818+
tcl_build_dir=`$as_dirname -- "$TCLSH_PROG" ||
9819+
$as_expr X"$TCLSH_PROG" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
9820+
X"$TCLSH_PROG" : 'X\(//\)[^/]' \| \
9821+
X"$TCLSH_PROG" : 'X\(//\)$' \| \
9822+
X"$TCLSH_PROG" : 'X\(/\)' \| . 2>/dev/null ||
9823+
printf '%s\n' X"$TCLSH_PROG" |
9824+
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
9825+
s//\1/
9826+
q
9827+
}
9828+
/^X\(\/\/\)[^/].*/{
9829+
s//\1/
9830+
q
9831+
}
9832+
/^X\(\/\/\)$/{
9833+
s//\1/
9834+
q
9835+
}
9836+
/^X\(\/\).*/{
9837+
s//\1/
9838+
q
9839+
}
9840+
s/.*/./; q'`
9841+
9842+
eval "tcl_save_libpath=\$$LD_LIBRARY_PATH_VAR"
9843+
eval "$LD_LIBRARY_PATH_VAR=\$tcl_build_dir"
9844+
eval "export $LD_LIBRARY_PATH_VAR"
9845+
9846+
98189847
found=`echo "puts [package vsatisfies \\$tcl_version 9]" | $TCLSH_PROG`
98199848
if test "x$found" = "x1"; then
98209849
found=yes
98219850
else
98229851
found=no
98239852
fi
98249853

9854+
9855+
eval "$LD_LIBRARY_PATH_VAR=\$tcl_save_libpath"
9856+
eval "export $LD_LIBRARY_PATH_VAR"
9857+
98259858
{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $found" >&5
98269859
printf '%s\n' "$found" >&6; }
98279860
if test x"$found" != x"yes"; then
98289861
as_fn_error $? "cannot find a usable native Tcl 9 tclsh. Either set TCLSH_NATIVE or use configure with --disable-zipfs" "$LINENO" 5
98299862
fi
9830-
TCLSH_NATIVE="$TCLSH_PROG"
9863+
eval "TCLSH_NATIVE=\"$LD_LIBRARY_PATH_VAR=\$tcl_build_dir \$TCLSH_PROG\""
98319864
fi
98329865
else
98339866
# User specified. Check version acceptable.

‎configure.ac‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,23 @@ if test "${ZIPFS_BUILD}" != 0; then
245245
# compiling.
246246
if test -z "$TCLSH_NATIVE" -a -n "$TCLSH_PROG" -a x"$ac_cv_cross" != x"yes"; then
247247
AC_MSG_CHECKING([$TCLSH_PROG for Tcl 9])
248+
249+
tcl_build_dir=`AS_DIRNAME(["$TCLSH_PROG"])`
250+
251+
eval "tcl_save_libpath=\$$LD_LIBRARY_PATH_VAR"
252+
eval "$LD_LIBRARY_PATH_VAR=\$tcl_build_dir"
253+
eval "export $LD_LIBRARY_PATH_VAR"
254+
248255
CHECK_TCLSH_VERSION([found], [$TCLSH_PROG], [9])
256+
257+
eval "$LD_LIBRARY_PATH_VAR=\$tcl_save_libpath"
258+
eval "export $LD_LIBRARY_PATH_VAR"
259+
249260
AC_MSG_RESULT([$found])
250261
if test x"$found" != x"yes"; then
251262
AC_MSG_ERROR([cannot find a usable native Tcl 9 tclsh. Either set TCLSH_NATIVE or use configure with --disable-zipfs])
252263
fi
253-
TCLSH_NATIVE="$TCLSH_PROG"
264+
eval "TCLSH_NATIVE=\"$LD_LIBRARY_PATH_VAR=\$tcl_build_dir \$TCLSH_PROG\""
254265
fi
255266
else
256267
# User specified. Check version acceptable.

0 commit comments

Comments
 (0)