Path issues in buildtclext.tcl
(1) By Jan Palus (jpalus) on 2024-10-23 18:45:24 [source]
configure
accepts:
--with-tcl=DIR directory containing (tclConfig.sh)
yet buildtclext.tcl
ignores it and tries its own way of finding tclConfig.sh
.
Also configure
accepts:
TCLLIBDIR Where to install tcl plugin
but buildtclext.tcl
ignores it and uses $auto_path
instead.
And last but not least buildtclext.tcl
does not take $(DESTDIR)
into account.
(2) By Richard Hipp (drh) on 2024-10-26 19:15:27 in reply to 1 [link] [source]
Makefile rules have now been adjusted. Please download the latest trunk version of the source code (perhaps from https://sqlite.org/src/tarball/trunk/sqlite-trunk.tar.gz) and rerun your "./configure && make install DESTDIR=...
" or whatever it was that you were trying to do and let us know if it is working for you now. Thanks!
(3) By Jan Palus (jpalus) on 2024-10-29 23:44:35 in reply to 2 [link] [source]
Thanks. To comment on specific issues:
#1. Respecting --with-tcl
: it works good enough although I think the if
should be guarded additionally by "" eq $with_tcl
:
if {$use_tcl} {
if {[catch {exec $with_tclsh $top_srcdir/tool/find_tclconfig.tcl} result] == 0} {
set with_tcl $result
}
if {"" ne $with_tcl && [file isdir $with_tcl]} {
msg-result "$with_tclsh recommends the tclConfig.sh from $with_tcl"
} else {
proj-warn "$with_tclsh is unable to recommand a tclConfig.sh"
set use_tcl 0
}
}
#2. Respecting TCLLIBDIR -- still missing. sqlite installs to first path from $auto_path
which is not the path that I'd like it to install to
# T.tcllibdir = shell code to extract the TCLLIBDIR to the tcllibdir
# shell var and exit with !0 if it cannot be determined. It must be
# part of a chained series of commands so that the var survives for
# the following rules in the same recipe.
#
# Algo: tcllibdir = the first entry from TCL's $auto_path which refers
# to an existing dir, then append /sqlite3 to it.
#
T.tcllibdir = \
for tcllibdir in `echo "puts stdout \\$$auto_path" | $(TCLSH_CMD)`; do \
[ -d "$$tcllibdir" ] && break; done; \
if [ x = "x$$tcllibdir" ]; then echo "Cannot determine TCLLIBDIR" 1>&2; exit 1; fi; \
tcllibdir="$$tcllibdir/sqlite3"; echo "TCLLIBDIR=$$tcllibdir"
#3. Respecting $(DESTDIR) -- works fine
(4) By Stephan Beal (stephan) on 2024-10-30 01:49:36 in reply to 3 [link] [source]
Respecting TCLLIBDIR -- still missing.
After looking over the legacy configure script, i see that it used to honor whatever override TCLLIBDIR was set when configure was run. We no longer do that check at configure-time because that makes it onerous to communicate the TCL-related configuration to static/hand-written makefiles (which we have a few of outside of the source tree).
However, as of a moment ago, in the current trunk you can override TCLLIBDIR when running make or as an environment var:
$ m libtclsqlite3.so
...
TCLLIBDIR=/usr/share/tcltk/tcl8.6/sqlite3
+ ccache ... libsqlite3.so ... -Wl,-rpath,/usr/share/tcltk/tcl8.6/sqlite3
$ rm libtclsqlite3.so
$ m libtclsqlite3.so TCLLIBDIR=/foo/bar
TCLLIBDIR=/foo/bar
+ ccache ... -o libtclsqlite3.so ... -Wl,-rpath,/foo/bar
$ rm libtclsqlite3.so
$ TCLLIBDIR=/bar/baz m libtclsqlite3.so
$ ccache ... -o libtclsqlite3.so ... -Wl,-rpath,/bar/baz
In addition, i will investigate re-adding the option to bake it into the build at configure-time, noting that we still need the option of doing it at make-time (using the T.tcllibdir bit you quoted) for the sake of our static/hand-written makefiles.
(5) By Stephan Beal (stephan) on 2024-10-30 02:09:02 in reply to 4 [link] [source]
will investigate re-adding the option to bake it into the build at configure-time ...
The trunk once again supports that:
$ ./configure TCLLIBDIR=/this/is/my/place
...
$ m libtclsqlite3.so
...
ccache ... libtclsqlite3.so tclsqlite.o ... -Wl,-rpath,/this/is/my/place
And it can also be overridden at make-time.