sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
sqlite / auto.def
| 1 | #!/do/not/tclsh |
| 2 | # ^^^ help out editors which guess this file's content type. |
| 3 | # |
| 4 | # This is the main autosetup-compatible configure script for the |
| 5 | # SQLite project. |
| 6 | # |
| 7 | # This script and all of its dependencies must be kept compatible with |
| 8 | # JimTCL, a copy of which is included in this source tree as |
| 9 | # ./autosetup/jimsh0.c. The number of incompatibilities between |
| 10 | # canonical TCL and JimTCL is very low and alternative formulations of |
| 11 | # incompatible constructs have, so far, been easy to find. |
| 12 | # |
| 13 | # JimTCL: https://jim.tcl.tk |
| 14 | # |
| 15 | # Code-diver notes: APIs names starting with "sqlite-" are specific to |
| 16 | # this project and can be found in autosetup/sqlite-config.tcl. Names |
| 17 | # starting with "proj-" are project-agnostic and found in |
| 18 | # autosetup/proj.tcl. |
| 19 | # |
| 20 | use sqlite-config |
| 21 | sqlite-configure canonical { |
| 22 | proj-if-opt-truthy dev { |
| 23 | # --enable-dev needs to come early so that the downstream tests |
| 24 | # which check for the following flags use their updated state. |
| 25 | proj-opt-set all 1 |
| 26 | proj-opt-set debug 1 |
| 27 | proj-opt-set amalgamation 0 |
| 28 | define CFLAGS [get-env CFLAGS {-O0 -g}] |
| 29 | # -------------^^^^^^^ intentionally using [get-env] instead of |
| 30 | # [proj-get-env] here because [sqlite-setup-default-cflags] uses |
| 31 | # [proj-get-env] and we want this to supercede that. |
| 32 | sqlite-munge-cflags; # straighten out -DSQLITE_ENABLE/OMIT flags |
| 33 | } |
| 34 | sqlite-handle-debug ;# must come after --dev flag check |
| 35 | sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk] |
| 36 | sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment |
| 37 | sqlite-check-common-system-deps |
| 38 | |
| 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-strict |
| 56 | } |
| 57 | define CFLAGS_ASAN_FSANITIZE [proj-check-fsanitize [split $fsan ", "]] |
| 58 | |
| 59 | sqlite-handle-tcl |
| 60 | sqlite-handle-emsdk |
| 61 | |
| 62 | proj-if-opt-truthy static-shells { |
| 63 | proj-opt-set static-tclsqlite3 1 |
| 64 | proj-opt-set static-cli-shell 1 |
| 65 | } |
| 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 | # vec1 (ext/vec1) is only built on request ("make vec1.so"). If the |
| 70 | # compiler supports AVX2 it is built as a multi-arch extension that |
| 71 | # selects AVX2 or scalar code at runtime. Use [cctest] rather than |
| 72 | # [cc-check-flags] so the flags are not appended to later tests. |
| 73 | msg-checking "Checking for AVX2 flags for vec1... " |
| 74 | if {[cctest -cflags {-mavx2 -mfma}]} { |
| 75 | msg-result "-mavx2 -mfma" |
| 76 | define CFLAGS_VEC1_AVX2 {-mavx2 -mfma} |
| 77 | } else { |
| 78 | msg-result "no" |
| 79 | define CFLAGS_VEC1_AVX2 "" |
| 80 | } |
| 81 | |
| 82 | }; # sqlite-configure |