diff --git a/auto.def b/auto.def index 2a3aa4be4d..d4ee5fee6a 100644 --- a/auto.def +++ b/auto.def @@ -70,6 +70,7 @@ options { with-tempstore:=no => {Use an in-ram database for temporary tables: never,no,yes,always} editline=0 => {BSD editline support} readline=0 => {readline support} + largefile=1 => {Disable large file support} with-readline-lib => {readline library} with-readline-inc => {readline include paths} with-linenoise:DIR => {} @@ -194,41 +195,27 @@ if {"" eq [hwaci-bin-define install]} { } ######### -# Enable large file support (if special flags are necessary) -cc-check-lfs - -######### -# Check for needed/wanted data types -cc-check-types int8_t int16_t int32_t int64_t intptr_t \ - uint8_t uint16_t uint32_t uint64_t uintptr_t - -######### -# Figure out whether or not we have these functions -cc-check-functions fdatasync gmtime_r isnan localtime_r localtime_s \ - malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64 - -######### -# Check for needed/wanted headers -cc-check-includes sys/types.h stdlib.h stdint.h inttypes.h malloc.h -if {[cc-check-includes zlib.h] && [cc-check-function-in-lib deflate z]} { - define HAVE_ZLIB 1 - define LDFLAGS_ZLIB -lz -} else { - define HAVE_ZLIB 0 - define LDFLAGS_ZLIB "" -} - -msg-checking "Debug build? " -hwaci-if-opt-truthy with-debug { - msg-result yes -} { - msg-result "no. Use --with-debug to enable." -} +# Locate a compiler for the build machine. This compiler should +# generate command-line programs that run on the build machine. +# +# XXX if test x"$cross_compiling" = xno; then +# XXX BUILD_CC=$CC +# XXX BUILD_CFLAGS=$CFLAGS +# XXX else +# XXX if test "${BUILD_CC+set}" != set; then +# XXX AC_CHECK_PROGS BUILD_CC gcc cc cl +# XXX fi +# XXX if test "${BUILD_CFLAGS+set}" != set; then +# XXX BUILD_CFLAGS="-g" +# XXX fi +# XXX fi +# XXX AC_SUBST BUILD_CC ########## # Handle --with-wasi-sdk=DIR # -# This must be early because it changes the toolchain. +# This must be early because it may change the toolchain and several +# config options. # # It's unclear whether we can actually get away with making these # changes to the autosetup environment. @@ -243,7 +230,7 @@ if {1} { if {![file exists $wasiSdkDir/bin/clang]} { user-error "--with-wasi-sdk=${wasiSdkDir} directory does not contain bin/clang" } - msg-result "using wasi-sdk clang, disabling: tcl, CLI shell, DLL" + msg-result "using wasi-sdk clang, disabling: tcl, CLI shell, DLL, threading" define HAVE_WASI_SDK 1 define WASI_SDK_DIR $wasiSdkDir hwaci-opt-set tcl 0 @@ -271,13 +258,40 @@ if {1} { # we disable the DLL build... # set enable_shared no } -# unset wasiSdkDir + unset wasiSdkDir }; # --wasi-sdk-dir ######### -# By default, we use the amalgamation (this may be changed below...) -# -# XXX USE_AMALGAMATION=1 +# Enable large file support (if special flags are necessary) +cc-check-lfs + +######### +# Check for needed/wanted data types +cc-check-types int8_t int16_t int32_t int64_t intptr_t \ + uint8_t uint16_t uint32_t uint64_t uintptr_t + +cc-check-functions gmtime_r isnan localtime_r localtime_s \ + malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64 + +cc-check-function-in-lib fdatasync rt +define LDFLAGS_FDATASYNC [get-define lib_fdatasync] +undefine lib_fdatasync + +######### +# Check for needed/wanted headers +cc-check-includes sys/types.h stdlib.h stdint.h inttypes.h malloc.h +if {[cc-check-includes zlib.h] && [cc-check-function-in-lib deflate z]} { + define HAVE_ZLIB 1; # "-DSQLITE_HAVE_ZLIB=1" + define LDFLAGS_ZLIB -lz +} else { + define HAVE_ZLIB 0 + define LDFLAGS_ZLIB "" +} + +hwaci-define-if-opt-truthy with-debug SQLITE_DEBUG "Debug build?" +hwaci-define-if-opt-truthy amalgamation USE_AMALGAMATION "Use amalgamation for builds?" +hwaci-define-if-opt-truthy gcov USE_GCOV "Use gcov?" +hwaci-define-if-opt-truthy test-status TSTRNNR_OPTS "test-runner flags?" {--status} {} if {0} { ######### @@ -400,53 +414,21 @@ if {0} { # XXX fi } -if {0} { - ######### - # Set up options for running tests. - # - if {[opt-bool test-status]} { - define TSTRNNR_OPTS {--status} - } else { - define TSTRNNR_OPTS {} - } - # XXX if test $use_vt100 != no; then - # XXX TSTRNNR_OPTS=--status - # XXX else - # XXX TSTRNNR_OPTS= - # XXX fi - # XXX AC_SUBST TSTRNNR_OPTS -} -######### -# Locate a compiler for the build machine. This compiler should -# generate command-line programs that run on the build machine. -# -# XXX if test x"$cross_compiling" = xno; then -# XXX BUILD_CC=$CC -# XXX BUILD_CFLAGS=$CFLAGS -# XXX else -# XXX if test "${BUILD_CC+set}" != set; then -# XXX AC_CHECK_PROGS BUILD_CC gcc cc cl -# XXX fi -# XXX if test "${BUILD_CFLAGS+set}" != set; then -# XXX BUILD_CFLAGS="-g" -# XXX fi -# XXX fi -# XXX AC_SUBST BUILD_CC - - -########## -# Do we want to support multithreaded use of sqlite -# msg-checking "Support threadsafe operation? " hwaci-if-opt-truthy threadsafe { msg-result yes add-feature-flag -DSQLITE_THREADSAFE=1 - cc-check-function-in-lib pthread_create pthread - cc-check-function-in-lib pthread_mutexattr_init pthread + if {![cc-check-function-in-lib pthread_create pthread] + || ![cc-check-function-in-lib pthread_mutexattr_init pthread]} { + user-error "Missing required pthread bits" + } + define LDFLAGS_PTHREAD [get-define lib_pthread_create] + undefine lib_pthread_create } { msg-result no add-feature-flag -DSQLITE_THREADSAFE=0 + define LDFLAGS_PTHREAD "" } ########## @@ -619,57 +601,10 @@ if {0} { # XXX AC_SUBST TARGET_HAVE_LINENOISE } -if {0} { - ########## - # Figure out what C libraries are required to compile programs - # that use "fdatasync()" function. - # - cc-check-function-in-lib fdatasync rt -} - -if {0} { - ######### - # check for debug enabled - if {[opt-bool debug]} { - } - msg-checking "Checking build type..." - # XXX if test "${enable_debug}" = "yes" ; then - # XXX TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0 -Wall" - msg-result "debug" - # XXX else - # XXX TARGET_DEBUG="-DNDEBUG" - msg-result "release" - # XXX fi - # XXX AC_SUBST TARGET_DEBUG -} - -if {0} { - ######### - # See whether we should use the amalgamation to build - - if {![opt-bool amalgamation]} { - } - # XXX if test "${enable_amalgamation}" = "no" ; then - # XXX USE_AMALGAMATION=0 - # XXX fi - # XXX AC_SUBST USE_AMALGAMATION -} - -if {0} { - ######### - # Look for zlib. Only needed by extensions and by the sqlite3.exe shell - cc-check-includes zlib.h - if {[cc-check-function-in-lib deflate z]} { - define HAVE_ZLIB 1; # "-DSQLITE_HAVE_ZLIB=1" - } else { - define HAVE_ZLIB 0; # HAVE_ZLIB="" - } - # XXX AC_SUBST HAVE_ZLIB -} - hwaci-if-opt-truthy load-extension { if {[cc-check-function-in-lib dlopen dl]} { define LDFLAGS_DLOPEN [get-define lib_dlopen] + undefine lib_dlopen } else { user-error "dlopen() not found. Use --disable-load-extension to bypass this check." } @@ -699,30 +634,6 @@ hwaci-if-opt-truthy json { msg-result "Disabling JSON SQL functions" } -if {0} { - ########## - # Do we want to support memsys3 and/or memsys5 - # - if {[opt-bool memsys5]} { - } - msg-checking "Checking whether to support MEMSYS5..." - # XXX if test "${enable_memsys5}" = "yes"; then - # XXX OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS5" - msg-result "yes" - # XXX else - msg-result "no" - # XXX fi - if {[opt-bool memsys3]} { - } - msg-checking "Checking whether to support MEMSYS3..." - # XXX if test "${enable_memsys3}" = "yes" -a "${enable_memsys5}" = "no"; then - # XXX OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_MEMSYS3" - msg-result "yes" - # XXX else - msg-result "no" - # XXX fi -} - if {0} { # is this still relevant? @@ -774,15 +685,6 @@ if {0} { # XXX BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS } -msg-checking "Enable gcov? " -hwaci-if-opt-truthy gcov { - define USE_GCOV 1 - msg-result yes -} { - define USE_GCOV 0 - msg-result no -} - proc affirm-have-math {} { if {![cc-check-function-in-lib log m]} { user-error "Missing required math APIs" @@ -873,7 +775,7 @@ hwaci-if-opt-truthy dump-defines { global DUMP_DEFINES_FILE msg-result "--dump-defines is creating file: $DUMP_DEFINES_FILE" make-config-header $DUMP_DEFINES_FILE \ - -bare {OPT_FEATURE_FLAGS SQLITE_OS_* LDFLAGS_* USE_*} \ + -bare {OPT_FEATURE_FLAGS SQLITE_OS* SQLITE_DEBUG LDFLAGS_* USE_*} \ -auto {*} # achtung: ^^^^ whichever SQLITE_OS_foo flag which is set to 0 will # get _undefined_ here unless it's part of the -bare set. diff --git a/autosetup/hwaci-common.tcl b/autosetup/hwaci-common.tcl index 930580960b..20bdb4b470 100644 --- a/autosetup/hwaci-common.tcl +++ b/autosetup/hwaci-common.tcl @@ -144,6 +144,29 @@ proc hwaci-if-opt-truthy {flag then {else {}}} { if {[hwaci-opt-truthy $flag]} {eval $then} else {eval $else} } +######################################################################## +# If [hwaci-opt-truthy $flag] then [define $def $iftrue] else +# [define $def $iffalse]. Output [msg-checking $msg] and a +# [msg-results ...] which corresponds to the result. Returns 1 +# if the opt-truthy check passes, else 0. +proc hwaci-define-if-opt-truthy {flag def msg {iftrue 1} {iffalse 0}} { + msg-checking "$msg " + set rc 0 + if {[hwaci-opt-truthy $flag]} { + define $def $iftrue + set rc 1 + } else { + define $def $iffalse + } + set msg [get-define $def] + switch -- $msg { + 0 { set msg no } + 1 { set msg yes } + } + msg-result $msg + return $rc +} + ######################################################################## # Args: [-v] optName defName {descr {}} # diff --git a/manifest b/manifest index 8bdf8719e2..c124584a49 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\scommon\sfeature\sflag\shandling\sa\sbit. -D 2024-09-25T14:58:09.490 +C Further\sstreamlining\sof\sauto.def. +D 2024-09-25T18:03:26.242 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -14,7 +14,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 e90da95aff732435d819c840799ae95743ef1bad622e8178c79fa509a9d34b28 +F auto.def 334d1bcda82fe05ac65baa1485701e05911ce4304175f716bacc33b5ddb1d61c F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -46,7 +46,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78 F autosetup/cc.tcl 1b52de228642c1db5a714d54ca974d723ec8b4092e8c3765d348b625850f7311 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82 -F autosetup/hwaci-common.tcl c676836141db22751ab9c4e8ff9e66e744546691643f2c2cce459f3af6647f28 +F autosetup/hwaci-common.tcl 6c48b16beb9eb8015f207980095f5f65c55e5238159a9d50791b643e5c295205 F autosetup/jimsh0.c 1b5fe91fffcddbc29f2b16acb80f1650632ea2edbe8336b8155ef7b4c66f6d8d F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb @@ -2232,8 +2232,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 2141527a38ca8170e79b5b5e664378f0d8464055119f5b986e5d7b1be75e919e -R 6f04bd8bd4e606869da2c4023fe473ea +P 8716c35eaa168677a10de7b4aa55d35c54035f5e685cc1a5890b940a41cc6ff7 +R 7ae842c7d3995cad59964f0358f0039c U stephan -Z f4464a4d74c89ea0380cf484c98507f9 +Z fd55233750e1823126fedbcf310025fa # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9dce95606d..172f049785 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8716c35eaa168677a10de7b4aa55d35c54035f5e685cc1a5890b940a41cc6ff7 +74d12433599e2f189d8d0a44be834651531ac5a215bf42de386053cd00d29162