#!/usr/bin/tclsh
#
# To build the
#
# const char **azCompileOpt[]
#
# definition used in src/ctime.c, run this script from
# the checkout root. It generates src/ctime.c .
#
set ::headWarning
# Make { and } easier to put into literals (even on EBCDIC machines.)
regexp {(\{)(\})} "{}" ma ::lb ::rb
set ::headCode "
/*
** 2010 February 23
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
**
** This file implements routines used to report what compile-time options
** SQLite was built with.
*/
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS /* IMP: R-16824-07538 */
/*
** Include the configuration header output by 'configure' if we're using the
** autoconf-based build
*/
#if defined(_HAVE_SQLITE_CONFIG_H) && !defined(SQLITECONFIG_H)
#include \"sqlite_cfg.h\"
#define SQLITECONFIG_H 1
#endif
/* These macros are provided to \"stringify\" the value of the define
** for those options in which the value is meaningful. */
#define CTIMEOPT_VAL_(opt) #opt
#define CTIMEOPT_VAL(opt) CTIMEOPT_VAL_(opt)
/* Like CTIMEOPT_VAL, but especially for SQLITE_DEFAULT_LOOKASIDE. This
** option requires a separate macro because legal values contain a single
** comma. e.g. (-DSQLITE_DEFAULT_LOOKASIDE=\"100,100\") */
#define CTIMEOPT_VAL2_(opt1,opt2) #opt1 \",\" #opt2
#define CTIMEOPT_VAL2(opt) CTIMEOPT_VAL2_(opt)
#include \"sqliteInt.h\"
/*
** An array of names of all compile-time options. This array should
** be sorted A-Z.
**
** This array looks large, but in a typical installation actually uses
** only a handful of compile-time options, so most times this array is usually
** rather short and uses little memory space.
*/
static const char * const sqlite3azCompileOpt\[\] = $::lb
"
set ::tailCode "
$::rb ;
const char **sqlite3CompileOptions(int *pnOpt){
*pnOpt = sizeof(sqlite3azCompileOpt) / sizeof(sqlite3azCompileOpt\[0\]);
return (const char**)sqlite3azCompileOpt;
}
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */
"
# All Boolean compile time options which default to something
# other than 0 or empty. The default is paired with the PP
# symbol so that a differing define can be detected.
#
set boolean_defnnz_options
# All Boolean compile time options which default to 0 or empty.
#
set boolean_defnil_options
# All compile time options for which the assigned value is other than boolean
# and is a comma-separated scalar pair.
#
set value2_options
# All compile time options for which the assigned value is other than boolean
# and is a single scalar.
#
set value_options
# Options that require custom code.
#
set options(COMPILER)
set options(HAVE_ISNAN)
set options(OMIT_DATETIME_FUNCS)
set options(SYSTEM_MALLOC) "\
#if (!defined(SQLITE_WIN32_MALLOC) \\
&& !defined(SQLITE_ZERO_MALLOC) \\
&& !defined(SQLITE_MEMDEBUG) \\
) || defined(SQLITE_SYSTEM_MALLOC)
\"SYSTEM_MALLOC\",
#endif
"
set options(THREADSAFE)
foreach name_defval $boolean_defnnz_options
foreach b $boolean_defnil_options
foreach v $value_options
foreach v $value2_options
set ctime_c "src/ctime.c"
if
puts $cfd $::headWarning;
puts $cfd $::headCode;
foreach o
puts -nonewline $cfd $::tailCode;
close $cfd