Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -107,10 +107,14 @@ # This is the command to use for tclsh - normally just "tclsh", but we may # know the specific version we want to use # TCLSH_CMD = @TCLSH_CMD@ + +# Where do we want to install the tcl plugin +# +TCLLIBDIR = @TCLLIBDIR@ # The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib" # SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ @@ -458,12 +462,13 @@ ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8" libtclsqlite3.la: tclsqlite.lo libsqlite3.la $(LTLINK) -o $@ tclsqlite.lo \ libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \ - -rpath "$(libdir)/sqlite" \ - -version-info "8:6:8" + -rpath "$(TCLLIBDIR)" \ + -version-info "8:6:8" \ + -avoid-version sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h $(LTLINK) $(READLINE_FLAGS) \ -o $@ $(TOP)/src/shell.c libsqlite3.la \ $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)" @@ -766,12 +771,17 @@ $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) $(INSTALL) -d $(DESTDIR)$(pkgconfigdir) $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir) -tcl_install: libtclsqlite3.la - $(TCLSH_CMD) $(TOP)/tclinstaller.tcl $(RELEASE) +pkgIndex.tcl: + echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3.so sqlite3]' > $@ +tcl_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) clean: rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la rm -f sqlite3.h opcodes.* rm -rf .libs .deps tsrc Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -90,11 +90,11 @@ AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) dnl Put the RCS revision string after AC_INIT so that it will also dnl show in in configure. # The following RCS revision string applies to configure.in -# $Revision: 1.53 $ +# $Revision: 1.54 $ ######### # Programs needed # AC_PROG_LIBTOOL @@ -137,10 +137,20 @@ echo "Warning: can't find tclsh - defaulting to non-amalgamation build." USE_AMALGAMATION=0 TCLSH_CMD="tclsh" fi AC_SUBST(TCLSH_CMD) + +AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin]) +if test "x${TCLLIBDIR+set}" != "xset" ; then + TCLLIBDIR='$(libdir)' + for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do + TCLLIBDIR=$i + break + done + TCLLIBDIR="${TCLLIBDIR}/sqlite3" +fi ######### # Set up an appropriate program prefix # DELETED tclinstaller.tcl Index: tclinstaller.tcl ================================================================== --- tclinstaller.tcl +++ /dev/null @@ -1,32 +0,0 @@ -# This script attempts to install SQLite3 so that it can be used -# by TCL. Invoke this script with single argument which is the -# version number of SQLite. Example: -# -# tclsh tclinstaller.tcl 3.0 -# -set VERSION [lindex $argv 0] -set LIBFILE .libs/libtclsqlite3[info sharedlibextension] -if { ![info exists env(DESTDIR)] } { set env(DESTDIR) "" } -if { ![info exists env(TCLLIBDIR)] } { set env(TCLLIBDIR) [lindex $auto_path 0] } -set LIBDIR $env(DESTDIR)$env(TCLLIBDIR) -set LIBDIR_INSTALL $env(TCLLIBDIR) -set LIBNAME [file tail $LIBFILE] -set LIB $LIBDIR/sqlite3/$LIBNAME -set LIB_INSTALL $LIBDIR_INSTALL/sqlite3/$LIBNAME - -file delete -force $LIBDIR/sqlite3 -file mkdir $LIBDIR/sqlite3 -set fd [open $LIBDIR/sqlite3/pkgIndex.tcl w] -puts $fd "package ifneeded sqlite3 $VERSION \[list load $LIB_INSTALL sqlite3\]" -close $fd - -# We cannot use [file copy] because that will just make a copy of -# a symbolic link. We have to open and copy the file for ourselves. -# -set in [open $LIBFILE] -fconfigure $in -translation binary -set out [open $LIB w 0755] -fconfigure $out -translation binary -puts -nonewline $out [read $in] -close $in -close $out