drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 1 | #!/usr/bin/tclsh |
| 2 | # |
| 3 | # To build a single huge source file holding all of SQLite (or at |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 4 | # least the core components - the test harness, shell, and TCL |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 5 | # interface are omitted.) first do |
| 6 | # |
| 7 | # make target_source |
| 8 | # |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 9 | # The make target above moves all of the source code files into |
| 10 | # a subdirectory named "tsrc". (This script expects to find the files |
| 11 | # there and will not work if they are not found.) There are a few |
| 12 | # generated C code files that are also added to the tsrc directory. |
| 13 | # For example, the "parse.c" and "parse.h" files to implement the |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 14 | # the parser are derived from "parse.y" using lemon. And the |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 15 | # "keywordhash.h" files is generated by a program named "mkkeywordhash". |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 16 | # |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 17 | # After the "tsrc" directory has been created and populated, run |
| 18 | # this script: |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 19 | # |
drh | 84ab953 | 2015-05-04 17:06:39 +0000 | [diff] [blame] | 20 | # tclsh mksqlite3c.tcl --srcdir $SRC |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 21 | # |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 22 | # The amalgamated SQLite code will be written into sqlite3.c |
| 23 | # |
| 24 | |
drh | 8de5a17 | 2009-07-20 12:25:44 +0000 | [diff] [blame] | 25 | # Begin by reading the "sqlite3.h" header file. Extract the version number |
drh | e191e2c | 2013-03-19 15:23:18 +0000 | [diff] [blame] | 26 | # from in this file. The version number is needed to generate the header |
drh | 8de5a17 | 2009-07-20 12:25:44 +0000 | [diff] [blame] | 27 | # comment of the amalgamation. |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 28 | # |
drh | 84ab953 | 2015-05-04 17:06:39 +0000 | [diff] [blame] | 29 | set addstatic 1 |
| 30 | set linemacros 0 |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 31 | set useapicall 0 |
drh | 84ab953 | 2015-05-04 17:06:39 +0000 | [diff] [blame] | 32 | for {set i 0} {$i<[llength $argv]} {incr i} { |
| 33 | set x [lindex $argv $i] |
| 34 | if {[regexp {^-+nostatic$} $x]} { |
| 35 | set addstatic 0 |
| 36 | } elseif {[regexp {^-+linemacros} $x]} { |
| 37 | set linemacros 1 |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 38 | } elseif {[regexp {^-+useapicall} $x]} { |
| 39 | set useapicall 1 |
drh | 84ab953 | 2015-05-04 17:06:39 +0000 | [diff] [blame] | 40 | } else { |
| 41 | error "unknown command-line option: $x" |
| 42 | } |
drh | 96e5088 | 2011-08-15 15:27:20 +0000 | [diff] [blame] | 43 | } |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 44 | set in [open tsrc/sqlite3.h] |
| 45 | set cnt 0 |
| 46 | set VERSION ????? |
| 47 | while {![eof $in]} { |
| 48 | set line [gets $in] |
| 49 | if {$line=="" && [eof $in]} break |
| 50 | incr cnt |
| 51 | regexp {#define\s+SQLITE_VERSION\s+"(.*)"} $line all VERSION |
| 52 | } |
| 53 | close $in |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 54 | |
| 55 | # Open the output file and write a header comment at the beginning |
| 56 | # of the file. |
| 57 | # |
| 58 | set out [open sqlite3.c w] |
shaneh | 5e0fb2c | 2011-06-17 15:54:59 +0000 | [diff] [blame] | 59 | # Force the output to use unix line endings, even on Windows. |
drh | ced174b | 2011-06-20 15:24:22 +0000 | [diff] [blame] | 60 | fconfigure $out -translation lf |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 61 | set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1] |
| 62 | puts $out [subst \ |
| 63 | {/****************************************************************************** |
drh | 19df335 | 2007-04-01 01:57:41 +0000 | [diff] [blame] | 64 | ** This file is an amalgamation of many separate C source files from SQLite |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 65 | ** version $VERSION. By combining all the individual C code files into this |
drh | 1d21021 | 2011-04-01 18:12:58 +0000 | [diff] [blame] | 66 | ** single large file, the entire code can be compiled as a single translation |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 67 | ** unit. This allows many compilers to do optimizations that would not be |
| 68 | ** possible if the files were compiled separately. Performance improvements |
drh | 0ee6862 | 2010-10-31 22:42:27 +0000 | [diff] [blame] | 69 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 70 | ** translation unit. |
| 71 | ** |
| 72 | ** This file is all you need to compile SQLite. To use SQLite in other |
| 73 | ** programs, you need this file and the "sqlite3.h" header file that defines |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 74 | ** the programming interface to the SQLite library. (If you do not have |
drh | 8de5a17 | 2009-07-20 12:25:44 +0000 | [diff] [blame] | 75 | ** the "sqlite3.h" header file at hand, you will find a copy embedded within |
| 76 | ** the text of this file. Search for "Begin file sqlite3.h" to find the start |
| 77 | ** of the embedded sqlite3.h header file.) Additional code files may be needed |
| 78 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 79 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 80 | ** separate file. This file contains only code for the core SQLite library. |
drh | bd08af4 | 2007-04-05 21:58:33 +0000 | [diff] [blame] | 81 | */ |
danielk1977 | 7c9aaa7 | 2008-01-01 05:49:07 +0000 | [diff] [blame] | 82 | #define SQLITE_CORE 1 |
drh | bd08af4 | 2007-04-05 21:58:33 +0000 | [diff] [blame] | 83 | #define SQLITE_AMALGAMATION 1}] |
drh | b6a9ece | 2007-06-26 00:37:27 +0000 | [diff] [blame] | 84 | if {$addstatic} { |
| 85 | puts $out \ |
| 86 | {#ifndef SQLITE_PRIVATE |
| 87 | # define SQLITE_PRIVATE static |
| 88 | #endif} |
| 89 | } |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 90 | |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 91 | # These are the header files used by SQLite. The first time any of these |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 92 | # files are seen in a #include statement in the C code, include the complete |
| 93 | # text of the file in-line. The file only needs to be included once. |
| 94 | # |
| 95 | foreach hdr { |
| 96 | btree.h |
drh | a315289 | 2007-05-05 11:48:52 +0000 | [diff] [blame] | 97 | btreeInt.h |
drh | 820a906 | 2008-01-31 13:35:48 +0000 | [diff] [blame] | 98 | fts3.h |
drh | f7829ad | 2009-11-25 22:42:22 +0000 | [diff] [blame] | 99 | fts3Int.h |
drh | 820a906 | 2008-01-31 13:35:48 +0000 | [diff] [blame] | 100 | fts3_hash.h |
| 101 | fts3_tokenizer.h |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 102 | hash.h |
shane | 9bcbdad | 2008-05-29 20:22:37 +0000 | [diff] [blame] | 103 | hwtime.h |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 104 | keywordhash.h |
mistachkin | 2318d33 | 2015-01-12 18:02:52 +0000 | [diff] [blame] | 105 | msvc.h |
drh | 428e282 | 2007-08-30 16:23:19 +0000 | [diff] [blame] | 106 | mutex.h |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 107 | opcodes.h |
| 108 | os_common.h |
mistachkin | f74b9e0 | 2013-11-26 01:00:31 +0000 | [diff] [blame] | 109 | os_setup.h |
mistachkin | 8bc5262 | 2013-11-25 09:36:07 +0000 | [diff] [blame] | 110 | os_win.h |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 111 | os.h |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 112 | pager.h |
| 113 | parse.h |
danielk1977 | 8c0a791 | 2008-08-20 14:49:23 +0000 | [diff] [blame] | 114 | pcache.h |
drh | 67e65e5 | 2015-02-02 21:34:54 +0000 | [diff] [blame] | 115 | pragma.h |
drh | 58f1c8b | 2008-05-26 20:19:25 +0000 | [diff] [blame] | 116 | rtree.h |
drh | 498dcae | 2013-03-13 11:42:00 +0000 | [diff] [blame] | 117 | sqlite3session.h |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 118 | sqlite3.h |
dan | cd73244 | 2015-02-10 20:00:38 +0000 | [diff] [blame] | 119 | sqlite3ext.h |
drh | cfb8f8d | 2015-07-23 20:44:49 +0000 | [diff] [blame] | 120 | sqlite3rbu.h |
danielk1977 | 1c82665 | 2008-09-08 08:08:09 +0000 | [diff] [blame] | 121 | sqliteicu.h |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 122 | sqliteInt.h |
drh | c551dd8 | 2007-06-19 15:23:48 +0000 | [diff] [blame] | 123 | sqliteLimit.h |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 124 | vdbe.h |
| 125 | vdbeInt.h |
drh | 8cd5b25 | 2015-03-02 22:06:43 +0000 | [diff] [blame] | 126 | vxworks.h |
drh | c438efd | 2010-04-26 00:19:45 +0000 | [diff] [blame] | 127 | wal.h |
drh | e54df42 | 2013-11-12 18:37:25 +0000 | [diff] [blame] | 128 | whereInt.h |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 129 | } { |
| 130 | set available_hdr($hdr) 1 |
| 131 | } |
drh | 71674ce | 2007-10-23 15:51:26 +0000 | [diff] [blame] | 132 | set available_hdr(sqliteInt.h) 0 |
drh | e191e2c | 2013-03-19 15:23:18 +0000 | [diff] [blame] | 133 | set available_hdr(sqlite3session.h) 0 |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 134 | |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 135 | # These headers should be copied into the amalgamation without modifying any |
| 136 | # of their function declarations or definitions. |
| 137 | set varonly_hdr(sqlite3.h) 1 |
| 138 | |
| 139 | # These are the functions that accept a variable number of arguments. They |
| 140 | # always need to use the "cdecl" calling convention even when another calling |
| 141 | # convention (e.g. "stcall") is being used for the rest of the library. |
| 142 | set cdecllist { |
| 143 | sqlite3_config |
| 144 | sqlite3_db_config |
| 145 | sqlite3_log |
| 146 | sqlite3_mprintf |
| 147 | sqlite3_snprintf |
| 148 | sqlite3_test_control |
| 149 | sqlite3_vtab_config |
| 150 | } |
| 151 | |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 152 | # 78 stars used for comment formatting. |
| 153 | set s78 \ |
| 154 | {*****************************************************************************} |
| 155 | |
| 156 | # Insert a comment into the code |
| 157 | # |
| 158 | proc section_comment {text} { |
| 159 | global out s78 |
| 160 | set n [string length $text] |
| 161 | set nstar [expr {60 - $n}] |
| 162 | set stars [string range $s78 0 $nstar] |
| 163 | puts $out "/************** $text $stars/" |
| 164 | } |
| 165 | |
| 166 | # Read the source file named $filename and write it into the |
| 167 | # sqlite3.c output file. If any #include statements are seen, |
mistachkin | 2a43c28 | 2013-08-31 05:46:42 +0000 | [diff] [blame] | 168 | # process them appropriately. |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 169 | # |
| 170 | proc copy_file {filename} { |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 171 | global seen_hdr available_hdr varonly_hdr cdecllist out |
| 172 | global addstatic linemacros useapicall |
drh | 96e5088 | 2011-08-15 15:27:20 +0000 | [diff] [blame] | 173 | set ln 0 |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 174 | set tail [file tail $filename] |
| 175 | section_comment "Begin file $tail" |
drh | 96e5088 | 2011-08-15 15:27:20 +0000 | [diff] [blame] | 176 | if {$linemacros} {puts $out "#line 1 \"$filename\""} |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 177 | set in [open $filename r] |
drh | 73be501 | 2007-08-08 12:11:21 +0000 | [diff] [blame] | 178 | set varpattern {^[a-zA-Z][a-zA-Z_0-9 *]+(sqlite3[_a-zA-Z0-9]+)(\[|;| =)} |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 179 | set declpattern {([a-zA-Z][a-zA-Z_0-9 ]+ \**)(sqlite3[_a-zA-Z0-9]+)(\(.*)} |
drh | ee85813 | 2007-05-08 20:37:38 +0000 | [diff] [blame] | 180 | if {[file extension $filename]==".h"} { |
drh | f7083bf | 2007-08-08 01:04:52 +0000 | [diff] [blame] | 181 | set declpattern " *$declpattern" |
drh | ee85813 | 2007-05-08 20:37:38 +0000 | [diff] [blame] | 182 | } |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 183 | set declpattern ^$declpattern\$ |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 184 | while {![eof $in]} { |
| 185 | set line [gets $in] |
drh | 96e5088 | 2011-08-15 15:27:20 +0000 | [diff] [blame] | 186 | incr ln |
drh | 9965a04 | 2008-10-14 18:21:11 +0000 | [diff] [blame] | 187 | if {[regexp {^\s*#\s*include\s+["<]([^">]+)[">]} $line all hdr]} { |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 188 | if {[info exists available_hdr($hdr)]} { |
| 189 | if {$available_hdr($hdr)} { |
shane | 9bcbdad | 2008-05-29 20:22:37 +0000 | [diff] [blame] | 190 | if {$hdr!="os_common.h" && $hdr!="hwtime.h"} { |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 191 | set available_hdr($hdr) 0 |
| 192 | } |
| 193 | section_comment "Include $hdr in the middle of $tail" |
| 194 | copy_file tsrc/$hdr |
| 195 | section_comment "Continuing where we left off in $tail" |
drh | 96e5088 | 2011-08-15 15:27:20 +0000 | [diff] [blame] | 196 | if {$linemacros} {puts $out "#line [expr {$ln+1}] \"$filename\""} |
mistachkin | 3a2a686 | 2015-07-15 21:00:33 +0000 | [diff] [blame] | 197 | } else { |
| 198 | # Comment out the entire line, replacing any nested comment |
| 199 | # begin/end markers with the harmless substring "**". |
| 200 | puts $out "/* [string map [list /* ** */ **] $line] */" |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 201 | } |
| 202 | } elseif {![info exists seen_hdr($hdr)]} { |
drh | 1a8a0d3 | 2014-05-05 20:21:52 +0000 | [diff] [blame] | 203 | if {![regexp {/\*\s+amalgamator:\s+dontcache\s+\*/} $line]} { |
| 204 | set seen_hdr($hdr) 1 |
| 205 | } |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 206 | puts $out $line |
mistachkin | 1a88b14 | 2013-08-31 18:06:52 +0000 | [diff] [blame] | 207 | } elseif {[regexp {/\*\s+amalgamator:\s+keep\s+\*/} $line]} { |
| 208 | # This include file must be kept because there was a "keep" |
| 209 | # directive inside of a line comment. |
| 210 | puts $out $line |
drh | 96e5088 | 2011-08-15 15:27:20 +0000 | [diff] [blame] | 211 | } else { |
mistachkin | 1a88b14 | 2013-08-31 18:06:52 +0000 | [diff] [blame] | 212 | # Comment out the entire line, replacing any nested comment |
| 213 | # begin/end markers with the harmless substring "**". |
| 214 | puts $out "/* [string map [list /* ** */ **] $line] */" |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 215 | } |
| 216 | } elseif {[regexp {^#ifdef __cplusplus} $line]} { |
| 217 | puts $out "#if 0" |
drh | 96e5088 | 2011-08-15 15:27:20 +0000 | [diff] [blame] | 218 | } elseif {!$linemacros && [regexp {^#line} $line]} { |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 219 | # Skip #line directives. |
drh | 45fac88 | 2015-10-09 01:42:49 +0000 | [diff] [blame] | 220 | } elseif {$addstatic |
| 221 | && ![regexp {^(static|typedef|SQLITE_PRIVATE)} $line]} { |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 222 | # Skip adding the SQLITE_PRIVATE or SQLITE_API keyword before |
| 223 | # functions if this header file does not need it. |
| 224 | if {![info exists varonly_hdr($tail)] |
| 225 | && [regexp $declpattern $line all rettype funcname rest]} { |
| 226 | regsub {^SQLITE_API } $line {} line |
drh | 0a0e131 | 2007-08-07 17:04:59 +0000 | [diff] [blame] | 227 | # Add the SQLITE_PRIVATE or SQLITE_API keyword before functions. |
| 228 | # so that linkage can be modified at compile-time. |
drh | 1ffe7c7 | 2013-03-19 17:10:10 +0000 | [diff] [blame] | 229 | if {[regexp {^sqlite3[a-z]*_} $funcname]} { |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 230 | set line SQLITE_API |
| 231 | append line " " [string trim $rettype] |
| 232 | if {[string index $rettype end] ne "*"} { |
| 233 | append line " " |
| 234 | } |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 235 | if {$useapicall} { |
| 236 | if {[lsearch -exact $cdecllist $funcname] >= 0} { |
mistachkin | 0e4125a | 2016-09-08 23:16:02 +0000 | [diff] [blame] | 237 | append line SQLITE_CDECL " " |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 238 | } else { |
mistachkin | 0e4125a | 2016-09-08 23:16:02 +0000 | [diff] [blame] | 239 | append line SQLITE_APICALL " " |
mistachkin | 4ef916e | 2016-08-24 19:58:46 +0000 | [diff] [blame] | 240 | } |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 241 | } |
mistachkin | 0e4125a | 2016-09-08 23:16:02 +0000 | [diff] [blame] | 242 | append line $funcname $rest |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 243 | puts $out $line |
drh | 0a0e131 | 2007-08-07 17:04:59 +0000 | [diff] [blame] | 244 | } else { |
| 245 | puts $out "SQLITE_PRIVATE $line" |
| 246 | } |
| 247 | } elseif {[regexp $varpattern $line all varname]} { |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 248 | # Add the SQLITE_PRIVATE before variable declarations or |
| 249 | # definitions for internal use |
| 250 | regsub {^SQLITE_API } $line {} line |
| 251 | if {![regexp {^sqlite3_} $varname]} { |
| 252 | regsub {^extern } $line {} line |
| 253 | puts $out "SQLITE_PRIVATE $line" |
| 254 | } else { |
| 255 | if {[regexp {const char sqlite3_version\[\];} $line]} { |
| 256 | set line {const char sqlite3_version[] = SQLITE_VERSION;} |
| 257 | } |
| 258 | regsub {^SQLITE_EXTERN } $line {} line |
| 259 | puts $out "SQLITE_API $line" |
drh | b3190c1 | 2008-12-08 21:37:14 +0000 | [diff] [blame] | 260 | } |
mlcreech | 3a00f90 | 2008-03-04 17:45:01 +0000 | [diff] [blame] | 261 | } elseif {[regexp {^(SQLITE_EXTERN )?void \(\*sqlite3IoTrace\)} $line]} { |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 262 | regsub {^SQLITE_API } $line {} line |
mlcreech | 3a00f90 | 2008-03-04 17:45:01 +0000 | [diff] [blame] | 263 | regsub {^SQLITE_EXTERN } $line {} line |
dan | 8038953 | 2014-12-24 17:17:30 +0000 | [diff] [blame] | 264 | puts $out $line |
drh | f158162 | 2009-02-03 13:51:17 +0000 | [diff] [blame] | 265 | } elseif {[regexp {^void \(\*sqlite3Os} $line]} { |
mistachkin | 59b9b02 | 2015-03-24 21:27:27 +0000 | [diff] [blame] | 266 | regsub {^SQLITE_API } $line {} line |
drh | f158162 | 2009-02-03 13:51:17 +0000 | [diff] [blame] | 267 | puts $out "SQLITE_PRIVATE $line" |
drh | 26b0fc0 | 2007-06-26 00:52:39 +0000 | [diff] [blame] | 268 | } else { |
drh | 0a0e131 | 2007-08-07 17:04:59 +0000 | [diff] [blame] | 269 | puts $out $line |
drh | 26b0fc0 | 2007-06-26 00:52:39 +0000 | [diff] [blame] | 270 | } |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 271 | } else { |
| 272 | puts $out $line |
| 273 | } |
| 274 | } |
| 275 | close $in |
| 276 | section_comment "End of $tail" |
| 277 | } |
| 278 | |
| 279 | |
| 280 | # Process the source files. Process files containing commonly |
| 281 | # used subroutines first in order to help the compiler find |
| 282 | # inlining opportunities. |
| 283 | # |
| 284 | foreach file { |
dan | da1f49b | 2017-06-16 19:51:47 +0000 | [diff] [blame] | 285 | ctime.c |
drh | 71674ce | 2007-10-23 15:51:26 +0000 | [diff] [blame] | 286 | sqliteInt.h |
drh | 98495b4 | 2007-03-31 22:29:05 +0000 | [diff] [blame] | 287 | |
drh | 40257ff | 2008-06-13 18:24:27 +0000 | [diff] [blame] | 288 | global.c |
drh | f714199 | 2008-06-19 00:16:08 +0000 | [diff] [blame] | 289 | status.c |
drh | a55ca9e | 2007-04-02 12:22:44 +0000 | [diff] [blame] | 290 | date.c |
drh | 970f724 | 2007-03-31 16:29:06 +0000 | [diff] [blame] | 291 | os.c |
| 292 | |
drh | 643167f | 2008-01-22 21:30:53 +0000 | [diff] [blame] | 293 | fault.c |
drh | d1370b6 | 2008-10-28 18:58:20 +0000 | [diff] [blame] | 294 | mem0.c |
drh | 97c8ec3 | 2007-08-27 21:49:34 +0000 | [diff] [blame] | 295 | mem1.c |
| 296 | mem2.c |
danielk1977 | 6b39c2e | 2008-06-25 14:57:53 +0000 | [diff] [blame] | 297 | mem3.c |
| 298 | mem5.c |
drh | 97c8ec3 | 2007-08-27 21:49:34 +0000 | [diff] [blame] | 299 | mutex.c |
drh | 18472fa | 2008-10-07 15:25:48 +0000 | [diff] [blame] | 300 | mutex_noop.c |
drh | 61f6dc6 | 2007-08-30 17:15:37 +0000 | [diff] [blame] | 301 | mutex_unix.c |
| 302 | mutex_w32.c |
drh | a315289 | 2007-05-05 11:48:52 +0000 | [diff] [blame] | 303 | malloc.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 304 | printf.c |
drh | 38b4149 | 2015-06-08 15:08:15 +0000 | [diff] [blame] | 305 | treeview.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 306 | random.c |
drh | f51446a | 2012-07-21 19:40:42 +0000 | [diff] [blame] | 307 | threads.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 308 | utf.c |
| 309 | util.c |
| 310 | hash.c |
| 311 | opcodes.c |
| 312 | |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 313 | os_unix.c |
| 314 | os_win.c |
| 315 | |
drh | f5e7bb5 | 2008-02-18 14:47:33 +0000 | [diff] [blame] | 316 | bitvec.c |
danielk1977 | 8c0a791 | 2008-08-20 14:49:23 +0000 | [diff] [blame] | 317 | pcache.c |
danielk1977 | d17e71c | 2008-11-13 14:42:18 +0000 | [diff] [blame] | 318 | pcache1.c |
drh | 3d4501e | 2008-12-04 20:40:10 +0000 | [diff] [blame] | 319 | rowset.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 320 | pager.c |
shaneh | fd06863 | 2010-05-06 19:20:29 +0000 | [diff] [blame] | 321 | wal.c |
drh | 61f6dc6 | 2007-08-30 17:15:37 +0000 | [diff] [blame] | 322 | |
shane | 9bcbdad | 2008-05-29 20:22:37 +0000 | [diff] [blame] | 323 | btmutex.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 324 | btree.c |
danielk1977 | 0410302 | 2009-02-03 16:51:24 +0000 | [diff] [blame] | 325 | backup.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 326 | |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 327 | vdbemem.c |
| 328 | vdbeaux.c |
| 329 | vdbeapi.c |
drh | c7bc4fd | 2009-11-25 18:03:42 +0000 | [diff] [blame] | 330 | vdbetrace.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 331 | vdbe.c |
drh | 3f75584 | 2007-05-03 16:55:32 +0000 | [diff] [blame] | 332 | vdbeblob.c |
dan | 7fe6270 | 2011-08-02 10:56:22 +0000 | [diff] [blame] | 333 | vdbesort.c |
danielk1977 | b317538 | 2008-10-17 18:51:52 +0000 | [diff] [blame] | 334 | memjournal.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 335 | |
drh | 7d10d5a | 2008-08-20 16:35:10 +0000 | [diff] [blame] | 336 | walker.c |
| 337 | resolve.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 338 | expr.c |
| 339 | alter.c |
| 340 | analyze.c |
| 341 | attach.c |
| 342 | auth.c |
| 343 | build.c |
| 344 | callback.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 345 | delete.c |
drh | 70a8ca3 | 2008-08-21 18:49:27 +0000 | [diff] [blame] | 346 | func.c |
dan | 3be7d6e | 2009-09-19 17:59:59 +0000 | [diff] [blame] | 347 | fkey.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 348 | insert.c |
| 349 | legacy.c |
| 350 | loadext.c |
| 351 | pragma.c |
| 352 | prepare.c |
| 353 | select.c |
| 354 | table.c |
| 355 | trigger.c |
| 356 | update.c |
| 357 | vacuum.c |
| 358 | vtab.c |
drh | 6f82e85 | 2015-06-06 20:12:09 +0000 | [diff] [blame] | 359 | wherecode.c |
drh | 6c1f4ef | 2015-06-08 14:23:15 +0000 | [diff] [blame] | 360 | whereexpr.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 361 | where.c |
| 362 | |
| 363 | parse.c |
| 364 | |
| 365 | tokenize.c |
drh | 46c99e0 | 2007-08-27 23:26:59 +0000 | [diff] [blame] | 366 | complete.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 367 | |
| 368 | main.c |
danielk1977 | 404ca07 | 2009-03-16 13:19:36 +0000 | [diff] [blame] | 369 | notify.c |
drh | 820a906 | 2008-01-31 13:35:48 +0000 | [diff] [blame] | 370 | |
| 371 | fts3.c |
dan | 290c939 | 2011-02-01 18:59:34 +0000 | [diff] [blame] | 372 | fts3_aux.c |
drh | aeba020 | 2008-12-31 16:01:04 +0000 | [diff] [blame] | 373 | fts3_expr.c |
drh | 820a906 | 2008-01-31 13:35:48 +0000 | [diff] [blame] | 374 | fts3_hash.c |
| 375 | fts3_porter.c |
| 376 | fts3_tokenizer.c |
| 377 | fts3_tokenizer1.c |
dan | d7a959c | 2013-04-22 15:30:37 +0000 | [diff] [blame] | 378 | fts3_tokenize_vtab.c |
dan | 16708c4 | 2009-11-19 15:25:25 +0000 | [diff] [blame] | 379 | fts3_write.c |
| 380 | fts3_snippet.c |
dan | 3d403c7 | 2012-05-25 17:50:19 +0000 | [diff] [blame] | 381 | fts3_unicode.c |
| 382 | fts3_unicode2.c |
drh | 58f1c8b | 2008-05-26 20:19:25 +0000 | [diff] [blame] | 383 | |
| 384 | rtree.c |
danielk1977 | 0c8a5d0 | 2008-08-04 11:49:20 +0000 | [diff] [blame] | 385 | icu.c |
danielk1977 | f9449d0 | 2008-09-24 09:58:00 +0000 | [diff] [blame] | 386 | fts3_icu.c |
drh | cfb8f8d | 2015-07-23 20:44:49 +0000 | [diff] [blame] | 387 | sqlite3rbu.c |
drh | 1a4a680 | 2015-05-04 18:31:09 +0000 | [diff] [blame] | 388 | dbstat.c |
drh | 498dcae | 2013-03-13 11:42:00 +0000 | [diff] [blame] | 389 | sqlite3session.c |
drh | 5006565 | 2015-10-08 19:29:18 +0000 | [diff] [blame] | 390 | json1.c |
| 391 | fts5.c |
drh | c6603af | 2017-06-29 14:33:51 +0000 | [diff] [blame] | 392 | stmt.c |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 393 | } { |
| 394 | copy_file tsrc/$file |
| 395 | } |
| 396 | |
drh | 91c58e2 | 2007-03-27 12:04:04 +0000 | [diff] [blame] | 397 | close $out |