AryaWu/sqlite
0
1#!/do/not/tclsh2# ^^^ help out editors which guess this file's content type.3#4# This is the main autosetup-compatible configure script for the5# SQLite project.6#7# This script and all of its dependencies must be kept compatible with8# JimTCL, a copy of which is included in this source tree as9# ./autosetup/jimsh0.c. The number of incompatibilities between10# canonical TCL and JimTCL is very low and alternative formulations of11# incompatible constructs have, so far, been easy to find.12#13# JimTCL: https://jim.tcl.tk14#15# Code-diver notes: APIs names starting with "sqlite-" are specific to16# this project and can be found in autosetup/sqlite-config.tcl. Names17# starting with "proj-" are project-agnostic and found in18# autosetup/proj.tcl.19#20use sqlite-config21sqlite-configure canonical {22 proj-if-opt-truthy dev {23 # --enable-dev needs to come early so that the downstream tests24 # which check for the following flags use their updated state.25 proj-opt-set all 126 proj-opt-set debug 127 proj-opt-set amalgamation 028 define CFLAGS [get-env CFLAGS {-O0 -g}]29 # -------------^^^^^^^ intentionally using [get-env] instead of30 # [proj-get-env] here because [sqlite-setup-default-cflags] uses31 # [proj-get-env] and we want this to supercede that.32 sqlite-munge-cflags; # straighten out -DSQLITE_ENABLE/OMIT flags33 }34 sqlite-handle-debug ;# must come after --dev flag check35 sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk]36 sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment37 sqlite-check-common-system-deps38 39 proj-define-for-opt amalgamation USE_AMALGAMATION "Use amalgamation for builds?"40 41 proj-define-for-opt gcov USE_GCOV "Use gcov?"42 43 proj-define-for-opt test-status TSTRNNR_OPTS \44 "test-runner flags:" {--status} {}45 46 proj-define-for-opt linemacros AMALGAMATION_LINE_MACROS \47 "Use #line macros in the amalgamation:"48 49 define AMALGAMATION_EXTRA_SRC \50 [join [opt-val amalgamation-extra-src ""] " "]51 52 define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools]53 54 if {[set fsan [join [opt-val asan-fsanitize] ","]] in {auto ""}} {55 set fsan address,bounds-strict56 }57 define CFLAGS_ASAN_FSANITIZE [proj-check-fsanitize [split $fsan ", "]]58 59 sqlite-handle-tcl60 sqlite-handle-emsdk61 62 proj-if-opt-truthy static-shells {63 proj-opt-set static-tclsqlite3 164 proj-opt-set static-cli-shell 165 }66 proj-define-for-opt static-tclsqlite3 STATIC_TCLSQLITE3 "Statically link tclsqlite3?"67 proj-define-for-opt static-cli-shell STATIC_CLI_SHELL "Statically link CLI shell?"68 69}; # sqlite-configure70 