From 91db27aff576f818bd8be078494fed3feb341f0d Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 1 Aug 2024 18:10:00 +0000 Subject: [PATCH 1/8] Clean up and restructure the TCL configuration sections in autoconf. The new --with-tclsh=FILE option lets you select the specific tclsh that you want to run. FossilOrigin-Name: 8fafc679d91e857602fbbe203144ca98242246660ede5a49c5fec8aaff571151 --- configure | 361 +++++++++++----------------------------- configure.ac | 252 ++++++---------------------- manifest | 18 +- manifest.uuid | 2 +- tool/find_tclconfig.tcl | 24 +++ 5 files changed, 187 insertions(+), 470 deletions(-) create mode 100644 tool/find_tclconfig.tcl diff --git a/configure b/configure index efd0422ac1..744410589b 100755 --- a/configure +++ b/configure @@ -781,18 +781,6 @@ TARGET_HAVE_EDITLINE TARGET_HAVE_READLINE TARGET_READLINE_INC TARGET_READLINE_LIBS -HAVE_TCL -TCL_SHLIB_SUFFIX -TCL_STUB_LIB_SPEC -TCL_STUB_LIB_FLAG -TCL_STUB_LIB_FILE -TCL_LIB_SPEC -TCL_LIB_FLAG -TCL_LIB_FILE -TCL_INCLUDE_SPEC -TCL_SRC_DIR -TCL_BIN_DIR -TCL_VERSION TARGET_EXEEXT SQLITE_OS_WIN SQLITE_OS_UNIX @@ -806,6 +794,18 @@ RELEASE VERSION program_prefix TCLLIBDIR +HAVE_TCL +TCL_SHLIB_SUFFIX +TCL_STUB_LIB_SPEC +TCL_STUB_LIB_FLAG +TCL_STUB_LIB_FILE +TCL_LIB_SPEC +TCL_LIB_FLAG +TCL_LIB_FILE +TCL_INCLUDE_SPEC +TCL_SRC_DIR +TCL_BIN_DIR +TCL_VERSION TCLSH_CMD INSTALL_DATA INSTALL_SCRIPT @@ -894,12 +894,12 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_largefile +with_tclsh +with_tcl with_wasi_sdk enable_threadsafe enable_releasemode enable_tempstore -enable_tcl -with_tcl enable_editline enable_readline with_readline_lib @@ -1555,7 +1555,6 @@ Optional Features: --enable-releasemode Support libtool link to release mode --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always) - --disable-tcl do not build TCL extension --enable-editline enable BSD editline support --disable-readline disable readline support --enable-debug enable debugging & verbose explain @@ -1583,10 +1582,10 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-tclsh=PATHNAME full pathname of a tclsh to use + --with-tcl=DIR directory containing (tclConfig.sh) --with-wasi-sdk=DIR directory containing the WASI SDK. Triggers cross-compile to WASM. - --with-tcl=DIR directory containing tcl configuration - (tclConfig.sh) --with-readline-lib specify readline library --with-readline-inc specify readline include paths --with-linenoise=DIR source directory for linenoise library @@ -3945,13 +3944,13 @@ if ${lt_cv_nm_interface+:} false; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:3948: $ac_compile\"" >&5) + (eval echo "\"\$as_me:3947: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:3951: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:3950: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:3954: output\"" >&5) + (eval echo "\"\$as_me:3953: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5157,7 +5156,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5160 "configure"' > conftest.$ac_ext + echo '#line 5159 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6682,11 +6681,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6685: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6684: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6689: \$? = $ac_status" >&5 + echo "$as_me:6688: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7021,11 +7020,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7024: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7023: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7028: \$? = $ac_status" >&5 + echo "$as_me:7027: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7126,11 +7125,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7129: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7128: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7133: \$? = $ac_status" >&5 + echo "$as_me:7132: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7181,11 +7180,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7184: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7183: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7188: \$? = $ac_status" >&5 + echo "$as_me:7187: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9561,7 +9560,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9564 "configure" +#line 9563 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -9657,7 +9656,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9660 "configure" +#line 9659 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10314,24 +10313,23 @@ done USE_AMALGAMATION=1 ######### -# See whether we can run specific tclsh versions known to work well; -# if not, then we fall back to plain tclsh. -# TODO: try other versions before falling back? +# Figure out all the name of a working tclsh and parameters needed to compile against Tcl. +# The --with-tcl= configuration parameter might be useful for this. # -if test x"${with_tcl}" != x; then - if test ! -r ${with_tcl}/tclConfig.sh; then - as_fn_error $? "no tclConfig.sh file found in --with-tcl: ${with_tcl}" "$LINENO" 5 - else - . ${with_tcl}/tclConfig.sh - TCLSH_CMD=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION} - if test ! -x ${TCLSH_CMD}; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot use tclsh at: ${TCLSH_CMD}" >&5 -$as_echo "$as_me: WARNING: cannot use tclsh at: ${TCLSH_CMD}" >&2;} - TCLSH_CMD=none - fi - fi -else - for ac_prog in tclsh8.6 tclsh8.5 tclsh + +# Check whether --with-tclsh was given. +if test "${with_tclsh+set}" = set; then : + withval=$with_tclsh; +fi + + +# Check whether --with-tcl was given. +if test "${with_tcl+set}" = set; then : + withval=$with_tcl; +fi + +if test x"${with_tclsh}" == x -a x"${with_tcl}" == x; then + for ac_prog in tclsh8.6 tclsh tclsh9.0 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -10374,23 +10372,71 @@ fi done test -n "$TCLSH_CMD" || TCLSH_CMD="none" + with_tclsh=${TCLSH_CMD} +fi +if test x"${with_tclsh}" != x -a x"${with_tclsh}" != xnone; then + TCLSH_CMD=${with_tclsh} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using tclsh at \"$TCLSH_CMD\"" >&5 +$as_echo "using tclsh at \"$TCLSH_CMD\"" >&6; } + with_tcl=`${with_tclsh} <${srcdir}/tool/find_tclconfig.tcl` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH_CMD recommends the tclConfig.sh at ${with_tcl}" >&5 +$as_echo "$TCLSH_CMD recommends the tclConfig.sh at ${with_tcl}" >&6; } +fi +if test x"${with_tcl}" != x; then + if test -r ${with_tcl}/tclConfig.sh; then + tclconfig="${with_tcl}/tclConfig.sh" + else + if test -r ${with_tcl}/tcl8.6/tclConfig.sh; then + tclconfig="${with_tcl}/tcl8.6/tclConfig.sh" + else + as_fn_error $? "no tclConfig.sh file found in ${with_tcl} or ${with_tcl}/tcl8.6" "$LINENO" 5 + fi + fi + if test x"${tclconfig}" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading TCL configuration from ${tclconfig}" >&5 +$as_echo "loading TCL configuration from ${tclconfig}" >&6; } + . ${tclconfig} + + + + + + + + + + + + fi + if test x"$TCLSH_CMD" == x; then + TCLSH_CMD=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION} + if test ! -x ${TCLSH_CMD}; then + TCLSH_CMD_2=${TCL_EXEC_PREFIX}/bin/tclsh + if test ! -x ${TCLSH_CMD_2}; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find a usable tclsh at either ${TCLSH_CMD} or ${TCLSH_CMD_2}" >&5 +$as_echo "$as_me: WARNING: cannot find a usable tclsh at either ${TCLSH_CMD} or ${TCLSH_CMD_2}" >&2;} + TCLSH_CMD=none + else + TCLSH_CMD=${TCLSH_CMD_2} + fi + fi + fi fi if test "$TCLSH_CMD" = "none"; then # If we can't find a local tclsh, then building the amalgamation will fail. # We act as though --disable-amalgamation has been used. - echo "Warning: can't find tclsh - defaulting to non-amalgamation build." + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Warning: can't find tclsh - defaulting to non-amalgamation build." >&5 +$as_echo "$as_me: WARNING: Warning: can't find tclsh - defaulting to non-amalgamation build." >&2;} USE_AMALGAMATION=0 TCLSH_CMD="tclsh" -fi -if test x"$TCLSH_CMD" = x; then - as_fn_error $? "cannot find a usable tclsh" "$LINENO" 5 + HAVE_TCL=0 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using $TCLSH_CMD" >&5 -$as_echo "using $TCLSH_CMD" >&6; } + HAVE_TCL=1 fi + if test "x${TCLLIBDIR+set}" != "xset" ; then TCLLIBDIR='$(libdir)' for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do @@ -10789,213 +10835,6 @@ fi -########## -# Figure out all the parameters needed to compile against Tcl. -# -# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG -# macros in the in the tcl.m4 file of the standard TCL distribution. -# Those macros could not be used directly since we have to make some -# minor changes to accomodate systems that do not have TCL installed. -# -# Check whether --enable-tcl was given. -if test "${enable_tcl+set}" = set; then : - enableval=$enable_tcl; use_tcl=$enableval -else - use_tcl=yes -fi - -if test "${use_tcl}" = "yes" ; then - -# Check whether --with-tcl was given. -if test "${with_tcl+set}" = set; then : - withval=$with_tcl; with_tclconfig=${withval} -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 -$as_echo_n "checking for Tcl configuration... " >&6; } - if ${ac_cv_c_tclconfig+:} false; then : - $as_echo_n "(cached) " >&6 -else - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 - fi - fi - - # Start autosearch by asking tclsh - if test x"${ac_cv_c_tclconfig}" = x ; then - if test x"$cross_compiling" = xno; then - for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="$i" - break - fi - done - fi - fi - - # On ubuntu 14.10, $auto_path on tclsh is not quite correct. - # So try again after applying corrections. - if test x"${ac_cv_c_tclconfig}" = x ; then - if test x"$cross_compiling" = xno; then - for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD} | sed 's,/tcltk/tcl,/tcl,g'` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="$i" - break - fi - done - fi - fi - - # Recent versions of Xcode on Macs hid the tclConfig.sh file - # in a strange place. - if test x"${ac_cv_c_tclconfig}" = x ; then - if test x"$cross_compiling" = xno; then - for i in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX*.sdk/usr/lib - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="$i" - break - fi - done - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` - do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - `ls -d ${libdir} 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` - do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - -fi - - - if test x"${ac_cv_c_tclconfig}" = x ; then - use_tcl=no - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find Tcl configuration definitions" >&5 -$as_echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&5 -$as_echo "$as_me: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&5 -$as_echo "$as_me: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&2;} - else - TCL_BIN_DIR=${ac_cv_c_tclconfig} - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 -$as_echo "found $TCL_BIN_DIR/tclConfig.sh" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 -$as_echo_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh... " >&6; } - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 -$as_echo "loading" >&6; } - . $TCL_BIN_DIR/tclConfig.sh - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5 -$as_echo "file not found" >&6; } - fi - - # - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f $TCL_BIN_DIR/Makefile ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - fi - - # - # eval is required to do the TCL_DBGX substitution - # - - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - - - - - - - - - - - - - - fi -fi -if test "${use_tcl}" = "no" ; then - HAVE_TCL="" -else - HAVE_TCL=1 -fi - - ########## # Figure out what C libraries are required to compile programs # that use "readline()" library. diff --git a/configure.ac b/configure.ac index 9d8c594bae..404a80bffd 100644 --- a/configure.ac +++ b/configure.ac @@ -116,37 +116,71 @@ AC_CHECK_FUNCS([fdatasync gmtime_r isnan localtime_r localtime_s malloc_usable_s USE_AMALGAMATION=1 ######### -# See whether we can run specific tclsh versions known to work well; -# if not, then we fall back to plain tclsh. -# TODO: try other versions before falling back? +# Figure out all the name of a working tclsh and parameters needed to compile against Tcl. +# The --with-tcl= configuration parameter might be useful for this. # +AC_ARG_WITH(tclsh, AS_HELP_STRING([--with-tclsh=PATHNAME],[full pathname of a tclsh to use])) +AC_ARG_WITH(tcl, AS_HELP_STRING([--with-tcl=DIR],[directory containing (tclConfig.sh)])) +if test x"${with_tclsh}" == x -a x"${with_tcl}" == x; then + AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.6 tclsh tclsh9.0],none) + with_tclsh=${TCLSH_CMD} +fi +if test x"${with_tclsh}" != x -a x"${with_tclsh}" != xnone; then + TCLSH_CMD=${with_tclsh} + AC_MSG_RESULT([using tclsh at "$TCLSH_CMD"]) + with_tcl=`${with_tclsh} <${srcdir}/tool/find_tclconfig.tcl` + AC_MSG_RESULT([$TCLSH_CMD recommends the tclConfig.sh at ${with_tcl}]) +fi if test x"${with_tcl}" != x; then - if test ! -r ${with_tcl}/tclConfig.sh; then - AC_MSG_ERROR([no tclConfig.sh file found in --with-tcl: ${with_tcl}]) + if test -r ${with_tcl}/tclConfig.sh; then + tclconfig="${with_tcl}/tclConfig.sh" else - . ${with_tcl}/tclConfig.sh - TCLSH_CMD=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION} - if test ! -x ${TCLSH_CMD}; then - AC_MSG_WARN([cannot use tclsh at: ${TCLSH_CMD}]) - TCLSH_CMD=none + if test -r ${with_tcl}/tcl8.6/tclConfig.sh; then + tclconfig="${with_tcl}/tcl8.6/tclConfig.sh" + else + AC_MSG_ERROR([no tclConfig.sh file found in ${with_tcl} or ${with_tcl}/tcl8.6]) + fi + fi + if test x"${tclconfig}" != x; then + AC_MSG_RESULT([loading TCL configuration from ${tclconfig}]) + . ${tclconfig} + AC_SUBST(TCL_VERSION) + AC_SUBST(TCL_BIN_DIR) + AC_SUBST(TCL_SRC_DIR) + AC_SUBST(TCL_INCLUDE_SPEC) + AC_SUBST(TCL_LIB_FILE) + AC_SUBST(TCL_LIB_FLAG) + AC_SUBST(TCL_LIB_SPEC) + AC_SUBST(TCL_STUB_LIB_FILE) + AC_SUBST(TCL_STUB_LIB_FLAG) + AC_SUBST(TCL_STUB_LIB_SPEC) + AC_SUBST(TCL_SHLIB_SUFFIX) + fi + if test x"$TCLSH_CMD" == x; then + TCLSH_CMD=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION} + if test ! -x ${TCLSH_CMD}; then + TCLSH_CMD_2=${TCL_EXEC_PREFIX}/bin/tclsh + if test ! -x ${TCLSH_CMD_2}; then + AC_MSG_WARN([cannot find a usable tclsh at either ${TCLSH_CMD} or ${TCLSH_CMD_2}]) + TCLSH_CMD=none + else + TCLSH_CMD=${TCLSH_CMD_2} + fi fi fi -else - AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.6 tclsh8.5 tclsh], none) fi if test "$TCLSH_CMD" = "none"; then # If we can't find a local tclsh, then building the amalgamation will fail. # We act as though --disable-amalgamation has been used. - echo "Warning: can't find tclsh - defaulting to non-amalgamation build." + AC_MSG_WARN([Warning: can't find tclsh - defaulting to non-amalgamation build.]) USE_AMALGAMATION=0 TCLSH_CMD="tclsh" -fi -if test x"$TCLSH_CMD" = x; then - AC_MSG_ERROR([cannot find a usable tclsh]) + HAVE_TCL=0 else - AC_MSG_RESULT([using $TCLSH_CMD]) + HAVE_TCL=1 fi AC_SUBST(TCLSH_CMD) +AC_SUBST(HAVE_TCL) AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin]) if test "x${TCLLIBDIR+set}" != "xset" ; then @@ -357,190 +391,6 @@ AC_SUBST(SQLITE_OS_UNIX) AC_SUBST(SQLITE_OS_WIN) AC_SUBST(TARGET_EXEEXT) -########## -# Figure out all the parameters needed to compile against Tcl. -# -# This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG -# macros in the in the tcl.m4 file of the standard TCL distribution. -# Those macros could not be used directly since we have to make some -# minor changes to accomodate systems that do not have TCL installed. -# -AC_ARG_ENABLE(tcl, AS_HELP_STRING([--disable-tcl],[do not build TCL extension]), - [use_tcl=$enableval],[use_tcl=yes]) -if test "${use_tcl}" = "yes" ; then - AC_ARG_WITH(tcl, AS_HELP_STRING([--with-tcl=DIR],[directory containing tcl configuration (tclConfig.sh)]), with_tclconfig=${withval}) - AC_MSG_CHECKING([for Tcl configuration]) - AC_CACHE_VAL(ac_cv_c_tclconfig,[ - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) - fi - fi - - # Start autosearch by asking tclsh - if test x"${ac_cv_c_tclconfig}" = x ; then - if test x"$cross_compiling" = xno; then - for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="$i" - break - fi - done - fi - fi - - # On ubuntu 14.10, $auto_path on tclsh is not quite correct. - # So try again after applying corrections. - if test x"${ac_cv_c_tclconfig}" = x ; then - if test x"$cross_compiling" = xno; then - for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD} | sed 's,/tcltk/tcl,/tcl,g'` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="$i" - break - fi - done - fi - fi - - # Recent versions of Xcode on Macs hid the tclConfig.sh file - # in a strange place. - if test x"${ac_cv_c_tclconfig}" = x ; then - if test x"$cross_compiling" = xno; then - for i in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX*.sdk/usr/lib - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="$i" - break - fi - done - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ - ../../../tcl \ - `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` - do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - `ls -d ${libdir} 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ - `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` - do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - ]) - - if test x"${ac_cv_c_tclconfig}" = x ; then - use_tcl=no - AC_MSG_WARN(Can't find Tcl configuration definitions) - AC_MSG_WARN(*** Without Tcl the regression tests cannot be executed ***) - AC_MSG_WARN(*** Consider using --with-tcl=... to define location of Tcl ***) - else - TCL_BIN_DIR=${ac_cv_c_tclconfig} - AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh) - - AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then - AC_MSG_RESULT([loading]) - . $TCL_BIN_DIR/tclConfig.sh - else - AC_MSG_RESULT([file not found]) - fi - - # - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f $TCL_BIN_DIR/Makefile ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - fi - - # - # eval is required to do the TCL_DBGX substitution - # - - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - AC_SUBST(TCL_VERSION) - AC_SUBST(TCL_BIN_DIR) - AC_SUBST(TCL_SRC_DIR) - AC_SUBST(TCL_INCLUDE_SPEC) - - AC_SUBST(TCL_LIB_FILE) - AC_SUBST(TCL_LIB_FLAG) - AC_SUBST(TCL_LIB_SPEC) - - AC_SUBST(TCL_STUB_LIB_FILE) - AC_SUBST(TCL_STUB_LIB_FLAG) - AC_SUBST(TCL_STUB_LIB_SPEC) - AC_SUBST(TCL_SHLIB_SUFFIX) - fi -fi -if test "${use_tcl}" = "no" ; then - HAVE_TCL="" -else - HAVE_TCL=1 -fi -AC_SUBST(HAVE_TCL) - ########## # Figure out what C libraries are required to compile programs # that use "readline()" library. diff --git a/manifest b/manifest index 488738897e..19bf09ec46 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Include\sa\stest\scase\ssummary\sin\sthe\soutput\sof\s"errors"\sin\stestrunner.tcl. -D 2024-08-01T14:43:27.026 +C Clean\sup\sand\srestructure\sthe\sTCL\sconfiguration\ssections\sin\sautoconf.\nThe\snew\s--with-tclsh=FILE\soption\slets\syou\sselect\sthe\sspecific\stclsh\nthat\syou\swant\sto\srun. +D 2024-08-01T18:10:00.524 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -35,8 +35,8 @@ F autoconf/tea/win/nmakehlp.c b01f822eabbe1ed2b64e70882d97d48402b42d2689a1ea0034 F autoconf/tea/win/rules.vc 7b3bb2ef32ade0f3f14d951231811678722725e3bca240dd9727ae0dfe10f6a5 F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6 F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559 -F configure e0efd210b151971f4158e3fdf93b34322882a668a96f88b6167a6f7a51edebec x -F configure.ac 7361a1dd862c0ba0d2daa3d978bc3b93fcccc1ef3efe204d0238722c19bbdcf5 +F configure 7657b4eaced7589ee0259f7c99ca0b71fe3d47b7fdcc13844b64f77d3084c082 x +F configure.ac 6c41bb7a160c3c057af689f5fbf44bd290ccf2fb68be63b3f8d6a9062b224832 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd F doc/compile-for-windows.md e8635eea9153dcd6a51fd2740666ebc4492b3813cb1ac31cd8e99150df91762d @@ -2104,6 +2104,7 @@ F tool/enlargedb.c 3e8b2612b985cfa7e3e8800031ee191b43ae80de96abb5abbd5eada62651e F tool/extract-sqlite3h.tcl 069ceab0cee26cba99952bfa08c0b23e35941c837acabe143f0c355d96c9e2eb x F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2 F tool/fast_vacuum.c c129ae2924a48310c7b766810391da9e8fda532b9f6bd3f9a9e3a799a1b42af9 +F tool/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1821baf61bc86a7e F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439 F tool/fuzzershell.c 41480c8a1e4749351f381431ecfdfceba645396c5d836f8d26b51a33c4a21b33 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 @@ -2200,8 +2201,11 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 03b7f99229cfcffde024915e6812d75ae11318db9dc93a00838e4588a79b1243 -R 08e6905a776f74e196253ed63d164e48 +P 173df1478e89996126e172656e35da8026d4ef145b2341ef56213f00ade14f48 +R 9276dc9ad744c7eb260be766cc2b74e8 +T *branch * autoconf-revamp +T *sym-autoconf-revamp * +T -sym-trunk * U drh -Z 096dcbc7b2b21544af81d2d7e8439d72 +Z c7858b737379341436d4877837104339 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7d0cd49d41..0be9acc96b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -173df1478e89996126e172656e35da8026d4ef145b2341ef56213f00ade14f48 +8fafc679d91e857602fbbe203144ca98242246660ede5a49c5fec8aaff571151 diff --git a/tool/find_tclconfig.tcl b/tool/find_tclconfig.tcl new file mode 100644 index 0000000000..c3d3df8ec3 --- /dev/null +++ b/tool/find_tclconfig.tcl @@ -0,0 +1,24 @@ +# +# Run this TCL script to find and print the pathname for the tclConfig.sh +# file. Used by ../configure +# +if {[catch { + set libdir [tcl::pkgconfig get libdir,install] +}]} { + puts stderr "tclsh too old: does not support tcl::pkgconfig" + exit 1 +} +if {![file exists $libdir]} { + puts stderr "tclsh reported library directory \"$libdir\" does not exist" + exit 1 +} +if {![file exists $libdir/tclConfig.sh]} { + set n1 $libdir/tcl$::tcl_version + if {[file exists $n1/tclConfig.sh]} { + set libdir $n1 + } else { + puts stderr "cannot find tclConfig.sh in either $libdir or $n1" + exit 1 + } +} +puts $libdir From 24b1d7a0c8d0ad66864d7600ea60888649e54b5b Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 1 Aug 2024 20:18:10 +0000 Subject: [PATCH 2/8] Work on a TCL script that will compile and install the TCL extension. Works on Linux only, so far. This is an incremental check-in. FossilOrigin-Name: 58babd2aa4b5c9c70e1169cdf09f05eb95d7b13f50bb2ec0e487182288172678 --- manifest | 14 ++-- manifest.uuid | 2 +- tool/buildtclext.tcl | 167 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 174 insertions(+), 9 deletions(-) create mode 100644 tool/buildtclext.tcl diff --git a/manifest b/manifest index 19bf09ec46..a7deb9327a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Clean\sup\sand\srestructure\sthe\sTCL\sconfiguration\ssections\sin\sautoconf.\nThe\snew\s--with-tclsh=FILE\soption\slets\syou\sselect\sthe\sspecific\stclsh\nthat\syou\swant\sto\srun. -D 2024-08-01T18:10:00.524 +C Work\son\sa\sTCL\sscript\sthat\swill\scompile\sand\sinstall\sthe\sTCL\sextension.\nWorks\son\sLinux\sonly,\sso\sfar.\s\sThis\sis\san\sincremental\scheck-in. +D 2024-08-01T20:18:10.470 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -2093,6 +2093,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x F tool/build-shell.sh f193b5e3eb4afcb4abbf96bf1475be6cfb74763ee2e50c82bc7ca105e8a136c5 +F tool/buildtclext.tcl 0ef183d0786744d13b06fec85e2cd4ee7369dd58c3ef2f684c5a616d952777d4 F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2201,11 +2202,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 173df1478e89996126e172656e35da8026d4ef145b2341ef56213f00ade14f48 -R 9276dc9ad744c7eb260be766cc2b74e8 -T *branch * autoconf-revamp -T *sym-autoconf-revamp * -T -sym-trunk * +P 8fafc679d91e857602fbbe203144ca98242246660ede5a49c5fec8aaff571151 +R e8c67e263d146ad1487048a2a5cec02e U drh -Z c7858b737379341436d4877837104339 +Z b7f53b5d5d52347992c8bf634ae8776a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0be9acc96b..0a50f25895 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8fafc679d91e857602fbbe203144ca98242246660ede5a49c5fec8aaff571151 +58babd2aa4b5c9c70e1169cdf09f05eb95d7b13f50bb2ec0e487182288172678 diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl new file mode 100644 index 0000000000..947bcf5e4c --- /dev/null +++ b/tool/buildtclext.tcl @@ -0,0 +1,167 @@ +# +# Run this TCL script to build and optionally install the TCL interface +# library for SQLite. Run the script with the specific "tclsh" for which +# the installation should occur. +# +# Options: +# +# --build-only Only build the extension, don't install it +# --install-only Install an extension previously build +# --uninstall Uninstall the extension +# +set installonly 0 +set buildonly 0 +set uninstall 0 +for {set ii 0} {$ii<[llength $argv]} {incr ii} { + set a0 [lindex $argv $ii] + if {$a0=="--install-only"} { + set installonly 1 + } elseif {$a0=="--build-only"} { + set buildonly 1 + } elseif {$a0=="--uninstall"} { + set uninstall 1 + } else { + puts stderr "Unknown option: \"$a0\"" + exit 1 + } +} + +# Find the root of the SQLite source tree +# +set srcdir [file normalize [file dir $argv0]/..] + +# Get the SQLite version number into $VERSION +# +set fd [open $srcdir/VERSION] +set VERSION [string trim [read $fd]] +close $fd + +# Figure out the location of the tclConfig.sh file used by the +# tclsh that is executing this script. +# +if {[catch { + set LIBDIR [tcl::pkgconfig get libdir,install] +}]} { + puts stderr "$argv0: tclsh does not support tcl::pkgconfig." + exit 1 +} +if {![file exists $LIBDIR]} { + puts stderr "$argv0: cannot find the tclConfig.sh file." + puts stderr "$argv0: tclsh reported library directory \"$LIBDIR\"\ + does not exist." + exit 1 +} +if {![file exists $LIBDIR/tclConfig.sh]} { + set n1 $LIBDIR/tcl$::tcl_version + if {[file exists $n1/tclConfig.sh]} { + set LIBDIR $n1 + } else { + puts stderr "$argv0: cannot find tclConfig.sh in either $LIBDIR or $n1" + exit 1 + } +} + +# Read the tclConfig.sh file into the $tclConfig variable +# +set fd [open $LIBDIR/tclConfig.sh rb] +set tclConfig [read $fd] +close $fd + +# Extract parameter we will need from the tclConfig.sh file +# +set TCLMAJOR 8 +regexp {TCL_MAJOR_VERSION='(\d)'} $tclConfig all TCLMAJOR +set SUFFIX so +regexp {TCL_SHLIB_SUFFIX='\.([^']+)'} $tclConfig all SUFFIX +set CC gcc +regexp {TCL_CC='([^']+)'} $tclConfig all CC +set CFLAGS -fPIC +regexp {TCL_SHLIB_CFLAGS='([^']+)'} $tclConfig all CFLAGS +set opt {} +regexp {TCL_CFLAGS_OPTIMIZE='([^']+)'} $tclConfig all opt +if {$opt!=""} { + append CFLAGS " $opt" +} +set LIBS {} +regexp {TCL_STUB_LIB_SPEC='([^']+)'} $tclConfig all LIBS +set INC "-I$srcdir/src" +set inc {} +regexp {TCL_INCLUDE_SPEC='([^']+)'} $tclConfig all inc +if {$inc!=""} { + append INC " $inc" +} +set cmd {} +regexp {TCL_SHLIB_LD='([^']+)'} $tclConfig all cmd +set LDFLAGS $INC +set CMD [subst $cmd] +if {$TCLMAJOR>8} { + set OUT libtcl9sqlite$VERSION.$SUFFIX +} else { + set OUT libsqlite$VERSION.$SUFFIX +} + +# Uninstall the extension +# +if {$uninstall} { + set cnt 0 + foreach dir $auto_path { + if {[file isdirectory $dir/sqlite$VERSION]} { + incr cnt + if {![file writable $dir] || ![file writable $dir/sqlite$VERSION]} { + puts "cannot uninstall $dir/sqlite$VERSION - permission denied" + } else { + puts "uninstalling $dir/sqlite$VERSION..." + file delete -force $dir/sqlite$VERSION + } + } + } + if {$cnt==0} { + puts "nothing to uninstall" + } + exit +} + +# Figure out where the extension will be installed. +# +set DEST {} +foreach dir $auto_path { + if {[file writable $dir]} { + set DEST $dir + break + } +} +if {$DEST==""} { + puts "None of the directories on $auto_path are writable by this process," + puts "so the installation cannot take place. Consider running using sudo" + puts "to work around this." +} + +if {!$installonly} { + # Generate the pkgIndex.tcl file + # + set fd [open pkgIndex.tcl w] + puts $fd [subst -nocommands {# -*- tcl -*- +# Tcl package index file, version ??? +# +package ifneeded sqlite3 $VERSION \\ + [list load [file join \$dir $OUT] sqlite3] +}] + close $fd + + # Generate and execute the command with which to do the compilation. + # + set cmd "$CMD tclsqlite3.c -o $OUT $LIBS" + puts $cmd + exec {*}$cmd +} + +# Install the extension +# +if {$DEST!="" && !$buildonly} { + set DEST2 $DEST/sqlite$VERSION + file mkdir $DEST2 + puts "installing $DEST2/pkgIndex.tcl" + file copy -force pkgIndex.tcl $DEST2 + puts "installing $DEST2/$OUT" + file copy -force $OUT $DEST2 +} From 1bed50d42470ead54ce5236e5978cc398f756c0a Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 1 Aug 2024 20:26:22 +0000 Subject: [PATCH 3/8] New makefile targets: tclextension-install and tclextension-uninstall. Seem to work on Linux. FossilOrigin-Name: 534f8344abbda78e841edafe84c27ea8b1dfdecb9ab51271772a7f7264ef5b8c --- Makefile.in | 15 ++++++++------- manifest | 14 +++++++------- manifest.uuid | 2 +- tool/buildtclext.tcl | 2 ++ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4ce4b7392f..bae560b4dc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1556,13 +1556,14 @@ install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_instal $(INSTALL) -d $(DESTDIR)$(pkgconfigdir) $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir) -pkgIndex.tcl: - echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@ -tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl - $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR) - $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR) - rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a - $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR) +pkgIndex.tcl: tclsqlite3.c + $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --build-only + +tclextension-install: pkgIndex.tcl + $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --install-only + +tclextension-uninstall: + $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --uninstall clean: rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la diff --git a/manifest b/manifest index a7deb9327a..e6c0cd9da5 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Work\son\sa\sTCL\sscript\sthat\swill\scompile\sand\sinstall\sthe\sTCL\sextension.\nWorks\son\sLinux\sonly,\sso\sfar.\s\sThis\sis\san\sincremental\scheck-in. -D 2024-08-01T20:18:10.470 +C New\smakefile\stargets:\stclextension-install\sand\stclextension-uninstall.\s\sSeem\nto\swork\son\sLinux. +D 2024-08-01T20:26:22.352 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 58c2cc5010aa5fd5e8eef6fe24d4ebcec7dc2e8c56f135d4f49e90a099bbc531 +F Makefile.in 1e1686272e573f924567483d123abc2a1397cf59c0ec823916a1368b46e13382 F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 F Makefile.msc 993f8addade63bcac7192416e7161ceee60edcee2376299ea48b2a74c66ac2d5 F README.md 6358805260a03ebead84e168bbf3740ddf3f683b477e478567186aa7afb490d3 @@ -2093,7 +2093,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x F tool/build-shell.sh f193b5e3eb4afcb4abbf96bf1475be6cfb74763ee2e50c82bc7ca105e8a136c5 -F tool/buildtclext.tcl 0ef183d0786744d13b06fec85e2cd4ee7369dd58c3ef2f684c5a616d952777d4 +F tool/buildtclext.tcl b360c5133169d555b2b2d6aeac8aece43a34babc672dd6c05fd41ebc850cc14f F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2202,8 +2202,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 8fafc679d91e857602fbbe203144ca98242246660ede5a49c5fec8aaff571151 -R e8c67e263d146ad1487048a2a5cec02e +P 58babd2aa4b5c9c70e1169cdf09f05eb95d7b13f50bb2ec0e487182288172678 +R 38f4741323b0ec90afecf9f175b90c98 U drh -Z b7f53b5d5d52347992c8bf634ae8776a +Z a4ed4e2858217ff286bef81105749295 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0a50f25895..49f1f98f35 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -58babd2aa4b5c9c70e1169cdf09f05eb95d7b13f50bb2ec0e487182288172678 +534f8344abbda78e841edafe84c27ea8b1dfdecb9ab51271772a7f7264ef5b8c diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl index 947bcf5e4c..f2510da98e 100644 --- a/tool/buildtclext.tcl +++ b/tool/buildtclext.tcl @@ -3,6 +3,8 @@ # library for SQLite. Run the script with the specific "tclsh" for which # the installation should occur. # +# Must do "make tclsqlite3.c" first. +# # Options: # # --build-only Only build the extension, don't install it From 58c5a95c07f12a17a554da852cdbbfc0297bded8 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 1 Aug 2024 23:00:37 +0000 Subject: [PATCH 4/8] Add the tclextension-list makefile target. The the makefile running on Mac. FossilOrigin-Name: 2f667cc8e54167342e17e63e1a017388365ebf4cd379f9c16c12e4603b34a326 --- Makefile.in | 19 +++++++- manifest | 16 +++---- manifest.uuid | 2 +- src/tclsqlite.c | 11 ++++- tool/buildtclext.tcl | 111 ++++++++++++++++++++++++++++++------------- 5 files changed, 112 insertions(+), 47 deletions(-) diff --git a/Makefile.in b/Makefile.in index bae560b4dc..61fcf6e7d6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1556,15 +1556,30 @@ install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_instal $(INSTALL) -d $(DESTDIR)$(pkgconfigdir) $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir) -pkgIndex.tcl: tclsqlite3.c +# Build the SQLite TCL extension in a way that make it compatible +# with whatever version of TCL is running as $TCLSH_CMD, possibly defined +# by --with-tclsh= +# +tclextension: tclsqlite3.c $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --build-only -tclextension-install: pkgIndex.tcl +# Install the SQLite TCL extension in a way that is appropriate for $TCLSH_CMD +# to find it. +# +tclextension-install: tclextension $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --install-only +# Install the SQLite TCL extension that is used by $TCLSH_CMD +# tclextension-uninstall: $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --uninstall +# List all installed the SQLite TCL extension that is are accessible +# by $TCLSH_CMD, included prior versions. +# +tclextension-list: + $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --info + clean: rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la rm -f sqlite3.h opcodes.* diff --git a/manifest b/manifest index e6c0cd9da5..15bb5252ff 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C New\smakefile\stargets:\stclextension-install\sand\stclextension-uninstall.\s\sSeem\nto\swork\son\sLinux. -D 2024-08-01T20:26:22.352 +C Add\sthe\stclextension-list\smakefile\starget.\s\sThe\sthe\smakefile\srunning\son\sMac. +D 2024-08-01T23:00:37.841 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 1e1686272e573f924567483d123abc2a1397cf59c0ec823916a1368b46e13382 +F Makefile.in 4fc6dc2def18b4a2e8fb4c4cad04699e829b3fcefa85974ec71a4a9110a0ea88 F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 F Makefile.msc 993f8addade63bcac7192416e7161ceee60edcee2376299ea48b2a74c66ac2d5 F README.md 6358805260a03ebead84e168bbf3740ddf3f683b477e478567186aa7afb490d3 @@ -768,7 +768,7 @@ F src/sqliteInt.h b77218c425891c7c90506c77fd2eb13bae03628d065b44fffeb37401cd955a F src/sqliteLimit.h 6878ab64bdeb8c24a1d762d45635e34b96da21132179023338c93f820eee6728 F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 -F src/tclsqlite.c 8e86ab2595c2ff7bb155331fb173e560180235bceaacce7931a718b1c2e6dfb4 +F src/tclsqlite.c 9bd7443f5db3250dbb073aa6f046a52f939832ac0193c710d6fffb6ca68674be F src/tclsqlite.h c6af51f31a2b2172d674608763a4b98fdf5cd587e4025053e546fb8077757262 F src/test1.c 51159784f29d3dfd4b50fd6ed9c43c8f7f36925c501a3ad3083528e5e5544bd7 F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3 @@ -2093,7 +2093,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x F tool/build-shell.sh f193b5e3eb4afcb4abbf96bf1475be6cfb74763ee2e50c82bc7ca105e8a136c5 -F tool/buildtclext.tcl b360c5133169d555b2b2d6aeac8aece43a34babc672dd6c05fd41ebc850cc14f +F tool/buildtclext.tcl 23a986cfcb0338e02ad277cebd94d92b37a9cd848fe168f088fa80ca973b4d79 F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2202,8 +2202,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 58babd2aa4b5c9c70e1169cdf09f05eb95d7b13f50bb2ec0e487182288172678 -R 38f4741323b0ec90afecf9f175b90c98 +P 534f8344abbda78e841edafe84c27ea8b1dfdecb9ab51271772a7f7264ef5b8c +R 2909fb7ee21646cc58011e08d136b308 U drh -Z a4ed4e2858217ff286bef81105749295 +Z d8a3255efb288995807535829d58616f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 49f1f98f35..01a9c859f1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -534f8344abbda78e841edafe84c27ea8b1dfdecb9ab51271772a7f7264ef5b8c +2f667cc8e54167342e17e63e1a017388365ebf4cd379f9c16c12e4603b34a326 diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 906f429ab9..51049b4d21 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -369,12 +369,19 @@ static int SQLITE_TCLAPI incrblobOutput( return nWrite; } +/* The datatype of Tcl_DriverWideSeekProc changes between tcl8.6 and tcl9.0 */ +#if TCL_MAJOR_VERSION==9 +# define WideSeekProcType long lone +#else +# define WideSeekProcType Tcl_WideInt +#endif + /* ** Seek an incremental blob channel. */ -static long long SQLITE_TCLAPI incrblobWideSeek( +static WideSeekProcType SQLITE_TCLAPI incrblobWideSeek( ClientData instanceData, - long long offset, + WideSeekProcType offset, int seekMode, int *errorCodePtr ){ diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl index f2510da98e..26067ecd87 100644 --- a/tool/buildtclext.tcl +++ b/tool/buildtclext.tcl @@ -1,29 +1,38 @@ +#!/usr/bin/tclsh # -# Run this TCL script to build and optionally install the TCL interface -# library for SQLite. Run the script with the specific "tclsh" for which -# the installation should occur. -# -# Must do "make tclsqlite3.c" first. -# -# Options: -# -# --build-only Only build the extension, don't install it -# --install-only Install an extension previously build -# --uninstall Uninstall the extension -# -set installonly 0 -set buildonly 0 +set help \ +{Run this TCL script to build and install the TCL interface library for +SQLite. Run the script with the specific "tclsh" for which the installation +should occur. + +There must be a valid "tclsqlite3.c" file in the working directory prior +to running this script. Use "make tclsqlite3.c" to generate that file. + +Options: + + --build-only Only build the extension, don't install it + --info Show info on existing SQLite TCL extension installs + --install-only Install an extension previously build + --uninstall Uninstall the extension} + + +set build 1 +set install 1 set uninstall 0 +set infoonly 0 for {set ii 0} {$ii<[llength $argv]} {incr ii} { set a0 [lindex $argv $ii] if {$a0=="--install-only"} { - set installonly 1 + set build 0 } elseif {$a0=="--build-only"} { - set buildonly 1 + set install 0 } elseif {$a0=="--uninstall"} { set uninstall 1 + } elseif {$a0=="--info"} { + set infoonly 1 } else { - puts stderr "Unknown option: \"$a0\"" + puts stderr "Unknown option: \"$a0\"\n" + puts stderr $help exit 1 } } @@ -94,7 +103,7 @@ if {$inc!=""} { } set cmd {} regexp {TCL_SHLIB_LD='([^']+)'} $tclConfig all cmd -set LDFLAGS $INC +set LDFLAGS "$INC -DUSE_TCL_STUBS" set CMD [subst $cmd] if {$TCLMAJOR>8} { set OUT libtcl9sqlite$VERSION.$SUFFIX @@ -102,6 +111,24 @@ if {$TCLMAJOR>8} { set OUT libsqlite$VERSION.$SUFFIX } +# Show information about prior installs +# +if {$infoonly} { + set cnt 0 + foreach dir $auto_path { + foreach subdir [glob -nocomplain -types d $dir/sqlite3*] { + if {[file exists $subdir/pkgIndex.tcl]} { + puts $subdir + incr cnt + } + } + } + if {$cnt==0} { + puts "no current installations of the SQLite TCL extension" + } + exit +} + # Uninstall the extension # if {$uninstall} { @@ -123,24 +150,40 @@ if {$uninstall} { exit } -# Figure out where the extension will be installed. -# -set DEST {} -foreach dir $auto_path { - if {[file writable $dir]} { - set DEST $dir - break +if {$install} { + # Figure out where the extension will be installed. Put the extension + # in the first writable directory on $auto_path. + # + set DEST {} + foreach dir $auto_path { + if {[file writable $dir]} { + set DEST $dir + break + } elseif {[glob -nocomplain $dir/sqlite3*/pkgIndex.tcl]!=""} { + set conflict [lindex [glob $dir/sqlite3*/pkgIndex.tcl] 0] + puts "Unable to install. There is already a conflicting version" + puts "of the SQLite TCL Extension that cannot be overwritten at\n" + puts " [file dirname $conflict]\n" + puts "Consider running using sudo to work around this problem." + exit 1 + } + } + if {$DEST==""} { + puts "None of the directories on \$auto_path are writable by this process," + puts "so the installation cannot take place. Consider running using sudo" + puts "to work around this problem.\n" + puts "These are the (unwritable) \$auto_path directories:\n" + foreach dir $auto_path { + puts " * $dir" + } + exit 1 } } -if {$DEST==""} { - puts "None of the directories on $auto_path are writable by this process," - puts "so the installation cannot take place. Consider running using sudo" - puts "to work around this." -} -if {!$installonly} { +if {$build} { # Generate the pkgIndex.tcl file # + puts "generating pkgConfig.tcl..." set fd [open pkgIndex.tcl w] puts $fd [subst -nocommands {# -*- tcl -*- # Tcl package index file, version ??? @@ -157,9 +200,9 @@ package ifneeded sqlite3 $VERSION \\ exec {*}$cmd } -# Install the extension -# -if {$DEST!="" && !$buildonly} { + +if {$install} { + # Install the extension set DEST2 $DEST/sqlite$VERSION file mkdir $DEST2 puts "installing $DEST2/pkgIndex.tcl" From bb99e73ef55cd18764754509affaf333ae345d96 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 1 Aug 2024 23:30:29 +0000 Subject: [PATCH 5/8] Simplification the ./configure script. Carry Makefile CFLAGS and OPTS through into builttclext.tcl. Fix a bug in tclsqlite.c introduced by the previous check-in. FossilOrigin-Name: 72a80aa0abb121a23f8cc1eb1af04ba06c733a7a40c06f1fe9e62f2a0a26ca6e --- Makefile.in | 2 +- configure | 51 +++++++++++++++----------------------------- configure.ac | 13 +++-------- manifest | 20 ++++++++--------- manifest.uuid | 2 +- src/tclsqlite.c | 2 +- tool/buildtclext.tcl | 33 ++++++++++++++++++++-------- 7 files changed, 57 insertions(+), 66 deletions(-) diff --git a/Makefile.in b/Makefile.in index 61fcf6e7d6..4e804f889a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1561,7 +1561,7 @@ install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_instal # by --with-tclsh= # tclextension: tclsqlite3.c - $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --build-only + $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --build-only --cc $(CC) $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) # Install the SQLite TCL extension in a way that is appropriate for $TCLSH_CMD # to find it. diff --git a/configure b/configure index 744410589b..3486ebc034 100755 --- a/configure +++ b/configure @@ -795,17 +795,7 @@ VERSION program_prefix TCLLIBDIR HAVE_TCL -TCL_SHLIB_SUFFIX -TCL_STUB_LIB_SPEC -TCL_STUB_LIB_FLAG -TCL_STUB_LIB_FILE TCL_LIB_SPEC -TCL_LIB_FLAG -TCL_LIB_FILE -TCL_INCLUDE_SPEC -TCL_SRC_DIR -TCL_BIN_DIR -TCL_VERSION TCLSH_CMD INSTALL_DATA INSTALL_SCRIPT @@ -3944,13 +3934,13 @@ if ${lt_cv_nm_interface+:} false; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:3947: $ac_compile\"" >&5) + (eval echo "\"\$as_me:3937: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:3950: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:3940: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:3953: output\"" >&5) + (eval echo "\"\$as_me:3943: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5156,7 +5146,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5159 "configure"' > conftest.$ac_ext + echo '#line 5149 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6681,11 +6671,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6684: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6674: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6688: \$? = $ac_status" >&5 + echo "$as_me:6678: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7020,11 +7010,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7023: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7013: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7027: \$? = $ac_status" >&5 + echo "$as_me:7017: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7125,11 +7115,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7128: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7118: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7132: \$? = $ac_status" >&5 + echo "$as_me:7122: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7180,11 +7170,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7183: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7173: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7187: \$? = $ac_status" >&5 + echo "$as_me:7177: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9560,7 +9550,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9563 "configure" +#line 9553 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -9656,7 +9646,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9659 "configure" +#line 9649 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10397,16 +10387,9 @@ if test x"${with_tcl}" != x; then $as_echo "loading TCL configuration from ${tclconfig}" >&6; } . ${tclconfig} - - - - - - - - - - + # There are lots of other configuration variables that are provided by the + # tclConfig.sh file and that could be included here. But as of right now, + # TCL_LIB_SPEC is the only what that the Makefile uses. fi if test x"$TCLSH_CMD" == x; then TCLSH_CMD=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION} diff --git a/configure.ac b/configure.ac index 404a80bffd..fba0755e62 100644 --- a/configure.ac +++ b/configure.ac @@ -144,17 +144,10 @@ if test x"${with_tcl}" != x; then if test x"${tclconfig}" != x; then AC_MSG_RESULT([loading TCL configuration from ${tclconfig}]) . ${tclconfig} - AC_SUBST(TCL_VERSION) - AC_SUBST(TCL_BIN_DIR) - AC_SUBST(TCL_SRC_DIR) - AC_SUBST(TCL_INCLUDE_SPEC) - AC_SUBST(TCL_LIB_FILE) - AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) - AC_SUBST(TCL_STUB_LIB_FILE) - AC_SUBST(TCL_STUB_LIB_FLAG) - AC_SUBST(TCL_STUB_LIB_SPEC) - AC_SUBST(TCL_SHLIB_SUFFIX) + # There are lots of other configuration variables that are provided by the + # tclConfig.sh file and that could be included here. But as of right now, + # TCL_LIB_SPEC is the only what that the Makefile uses. fi if test x"$TCLSH_CMD" == x; then TCLSH_CMD=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION} diff --git a/manifest b/manifest index 15bb5252ff..26917c15b6 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Add\sthe\stclextension-list\smakefile\starget.\s\sThe\sthe\smakefile\srunning\son\sMac. -D 2024-08-01T23:00:37.841 +C Simplification\sthe\s./configure\sscript.\s\sCarry\sMakefile\sCFLAGS\sand\sOPTS\sthrough\ninto\sbuilttclext.tcl.\s\sFix\sa\sbug\sin\stclsqlite.c\sintroduced\sby\sthe\sprevious\ncheck-in. +D 2024-08-01T23:30:29.441 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 4fc6dc2def18b4a2e8fb4c4cad04699e829b3fcefa85974ec71a4a9110a0ea88 +F Makefile.in 3de6a3420170d4f6fac8fd0f338db422ce100be1e64c1e8cb62b85876ebc5fca F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 F Makefile.msc 993f8addade63bcac7192416e7161ceee60edcee2376299ea48b2a74c66ac2d5 F README.md 6358805260a03ebead84e168bbf3740ddf3f683b477e478567186aa7afb490d3 @@ -35,8 +35,8 @@ F autoconf/tea/win/nmakehlp.c b01f822eabbe1ed2b64e70882d97d48402b42d2689a1ea0034 F autoconf/tea/win/rules.vc 7b3bb2ef32ade0f3f14d951231811678722725e3bca240dd9727ae0dfe10f6a5 F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6 F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559 -F configure 7657b4eaced7589ee0259f7c99ca0b71fe3d47b7fdcc13844b64f77d3084c082 x -F configure.ac 6c41bb7a160c3c057af689f5fbf44bd290ccf2fb68be63b3f8d6a9062b224832 +F configure 33192bee7d11f68a2be3a1ddf1dc4aa02060675f0bfb48eaf61b63fcd45abedf x +F configure.ac 1665604ede8e83da1454f26eb19dcc7cff70f1b21d305616b6c7cea2d107c005 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd F doc/compile-for-windows.md e8635eea9153dcd6a51fd2740666ebc4492b3813cb1ac31cd8e99150df91762d @@ -768,7 +768,7 @@ F src/sqliteInt.h b77218c425891c7c90506c77fd2eb13bae03628d065b44fffeb37401cd955a F src/sqliteLimit.h 6878ab64bdeb8c24a1d762d45635e34b96da21132179023338c93f820eee6728 F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 -F src/tclsqlite.c 9bd7443f5db3250dbb073aa6f046a52f939832ac0193c710d6fffb6ca68674be +F src/tclsqlite.c c6888598f08dee3d9112a38ef42c8f5c89ca7f3190f4694744d0b84250f4bf8c F src/tclsqlite.h c6af51f31a2b2172d674608763a4b98fdf5cd587e4025053e546fb8077757262 F src/test1.c 51159784f29d3dfd4b50fd6ed9c43c8f7f36925c501a3ad3083528e5e5544bd7 F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3 @@ -2093,7 +2093,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x F tool/build-shell.sh f193b5e3eb4afcb4abbf96bf1475be6cfb74763ee2e50c82bc7ca105e8a136c5 -F tool/buildtclext.tcl 23a986cfcb0338e02ad277cebd94d92b37a9cd848fe168f088fa80ca973b4d79 +F tool/buildtclext.tcl d6e880173bec323f30c0505c5f82eb29c5661bd501d33b5b7a3b5507269dc4f9 F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2202,8 +2202,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 534f8344abbda78e841edafe84c27ea8b1dfdecb9ab51271772a7f7264ef5b8c -R 2909fb7ee21646cc58011e08d136b308 +P 2f667cc8e54167342e17e63e1a017388365ebf4cd379f9c16c12e4603b34a326 +R 79bc0ffb836cbf05c7dcfd1908280244 U drh -Z d8a3255efb288995807535829d58616f +Z c826d5650b7fb369e6f2edfd17fa30c3 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 01a9c859f1..a4767bc367 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2f667cc8e54167342e17e63e1a017388365ebf4cd379f9c16c12e4603b34a326 +72a80aa0abb121a23f8cc1eb1af04ba06c733a7a40c06f1fe9e62f2a0a26ca6e diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 51049b4d21..0c8888fd48 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -371,7 +371,7 @@ static int SQLITE_TCLAPI incrblobOutput( /* The datatype of Tcl_DriverWideSeekProc changes between tcl8.6 and tcl9.0 */ #if TCL_MAJOR_VERSION==9 -# define WideSeekProcType long lone +# define WideSeekProcType long long #else # define WideSeekProcType Tcl_WideInt #endif diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl index 26067ecd87..8d6d0c25b0 100644 --- a/tool/buildtclext.tcl +++ b/tool/buildtclext.tcl @@ -11,15 +11,20 @@ to running this script. Use "make tclsqlite3.c" to generate that file. Options: --build-only Only build the extension, don't install it + --cc COMPILER Build using this compiler --info Show info on existing SQLite TCL extension installs --install-only Install an extension previously build - --uninstall Uninstall the extension} + --uninstall Uninstall the extension + +Other options are retained and passed through into the compiler.} set build 1 set install 1 set uninstall 0 set infoonly 0 +set CC {} +set OPTS {} for {set ii 0} {$ii<[llength $argv]} {incr ii} { set a0 [lindex $argv $ii] if {$a0=="--install-only"} { @@ -30,6 +35,11 @@ for {set ii 0} {$ii<[llength $argv]} {incr ii} { set uninstall 1 } elseif {$a0=="--info"} { set infoonly 1 + } elseif {$a0=="--cc" && $ii+1<[llength $argv]} { + incr ii + set CC [lindex $argv $ii] + } elseif {[string match -* $a0]} { + append OPTS " $a0" } else { puts stderr "Unknown option: \"$a0\"\n" puts stderr $help @@ -84,15 +94,12 @@ set TCLMAJOR 8 regexp {TCL_MAJOR_VERSION='(\d)'} $tclConfig all TCLMAJOR set SUFFIX so regexp {TCL_SHLIB_SUFFIX='\.([^']+)'} $tclConfig all SUFFIX -set CC gcc -regexp {TCL_CC='([^']+)'} $tclConfig all CC +if {$CC==""} { + set CC gcc + regexp {TCL_CC='([^']+)'} $tclConfig all CC +} set CFLAGS -fPIC regexp {TCL_SHLIB_CFLAGS='([^']+)'} $tclConfig all CFLAGS -set opt {} -regexp {TCL_CFLAGS_OPTIMIZE='([^']+)'} $tclConfig all opt -if {$opt!=""} { - append CFLAGS " $opt" -} set LIBS {} regexp {TCL_STUB_LIB_SPEC='([^']+)'} $tclConfig all LIBS set INC "-I$srcdir/src" @@ -104,6 +111,9 @@ if {$inc!=""} { set cmd {} regexp {TCL_SHLIB_LD='([^']+)'} $tclConfig all cmd set LDFLAGS "$INC -DUSE_TCL_STUBS" +if {[string length $OPTS]>1} { + append LDFLAGS $OPTS +} set CMD [subst $cmd] if {$TCLMAJOR>8} { set OUT libtcl9sqlite$VERSION.$SUFFIX @@ -197,7 +207,12 @@ package ifneeded sqlite3 $VERSION \\ # set cmd "$CMD tclsqlite3.c -o $OUT $LIBS" puts $cmd - exec {*}$cmd + if {[catch { + exec {*}$cmd + } errmsg]} { + puts $errmsg + exit 1 + } } From 490661fd967d301985a558d1cce3b1630140fb00 Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 2 Aug 2024 00:19:59 +0000 Subject: [PATCH 6/8] Extra robustness for the SQLite Tcl Extension builder, so that it works on Debian Linux. FossilOrigin-Name: 2f0738daaff48c51a60f063af6e453443bd7eedf6936daab325b2a36927c7a2b --- manifest | 12 ++++++------ manifest.uuid | 2 +- tool/buildtclext.tcl | 17 +++++++++++++---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 26917c15b6..55d18cc6fd 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Simplification\sthe\s./configure\sscript.\s\sCarry\sMakefile\sCFLAGS\sand\sOPTS\sthrough\ninto\sbuilttclext.tcl.\s\sFix\sa\sbug\sin\stclsqlite.c\sintroduced\sby\sthe\sprevious\ncheck-in. -D 2024-08-01T23:30:29.441 +C Extra\srobustness\sfor\sthe\sSQLite\sTcl\sExtension\sbuilder,\sso\sthat\sit\sworks\non\sDebian\sLinux. +D 2024-08-02T00:19:59.895 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -2093,7 +2093,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x F tool/build-shell.sh f193b5e3eb4afcb4abbf96bf1475be6cfb74763ee2e50c82bc7ca105e8a136c5 -F tool/buildtclext.tcl d6e880173bec323f30c0505c5f82eb29c5661bd501d33b5b7a3b5507269dc4f9 +F tool/buildtclext.tcl 865343ca043c4119e19de9651d01185d0017e588d70f533612c345553cc8160b F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2202,8 +2202,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 2f667cc8e54167342e17e63e1a017388365ebf4cd379f9c16c12e4603b34a326 -R 79bc0ffb836cbf05c7dcfd1908280244 +P 72a80aa0abb121a23f8cc1eb1af04ba06c733a7a40c06f1fe9e62f2a0a26ca6e +R 30cc174315110745d69ebebfb5ba6cf9 U drh -Z c826d5650b7fb369e6f2edfd17fa30c3 +Z 07ee2d4f800935e6e99694df22387f92 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a4767bc367..d4b99149ef 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -72a80aa0abb121a23f8cc1eb1af04ba06c733a7a40c06f1fe9e62f2a0a26ca6e +2f0738daaff48c51a60f063af6e453443bd7eedf6936daab325b2a36927c7a2b diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl index 8d6d0c25b0..5b50c627f9 100644 --- a/tool/buildtclext.tcl +++ b/tool/buildtclext.tcl @@ -72,9 +72,11 @@ if {![file exists $LIBDIR]} { does not exist." exit 1 } -if {![file exists $LIBDIR/tclConfig.sh]} { +if {![file exists $LIBDIR/tclConfig.sh] + || [file size $LIBDIR/tclConfig.sh]<5000} { set n1 $LIBDIR/tcl$::tcl_version - if {[file exists $n1/tclConfig.sh]} { + if {[file exists $n1/tclConfig.sh] + && [file size $n1/tclConfig.sh]>5000} { set LIBDIR $n1 } else { puts stderr "$argv0: cannot find tclConfig.sh in either $LIBDIR or $n1" @@ -84,6 +86,7 @@ if {![file exists $LIBDIR/tclConfig.sh]} { # Read the tclConfig.sh file into the $tclConfig variable # +#puts "using $LIBDIR/tclConfig.sh" set fd [open $LIBDIR/tclConfig.sh rb] set tclConfig [read $fd] close $fd @@ -94,9 +97,15 @@ set TCLMAJOR 8 regexp {TCL_MAJOR_VERSION='(\d)'} $tclConfig all TCLMAJOR set SUFFIX so regexp {TCL_SHLIB_SUFFIX='\.([^']+)'} $tclConfig all SUFFIX +if {$CC==""} { + set cc {} + regexp {TCL_CC='([^']+)'} $tclConfig all cc + if {$cc!=""} { + set CC $cc + } +} if {$CC==""} { set CC gcc - regexp {TCL_CC='([^']+)'} $tclConfig all CC } set CFLAGS -fPIC regexp {TCL_SHLIB_CFLAGS='([^']+)'} $tclConfig all CFLAGS @@ -108,7 +117,7 @@ regexp {TCL_INCLUDE_SPEC='([^']+)'} $tclConfig all inc if {$inc!=""} { append INC " $inc" } -set cmd {} +set cmd {${CC} ${CFLAGS} ${LDFLAGS} -shared} regexp {TCL_SHLIB_LD='([^']+)'} $tclConfig all cmd set LDFLAGS "$INC -DUSE_TCL_STUBS" if {[string length $OPTS]>1} { From 0c059b598d6ec7528cb455fe79b58ab67f869bd4 Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 2 Aug 2024 00:51:52 +0000 Subject: [PATCH 7/8] Continuing refinements of the tclextension-install makefile target. FossilOrigin-Name: 871c20a848e0e9b7f3d5661bd076fde16e9ec1e445a7ee657ef267978988ad56 --- Makefile.in | 4 ++-- manifest | 14 +++++++------- manifest.uuid | 2 +- tool/buildtclext.tcl | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4e804f889a..626a6bb909 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1566,8 +1566,8 @@ tclextension: tclsqlite3.c # Install the SQLite TCL extension in a way that is appropriate for $TCLSH_CMD # to find it. # -tclextension-install: tclextension - $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --install-only +tclextension-install: tclsqlite3.c + $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl # Install the SQLite TCL extension that is used by $TCLSH_CMD # diff --git a/manifest b/manifest index 55d18cc6fd..b182fa3dff 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Extra\srobustness\sfor\sthe\sSQLite\sTcl\sExtension\sbuilder,\sso\sthat\sit\sworks\non\sDebian\sLinux. -D 2024-08-02T00:19:59.895 +C Continuing\srefinements\sof\sthe\stclextension-install\smakefile\starget. +D 2024-08-02T00:51:52.845 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 3de6a3420170d4f6fac8fd0f338db422ce100be1e64c1e8cb62b85876ebc5fca +F Makefile.in 3cbcc2626f946d826350d68e16ecc987cb653117dde77ebfb33179f5ec86b5a9 F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 F Makefile.msc 993f8addade63bcac7192416e7161ceee60edcee2376299ea48b2a74c66ac2d5 F README.md 6358805260a03ebead84e168bbf3740ddf3f683b477e478567186aa7afb490d3 @@ -2093,7 +2093,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x F tool/build-shell.sh f193b5e3eb4afcb4abbf96bf1475be6cfb74763ee2e50c82bc7ca105e8a136c5 -F tool/buildtclext.tcl 865343ca043c4119e19de9651d01185d0017e588d70f533612c345553cc8160b +F tool/buildtclext.tcl 0368eda9802262105d4b1896439889b042a40acfe73e55869ea24edb4fcba94b F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2202,8 +2202,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 72a80aa0abb121a23f8cc1eb1af04ba06c733a7a40c06f1fe9e62f2a0a26ca6e -R 30cc174315110745d69ebebfb5ba6cf9 +P 2f0738daaff48c51a60f063af6e453443bd7eedf6936daab325b2a36927c7a2b +R 154770fef55d2b7a022438541d20df55 U drh -Z 07ee2d4f800935e6e99694df22387f92 +Z fb4c8793f898a65a5ea5be50709db328 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d4b99149ef..fb3c0b0c69 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2f0738daaff48c51a60f063af6e453443bd7eedf6936daab325b2a36927c7a2b +871c20a848e0e9b7f3d5661bd076fde16e9ec1e445a7ee657ef267978988ad56 diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl index 5b50c627f9..011f01cb5b 100644 --- a/tool/buildtclext.tcl +++ b/tool/buildtclext.tcl @@ -216,9 +216,9 @@ package ifneeded sqlite3 $VERSION \\ # set cmd "$CMD tclsqlite3.c -o $OUT $LIBS" puts $cmd - if {[catch { - exec {*}$cmd - } errmsg]} { + file delete -force $OUT + catch {exec {*}$cmd} errmsg + if {$errmsg!="" && ![file exists $OUT]} { puts $errmsg exit 1 } From ea9a25e5005a8e405738b1bcebf1f96eae0ba23c Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 2 Aug 2024 00:56:31 +0000 Subject: [PATCH 8/8] Previous Makefile.in change broke the tclextension-install target. FossilOrigin-Name: 7748367c78a1f480ec9e892ba77652e3c31a4b387b89221ae584891818804851 --- Makefile.in | 2 +- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile.in b/Makefile.in index 626a6bb909..778dc08493 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1567,7 +1567,7 @@ tclextension: tclsqlite3.c # to find it. # tclextension-install: tclsqlite3.c - $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl + $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --cc $(CC) $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) # Install the SQLite TCL extension that is used by $TCLSH_CMD # diff --git a/manifest b/manifest index b182fa3dff..c5f9ba6e5a 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Continuing\srefinements\sof\sthe\stclextension-install\smakefile\starget. -D 2024-08-02T00:51:52.845 +C Previous\sMakefile.in\schange\sbroke\sthe\stclextension-install\starget. +D 2024-08-02T00:56:31.886 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 3cbcc2626f946d826350d68e16ecc987cb653117dde77ebfb33179f5ec86b5a9 +F Makefile.in fbfe18ff577bcb35b1236015e442667bcdf94230cef07a0897e26f3cab5bf488 F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 F Makefile.msc 993f8addade63bcac7192416e7161ceee60edcee2376299ea48b2a74c66ac2d5 F README.md 6358805260a03ebead84e168bbf3740ddf3f683b477e478567186aa7afb490d3 @@ -2202,8 +2202,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 2f0738daaff48c51a60f063af6e453443bd7eedf6936daab325b2a36927c7a2b -R 154770fef55d2b7a022438541d20df55 +P 871c20a848e0e9b7f3d5661bd076fde16e9ec1e445a7ee657ef267978988ad56 +R ba9c12b4ec23352b095b4f17c1f3bef8 U drh -Z fb4c8793f898a65a5ea5be50709db328 +Z bc0e02f193279e0ca2d17c115ebd2a46 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fb3c0b0c69..797363580e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -871c20a848e0e9b7f3d5661bd076fde16e9ec1e445a7ee657ef267978988ad56 +7748367c78a1f480ec9e892ba77652e3c31a4b387b89221ae584891818804851