blob: 3059643d66c391ac6e183a2ced2675126544fb4b [file] [log] [blame]
drh4b2266a2004-11-27 15:52:16 +00001# This script attempts to install SQLite3 so that it can be used
2# by TCL. Invoke this script with single argument which is the
3# version number of SQLite. Example:
4#
5# tclsh tclinstaller.tcl 3.0
6#
7set VERSION [lindex $argv 0]
8set LIBFILE .libs/libtclsqlite3[info sharedlibextension]
9set LIBDIR [lindex $auto_path 0]
10set LIBNAME [file tail $LIBFILE]
11set LIB $LIBDIR/sqlite3/$LIBNAME
12
13file delete -force $LIBDIR/sqlite3
14file mkdir $LIBDIR/sqlite3
15set fd [open $LIBDIR/sqlite3/pkgIndex.tcl w]
16puts $fd "package ifneeded sqlite3 $VERSION \[list load $LIB sqlite3\]"
17close $fd
18
19# We cannot use [file copy] because that will just make a copy of
20# a symbolic link. We have to open and copy the file for ourselves.
21#
22set in [open $LIBFILE]
23fconfigure $in -translation binary
24set out [open $LIB w]
25fconfigure $out -translation binary
26puts -nonewline $out [read $in]
27close $in
28close $out