/ Check-in [57e17c7c]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add a --nostatic option to mksqlite3c.tcl. With this option turned on, the extra "static" storage class markers are not inserted into the amalgamation. (CVS 4013)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 57e17c7cda23a3b3e1d0a691af07c35c1c644dcc
User & Date: drh 2007-05-16 13:55:26
Context
2007-05-16
14:23
Omit some extra code when OMIT_INCRBLOB is defined. (CVS 4014) check-in: 1d89be28 user: danielk1977 tags: trunk
13:55
Add a --nostatic option to mksqlite3c.tcl. With this option turned on, the extra "static" storage class markers are not inserted into the amalgamation. (CVS 4013) check-in: 57e17c7c user: drh tags: trunk
11:55
Keep the full precision of integers if possible when casting to "numeric". Ticket #2364. (CVS 4012) check-in: 2ac985a3 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/mksqlite3c.tcl.

    22     22   # The amalgamated SQLite code will be written into sqlite3.c
    23     23   #
    24     24   
    25     25   # Begin by reading the "sqlite3.h" header file.  Count the number of lines
    26     26   # in this file and extract the version number.  That information will be
    27     27   # needed in order to generate the header of the amalgamation.
    28     28   #
           29  +if {[lsearch $argv --nostatic]>=0} {
           30  +  set addstatic 0
           31  +} else {
           32  +  set addstatic 1
           33  +}
    29     34   set in [open tsrc/sqlite3.h]
    30     35   set cnt 0
    31     36   set VERSION ?????
    32     37   while {![eof $in]} {
    33     38     set line [gets $in]
    34     39     if {$line=="" && [eof $in]} break
    35     40     incr cnt
................................................................................
   107    112   }
   108    113   
   109    114   # Read the source file named $filename and write it into the
   110    115   # sqlite3.c output file.  If any #include statements are seen,
   111    116   # process them approprately.
   112    117   #
   113    118   proc copy_file {filename} {
   114         -  global seen_hdr available_hdr out
          119  +  global seen_hdr available_hdr out addstatic
   115    120     set tail [file tail $filename]
   116    121     section_comment "Begin file $tail"
   117    122     set in [open $filename r]
   118    123     if {[file extension $filename]==".h"} {
   119    124       set declpattern {^ *[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(}
   120    125     } else {
   121    126       set declpattern {^[a-zA-Z][a-zA-Z_0-9 ]+ \*?sqlite3[A-Z][a-zA-Z0-9]+\(}
................................................................................
   136    141           set seen_hdr($hdr) 1
   137    142           puts $out $line
   138    143         }
   139    144       } elseif {[regexp {^#ifdef __cplusplus} $line]} {
   140    145         puts $out "#if 0"
   141    146       } elseif {[regexp {^#line} $line]} {
   142    147         # Skip #line directives.
   143         -    } elseif {[regexp $declpattern $line] && ![regexp {^static} $line]} {
          148  +    } elseif {$addstatic && [regexp $declpattern $line] 
          149  +                  && ![regexp {^static} $line]} {
   144    150         # Add the "static" keyword before internal functions.
   145    151         puts $out "static $line"
   146    152       } else {
   147    153         puts $out $line
   148    154       }
   149    155     }
   150    156     close $in
................................................................................
   213    219      tokenize.c
   214    220   
   215    221      main.c
   216    222   } {
   217    223     copy_file tsrc/$file
   218    224   }
   219    225   
   220         -if 0 {
   221         -puts $out "#ifdef SQLITE_TEST"
   222         -foreach file {
   223         -   test1.c
   224         -   test2.c
   225         -   test3.c
   226         -   test4.c
   227         -   test5.c
   228         -   test6.c
   229         -   test7.c
   230         -   test8.c
   231         -   test_async.c
   232         -   test_autoext.c
   233         -   test_loadext.c
   234         -   test_md5.c
   235         -   test_schema.c
   236         -   test_server.c
   237         -   test_tclvar.c
   238         -} {
   239         -  copy_file ../sqlite/src/$file
   240         -}
   241         -puts $out "#endif /* SQLITE_TEST */"
   242         -puts $out "#ifdef SQLITE_TCL"
   243         -copy_file ../sqlite/src/tclsqlite.c
   244         -puts $out "#endif /* SQLITE_TCL */"
   245         -}
   246         -
   247    226   close $out