diff options
Diffstat (limited to 'autosetup')
-rw-r--r-- | autosetup/proj.tcl | 67 | ||||
-rw-r--r-- | autosetup/sqlite-config.tcl | 59 |
2 files changed, 70 insertions, 56 deletions
diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 1a90b479a..5cebc0472 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -885,7 +885,9 @@ proc proj-looks-like-windows {{key host}} { # proc proj-looks-like-mac {{key host}} { switch -glob -- [get-define $key] { - *apple* { + *-*-darwin* { + # https://sqlite.org/forum/forumpost/7b218c3c9f207646 + # There's at least one Linux out there which matches *apple*. return 1 } default { @@ -927,17 +929,13 @@ proc proj-exe-extension {} { # proc proj-dll-extension {} { set inner {{key} { - switch -glob -- [get-define $key] { - *apple* { - return ".dylib" - } - *-*-ming* - *-*-cygwin - *-*-msys { - return ".dll" - } - default { - return ".so" - } + if {[proj-looks-like-mac $key]} { + return ".dylib" } + if {[proj-looks-like-windows $key]} { + return ".dll" + } + return ".so" }} define BUILD_DLLEXT [apply $inner build] define TARGET_DLLEXT [apply $inner host] @@ -2189,11 +2187,7 @@ proc proj-parse-flags {argvName tgtArrayName prototype} { upvar $argvName argv upvar $tgtArrayName outFlags array set flags {}; # staging area - array set scripts {}; # map of -flag=>script - array set consuming {}; # map of -flag=>1 for arg-consuming flags - array set multi {}; # map of -flag=>1 for multi-time flags - array set seen {}; # map of -flag=>number of times seen - array set call {}; # map of -flag=>1 for -call entries + array set blob {}; # holds markers for various per-key state and options set incrSkip 1; # 1 if we stop at the first non-flag, else 0 # Parse $prototype for flag definitions... set n [llength $prototype] @@ -2201,8 +2195,8 @@ proc proj-parse-flags {argvName tgtArrayName prototype} { #puts "**** checkProtoFlag #$i of $n k=$k fv=$fv" switch -exact -- $fv { -literal { - proj-assert {![info exists consuming($k)]} - set scripts($k) [list expr [lindex $prototype [incr i]]] + proj-assert {![info exists blob(${k}.consumes)]} + set blob(${k}.script) [list expr [lindex $prototype [incr i]]] } -apply { set fv [lindex $prototype [incr i]] @@ -2210,16 +2204,16 @@ proc proj-parse-flags {argvName tgtArrayName prototype} { # Treat this as a lambda literal set fv [list $fv] } - lappend call($k) "apply $fv" + lappend blob(${k}.call) "apply $fv" } -call { # arg is either a proc name or {apply $aLambda} set fv [lindex $prototype [incr i]] - lappend call($k) $fv + lappend blob(${k}.call) $fv } default { - proj-assert {![info exists consuming($k)]} - set scripts($k) $fv + proj-assert {![info exists blob(${k}.consumes)]} + set blob(${k}.script) $fv } } if {$i >= $n} { @@ -2244,7 +2238,7 @@ proc proj-parse-flags {argvName tgtArrayName prototype} { if {[string match {*\*} $k]} { # Re-map -foo* to -foo and flag -foo as a repeatable flag set k [string map {* ""} $k] - incr multi($k) + incr blob(${k}.multi) } if {[info exists flags($k)]} { @@ -2258,7 +2252,7 @@ proc proj-parse-flags {argvName tgtArrayName prototype} { if {$i >= $n} { proj-error -up "[proj-scope]: Missing argument for $k => flag" } - incr consuming($k) + incr blob(${k}.consumes) set vi [lindex $prototype $i] if {$vi in {-apply -call}} { proj-error -up "[proj-scope]: Missing default value for $k flag" @@ -2281,10 +2275,9 @@ proc proj-parse-flags {argvName tgtArrayName prototype} { set flags($k) $vi } #puts "-- flags"; parray flags - #puts "-- scripts"; parray scripts - #puts "-- calls"; parray call + #puts "-- blob"; parray blob set rc 0 - set rv {} + set rv {}; # staging area for the target argv value set skipMode 0 set n [llength $argv] # Now look for those flags in $argv... @@ -2295,36 +2288,36 @@ proc proj-parse-flags {argvName tgtArrayName prototype} { lappend rv $arg } elseif {"--" eq $arg} { # "--" is the conventional way to end processing of args - if {[incr seen(--)] > 1} { + if {[incr blob(--)] > 1} { # Elide only the first one lappend rv $arg } incr skipMode $incrSkip } elseif {[info exists flags($arg)]} { # A known flag... - set isMulti [info exists multi($arg)] - incr seen($arg) - if {1 < $seen($arg) && !$isMulti} { + set isMulti [info exists blob(${arg}.multi)] + incr blob(${arg}.seen) + if {1 < $blob(${arg}.seen) && !$isMulti} { proj-error -up [proj-scope] "$arg flag was used multiple times" } set vMode 0; # 0=as-is, 1=eval, 2=call - set isConsuming [info exists consuming($arg)] + set isConsuming [info exists blob(${arg}.consumes)] if {$isConsuming} { incr i if {$i >= $n} { proj-error -up [proj-scope] "is missing argument for $arg flag" } set vv [lindex $argv $i] - } elseif {[info exists scripts($arg)]} { + } elseif {[info exists blob(${arg}.script)]} { set vMode 1 - set vv $scripts($arg) + set vv $blob(${arg}.script) } else { set vv $flags($arg) } - if {[info exists call($arg)]} { + if {[info exists blob(${arg}.call)]} { set vMode 2 - set vv [concat {*}$call($arg) $arg $vv] + set vv [concat {*}$blob(${arg}.call) $arg $vv] } elseif {$isConsuming} { proj-assert {!$vMode} # fall through @@ -2351,7 +2344,7 @@ proc proj-parse-flags {argvName tgtArrayName prototype} { } } if {$isConsuming && $isMulti} { - if {1 == $seen($arg)} { + if {1 == $blob(${arg}.seen)} { # On the first hit, overwrite the default with a new list. set flags($arg) [list $vv] } else { diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 85fe41438..4dd065095 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -217,6 +217,11 @@ proc sqlite-configure {buildMode configScript} { => {This legacy flag has no effect on the library but may influence the generated sqlite_cfg.h by adding #define HAVE_LFS} } + {canonical} { + column-metadata => {Enable the column metadata APIs} + # ^^^ Affects how sqlite3.c is generated, so is not available in + # the autoconf build. + } } # Options for TCL support @@ -227,8 +232,6 @@ proc sqlite-configure {buildMode configScript} { This tree requires TCL for code generation but can use the in-tree copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the test code require a canonical tclsh.} - } - {canonical} { with-tcl:DIR => {Directory containing tclConfig.sh or a directory one level up from that, from which we can derive a directory containing tclConfig.sh. @@ -236,11 +239,10 @@ proc sqlite-configure {buildMode configScript} { the --prefix flag.} with-tclsh:PATH => {Full pathname of tclsh to use. It is used for (A) trying to find - tclConfig.sh and (B) all TCL-based code generation. Warning: if - its containing dir has multiple tclsh versions, it may select the + tclConfig.sh and (B) all TCL-based code generation. Use --with-tcl + unless you have a specific need for this flag. Warning: if its + containing dir has multiple tclsh versions, it may select the wrong tclConfig.sh!} - } - {canonical} { static-tclsqlite3=0 => {Statically-link tclsqlite3. This only works if TCL support is enabled and all requisite libraries are available in @@ -334,8 +336,8 @@ proc sqlite-configure {buildMode configScript} { => {Link the sqlite3 shell app against the DLL instead of embedding sqlite3.c} } {canonical autoconf} { - # A potential TODO without a current use case: - #rpath=1 => {Disable use of the rpath linker flag} + rpath=1 => {Disable use of the rpath linker flag} + # soname: https://sqlite.org/src/forumpost/5a3b44f510df8ded soname:=legacy => {SONAME for libsqlite3.so. "none", or not using this flag, sets no @@ -772,7 +774,8 @@ proc sqlite-handle-common-feature-flags {} { sqlite-add-feature-flag -DSQLITE_ENABLE_MEMSYS3 } } - scanstatus -DSQLITE_ENABLE_STMT_SCANSTATUS {} + scanstatus -DSQLITE_ENABLE_STMT_SCANSTATUS {} + column-metadata -DSQLITE_ENABLE_COLUMN_METADATA {} }] { if {$boolFlag ni $::autosetup(options)} { # Skip flags which are in the canonical build but not @@ -1969,13 +1972,14 @@ proc sqlite-check-tcl {} { # TCLLIBDIR from here, which will cause the canonical makefile to # use this one rather than to re-calculate it at make-time. set tcllibdir [get-env TCLLIBDIR ""] + set sq3Ver [get-define PACKAGE_VERSION] if {"" eq $tcllibdir} { # Attempt to extract TCLLIBDIR from TCL's $auto_path if {"" ne $with_tclsh && [catch {exec echo "puts stdout \$auto_path" | "$with_tclsh"} result] == 0} { foreach i $result { if {[file isdir $i]} { - set tcllibdir $i/sqlite3 + set tcllibdir $i/sqlite${sq3Ver} break } } @@ -2111,15 +2115,31 @@ proc sqlite-determine-codegen-tcl {} { # sqlite-determine-codegen-tcl. proc sqlite-handle-tcl {} { sqlite-check-tcl - if {"canonical" eq $::sqliteConfig(build-mode)} { - msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]" + if {"canonical" ne $::sqliteConfig(build-mode)} return + msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]" + + # Determine the base name of the Tcl extension's DLL + # + if {[get-define HAVE_TCL]} { + if {[string match *-cygwin [get-define host]]} { + set libname cyg + } else { + set libname lib + } + if {[get-define TCL_MAJOR_VERSION] > 8} { + append libname tcl9 + } + append libname sqlite + } else { + set libname "" } + define TCL_EXT_DLL_BASENAME $libname + # The extension is added in the makefile } ######################################################################## # Handle the --enable/disable-rpath flag. proc sqlite-handle-rpath {} { - proj-check-rpath # autosetup/cc-shared.tcl sets the rpath flag definition in # [get-define SH_LINKRPATH], but it does so on a per-platform basis # rather than as a compiler check. Though we should do a proper @@ -2128,12 +2148,13 @@ proc sqlite-handle-rpath {} { # for which sqlite-env-is-unix-on-windows returns a non-empty # string. -# if {[proj-opt-truthy rpath]} { -# proj-check-rpath -# } else { -# msg-result "Disabling use of rpath." -# define LDFLAGS_RPATH "" -# } + # https://sqlite.org/forum/forumpost/13cac3b56516f849 + if {[proj-opt-truthy rpath]} { + proj-check-rpath + } else { + msg-result "Disabling use of rpath." + define LDFLAGS_RPATH "" + } } ######################################################################## |