# # Run this Tcl script to generate the dynload.html file. # set rcsid {$Id: dynload.tcl,v 1.1 2001/02/11 16:58:22 drh Exp $} puts {
This note was contributed by Bill Saunders. Thanks, Bill!
To compile the SQLite Tcl extension into a dynamically loaded module I did the following:
Do a standard compile (I had a dir called bld at the same level as sqlite ie /root/bld /root/sqlite I followed the directions and did a standard build in the bld directory)
Now do the following in the bld directory
gcc -shared -I. -lgdbm ../sqlite/src/tclsqlite.c libsqlite.a -o sqlite.so
This should produce the file sqlite.so in the bld directory
Create a pkgIndex.tcl file that contains this line
package ifneeded sqlite 1.0 [list load [file join $dir sqlite.so]]
To use this put sqlite.so and pkgIndex.tcl in the same directory
From that directory start wish
Execute the following tcl command (tells tcl where to fine loadable modules)
lappend auto_path [exec pwd]
Load the package
package require sqlite
Have fun....