From 3c6db6831dd071ea457fef748548c58d7d22a453 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 27 Sep 2024 03:04:16 +0000 Subject: [PATCH] General auto.def cleanups, mostly around JimTCL. Swap out impl for the sqlite_cfg.h generator - this approach is lower-maintenance (requires no hand-maintained template) but may not be compatible with expectations. FossilOrigin-Name: da197946dbaacedb6e74827db9b5dd195d4aaf78ad9411a14aca732ab77917c6 --- auto.def | 62 ++++++++++++++++++++++++++++++++++++--------------- manifest | 12 +++++----- manifest.uuid | 2 +- 3 files changed, 51 insertions(+), 25 deletions(-) diff --git a/auto.def b/auto.def index 4d96682408..d0c7be78b7 100644 --- a/auto.def +++ b/auto.def @@ -175,7 +175,7 @@ if {"" eq [hwaci-bin-define install]} { msg-result "Cannot find install binary, so 'make install' will not work." } -######### +######################################################################## # Locate a compiler for the build machine. This compiler should # generate command-line programs that run on the build machine. # @@ -195,7 +195,7 @@ if {"" eq [hwaci-bin-define install]} { define BUILD_CC [get-define CC_FOR_BUILD] define BUILD_CFLAGS [get-env CFLAGS {-g}] -########## +######################################################################## # Handle --with-wasi-sdk=DIR # # This must be early because it may change the toolchain and several @@ -244,7 +244,7 @@ if {1} { unset wasiSdkDir }; # --wasi-sdk-dir -######## +######################################################################## # Check which TCL to use as a code generator define CFLAGS_JIMSH {} puts "Looking for path-resolution function for JimTCL... " @@ -258,11 +258,11 @@ if {[cc-check-functions realpath]} { puts "Cannot find realpath() or _fullpath(). Falling back to system's TCL for code generation." } -######### +######################################################################## # 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 @@ -274,7 +274,7 @@ 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 sys/stat.h dlfcn.h unistd.h \ @@ -282,6 +282,9 @@ cc-check-includes \ string.h strings.h \ stdint.h inttypes.h +# These are optional for JimTCL: +cc-check-includes dirent.h sys/time.h + if {[cc-check-includes zlib.h] && [cc-check-function-in-lib deflate z]} { # TODO: port over the more sophisticated zlib search from the fossil auto.def define HAVE_ZLIB 1; # "-DSQLITE_HAVE_ZLIB=1" @@ -308,6 +311,8 @@ hwaci-if-opt-truthy with-debug { msg-result no } +######################################################################## +# TCL... define HAVE_TCL 0 define TCLSH_CMD {exit 1} if {"" eq [get-define CFLAGS_JIMSH]} { @@ -364,7 +369,6 @@ if {"" eq [get-define CFLAGS_JIMSH]} { # XXX fi } - # XXX if test x"${use_tcl}" = "xyes"; then # XXX if test x"${with_tcl}" != x; then # XXX if test -r ${with_tcl}/tclConfig.sh; then @@ -459,6 +463,8 @@ if {"" eq [get-define CFLAGS_JIMSH]} { }; # end of tcl +######################################################################## +# Thread safety? msg-checking "Support threadsafe operation? " hwaci-if-opt-truthy threadsafe { msg-result yes @@ -475,7 +481,7 @@ hwaci-if-opt-truthy threadsafe { define LDFLAGS_PTHREAD "" } -########## +######################################################################## # Do we want to support release? # # Maintenance note: this might be irrelevant with an autosetup port, @@ -503,7 +509,7 @@ if {0} { # XXX AC_SUBST ALLOWRELEASE } -########## +######################################################################## # Do we want temporary databases in memory? # if {1} { @@ -729,7 +735,7 @@ if {0} { # XXX BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS } -########## +######################################################################## # Emscripten SDK for building the web-based wasm components. # if {[hwaci-check-emsdk]} { @@ -784,25 +790,45 @@ foreach {boolFlag featureFlag ifSetEvalThis} { } } +######################################################################## +# Extend JimTCL a bit... +if {"" ne [get-define CFLAGS_JIMSH]} { + foreach jimFunc {opendir fsync isascii} { + if {[cc-check-functions $jimFunc]} { + define-append CFLAGS_JIMSH -DHAVE_[string toupper $jimFunc] + } + } + #foreach jimDef {HAVE_UNISTD_H HAVE_DIRENT_H} { + # if {[is-defined $jimDef]} { + # define-append CFLAGS_JIMSH -D$jimDef + # } + #} + define-append CFLAGS_JIMSH -DHAVE_LONG_LONG; # SQLite relies on long long, so we know it's available +}; # JimTCL + define ENABLE_SHARED $enable_shared -if {1} { - # for sqlite_cfg.h - define PACKAGE_URL {https://sqlite.org} - define PACKAGE_VERSION [get-define VERSION] -} - -######### +######################################################################## # Generate the output files. # if {1} { hwaci-make-from-dot-in Makefile hwaci-make-from-dot-in sqlite3.pc # hwaci-make-from-dot-in sqlite_cfg.h + if {1} { + # for sqlite_cfg.h + define PACKAGE_URL {https://sqlite.org} + define PACKAGE_VERSION [get-define VERSION] + } + if {0} { + # Requires a hand-written sqlite_cfg.h.in... hwaci-make-from-dot-in sqlite_cfg.h + # vs... } else { - make-config-header -bare {SIZEOF_* HAVE_DECL_*} \ + # Requires no input template... + make-config-header sqlite_cfg.h \ + -bare {SIZEOF_* HAVE_DECL_*} \ -auto {HAVE_* PACKAGE_*} -none * } # make-config-header sqlite_cfg.h -bare {SIZEOF_* HAVE_*} -none * diff --git a/manifest b/manifest index a38775c4c1..5efe4184b7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Tweak\sbuild\sto\sfall\sback\sto\ssystem-side\stclsh\sif\swe\scannot\sfind\srealpath()\sor\s_fullpath()\sfor\sJimTCL\s(needed\sfor\ssome\sof\sthe\scode\sgenerator\sscripts\sto\swork). -D 2024-09-27T02:35:41.157 +C General\sauto.def\scleanups,\smostly\saround\sJimTCL.\sSwap\sout\simpl\sfor\sthe\ssqlite_cfg.h\sgenerator\s-\sthis\sapproach\sis\slower-maintenance\s(requires\sno\shand-maintained\stemplate)\sbut\smay\snot\sbe\scompatible\swith\sexpectations. +D 2024-09-27T03:04:16.754 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 73d6e09e94dbe2a11c26524d2448c81a7bc5fdb52c2378396138d57ddbf058bb +F auto.def 16cabd934d00c8c69fa28f628b5236686c5bfb9f925ce3a8a50fd1caa8c4eedd F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac @@ -2233,8 +2233,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 3193b86a91d8096be68cb83133c7665129694521d7da81bf725e285c229271f7 -R c9ebfe69a4af214d35d57aa4421c3f6e +P b31dbb9945d0ac5e22d146565443bcdc0dd1a1c83034cfb5867b2303ada2bdea +R 559826a6b99ae3d6f2212d863a4322c6 U stephan -Z 2d082ca6d901dc26c8447cb73e030ab8 +Z 5d3d66ed442efd8056a05e7c3e59ac1d # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 67187e8b40..006e487e4a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b31dbb9945d0ac5e22d146565443bcdc0dd1a1c83034cfb5867b2303ada2bdea +da197946dbaacedb6e74827db9b5dd195d4aaf78ad9411a14aca732ab77917c6