diff options
author | stephan <stephan@noemail.net> | 2025-03-31 13:08:29 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2025-03-31 13:08:29 +0000 |
commit | 0a0367f38740284b7f423ddc98b66361f3ddccf4 (patch) | |
tree | cc1e71fcfc01e8efc673ea39ced2ffc50a90a48f | |
parent | 227df626e95e8e122bdd2c94fd099b05df32b0e8 (diff) | |
download | sqlite-0a0367f38740284b7f423ddc98b66361f3ddccf4.tar.gz sqlite-0a0367f38740284b7f423ddc98b66361f3ddccf4.zip |
Ensure that the compilation of extensions get the same CFLAGS as the core lib. Move the feature flags enabled by --dev out of TARGET_DEBUG and into OPT_FEATURE_FLAGS (for consistency). Rename the make-internal gcov-related flags to be more descriptive. At the end of the configure script, if SQLITE_DEBUG is active then emit a note reminding the builder that performance will suffer.
FossilOrigin-Name: e64c6a3856b839e4e8c0a1cb1713b0d2f1d3cb9b915dd215b0d3cb229502d539
-rw-r--r-- | Makefile.in | 13 | ||||
-rw-r--r-- | auto.def | 2 | ||||
-rw-r--r-- | autosetup/sqlite-config.tcl | 13 | ||||
-rw-r--r-- | main.mk | 40 | ||||
-rw-r--r-- | manifest | 18 | ||||
-rw-r--r-- | manifest.uuid | 2 |
6 files changed, 52 insertions, 36 deletions
diff --git a/Makefile.in b/Makefile.in index 5a215ec7b..e5f0c527c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -139,15 +139,6 @@ libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@ CFLAGS.fuzzcheck-asan.fsanitize = @CFLAGS_ASAN_FSANITIZE@ # -# Define -D_HAVE_SQLITE_CONFIG_H so that the code knows it -# can include the generated sqlite_cfg.h. -# -# main.mk will fill out T.cc.sqlite with additional flags common to -# all builds. -# -T.cc.sqlite.extras = -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite - -# # Intended to either be empty or be set to -g -DSQLITE_DEBUG=1. # T.cc.TARGET_DEBUG = @TARGET_DEBUG@ @@ -249,8 +240,8 @@ TSTRNNR_OPTS = @TSTRNNR_OPTS@ CFLAGS.gcov1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage LDFLAGS.gcov1 = -lgcov USE_GCOV = @USE_GCOV@ -T.compile.extras = $(CFLAGS.gcov$(USE_GCOV)) -T.link.extras = $(LDFLAGS.gcov$(USE_GCOV)) +T.compile.gcov = $(CFLAGS.gcov$(USE_GCOV)) +T.link.gcov = $(LDFLAGS.gcov$(USE_GCOV)) # # Vars with the AS_ prefix are specifically related to AutoSetup. @@ -26,7 +26,7 @@ sqlite-configure canonical { # [proj-get-env] and we want this to supercede that. sqlite-munge-cflags; # straighten out -DSQLITE_ENABLE/OMIT flags } - sqlite-handle-debug + sqlite-handle-debug ;# must come after --dev flag check sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk] sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment sqlite-check-common-system-deps diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index e6998a47e..eda9f2588 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -525,7 +525,8 @@ define OPT_SHELL {} ; # Feature-related CFLAGS for the sqlite3 CLI app # Adds $args, if not empty, to OPT_FEATURE_FLAGS. If the first arg is # -shell then it strips that arg and passes the remaining args the # sqlite-add-shell-opt in addition to adding them to -# OPT_FEATURE_FLAGS. +# OPT_FEATURE_FLAGS. This is intended only for holding +# -DSQLITE_ENABLE/OMIT/... flags, but that is not enforced here. proc sqlite-add-feature-flag {args} { set shell "" if {"-shell" eq [lindex $args 0]} { @@ -771,6 +772,9 @@ proc sqlite-finalize-feature-flags {} { proj-assert {"canonical" eq $::sqliteConfig(build-mode)} msg-result "Appending source files to amalgamation: $extraSrc" } + if {[lsearch [get-define TARGET_DEBUG ""] -DSQLITE_DEBUG=1] > -1} { + msg-result "Note: this is a debug build, so performance will suffer." + } } ######################################################################## @@ -780,7 +784,8 @@ proc sqlite-finalize-feature-flags {} { proc sqlite-handle-debug {} { msg-checking "SQLITE_DEBUG build? " proj-if-opt-truthy debug { - define TARGET_DEBUG {-g -DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0 -Wall} + define TARGET_DEBUG {-g -DSQLITE_DEBUG=1 -O0 -Wall} + sqlite-add-feature-flag -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE proj-opt-set memsys5 msg-result yes } { @@ -1384,7 +1389,7 @@ proc sqlite-handle-load-extension {} { msg-result "Loadable extension support enabled." } else { msg-result "Disabling loadable extension support. Use --enable-load-extension to enable them." - sqlite-add-feature-flag {-DSQLITE_OMIT_LOAD_EXTENSION=1} + sqlite-add-feature-flag -DSQLITE_OMIT_LOAD_EXTENSION=1 } return $found } @@ -1398,7 +1403,7 @@ proc sqlite-handle-math {} { } define LDFLAGS_MATH [get-define lib_ceil] undefine lib_ceil - sqlite-add-feature-flag {-DSQLITE_ENABLE_MATH_FUNCTIONS} + sqlite-add-feature-flag -DSQLITE_ENABLE_MATH_FUNCTIONS msg-result "Enabling math SQL functions" } { define LDFLAGS_MATH "" @@ -260,8 +260,9 @@ EXTRA_SRC ?= # # $(OPTS)=... is another way of influencing C compilation. It is # distinctly separate from $(OPTIONS) and $(OPT_FEATURE_FLAGS) but, -# like those, $(OPTS) applies to all invocations of $(T.cc). The -# configure process does not set either of $(OPTIONS) or $(OPTS). +# like those, $(OPTS) applies to all invocations of $(T.cc) (and some +# invocations of $(B.cc). The configure process does not set either of +# $(OPTIONS) or $(OPTS). # OPT_FEATURE_FLAGS ?= # @@ -364,24 +365,43 @@ INSTALL.noexec = $(INSTALL) -m 0644 # ^^^ do not use GNU-specific flags to $(INSTALL), e.g. --mode=... # +# T.compile.gcov = gcov-specific compilation flags for the target +# platform. +# +T.compile.gcov ?= +# +# T.link.gcov = gcov-specific link flags for the target platform. +# +T.link.gcov ?= + +# # $(T.compile) = generic target platform compiler invocation, -# differing only from $(T.cc) in that it appends $(T.compile.extras), -# which are primarily intended for use with gcov-related flags. +# differing only from $(T.cc) in that it appends $(T.compile.gcov), +# which is intended for use with gcov-related flags. # -T.compile = $(T.cc) $(T.compile.extras) +T.compile = $(T.cc) $(T.compile.gcov) # # Optionally set by the configure script to include -DSQLITE_DEBUG=1 +# and other debug-related flags. # T.cc.TARGET_DEBUG ?= # +# Extra CFLAGS for both the core sqlite3 components and extensions. +# +# Define -D_HAVE_SQLITE_CONFIG_H so that the code knows it +# can include the generated sqlite_cfg.h. +# +T.cc.sqlite.extras = -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite $(T.cc.TARGET_DEBUG) + +# # $(T.cc.sqlite) is $(T.cc) plus any flags which are desired for the # library as a whole, but not necessarily needed for every binary. It # will normally get initially populated with flags by the # configure-generated makefile. # -T.cc.sqlite ?= $(T.cc) $(T.cc.sqlite.extras) $(T.cc.TARGET_DEBUG) +T.cc.sqlite ?= $(T.compile) $(T.cc.sqlite.extras) # # $(CFLAGS.intree_includes) = -I... flags relevant specifically to @@ -397,16 +417,16 @@ T.cc.sqlite += $(CFLAGS.intree_includes) # # $(T.cc.extension) = compiler invocation for loadable extensions. # -T.cc.extension = $(T.compile) -I. -I$(TOP)/src $(T.cc.TARGET_DEBUG) -DSQLITE_CORE +T.cc.extension = $(T.compile) -I. -I$(TOP)/src $(T.cc.sqlite.extras) -DSQLITE_CORE # # $(T.link) = compiler invocation for when the target will be an # executable. # -# $(T.link.extras) = optional config-specific flags for $(T.link), -# primarily intended for use with gcov-related flags. +# $(T.link.gcov) = optional config-specific flags for $(T.link), +# intended for use with gcov-related flags. # -T.link = $(T.cc.sqlite) $(T.link.extras) +T.link = $(T.cc.sqlite) $(T.link.gcov) # # $(T.link.shared) = $(T.link) invocation specifically for shared libraries # @@ -1,10 +1,10 @@ -C Ensure\sthat\sextension\ssources\salso\sinherit\sthe\sdebugging-related\sflags\sfrom\s--debug\sor\s--dev. -D 2025-03-31T10:54:09.382 +C Ensure\sthat\sthe\scompilation\sof\sextensions\sget\sthe\ssame\sCFLAGS\sas\sthe\score\slib.\sMove\sthe\sfeature\sflags\senabled\sby\s--dev\sout\sof\sTARGET_DEBUG\sand\sinto\sOPT_FEATURE_FLAGS\s(for\sconsistency).\sRename\sthe\smake-internal\sgcov-related\sflags\sto\sbe\smore\sdescriptive.\sAt\sthe\send\sof\sthe\sconfigure\sscript,\sif\sSQLITE_DEBUG\sis\sactive\sthen\semit\sa\snote\sreminding\sthe\sbuilder\sthat\sperformance\swill\ssuffer. +D 2025-03-31T13:08:29.964 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 34794659ddf442225267c4c9b743b7817d2321be88d5eb44d87f35443dc284b6 +F Makefile.in 24a030d8507a7e040907ea3eb7740bd583f89ef8019ef23826dfc1cf3d6f26f0 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc bb2cc6f75bbcb2d690fbdd1489914a2febd5e99bad9c77538cb3330d304694c6 F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 @@ -15,7 +15,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def 80e6d7f7172fcfc53c67e9304c80482637aee04d3370f172f82d1244ff1f19ef +F auto.def 3c423bc80e144784abeff067ade482fc4d64979bf2d3d673d974d952cf6c6260 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in 66d98d473556c4e2daf7252355f4b5db129091800027f280082804eb4c45784f F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b @@ -52,7 +52,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1 F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl cac07d75249fa127500b8e96080dc807e9ae97fe98d29e84a17bc28f4628e93f -F autosetup/sqlite-config.tcl b9ab4e0305833757cdc9ba8d366434f31e5ee46083230f5b3343ff09bc2ea0d7 +F autosetup/sqlite-config.tcl f4ee2028c603fdffb0dfec1a1ac16f5477c8047c728eac6357382f3767ec203b F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -709,7 +709,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk c35bf589abc5baa7dc4bc44d7f666b82bbc6891fa67486c95d942af9343870b5 +F main.mk ed671b5709a4f3e4ed156c0d9e323206fec612d819995d1845e93594d4de7ea2 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,8 +2216,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 e48189ed33fa9d02b23c18255c7b4c6cab2a6d4b62f7c1edbb0a58ab329735fc -R 900351079f392a3dac0ffc6765fe20f2 +P 3e96b772a46638bc25e036de053d620ded3350871ee10e06fd6fe51429934b0d +R 5a85f2774d52509b8f6ae6acd48a3210 U stephan -Z 4c01788cf2ee043c6a538c02c303b015 +Z 7e629c8c02794da90c85323f978e7eb9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 3e231d651..80bb6da65 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3e96b772a46638bc25e036de053d620ded3350871ee10e06fd6fe51429934b0d +e64c6a3856b839e4e8c0a1cb1713b0d2f1d3cb9b915dd215b0d3cb229502d539 |