From e34646b5dc51d51624af2bc163213e4ab90ee23a Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 27 Oct 2024 07:06:03 +0000 Subject: [PATCH] configure: add --with-icu-lib=LDFLAGS and --enable-icu-collations. Fix auto-reconfigure when flags contain spaces. FossilOrigin-Name: 2a881a2e1b7355c7733c3a41a82290ba6f3983232a9ec378d9a1b62ee4109f54 --- Makefile.in | 1 + auto.def | 81 +++++++++++++++++++++++++++++++++------------------ manifest | 14 ++++----- manifest.uuid | 2 +- 4 files changed, 62 insertions(+), 36 deletions(-) diff --git a/Makefile.in b/Makefile.in index b1a5840854..994ec4bc4e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -107,6 +107,7 @@ LDFLAGS.pthread = @LDFLAGS_PTHREAD@ LDFLAGS.dlopen = @LDFLAGS_DLOPEN@ LDFLAGS.readline = @LDFLAGS_READLINE@ CFLAGS.readline = @CFLAGS_READLINE@ +LDFLAGS.icu = @LDFLAGS_ICU@ ENABLE_SHARED = @ENABLE_SHARED@ HAVE_WASI_SDK = @HAVE_WASI_SDK@ diff --git a/auto.def b/auto.def index c4e587b9db..d5f9d2f550 100644 --- a/auto.def +++ b/auto.def @@ -12,8 +12,6 @@ # # JimTCL: https://jim.tcl.tk # - - use cc cc-db cc-shared cc-lib hwaci-common pkg-config # Are we cross-compiling? @@ -171,6 +169,8 @@ set flags { with-readline-header:PATH => {Full path to readline.h, from which --with-readline-inc will be derived} with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h} + with-icu-lib:LDFLAGS => {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries} + icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-lib=...} amalgamation=1 => {Disable the amalgamation and instead build all files separately} load-extension=1 => {Disable loading of external extensions} math=1 => {Disable math functions} @@ -202,18 +202,22 @@ unset flags set srcdir $::autosetup(srcdir) set top_srcdir [get-define abs_top_srcdir] -msg-result "srcdir = $srcdir" -msg-result "top_srcdir = $top_srcdir" -set PACKAGE_VERSION [readfile $::autosetup(srcdir)/VERSION] -msg-result "VERSION = $PACKAGE_VERSION" - +set PACKAGE_VERSION [readfile $srcdir/VERSION] define PACKAGE_NAME "sqlite" define PACKAGE_URL {https://sqlite.org} define PACKAGE_VERSION $PACKAGE_VERSION define PACKAGE_STRING "[get-define PACKAGE_NAME] $PACKAGE_VERSION" define PACKAGE_BUGREPORT [get-define PACKAGE_URL]/forum -define-append SQLITE_AUTOREMAKE cd $::autosetup(srcdir) && $top_srcdir/configure {*}$::autosetup(argv) +msg-result "srcdir = $srcdir" +msg-result "top_srcdir = $top_srcdir" +msg-result "VERSION = $PACKAGE_VERSION" + +define-append SQLITE_AUTOREMAKE cd '$srcdir' && '$top_srcdir/configure' +#{*}$::autosetup(argv) breaks with --flag='val with spaces', so... +foreach arg $::autosetup(argv) { + define-append SQLITE_AUTOREMAKE '$arg' +} set outOfTreeBuild 0 if {![file exists sqlite3.pc.in]} { @@ -437,6 +441,11 @@ if {[cc-check-includes zlib.h] && [hwaci-check-function-in-lib deflate z]} { define LDFLAGS_ZLIB "" } +# +# Determine proper rpath-handling flags. +# +hwaci-check-rpath + hwaci-define-if-opt-truthy amalgamation USE_AMALGAMATION \ "Use amalgamation for builds?" @@ -934,6 +943,24 @@ if {![get-define HAVE_WASI_SDK] && [hwaci-check-emsdk]} { } unset emccsh +######################################################################## +# ICU +if {"" ne [define LDFLAGS_ICU [join [opt-val with-icu-lib ""]]]} { + # Flags sets seen in the wild for ICU: + # {-licui18n -licuuc -licudata} {-licui18n -licuuc} + add-feature-flag -DSQLITE_ENABLE_ICU + msg-result "Enabling ICU support with libs: [get-define LDFLAGS_ICU]" + if {[opt-bool icu-collations]} { + msg-result "Enabling ICU collations." + add-feature-flag -DSQLITE_ENABLE_ICU_COLLATIONS + } + + # --enable-icu-collations is handled later, along with the other + # --simple-feature-flag options. +} elseif {[opt-bool icu-collations]} { + hwaci-warn "ignoring --enable-icu-collations because --with-icu-lib was not specified" +} + ######################################################################## # Check for log(3) in libm and die with an error if it is not # found. $why should be the feature name which requires that function @@ -964,19 +991,19 @@ foreach {boolFlag featureFlag ifSetEvalThis} { rtree -DSQLITE_ENABLE_RTREE {} session {-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK} {} update-limit -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT {} + memsys5 -DSQLITE_ENABLE_MEMSYS5 {} memsys3 {} { if {[opt-bool memsys5]} { - msg-result "NOT enabling memsys3 because memsys5 is enabled." + hwaci-warn "not enabling memsys3 because memsys5 is enabled." + expr 0 } else { add-feature-flag -DSQLITE_ENABLE_MEMSYS3 } } - memsys5 -DSQLITE_ENABLE_MEMSYS5 {} } { hwaci-if-opt-truthy $boolFlag { add-feature-flag $featureFlag - eval $ifSetEvalThis - if {"all" ne $boolFlag} { + if {0 != [eval $ifSetEvalThis] && "all" ne $boolFlag} { msg-result "Enabling $boolFlag" } } { @@ -1000,6 +1027,20 @@ foreach {boolFlag featureFlag} { } } +######################################################################### +# Show the final feature flag sets: +set oFF [get-define OPT_FEATURE_FLAGS] +if {"" ne $oFF} { + define OPT_FEATURE_FLAGS [lsort -unique $oFF] + msg-result "Library feature flags: [get-define OPT_FEATURE_FLAGS]" +} +set oFF [get-define OPT_SHELL] +if {"" ne $oFF} { + define OPT_SHELL [lsort -unique $oFF] + msg-result "Shell options: [get-define OPT_SHELL]" +} +unset oFF + ######################################################################## # Maybe extend JimTCL a bit. As of this writing (2024-09-27) it only # needs (-DHAVE_REALPATH or -DHAVE__FULLPATH) and -DHAVE_DIRENT_H to @@ -1020,10 +1061,6 @@ if {0 && "" ne [get-define CFLAGS_JIMSH]} { define-append CFLAGS_JIMSH -DHAVE_LONG_LONG; # SQLite relies on long long, so we know it's available }; # JimTCL -######################################################################## -# Determine proper rpath-handling flags -hwaci-check-rpath - ######################################################################## # Generate the output files. # @@ -1046,18 +1083,6 @@ if {0} { } #TODO hwaci-make-from-dot-in ext/wasm/GNUmakefile -set oFF [get-define OPT_FEATURE_FLAGS] -if {"" ne $oFF} { - define OPT_FEATURE_FLAGS [lsort -unique $oFF] - msg-result "Library feature flags: [get-define OPT_FEATURE_FLAGS]" -} -set oFF [get-define OPT_SHELL] -if {"" ne $oFF} { - define OPT_SHELL [lsort -unique $oFF] - msg-result "Shell options: [get-define OPT_SHELL]" -} -unset oFF - if {"" ne $DUMP_DEFINES_JSON} { ######################################################################## # Dump config-defines.json... diff --git a/manifest b/manifest index ecbd5b4d19..53dd1cdd5e 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Makefile.in:\sinclude\sCPPFLAGS\sin\sthe\sCFLAGS,\sas\sthe\slegacy\sMakefile.in\sdid,\sbecause\ssome\sdownstream\sscripts\srely\son\sthat.\sRemove\sa\sduplicated\sTCLLIBDIR\sassignment. -D 2024-10-27T06:03:27.496 +C configure:\sadd\s--with-icu-lib=LDFLAGS\sand\s--enable-icu-collations.\sFix\sauto-reconfigure\swhen\sflags\scontain\sspaces. +D 2024-10-27T07:06:03.774 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md b6e6c1baf38e4339bd3f1e0e5e5bfd0a9a93d133360691b2785c2d4b2f2dcec2 -F Makefile.in b0f2b40be5273a8a369af03d4d9a56c5027cd4fc2ee41feddced218dfb6c1e1b +F Makefile.in c9fb22b54d1b9aafba00cc22306286a479e97e498f426414fcc1861486ed2260 F Makefile.linux-generic 8df0e6ee5e4671f844caf27f88d2be7421e904639f7a0ffdce0e2cd4ea11e8c0 F Makefile.msc d2d927177660945599ba88ea32f1ab5c261a96a8797380b99766e27f3aea7e4f F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159 @@ -13,7 +13,7 @@ F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 -F auto.def dbd0ab35f0c01b421e53e851cbc6117913d60a4eeea2b75af24a1647838242ee +F auto.def 376f5bd1f1d88602ce9d964e69ce4df6ec9bfeafcb7988c0cabe8fc06036b450 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -2237,8 +2237,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P ccb8f16f8a5c500b683800672aa4bc87d2f109e87ebdabf6c54d5b6dc69718f7 -R ea34d3fe32036f9e4036fc2d28aa1616 +P 8e352f4199e048030113e0cc359eaadb6d29bc4b3dd7a0442d7500f7c3847e50 +R f3abdd771eb17cd501d5fa951125d236 U stephan -Z d899eb4b8c2da605c59f9ecc775c852d +Z f4577442737993b89d90f014d56548e1 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c860a994ca..b059654579 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8e352f4199e048030113e0cc359eaadb6d29bc4b3dd7a0442d7500f7c3847e50 +2a881a2e1b7355c7733c3a41a82290ba6f3983232a9ec378d9a1b62ee4109f54