Index: tool/mksqlite3c.tcl ================================================================== --- tool/mksqlite3c.tcl +++ tool/mksqlite3c.tcl @@ -24,10 +24,15 @@ # Begin by reading the "sqlite3.h" header file. Count the number of lines # in this file and extract the version number. That information will be # needed in order to generate the header of the amalgamation. # +if {[lsearch $argv --nostatic]>=0} { + set addstatic 0 +} else { + set addstatic 1 +} set in [open tsrc/sqlite3.h] set cnt 0 set VERSION ????? while {![eof $in]} { set line [gets $in] @@ -109,11 +114,11 @@ # Read the source file named $filename and write it into the # sqlite3.c output file. If any #include statements are seen, # process them approprately. # proc copy_file {filename} { - global seen_hdr available_hdr out + global seen_hdr available_hdr out addstatic set tail [file tail $filename] section_comment "Begin file $tail" set in [open $filename r] if {[file extension $filename]==".h"} { set declpattern {^ *[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(} @@ -138,11 +143,12 @@ } } elseif {[regexp {^#ifdef __cplusplus} $line]} { puts $out "#if 0" } elseif {[regexp {^#line} $line]} { # Skip #line directives. - } elseif {[regexp $declpattern $line] && ![regexp {^static} $line]} { + } elseif {$addstatic && [regexp $declpattern $line] + && ![regexp {^static} $line]} { # Add the "static" keyword before internal functions. puts $out "static $line" } else { puts $out $line } @@ -215,33 +221,6 @@ main.c } { copy_file tsrc/$file } -if 0 { -puts $out "#ifdef SQLITE_TEST" -foreach file { - test1.c - test2.c - test3.c - test4.c - test5.c - test6.c - test7.c - test8.c - test_async.c - test_autoext.c - test_loadext.c - test_md5.c - test_schema.c - test_server.c - test_tclvar.c -} { - copy_file ../sqlite/src/$file -} -puts $out "#endif /* SQLITE_TEST */" -puts $out "#ifdef SQLITE_TCL" -copy_file ../sqlite/src/tclsqlite.c -puts $out "#endif /* SQLITE_TCL */" -} - close $out