5 # const char **azCompileOpt[]
7 # definition used in src/ctime.c, run this script from
8 # the checkout root. It generates src/ctime.c .
10 # Results are normally written into src/ctime.c. But if an argument is
11 # provided, results are written there instead. Examples:
13 # tclsh tool/mkctimec.tcl ;# <-- results to src/ctime.c
15 # tclsh tool/mkctimec.tcl /dev/tty ;# <-- results to the terminal
19 set ::headWarning {/* DO NOT EDIT
!
20 ** This
file is automatically generated by the script in the canonical
21 ** SQLite
source tree at tool
/mkctimec.tcl.
23 ** To modify this header
, edit any of the various lists in that script
24 ** which specify categories of generated conditionals in this
file.
27 # Make { and } easier to put into literals (even on EBCDIC machines.)
28 regexp {(\{)(\})} "{}" ma
::lb ::rb
34 ** The author disclaims copyright to this source code. In place of
35 ** a legal notice, here is a blessing:
37 ** May you do good and not evil.
38 ** May you find forgiveness for yourself and forgive others.
39 ** May you share freely, never taking more than you give.
41 *************************************************************************
43 ** This file implements routines used to report what compile-time options
44 ** SQLite was built with.
46 #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS /* IMP: R-16824-07538 */
49 ** Include the configuration header output by 'configure' if we're using the
50 ** autoconf-based build
52 #if defined(_HAVE_SQLITE_CONFIG_H) && !defined(SQLITECONFIG_H)
53 #include \"sqlite_cfg.h\"
54 #define SQLITECONFIG_H 1
57 /* These macros are provided to \"stringify\" the value of the define
58 ** for those options in which the value is meaningful. */
59 #define CTIMEOPT_VAL_(opt) #opt
60 #define CTIMEOPT_VAL(opt) CTIMEOPT_VAL_(opt)
62 /* Like CTIMEOPT_VAL, but especially for SQLITE_DEFAULT_LOOKASIDE. This
63 ** option requires a separate macro because legal values contain a single
64 ** comma. e.g. (-DSQLITE_DEFAULT_LOOKASIDE=\"100,100\") */
65 #define CTIMEOPT_VAL2_(opt1,opt2) #opt1 \",\" #opt2
66 #define CTIMEOPT_VAL2(opt) CTIMEOPT_VAL2_(opt)
67 #include \"sqliteInt.h\"
70 ** An array of names of all compile-time options. This array should
73 ** This array looks large, but in a typical installation actually uses
74 ** only a handful of compile-time options, so most times this array is usually
75 ** rather short and uses little memory space.
77 static const char * const sqlite3azCompileOpt\[\] = $::lb
83 const char **sqlite3CompileOptions(int *pnOpt){
84 *pnOpt = sizeof(sqlite3azCompileOpt) / sizeof(sqlite3azCompileOpt\[0\]);
85 return (const char**)sqlite3azCompileOpt;
88 #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
91 # All Boolean compile time options which default to something
92 # other than 0 or empty. The default is paired with the PP
93 # symbol so that a differing define can be detected.
95 set boolean_defnnz_options
{
96 {SQLITE_HOMEGROWN_RECURSIVE_MUTEX
1}
97 {SQLITE_POWERSAFE_OVERWRITE
1}
98 {SQLITE_DEFAULT_MEMSTATUS
1}
100 {SQLITE_ALLOW_COVERING_INDEX_SCAN
1}
103 # All Boolean compile time options which default to 0 or empty.
105 set boolean_defnil_options
{
107 SQLITE_4_BYTE_ALIGNED_MALLOC
108 SQLITE_ALLOW_URI_AUTHORITY
109 SQLITE_BUG_COMPATIBLE_20160819
110 SQLITE_CASE_SENSITIVE_LIKE
114 SQLITE_DEFAULT_AUTOMATIC_INDEX
115 SQLITE_DEFAULT_AUTOVACUUM
116 SQLITE_DEFAULT_CKPTFULLFSYNC
117 SQLITE_DEFAULT_FOREIGN_KEYS
118 SQLITE_DEFAULT_LOCKING_MODE
119 SQLITE_DEFAULT_RECURSIVE_TRIGGERS
120 SQLITE_DEFAULT_SYNCHRONOUS
121 SQLITE_DEFAULT_WAL_SYNCHRONOUS
122 SQLITE_DIRECT_OVERFLOW_READ
123 SQLITE_DISABLE_DIRSYNC
124 SQLITE_DISABLE_FTS3_UNICODE
125 SQLITE_DISABLE_FTS4_DEFERRED
126 SQLITE_DISABLE_INTRINSIC
128 SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS
129 SQLITE_DISABLE_SKIPAHEAD_DISTINCT
130 SQLITE_ENABLE_8_3_NAMES
131 SQLITE_ENABLE_API_ARMOR
132 SQLITE_ENABLE_ATOMIC_WRITE
133 SQLITE_ENABLE_BATCH_ATOMIC_WRITE
134 SQLITE_ENABLE_BYTECODE_VTAB
135 SQLITE_ENABLE_COLUMN_METADATA
136 SQLITE_ENABLE_COLUMN_USED_MASK
137 SQLITE_ENABLE_COSTMULT
138 SQLITE_ENABLE_CURSOR_HINTS
139 SQLITE_ENABLE_DBPAGE_VTAB
140 SQLITE_ENABLE_DBSTAT_VTAB
141 SQLITE_ENABLE_EXPENSIVE_ASSERT
142 SQLITE_ENABLE_EXPLAIN_COMMENTS
144 SQLITE_ENABLE_FTS3_PARENTHESIS
145 SQLITE_ENABLE_FTS3_TOKENIZER
148 SQLITE_ENABLE_GEOPOLY
149 SQLITE_ENABLE_HIDDEN_COLUMNS
151 SQLITE_ENABLE_IOTRACE
152 SQLITE_ENABLE_LOAD_EXTENSION
153 SQLITE_ENABLE_LOCKING_STYLE
154 SQLITE_ENABLE_MATH_FUNCTIONS
155 SQLITE_ENABLE_MEMORY_MANAGEMENT
156 SQLITE_ENABLE_MEMSYS3
157 SQLITE_ENABLE_MEMSYS5
158 SQLITE_ENABLE_MULTIPLEX
159 SQLITE_ENABLE_NORMALIZE
160 SQLITE_ENABLE_NULL_TRIM
161 SQLITE_ENABLE_OFFSET_SQL_FUNC
162 SQLITE_ENABLE_OVERSIZE_CELL_CHECK
163 SQLITE_ENABLE_PREUPDATE_HOOK
167 SQLITE_ENABLE_SESSION
168 SQLITE_ENABLE_SNAPSHOT
169 SQLITE_ENABLE_SORTER_REFERENCES
172 SQLITE_ENABLE_STMT_SCANSTATUS
173 SQLITE_ENABLE_STMTVTAB
174 SQLITE_ENABLE_TREETRACE
175 SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
176 SQLITE_ENABLE_UNLOCK_NOTIFY
177 SQLITE_ENABLE_UPDATE_DELETE_LIMIT
178 SQLITE_ENABLE_URI_00_ERROR
179 SQLITE_ENABLE_VFSTRACE
180 SQLITE_ENABLE_WHERETRACE
182 SQLITE_EXPLAIN_ESTIMATED_ROWS
183 SQLITE_EXTRA_IFNULLROW
184 SQLITE_FTS5_ENABLE_TEST_MI
185 SQLITE_FTS5_NO_WITHOUT_ROWID
186 SQLITE_IGNORE_AFP_LOCK_ERRORS
187 SQLITE_IGNORE_FLOCK_LOCK_ERRORS
190 SQLITE_LEGACY_JSON_VALID
191 SQLITE_LIKE_DOESNT_MATCH_BLOBS
193 SQLITE_LOG_CACHE_SPILL
195 SQLITE_MIXED_ENDIAN_64BIT_FLOAT
196 SQLITE_MMAP_READWRITE
199 SQLITE_MUTEX_PTHREADS
203 SQLITE_OMIT_ALTERTABLE
206 SQLITE_OMIT_AUTHORIZATION
207 SQLITE_OMIT_AUTOINCREMENT
209 SQLITE_OMIT_AUTOMATIC_INDEX
210 SQLITE_OMIT_AUTORESET
211 SQLITE_OMIT_AUTOVACUUM
212 SQLITE_OMIT_BETWEEN_OPTIMIZATION
213 SQLITE_OMIT_BLOB_LITERAL
217 SQLITE_OMIT_COMPOUND_SELECT
218 SQLITE_OMIT_CONFLICT_CLAUSE
221 SQLITE_OMIT_DEPRECATED
222 SQLITE_OMIT_DESERIALIZE
225 SQLITE_OMIT_FLAG_PRAGMAS
226 SQLITE_OMIT_FLOATING_POINT
227 SQLITE_OMIT_FOREIGN_KEY
228 SQLITE_OMIT_GET_TABLE
229 SQLITE_OMIT_HEX_INTEGER
231 SQLITE_OMIT_INTEGRITY_CHECK
232 SQLITE_OMIT_INTROSPECTION_PRAGMAS
234 SQLITE_OMIT_LIKE_OPTIMIZATION
235 SQLITE_OMIT_LOAD_EXTENSION
236 SQLITE_OMIT_LOCALTIME
237 SQLITE_OMIT_LOOKASIDE
239 SQLITE_OMIT_OR_OPTIMIZATION
240 SQLITE_OMIT_PAGER_PRAGMAS
241 SQLITE_OMIT_PARSER_TRACE
244 SQLITE_OMIT_PROGRESS_CALLBACK
245 SQLITE_OMIT_QUICKBALANCE
247 SQLITE_OMIT_SCHEMA_PRAGMAS
248 SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
250 SQLITE_OMIT_SHARED_CACHE
251 SQLITE_OMIT_SHUTDOWN_DIRECTORIES
253 SQLITE_OMIT_TCL_VARIABLE
255 SQLITE_OMIT_TEST_CONTROL
257 SQLITE_OMIT_TRUNCATE_OPTIMIZATION
261 SQLITE_OMIT_VIRTUALTABLE
265 SQLITE_PERFORMANCE_TRACE
266 SQLITE_PREFER_PROXY_LOCKING
268 SQLITE_REVERSE_UNORDERED_SELECTS
269 SQLITE_RTREE_INT_ONLY
273 SQLITE_SUBSTR_COMPATIBILITY
276 SQLITE_UNLINK_AFTER_CLOSE
279 SQLITE_USE_FCNTL_TRACE
280 SQLITE_USER_AUTHENTICATION
287 # All compile time options for which the assigned value is other than boolean
288 # and is a comma-separated scalar pair.
291 SQLITE_DEFAULT_LOOKASIDE
294 # All compile time options for which the assigned value is other than boolean
295 # and is a single scalar.
298 SQLITE_ATOMIC_INTRINSICS
300 SQLITE_DEFAULT_CACHE_SIZE
301 SQLITE_DEFAULT_FILE_FORMAT
302 SQLITE_DEFAULT_FILE_PERMISSIONS
303 SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT
304 SQLITE_DEFAULT_LOCKING_MODE
305 SQLITE_DEFAULT_MMAP_SIZE
306 SQLITE_DEFAULT_PAGE_SIZE
307 SQLITE_DEFAULT_PCACHE_INITSZ
308 SQLITE_DEFAULT_PROXYDIR_PERMISSIONS
309 SQLITE_DEFAULT_ROWEST
310 SQLITE_DEFAULT_SECTOR_SIZE
311 SQLITE_DEFAULT_SYNCHRONOUS
312 SQLITE_DEFAULT_WAL_AUTOCHECKPOINT
313 SQLITE_DEFAULT_WAL_SYNCHRONOUS
314 SQLITE_DEFAULT_WORKER_THREADS
316 SQLITE_ENABLE_8_3_NAMES
318 SQLITE_ENABLE_LOCKING_STYLE
321 SQLITE_EXTRA_SHUTDOWN
322 SQLITE_FTS3_MAX_EXPR_DEPTH
323 SQLITE_INTEGRITY_CHECK_ERROR_MAX
324 SQLITE_MALLOC_SOFT_LIMIT
327 SQLITE_MAX_COMPOUND_SELECT
328 SQLITE_MAX_DEFAULT_PAGE_SIZE
329 SQLITE_MAX_EXPR_DEPTH
330 SQLITE_MAX_FUNCTION_ARG
332 SQLITE_MAX_LIKE_PATTERN_LENGTH
335 SQLITE_MAX_MMAP_SIZE_
336 SQLITE_MAX_PAGE_COUNT
338 SQLITE_MAX_SCHEMA_RETRY
339 SQLITE_MAX_SQL_LENGTH
340 SQLITE_MAX_TRIGGER_DEPTH
341 SQLITE_MAX_VARIABLE_NUMBER
343 SQLITE_MAX_WORKER_THREADS
346 SQLITE_STMTJRNL_SPILL
350 # Options that require custom code.
352 set options(COMPILER
) {
353 #if defined(__clang__) && defined(__clang_major__)
354 "COMPILER=clang-" CTIMEOPT_VAL
(__clang_major__
) "."
355 CTIMEOPT_VAL
(__clang_minor__
) "."
356 CTIMEOPT_VAL
(__clang_patchlevel__
),
357 #elif defined(_MSC_VER)
358 "COMPILER=msvc-" CTIMEOPT_VAL
(_MSC_VER
),
359 #elif defined(__GNUC__) && defined(__VERSION__)
360 "COMPILER=gcc-" __VERSION__
,
363 set options(HAVE_ISNAN
) {
364 #if HAVE_ISNAN || SQLITE_HAVE_ISNAN
368 set options(OMIT_DATETIME_FUNCS
) {
369 #if defined(SQLITE_OMIT_DATETIME_FUNCS) || defined(SQLITE_OMIT_FLOATING_POINT)
370 "OMIT_DATETIME_FUNCS",
373 set options(SYSTEM_MALLOC
) "\
374 #if (!defined(SQLITE_WIN32_MALLOC) \\
375 && !defined(SQLITE_ZERO_MALLOC) \\
376 && !defined(SQLITE_MEMDEBUG) \\
377 ) || defined(SQLITE_SYSTEM_MALLOC)
381 set options(THREADSAFE
) {
382 #if defined(SQLITE_THREADSAFE)
383 "THREADSAFE=" CTIMEOPT_VAL
(SQLITE_THREADSAFE
),
384 #elif defined(THREADSAFE)
385 "THREADSAFE=" CTIMEOPT_VAL
(THREADSAFE
),
391 proc trim_name
{in
} {
393 if {[string range
$in 0 6]=="SQLITE_"} {
394 set ret
[string range
$in 7 end
]
399 foreach name_defval
$boolean_defnnz_options {
400 set b
[lindex $name_defval 0]
401 set defval
[lindex $name_defval 1]
402 set name
[trim_name
$b]
403 set options($name) [subst {
406 "$name=" CTIMEOPT_VAL
($b),
412 foreach b
$boolean_defnil_options {
413 set name
[trim_name
$b]
414 set options($name) [subst {
421 foreach v
$value_options {
422 set name
[trim_name
$v]
423 set options($name) [subst {
425 "$name=" CTIMEOPT_VAL
($v),
430 foreach v
$value2_options {
431 set name
[trim_name
$v]
432 set options($name) [subst {
434 "$name=" CTIMEOPT_VAL2
($v),
440 set destfile
[lindex $argv 0]
442 set destfile
"[file dir [file dir [file normal $argv0]]]/src/ctime.c"
443 puts "Overwriting $destfile..."
446 if {[catch {set cfd
[open $destfile w
]}]!=0} {
447 puts stderr
"File '$destfile' unwritable."
451 puts $cfd $::headWarning;
452 puts $cfd $::headCode;
453 foreach o
[lsort [array names
options]] {
454 puts $cfd [string trim
$options($o)]
456 puts -nonewline $cfd $::tailCode;