Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -1598,11 +1598,11 @@ # Install the SQLite TCL extension in a way that is appropriate for $TCLSH_CMD # to find it. # tclextension-install: tclsqlite3.c - $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --cc "$(CC)" $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) + $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --destdir "$(DESTDIR)" --cc "$(CC)" $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS) # Install the SQLite TCL extension that is used by $TCLSH_CMD # tclextension-uninstall: $(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --uninstall Index: tool/buildtclext.tcl ================================================================== --- tool/buildtclext.tcl +++ tool/buildtclext.tcl @@ -13,10 +13,11 @@ --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 + --destdir DIR Installation root (used by "make install DESTDIR=...") Other options are retained and passed through into the compiler.} set build 1 @@ -23,10 +24,11 @@ set install 1 set uninstall 0 set infoonly 0 set CC {} set OPTS {} +set DESTDIR ""; # --destdir "$(DESTDIR)" for {set ii 0} {$ii<[llength $argv]} {incr ii} { set a0 [lindex $argv $ii] if {$a0=="--install-only"} { set build 0 } elseif {$a0=="--build-only"} { @@ -40,10 +42,13 @@ set install 0 set infoonly 1 } elseif {$a0=="--cc" && $ii+1<[llength $argv]} { incr ii set CC [lindex $argv $ii] + } elseif {$a0=="--destdir" && $ii+1<[llength $argv]} { + incr ii + set DESTDIR [lindex $argv $ii] } elseif {[string match -* $a0]} { append OPTS " $a0" } else { puts stderr "Unknown option: \"$a0\"\n" puts stderr $help @@ -243,12 +248,12 @@ } if {$install} { # Install the extension - set DEST2 $DEST/sqlite$VERSION + set DEST2 ${DESTDIR}$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 }