From: stephan Date: Thu, 28 Nov 2024 16:14:19 +0000 (+0000) Subject: Configure script doc updates and cleanups. Skip check for EMSDK when doing an out... X-Git-Tag: major-relase~104 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=187c115a692aad44703d1ebd6bf6d242d4c4ff53;p=thirdparty%2Fsqlite.git Configure script doc updates and cleanups. Skip check for EMSDK when doing an out-of-tree build, as ext/wasm does not support that build mode. FossilOrigin-Name: 9d2f4148db1641e9bf2989c2b1adf5b9dcb2b123526ecacd063bca208b3c36cf --- diff --git a/auto.def b/auto.def index fc86c58bed..9cea6a3dc1 100644 --- a/auto.def +++ b/auto.def @@ -36,14 +36,15 @@ set DUMP_DEFINES_JSON ""; #./config.defines.json # # 1) --debug is used by autosetup itself, so we have to rename it to # --with-debug. We cannot use --enable-debug because that is, for -# autosetup, and alias for --debug=1. Alternately, we can patch +# autosetup, an alias for --debug=1. Alternately, we can patch # autosetup to use --autosetup-debug for its own purposes instead. # # 2) In autosetup, all flags starting with (--enable, --disable) are # forced to be booleans and receive special handling in how they're # resolved. Because of that we have to rename: # -# 2.1) --enable-tempstore[=no] to --with-tempstore[=no]. +# 2.1) --enable-tempstore[=no] to --with-tempstore[=no], noting that +# it has four legal values, not two. # ######################################################################## # A gentle introduction to flags handling in autosetup @@ -65,17 +66,16 @@ set DUMP_DEFINES_JSON ""; #./config.defines.json # # Autosetup does no small amount of specialized handling for flags, # especially booleans. Each bool-type --FLAG implicitly gets -# --enable-FLAG and --disable-FLAG forms, and explicitly adding flags -# with those prefixes will force them to be boolean flags. e.g. we -# define a flag "readline", which will be interpreted in one of two -# ways, depending on how it's invoked and how its default is defined: +# --enable-FLAG and --disable-FLAG forms. e.g. we define a flag +# "readline", which will be interpreted in one of two ways, depending +# on how it's invoked and how its default is defined: # # --enable-readline ==> boolean true # --disable-readline ==> boolean false # -# Trying to pass --readline or --readline=1 or --readline=0 will -# result in an "unrecognized option" error, despite the the [options] -# call listing the flag as "readline". +# Passing --readline or --readline=1 is equivalent to passing +# --enable-readline, and --readline=0 is equivalent to +# --disable-readline. # # The behavior described above can lead lead to some confusion when # writing help text. For example: @@ -83,7 +83,7 @@ set DUMP_DEFINES_JSON ""; #./config.defines.json # options { json=1 {Disable JSON functions} } # # The reason the help text says "disable" is because a boolean option -# defaulting to true is, in the --help text, rendered as: +# which defaults to true is, in the --help text, rendered as: # # --disable-json Disable JSON functions # @@ -93,22 +93,7 @@ set DUMP_DEFINES_JSON ""; #./config.defines.json # # Non-boolean flags, in contrast, use the names specifically given to # them in the [options] invocation. e.g. "with-tcl" is the --with-tcl -# flag. Autosetup may, however, choose to automatically alter the help -# text, as demonstrated here: -# -# options { -# readline=1 => {Disable readline support} -# with-readline-lib: => {Readline library} -# with-readline-inc: => {Readline include paths} -# } -# -# $ ./configure --help | grep readline -# --disable-readline disable readline support -# --with-readline-lib specify readline library -# --with-readline-inc specify readline include paths -# -# Note that it prefixed and lower-case the help message. Whether -# that's a feature or a bug can be debated. +# flag. # # Fetching values for flags: # @@ -120,12 +105,15 @@ set DUMP_DEFINES_JSON ""; #./config.defines.json # # Non-boolean (i.e. string) flags: # - [opt-val FLAG ?default?] +# - [opt-str ...] - see the docs in ./autosetup/autosetup # ######################################################################## set flags { # When writing {help text blocks}, be aware that autosetup formats - # them differently (left-aligned, under the --flag, if the block - # starts with a newline. + # them differently (left-aligned, directly under the --flag) if the + # block starts with a newline. It does NOT expand vars and commands, + # but we use a [subst] call below which will replace (only) var + # refs. # shared=1 => {Disable build of shared libary} @@ -153,7 +141,9 @@ set flags { # 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.} + that, from which we can derive a directory containing tclConfig.sh. + A dir name of "prefix" is equivalent to the directory specified by + 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 @@ -315,18 +305,17 @@ proj-file-extensions if {".exe" eq [get-define TARGET_EXEEXT]} { define SQLITE_OS_UNIX 0 define SQLITE_OS_WIN 1 - # todo? add -DSQLITE_OS_WIN=1 to CFLAGS or CFLAGS_sqlite3_os? } else { define SQLITE_OS_UNIX 1 define SQLITE_OS_WIN 0 - # todo? add -DSQLITE_OS_UNIX=1 to CFLAGS or CFLAGS_sqlite3_os } ######### # Programs needed -cc-check-tools ld ar ; # must come before sqlite-check-wasi-sdk +cc-check-tools ld ar ; # must come before [sqlite-check-wasi-sdk] if {"" eq [proj-bin-define install]} { proj-warn "Cannot find install binary, so 'make install' will not work." + define BIN_INSTALL false } ######################################################################## @@ -341,21 +330,18 @@ define BUILD_CFLAGS [proj-get-env BUILD_CFLAGS {-g}] proj-if-opt-truthy dev { # --enable-dev needs to come early so that the downstream tests - # which check for these flags will show the user their updated - # state. + # which check for the following flags use their updated state. proj-opt-set all 1 proj-opt-set debug 1 proj-opt-set amalgamation 0 define CFLAGS [get-env CFLAGS {-O0 -g}] } -define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools] - ######################################################################## # Handle --with-wasi-sdk=DIR # -# This must be run early on because it may change the toolchain and -# disable a number of config options. +# This must be run relatively early on because it may change the +# toolchain and disable a number of config options. proc sqlite-check-wasi-sdk {} { set wasiSdkDir [opt-val with-wasi-sdk] ; # ??? [lindex [opt-val with-wasi-sdk] end] define HAVE_WASI_SDK 0 @@ -374,6 +360,7 @@ proc sqlite-check-wasi-sdk {} { msg-result "Using wasi-sdk clang. Disabling CLI shell modifying config flags:" # Boolean (--enable-/--disable-) flags which must be switched off: foreach opt { + dynlink-tools editline gcov icu-collations @@ -425,6 +412,11 @@ proc sqlite-check-wasi-sdk {} { }; # sqlite-check-wasi-sdk sqlite-check-wasi-sdk +######################################################################## +# --dynlink-tools tells the build to dynamically link certain binaries +# to libsqlite3.so instead of embedding a copy of the amalgamation. +define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools] + # # Enable large file support (if special flags are necessary) define HAVE_LFS 0 @@ -475,7 +467,11 @@ apply {{} { if {[proj-opt-was-provided soname]} { set soname [join [opt-val soname] ""] } else { - set soname none; # enabling soname breaks linking for the --dynlink-tools feature + # Enabling soname breaks linking for the --dynlink-tools feature, + # and this project has no direct use for soname, so default to + # none. Package maintainers, on the other hand, like to have an + # soname. + set soname none } switch -exact -- $soname { none - "" { return 0 } @@ -498,6 +494,7 @@ apply {{} { # --soname was explicitly requested but not available, so fail fatally proj-fatal "This environment does not support SONAME." } else { + # --soname was not explicitly requested but not available, so just warn msg-result "This environment does not support SONAME." } }} @@ -560,6 +557,7 @@ proj-if-opt-truthy debug { # failure to find TCL is not fatal but a loud warning will be emitted. # proc sqlite-check-tcl {} { + rename sqlite-check-tcl "" define TCLSH_CMD false ; # Significant is that it exits with non-0 define HAVE_TCL 0 ; # Will be enabled via --tcl or a successful search define TCLLIBDIR "" ; # Installation dir for TCL extension lib @@ -568,8 +566,8 @@ proc sqlite-check-tcl {} { if {![opt-bool tcl]} { proj-indented-notice { NOTE: TCL is disabled via --disable-tcl. This means that none - of the TCL-based components, including tests and sqlite3_analyzer, - will be built. + of the TCL-based components will be built, including tests + and sqlite3_analyzer. } return } @@ -687,8 +685,8 @@ proc sqlite-check-tcl {} { # in main.mk (search it for T.tcl.env.sh) so that # static/hand-written makefiles which import main.mk do not have # to define that before importing main.mk. Even so, we export - # TCLLIBDIR from here, which will cause the makefile to use this - # one rather than to re-calculate it at make-time. + # 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 ""] if {"" eq $tcllibdir} { # Attempt to extract TCLLIBDIR from TCL's $auto_path @@ -743,7 +741,7 @@ sqlite-check-tcl # sqlite-determine-codegen-tcl checks which TCL to use as a code # generator. By default, prefer jimsh simply because we have it # in-tree (it's part of autosetup) unless --with-tclsh=X is used, in -# which case prefix X. +# which case prefer X. # # Returns the human-readable name of the TCL it selects. Fails fatally # if it cannot detect a TCL appropriate for code generation. @@ -759,9 +757,16 @@ sqlite-check-tcl set useJimForCodeGen 0 ; # Set to 1 when using jimsh for code generation. # May affect later decisions. proc sqlite-determine-codegen-tcl {} { + rename sqlite-determine-codegen-tcl "" msg-result "Checking for TCL to use for code generation... " define CFLAGS_JIMSH [proj-get-env CFLAGS_JIMSH {-O1}] set cgtcl [opt-val with-tclsh jimsh] + if {"jimsh" ne $cgtcl} { + # When --with-tclsh=X is used, use that for all TCL purposes, + # including in-tree code generation, per developer request. + define BTCLSH "\$(TCLSH_CMD)" + return $cgtcl + } set flagsToRestore {CC CFLAGS AS_CFLAGS CPPFLAGS AS_CPPFLAGS LDFLAGS LINKFLAGS LIBS CROSS} define-push $flagsToRestore { # We have to swap CC to CC_FOR_BUILD for purposes of the various @@ -775,56 +780,50 @@ proc sqlite-determine-codegen-tcl {} { # block. foreach flag $flagsToRestore {define $flag ""} define CC [get-define CC_FOR_BUILD] - if {"jimsh" ne $cgtcl} { - # When --with-tclsh=X is used, use that for all TCL purposes, - # including in-tree code generation, per developer request. + # These headers are technically optional for JimTCL but necessary if + # we want to use it for code generation: + set sysh [cc-check-includes dirent.h sys/time.h] + # jimsh0.c hard-codes #define's for HAVE_DIRENT_H and + # HAVE_SYS_TIME_H on the platforms it supports, so we do not + # need to add -D... flags for those. We check for them here only + # so that we can avoid the situation that we later, at + # make-time, try to compile jimsh but it then fails due to + # missing headers (i.e. fail earlier rather than later). + if {$sysh && [cc-check-functions realpath]} { + define-append CFLAGS_JIMSH -DHAVE_REALPATH + define BTCLSH "\$(JIMSH)" + set ::useJimForCodeGen 1 + } elseif {$sysh && [cc-check-functions _fullpath]} { + # _fullpath() is a Windows API. It's not entirely clear + # whether we need to add {-DHAVE_SYS_TIME_H -DHAVE_DIRENT_H} + # to CFLAGS_JIMSH in this case. On MinGW32 we definitely do + # not want to because it already hard-codes them. On _MSC_VER + # builds it does not. + define-append CFLAGS_JIMSH -DHAVE__FULLPATH + define BTCLSH "\$(JIMSH)" + set ::useJimForCodeGen 1 + } elseif {[file-isexec [get-define TCLSH_CMD]]} { + set cgtcl [get-define TCLSH_CMD] define BTCLSH "\$(TCLSH_CMD)" } else { - # These headers are technically optional for JimTCL but necessary if - # we want to use it for code generation: - set sysh [cc-check-includes dirent.h sys/time.h] - # jimsh0.c hard-codes #define's for HAVE_DIRENT_H and - # HAVE_SYS_TIME_H on the platforms it supports, so we do not - # need to add -D... flags for those. We check for them here only - # so that we can avoid the situation that we later, at - # make-time, try to compile jimsh but it then fails due to - # missing headers (i.e. fail earlier rather than later). - if {$sysh && [cc-check-functions realpath]} { - define-append CFLAGS_JIMSH -DHAVE_REALPATH - define BTCLSH "\$(JIMSH)" - set ::useJimForCodeGen 1 - } elseif {$sysh && [cc-check-functions _fullpath]} { - # _fullpath() is a Windows API. It's not entirely clear - # whether we need to add {-DHAVE_SYS_TIME_H -DHAVE_DIRENT_H} - # to CFLAGS_JIMSH in this case. On MinGW32 we definitely do - # not want to because it already hard-codes them. On _MSC_VER - # builds it does not. - define-append CFLAGS_JIMSH -DHAVE__FULLPATH - define BTCLSH "\$(JIMSH)" - set ::useJimForCodeGen 1 - } elseif {[file-isexec [get-define TCLSH_CMD]]} { - set cgtcl [get-define TCLSH_CMD] - define BTCLSH "\$(TCLSH_CMD)" - } else { - # One last-ditch effort to find TCLSH_CMD: use info from - # tclConfig.sh to try to find a tclsh - if {"" eq [get-define TCLSH_CMD]} { - set tpre [get-define TCL_EXEC_PREFIX] - if {"" ne $tpre} { - set tv [get-define TCL_VERSION] - if {[file-isexec "${tpre}/bin/tclsh${tv}"]} { - define TCLSH_CMD "${tpre}/bin/tclsh${tv}" - } elseif {[file-isexec "${tpre}/bin/tclsh"]} { - define TCLSH_CMD "${tpre}/bin/tclsh" - } + # One last-ditch effort to find TCLSH_CMD: use info from + # tclConfig.sh to try to find a tclsh + if {"" eq [get-define TCLSH_CMD]} { + set tpre [get-define TCL_EXEC_PREFIX] + if {"" ne $tpre} { + set tv [get-define TCL_VERSION] + if {[file-isexec "${tpre}/bin/tclsh${tv}"]} { + define TCLSH_CMD "${tpre}/bin/tclsh${tv}" + } elseif {[file-isexec "${tpre}/bin/tclsh"]} { + define TCLSH_CMD "${tpre}/bin/tclsh" } } - set cgtcl [get-define TCLSH_CMD] - if {![file-isexec $cgtcl]} { - proj-fatal "Cannot find a tclsh to use for code generation." - } - define BTCLSH "\$(TCLSH_CMD)" } + set cgtcl [get-define TCLSH_CMD] + if {![file-isexec $cgtcl]} { + proj-fatal "Cannot find a tclsh to use for code generation." + } + define BTCLSH "\$(TCLSH_CMD)" } }; # CC swap-out return $cgtcl @@ -845,6 +844,8 @@ proj-if-opt-truthy threadsafe { } define LDFLAGS_PTHREAD [get-define lib_pthread_create] undefine lib_pthread_create + # Recall that LDFLAGS_PTHREAD might be empty even if pthreads if + # found because it's in -lc on some platforms. } { msg-result no sqlite-add-feature-flag -DSQLITE_THREADSAFE=0 @@ -858,7 +859,7 @@ apply {{} { set ts [opt-val with-tempstore no] set tsn 1 msg-checking "Use an in-RAM database for temporary tables? " - switch -- $ts { + switch -exact -- $ts { never { set tsn 0 } no { set tsn 1 } yes { set tsn 2 } @@ -908,6 +909,7 @@ apply {{} { # corresponding --FEATURE flag was explicitly given, fail fatally, # else fail silently. proc sqlite-check-line-editing {} { + rename sqlite-check-line-editing "" msg-result "Checking for line-editing capability..." define HAVE_READLINE 0 define HAVE_LINENOISE 0 @@ -1161,22 +1163,13 @@ proj-if-opt-truthy math { # are cumulative. If neither are provided, icu-collations is not # honored and a warning is emitted if it is provided. # -# Design note: though we can automatically enable ICU if the +# Design note: though we could automatically enable ICU if the # icu-config binary or (pkg-config icu-io) are found, we specifically # do not. ICU is always an opt-in feature. -# -# Maintenance reminder: check-in 09caa94c9e84 added pkg-config support -# to this but the result fails to link on both Linux and OpenBSD -# (other systems were untested) because the pkg-config results are -# missing a required library. proc sqlite-check-icu {} { + rename sqlite-check-icu "" define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]] define CFLAGS_ICU [join [opt-val with-icu-cflags ""]] - # Flags sets seen in the wild for ICU: - # - -licui18n -licuuc -licudata - # - -licui18n -licuuc - # - /usr/local/bin/icu-config --ldflags - # if {[proj-opt-was-provided with-icu-config]} { set icuConfigBin [opt-val with-icu-config] set tryIcuConfigBin 1; # set to 0 if we end up using pkg-config @@ -1237,8 +1230,18 @@ sqlite-check-icu ######################################################################## # Check for the Emscripten SDK for building the web-based wasm -# components. +# components. The core lib and tools do not require this but ext/wasm +# does. apply {{} { + if {$::autosetup(srcdir) ne $::autosetup(builddir)} { + # The EMSDK pieces require writing to the original source tree + # even when doing an out-of-tree build. The ext/wasm pieces do not + # support an out-of-tree build so we catch that case and treat it + # as if EMSDK were not found. + msg-result "Out-of tree build: not checking for EMSDK." + define EMCC_WRAPPER "" + return + } set emccsh $::srcdir/tool/emcc.sh if {![get-define HAVE_WASI_SDK] && [proj-check-emsdk]} { define EMCC_WRAPPER $emccsh diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 7da0b0fa35..a469c898de 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -138,7 +138,12 @@ proc proj-indented-notice {args} { } set lines [split [join $args] \n] foreach line $lines { - $outFunc " [string trimleft $line]" + set line [string trimleft $line] + if {"" eq $line} { + $outFunc $line + } else { + $outFunc " $line" + } } if {"" ne $fErr} { show-notices diff --git a/manifest b/manifest index b7f9c03141..bb43461239 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C ext/icu/README.txt:\sclean\sup\sEOL\swhitespace\sand\sadd\sa\smention\sof\sthe\s--with-icu-...\sconfigure\sflags\savailable\sas\sof\sversion\s3.48. -D 2024-11-28T15:52:21.879 +C Configure\sscript\sdoc\supdates\sand\scleanups.\sSkip\scheck\sfor\sEMSDK\swhen\sdoing\san\sout-of-tree\sbuild,\sas\sext/wasm\sdoes\snot\ssupport\sthat\sbuild\smode. +D 2024-11-28T16:14:19.067 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -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 961d2cf22b65d31f9eb97470b50cbbdca34b999cf86f438811c1ec214b296b8b +F auto.def a82198f9ab1db4b54a5e134196bb0256d414789f747bbed6bacb67805c4bc0db F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -49,7 +49,7 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f F autosetup/jimsh0.c d40e381ea4526a067590e7b91bd4b2efa6d4980d286f908054c647b3df4aee14 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 22556a325c964aa5377d4d881722385f41fcd7c1b60102ba8965f7814c83e9ce +F autosetup/proj.tcl 2e817159b997077cb79bd871f6255276b787558f386dfc0830b0f825f6a53767 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad @@ -2201,8 +2201,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P eb5ac9e5b9a4f9c85a2203107697da14c07c1667037dff672f9d786cea964a37 -R 78a02244626590a5fbc0925d20e4f240 +P 4976ac717bec2f2c89d94ac1d9b96afd1da573ba34e3c78637c3937287635e72 +R dfe7e573ed6abcbcf47ed2c31d6d6772 U stephan -Z fdab33deaf1f469df2a1f2ef0d0eef73 +Z 69e72e81037eeb2ecac489de03503f03 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index cd1048f863..a75e9a5e27 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4976ac717bec2f2c89d94ac1d9b96afd1da573ba34e3c78637c3937287635e72 +9d2f4148db1641e9bf2989c2b1adf5b9dcb2b123526ecacd063bca208b3c36cf