]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Generic build cleanups and reorgs.
authorstephan <stephan@noemail.net>
Sun, 20 Oct 2024 01:09:51 +0000 (01:09 +0000)
committerstephan <stephan@noemail.net>
Sun, 20 Oct 2024 01:09:51 +0000 (01:09 +0000)
FossilOrigin-Name: 365a3d71cf9e0be11e7b3e90b6500142619102d8321c1d6f8111f37117a57929

Makefile.in
auto.def
autosetup/hwaci-common.tcl
main.mk
manifest
manifest.uuid
sqlite_cfg.h.in
tool/mktoolzip.tcl

index 756790d0993ed72de4d15017ac961616b0a87d66..d43a12f31a1321cfb35a4d528426d681ae36194b 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/make
+# ^^^^ help out editors which guess this file's type.
 #
 # Makefile for SQLITE
 #
@@ -7,34 +8,90 @@
 # certain blocks are added or removed depending on configure-time
 # information.
 #
+
+########################################################################
+#XX# Lines starting with #XX# are TODOs for the port to autosetup.
+#
+# Known TODOs/FIXMEs/TOIMPROVEs for the autosetup port, in no
+# particular order...
+#
+# - libreadline detection and handling of its -I, -L, and -l flags.
+# These can vary considerably across systems. e.g. some need -lncurses,
+# and some don't know what -lncurses is.
+#
+# - TEA pieces
+#
+# - Replace the autotools-specific distribution deliverable(s).
+#
+# - Provide Makefile.msc, Makefile.linux-gcc, and any required similar
+# makefile stubs for platforms where the configure script will not
+# run. The core makefile rules in main.mk "should" apply as-is for
+# most platforms.
+#
+# - Confirm whether cross-compilation works and patch it
+# appropriately.
+#
 all:
-#XX# Lines starting with #XX# are TODOs for the port to autosetup
+clean:
 
-# The toplevel directory of the source tree.  This is the directory
+#
+# Maintenance reminder: When using the X?=Y variable assignment
+# formulation, please test the build with both GNU make and a POSIX
+# make (e.g. BSD make, a.k.a. bmake). On at least one occassion, that
+# formulation has led to inconsistent behavior between the two major
+# make flavors when used with variable names which might sensibly be
+# in the developer's environment (namely CC).
+#
+
+#
+# The top-most directory of the source tree.  This is the directory
 # that contains this "Makefile.in" and the "configure" script.
 #
 TOP = @abs_top_srcdir@
-# Just testing expansions...
+
+#
+# Just testing some default dir expansions...
 # srcdir = @srcdir@
 # top_srcdir = @top_srcdir@
 # abs_top_srcdir = @abs_top_srcdir@
 # abs_top_builddir = @abs_top_builddir@
-LDFLAGS_ZLIB ?= @LDFLAGS_ZLIB@
-LDFLAGS_MATH ?= @LDFLAGS_MATH@
-LDFLAGS_RPATH ?= @LDFLAGS_RPATH@
-LDFLAGS_READLINE ?= @LDFLAGS_READLINE@
-LDFLAGS_PTHREAD ?= @LDFLAGS_PTHREAD@
-LDFLAGS_SHOBJ ?= @SHOBJ_LDFLAGS@
-ENABLE_SHARED ?= @ENABLE_SHARED@
-HAVE_WASI_SDK ?= @HAVE_WASI_SDK@
+#
+
+#
+# Some standard variables and programs
+#
+prefix ?= @prefix@
+exec_prefix ?= @exec_prefix@
+libdir ?= @libdir@
+pkgconfigdir ?= $(libdir)/pkgconfig
+bindir ?= @bindir@
+includedir ?= @includedir@
+INSTALL = @BIN_INSTALL@
 AR = @AR@
 CC = @CC@
+#LD = @LD@ # isn't actually needed, at least on modern Unixes.
 
+#
 # C Compiler and options for use in building executables that
 # will run on the platform that is doing the build.
 #
 BCC = @BUILD_CC@ @BUILD_CFLAGS@
 
+#
+# Rather that stuffing all CFLAGS and LDFLAGS into a single set, we
+# break them down on a per-feature basis and expect the build targets
+# to use the one(s) it needs.
+#
+LDFLAGS_ZLIB = @LDFLAGS_ZLIB@
+LDFLAGS_MATH = @LDFLAGS_MATH@
+LDFLAGS_RPATH = @LDFLAGS_RPATH@
+LDFLAGS_READLINE = @LDFLAGS_READLINE@
+LDFLAGS_PTHREAD = @LDFLAGS_PTHREAD@
+LDFLAGS_SHOBJ = @SHOBJ_LDFLAGS@
+
+ENABLE_SHARED = @ENABLE_SHARED@
+HAVE_WASI_SDK = @HAVE_WASI_SDK@
+
 #
 # TCC is the C Compile and options for use in building executables that
 # will run on the target platform.  (BCC and TCC are usually the
@@ -43,38 +100,26 @@ BCC = @BUILD_CC@ @BUILD_CFLAGS@
 # on the "make" command-line.  Ex:  "make CC=clang CFLAGS=-fsanitize=undefined"
 #
 CFLAGS = @CFLAGS@ @SH_CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-# CFLAGS_stdio3 ==> for sqlite3_stdio.h
-CFLAGS_stdio3 := -I$(TOP)/ext/misc
-TCC ?= $(CC) $(CFLAGS)
+TCC = $(CC) $(CFLAGS)
 
 # Define -DNDEBUG to compile without debugging (i.e., for production usage)
 # Omitting the define will cause extra debugging code to be inserted and
 # includes extra comments when "EXPLAIN stmt" is used.
 #
-TCCX ?= $(TCC) @TARGET_DEBUG@
-# Define this for the autoconf-based build, so that the code knows it can
-# include the generated sqlite_cfg.h
+TCCX = $(TCC) @TARGET_DEBUG@
+# Define this for the autoconf-based build, so that the code knows it
+# can include the generated sqlite_cfg.h.
 #
 TCCX += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
 #
 # main.mk will fill out TCCX with some flags common to all builds.
 
-#XX#
-#XX## Compiler options needed for programs that use the TCL library.
-#XX##
-#XX#TCC += @TCL_INCLUDE_SPEC@
-#XX#
-#XX## The library that programs using TCL must link against.
-#XX##
-LIBTCL = @TCL_LIB_SPEC@
-
 #
 # Compiler options needed for programs that use the readline() library.
 #
-CFLAGS_readline = -DHAVE_READLINE=@HAVE_READLINE@ @CFLAGS_READLINE@
-#XX#CFLAGS_readline += -DHAVE_EDITLINE=@TARGET_HAVE_EDITLINE@
-#XX#CFLAGS_readline += -DHAVE_LINENOISE=@TARGET_HAVE_LINENOISE@
+CFLAGS_READLINE = -DHAVE_READLINE=@HAVE_READLINE@ @CFLAGS_READLINE@
+#XX#CFLAGS_READLINE += -DHAVE_EDITLINE=@TARGET_HAVE_EDITLINE@
+#XX#CFLAGS_READLINE += -DHAVE_LINENOISE=@TARGET_HAVE_LINENOISE@
 #XX#
 #XX## The library that programs using readline() must link against.
 #XX##
@@ -115,14 +160,20 @@ $(JIMSH): $(TOP)/autosetup/jimsh0.c
 BTCLSH = @BTCLSH@
 $(BTCLSH):
 
-# Flags controlling use of the in memory btree implementation
 #
-# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1 to
-# default to file, 2 to default to memory, and 3 to force temporary
+# $(CFLAGS_libsqlite3) must contain any CFLAGS which are relevant for
+# compiling the library's own sources, including (sometimes) when
+# compiling sqlite3.c directly in to another app.  Most notably, it
+# should always contain -DSQLITE_TEMP_STORE=N for the sake of
+# historical build expecations.
+#
+# SQLITE_TEMP_STORE is 0 to force temporary tables to be in a file, 1
+# to default to file, 2 to default to memory, and 3 to force temporary
 # tables to always be in memory.
 #
-TEMP_STORE ?= -DSQLITE_TEMP_STORE=@TEMP_STORE@
+CFLAGS_libsqlite3 = -DSQLITE_TEMP_STORE=@TEMP_STORE@
 
+#
 # Enable/disable loadable extensions, and other optional features
 # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
 # The same set of OMIT and ENABLE flags should be passed to the
@@ -141,7 +192,7 @@ TCC += $(OPT_FEATURE_FLAGS)
 TCC += $(OPTS)
 
 # Add in compile-time options for some libraries used by extensions
-TCC += @CFLAGS_ZLIB@
+#TCC += @CFLAGS_ZLIB@
 
 # Version numbers and release number for the SQLite being compiled.
 #
@@ -180,12 +231,6 @@ TCL_VERSION = @TCL_VERSION@
 TCLLIB_RPATH = @TCLLIB_RPATH@
 TCLLIBDIR = @TCLLIBDIR@
 
-# EMCC_WRAPPER must refer to the genuine emcc binary, or a
-# call-compatible wrapper, e.g. $(TOP)/tool/emcc.sh. If it's empty,
-# build components requiring Emscripten will not build.
-EMCC_WRAPPER = @EMCC_WRAPPER@
-
-
 # Additional options when running tests using testrunner.tcl
 # This is usually either blank, or else --status
 #
@@ -213,18 +258,6 @@ USE_GCOV = @USE_GCOV@
 TCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV))
 TLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
 
-# The directory into which to store package information for
-
-# Some standard variables and programs
-#
-prefix ?= @prefix@
-exec_prefix ?= @exec_prefix@
-libdir ?= @libdir@
-pkgconfigdir ?= $(libdir)/pkgconfig
-bindir ?= @bindir@
-includedir ?= @includedir@
-INSTALL = @BIN_INSTALL@
-
 #
 # You should not have to change anything below this line
 ################################################################################
@@ -235,29 +268,25 @@ INSTALL = @BIN_INSTALL@
 # AS_AUTO_DEF is the main configure script.
 #
 AS_AUTO_DEF = $(TOP)/auto.def
+#
+# Shell commands to re-run $(TOP)/configure with the same args it was
+# invoked with to produce this makefile.
+#
+AS_AUTOREMAKE = @SQLITE_AUTOREMAKE@
 
 USE_AMALGAMATION ?= @USE_AMALGAMATION@
 AMALGAMATION_LINE_MACROS ?= --linemacros=@AMALGAMATION_LINE_MACROS@
 
+#
+# CFLAGS for sqlite3$(TEXE)
+#
 SHELL_OPT ?= @OPT_SHELL@
 
-
-# In wasi-sdk builds, remove the CLI shell build from 'all'.
-target_sqlite3_shell_0 = sqlite3$(TEXE)
-target_sqlite3_shell = $(target_sqlite3_shell_$(HAVE_WASI_SDK))
-
 #
 # This is the default Makefile target.  The objects listed here
 # are what get build when you type just "make" with no arguments.
 #
 
-all:   sqlite3.h sqlite3.c shell.c $(target_sqlite3_shell)
-
-# Re-run $(TOP)/configure with the same args invoked to produce this
-# makefile.
-#
-AS_AUTOREMAKE = @SQLITE_AUTOREMAKE@
-
 Makefile: $(TOP)/Makefile.in $(AS_AUTO_DEF)
        $(AS_AUTOREMAKE)
        @touch $@
@@ -265,24 +294,26 @@ Makefile: $(TOP)/Makefile.in $(AS_AUTO_DEF)
 sqlite3.pc: $(TOP)/sqlite3.pc.in $(AS_AUTO_DEF)
        $(AS_AUTOREMAKE)
        @touch $@
-install-pc: sqlite3.pc $(install.pkgconfigdir)
-       $(INSTALL_noexec) sqlite3.pc $(install.pkgconfigdir)
 install: install-pc
 
 sqlite_cfg.h: $(TOP)/sqlite_cfg.h.in $(AS_AUTO_DEF)
        $(AS_AUTOREMAKE)
        @touch $@
 
-
 #
 # Fiddle app
 #
+# EMCC_WRAPPER must refer to the genuine emcc binary, or a
+# call-compatible wrapper, e.g. $(TOP)/tool/emcc.sh. If it's empty,
+# build components requiring Emscripten will not build.
+#
+EMCC_WRAPPER = @EMCC_WRAPPER@
 fiddle: sqlite3.c shell.c
        @if [ x = "x$(EMCC_WRAPPER)" ]; then \
                echo "Emscripten's emcc not found. Cannot build fiddle." 1&>2; \
                exit 1; \
        fi
-       make -C ext/wasm fiddle emcc_opt=-Os
+       $(MAKE) -C ext/wasm fiddle emcc_opt=-Os
 
 #
 # Spell-checking for source comments
@@ -303,4 +334,19 @@ fiddle: sqlite3.c shell.c
 misspell: ./custom.rws has_tclsh84
        $(TCLSH_CMD) ./tool/spellsift.tcl ./src/*.c ./src/*.h ./src/*.in
 
+#
+# clean/distclean are mostly defined in main.mk. In this makefile we
+# perform cleanup only known to be relevant to (only) the canonical
+# (autosetup-driven) build.
+#
+clean-autosetup:
+       -gmake -C ext/wasm distclean 2>/dev/null; true
+clean: clean-autosetup
+
+distclean-autosetup:   clean
+       rm -f sqlite_cfg.h config.log config.status $(JIMSH) Makefile sqlite3.pc
+       rm -f $(TOP)/tool/emcc.sh
+       -gmake -C ext/wasm distclean 2>/dev/null; true
+distclean: distclean-autosetup
+
 include $(TOP)/main.mk
index 071d95c66d6b3a99fb8b65d7e681129129594052..84c6e0b2ac20f4f37acf28287997ae1857d7e1e7 100644 (file)
--- a/auto.def
+++ b/auto.def
@@ -13,16 +13,15 @@ if {[get-define host] ne [get-define build]} {
 ########################################################################
 # A very long story made short, autosetup's --flag handling has
 # some behaviors which make it impossible to implement 100% identical
-# flags, compared to the historical autotools build. The differences
+# flags compared to the historical autotools build. The differences
 # are documented here:
 #
-#
 # 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.
 #
 # 2) In autosetup, all flags starting with (--enable, --disable) are
-# forced to be booleans and received special handling in how they're
+# 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].
@@ -870,26 +869,25 @@ hwaci-check-rpath
 ########################################################################
 # Generate the output files.
 #
-if {1} {
-  hwaci-make-from-dot-in Makefile
-  hwaci-make-from-dot-in sqlite3.pc
-  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 {
-    # Requires no input template...
-    make-config-header sqlite_cfg.h \
-      -bare {SIZEOF_* HAVE_DECL_*} \
-      -auto {HAVE_* PACKAGE_*} -none *
-  }
-  #hwaci-make-from-dot-in ext/wasm/GNUmakefile
+hwaci-make-from-dot-in Makefile
+hwaci-make-from-dot-in sqlite3.pc
+# 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 {
+  # Requires no input template...
+  make-config-header sqlite_cfg.h \
+    -bare {SIZEOF_* HAVE_DECL_*} \
+    -none {HAVE_CFLAG_* LDFLAGS_* SH_* SQLITE_AUTOREMAKE
+      TARGET_* USE_GCOV USE_OWN_JIMSH TCL_*} \
+    -auto {HAVE_* PACKAGE_*} \
+    -none *
 }
+#TODO hwaci-make-from-dot-in ext/wasm/GNUmakefile
 
 set oFF [get-define OPT_FEATURE_FLAGS]
 if {"" ne $oFF} {
index 532bc465b8563c6a5374b72dc343af86ea579d4b..84402ba04818598ad41f585fe355643bfcf934d2 100644 (file)
@@ -621,10 +621,10 @@ proc hwaci-check-emsdk {} {
   define BIN_EMCC ""
   #  define EMCC_OPT "-Oz"
   msg-checking "Emscripten SDK? "
-  if {$emsdkHome eq "" && [info exists ::env(EMSDK)]} {
-    # Fall back to checking the environment. $EMSDK gets set
-    # by sourcing emsdk_env.sh.
-    set emsdkHome $::env(EMSDK)
+  if {$emsdkHome eq ""} {
+    # Fall back to checking the environment. $EMSDK gets set by
+    # sourcing emsdk_env.sh.
+    set emsdkHome [get-env EMSDK ""]
   }
   set rc 0
   if {$emsdkHome ne ""} {
@@ -633,9 +633,6 @@ proc hwaci-check-emsdk {} {
     if {[file exists $emsdkEnv]} {
       msg-result "$emsdkHome"
       define EMSDK_ENV $emsdkEnv
-#      if {[info exists ::env(EMCC_OPT)]} {
-#        define EMCC_OPT $::env(EMCC_OPT)
-#      }
       set rc 1
       set emcc "$emsdkHome/upstream/emscripten/emcc"
       if {[file exists $emcc]} {
diff --git a/main.mk b/main.mk
index 5d529e741a78e48d54a971b54be47fe15dbbf0f6..5ca48a147f4e6bca3438a45ca07ad96741291d17 100644 (file)
--- a/main.mk
+++ b/main.mk
@@ -1,8 +1,15 @@
+#!/do/not/make
+# ^^^^ help out editors which guess this file's type.
 ###############################################################################
 # This is the main makefile for sqlite. It expects to be included from
 # a higher-level makefile which configures any dynamic state needed by
 # this one.
 #
+# Maintenance reminder: this file must remain devoid of GNU Make-isms.
+# i.e. it must be POSIX Make compatible.
+#
+#XX# Lines starting with #XX# are TODOs for the port to autosetup
+#
 # The following variables must be defined before this script is
 # invoked:
 #
@@ -20,7 +27,7 @@
 #                  will run on the target platform.  This is usually the same
 #                  as BCC, unless you are cross-compiling.
 #
-# AR               Tools used to build a static library.
+# AR               Tool used to build a static library.
 #
 # BEXE             File extension for executables on the build platform. ".exe"
 #                  for Windows and "" everywhere else.
 # TEXE             File extension for executables on the target platform. ".exe"
 #                  for Windows and "" everywhere else.
 #
+# BTCLSH           The TCL interpreter for in-tree code generation. May be
+#                  either JimTCL or the canonical TCL.
+#
 # ... and many, many more ...
 #
 # Once the variables above are defined, the rest of this make script
 # will build the SQLite library and testing tools.
 ################################################################################
+all:   sqlite3.h sqlite3.c
 
 #
-# Ideally these all come from the calling makefile, but we can provide
-# some sane defaults for many of them, where "sane" essentially means
-# "should suffice for conventional Unix-style OSes"...
+# Ideally these variables are all defined in the calling makefile, but
+# we can provide some sensible defaults for many of them which should
+# suffice for conventional Unix-style OSes.
 #
 prefix ?= /usr/local
 exec_prefix ?= $(prefix)
@@ -63,32 +74,54 @@ LDFLAGS_ZLIB ?= -lz
 LDFLAGS_MATH ?= -lm
 LDFLAGS_RPATH ?= -Wl,-rpath -Wl,$(prefix)/lib
 LDFLAGS_READLINE ?= -lreadline
+CFLAGS_READLINE ?=
 LDFLAGS_PTHREAD ?= -lpthread
 LDFLAGS_SHOBJ ?= -shared
 ENABLE_SHARED ?= 1
 HAVE_WASI_SDK ?= 0
+OPT_FEATURE_FLAGS ?=
 
+#
+# $(INSTALL) invocation for use with non-executable files.
+#
 INSTALL_noexec = $(INSTALL) -m 0644
 # ^^^ do not use GNU-specific flags to $(INSTALL), e.g. --mode=...
 
 # TCOMPILE = generic target platform compiler invocation
 TCOMPILE = $(TCC) $(TCOMPILE_EXTRAS)
 # TLINK = compiler invocation for when the target will be an executable
-TLINK = $(TCC) $(TLINK_EXTRAS)
+TLINK = $(TCCX) $(TLINK_EXTRAS)
 # TLINK_shared = $(TLINK) invocation specifically for shared libraries
 LDFLAGS_SHOBJ ?= -shared
 TLINK_shared = $(TLINK) $(LDFLAGS_SHOBJ)
 
 # TCCX is $(TCC) plus any CFLAGS which are common to most compilations
-# for the target platform. In auto-configured builds it is typically
-# defined by the main makefile to include configure-time-dependent
-# options.
+# for the target platform. In auto-configured builds it is defined by
+# the main makefile to include configure-time-dependent options.
 TCCX ?= $(TCC)
 TCCX += -I. -I$(TOP)/src -I$(TOP)/ext/rtree -I$(TOP)/ext/icu
 TCCX += -I$(TOP)/ext/fts3 -I$(TOP)/ext/async -I$(TOP)/ext/session
 TCCX += -I$(TOP)/ext/userauth
+# CFLAGS_stdio3 ==> for sqlite3_stdio.h
+CFLAGS_stdio3 := -I$(TOP)/ext/misc
+
+CFLAGS_libsqlite3 ?= -DSQLITE_TEMP_STORE=1
+
+#
+# The following TCL_vars come from tclConfig.sh
+#
+TCL_INCLUDE_SPEC ?=
+TCL_LIB_SPEC ?=
+TCL_STUB_LIB_SPEC ?=
+TCL_EXEC_PREFIX ?=
+TCL_VERSION ?=
+TCLLIBDIR ?=
+#
+# $(TCLLIB_RPATH) is the -rpath flag for libtclsqlite3, not
+# libsqlite3, and will usually differ from $(LDFLAGS_RPATH).
+#
+TCLLIB_RPATH ?=
 
-TEMP_STORE ?= -DSQLITE_TEMP_STORE=1
 
 #
 # LDFLAGS_libsqlite3 should be used with any target which either
@@ -102,17 +135,27 @@ LDFLAGS_libsqlite3 = \
   $(LDFLAGS_MATH) $(LDFLAGS_ZLIB)
 
 #
-# install.XYZ = dirs for installation. They're in quotes to
-# accommodate installations where paths have spaces in them.
-#
-install.bindir = "$(DESTDIR)$(bindir)"
-install.libdir = "$(DESTDIR)$(libdir)"
-install.includedir = "$(DESTDIR)$(prefix)/include"
-install.pkgconfigdir = "$(DESTDIR)$(pkgconfigdir)"
-$(install.bindir) $(install.libdir) $(install.includedir) $(install.pkgconfigdir):
+# install-dir.XYZ = dirs for installation.
+#
+# Design note: these should arguably all be defined with surrounding
+# double-quotes so that targets which have spaces in their paths will
+# work, but that leads to Make treating the quotes as part of the dir
+# name, which in turn leads to it never finding a matching name in the
+# filesystem and always invoking ($(INSTALL) -d ...) for them. The
+# moral of this story is that spaces in installation paths will break
+# the install process.
+#
+install-dir.bin = $(DESTDIR)$(bindir)
+install-dir.lib = $(DESTDIR)$(libdir)
+install-dir.include = $(DESTDIR)$(prefix)/include
+install-dir.pkgconfig = $(DESTDIR)$(pkgconfigdir)
+install-dir.man1 = $(DESTDIR)$(prefix)/share/man/man1
+install-dir.all = $(install-dir.bin) $(install-dir.include) \
+  $(install-dir.lib) $(install-dir.man1) \
+  $(install-dir.pkgconfig)
+$(install-dir.all):
        $(INSTALL) -d $@
 
-
 #
 # Object files for the SQLite library (non-amalgamation).
 #
@@ -493,6 +536,7 @@ HDR = \
    $(TOP)/src/vxworks.h \
    $(TOP)/src/whereInt.h \
    sqlite_cfg.h
+# Reminder: sqlite_cfg.h is typically created by the configure script
 
 # Header files used by extensions
 #
@@ -511,7 +555,8 @@ EXTHDR += \
 EXTHDR += \
   $(TOP)/ext/userauth/sqlite3userauth.h
 
-# executables needed for testing
+#
+# Executables needed for testing
 #
 TESTPROGS = \
   testfixture$(TEXE) \
@@ -533,10 +578,12 @@ FUZZDATA = \
   $(TOP)/test/fuzzdata7.db \
   $(TOP)/test/fuzzdata8.db
 
+#
 # Standard options to testfixture
 #
 TESTOPTS = --verbose=file --output=test-out.txt
 
+#
 # Extra compiler options for various shell tools
 #
 SHELL_OPT += -DSQLITE_DQS=0
@@ -671,255 +718,255 @@ sqlite3ext.h:   .target_source
 #     opcodes.o
 #
 parse.o:       parse.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c parse.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c parse.c
 
 opcodes.o:     opcodes.c
-       $(TCOMPILE) $(TEMP_STORE) -c opcodes.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c opcodes.c
 
 # Rules to build individual *.o files from files in the src directory.
 #
 alter.o:       $(TOP)/src/alter.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/alter.c
 
 analyze.o:     $(TOP)/src/analyze.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/analyze.c
 
 attach.o:      $(TOP)/src/attach.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/attach.c
 
 auth.o:        $(TOP)/src/auth.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/auth.c
 
 backup.o:      $(TOP)/src/backup.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/backup.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/backup.c
 
 bitvec.o:      $(TOP)/src/bitvec.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/bitvec.c
 
 btmutex.o:     $(TOP)/src/btmutex.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/btmutex.c
 
 btree.o:       $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/btree.c
 
 build.o:       $(TOP)/src/build.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/build.c
 
 callback.o:    $(TOP)/src/callback.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/callback.c
 
 complete.o:    $(TOP)/src/complete.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/complete.c
 
 ctime.o:       $(TOP)/src/ctime.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/ctime.c
 
 date.o:        $(TOP)/src/date.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/date.c
 
 dbpage.o:      $(TOP)/src/dbpage.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbpage.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/dbpage.c
 
 dbstat.o:      $(TOP)/src/dbstat.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/dbstat.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/dbstat.c
 
 delete.o:      $(TOP)/src/delete.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/delete.c
 
 expr.o:        $(TOP)/src/expr.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/expr.c
 
 fault.o:       $(TOP)/src/fault.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/fault.c
 
 fkey.o:        $(TOP)/src/fkey.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fkey.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/fkey.c
 
 func.o:        $(TOP)/src/func.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/func.c
 
 global.o:      $(TOP)/src/global.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/global.c
 
 hash.o:        $(TOP)/src/hash.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/hash.c
 
 insert.o:      $(TOP)/src/insert.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/insert.c
 
 json.o:        $(TOP)/src/json.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/json.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/json.c
 
 legacy.o:      $(TOP)/src/legacy.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/legacy.c
 
 loadext.o:     $(TOP)/src/loadext.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/loadext.c
 
 main.o:        $(TOP)/src/main.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/main.c
 
 malloc.o:      $(TOP)/src/malloc.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/malloc.c
 
 mem0.o:        $(TOP)/src/mem0.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/mem0.c
 
 mem1.o:        $(TOP)/src/mem1.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/mem1.c
 
 mem2.o:        $(TOP)/src/mem2.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/mem2.c
 
 mem3.o:        $(TOP)/src/mem3.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/mem3.c
 
 mem5.o:        $(TOP)/src/mem5.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/mem5.c
 
 memdb.o:       $(TOP)/src/memdb.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memdb.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/memdb.c
 
 memjournal.o:  $(TOP)/src/memjournal.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/memjournal.c
 
 mutex.o:       $(TOP)/src/mutex.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/mutex.c
 
 mutex_noop.o:  $(TOP)/src/mutex_noop.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_noop.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/mutex_noop.c
 
 mutex_unix.o:  $(TOP)/src/mutex_unix.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_unix.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/mutex_unix.c
 
 mutex_w32.o:   $(TOP)/src/mutex_w32.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/mutex_w32.c
 
 notify.o:      $(TOP)/src/notify.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/notify.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/notify.c
 
 pager.o:       $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/pager.c
 
 pcache.o:      $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/pcache.c
 
 pcache1.o:     $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/pcache1.c
 
 os.o:  $(TOP)/src/os.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/os.c
 
 os_kv.o:       $(TOP)/src/os_kv.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_kv.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/os_kv.c
 
 os_unix.o:     $(TOP)/src/os_unix.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/os_unix.c
 
 os_win.o:      $(TOP)/src/os_win.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/os_win.c
 
 pragma.o:      $(TOP)/src/pragma.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/pragma.c
 
 prepare.o:     $(TOP)/src/prepare.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/prepare.c
 
 printf.o:      $(TOP)/src/printf.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/printf.c
 
 random.o:      $(TOP)/src/random.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/random.c
 
 resolve.o:     $(TOP)/src/resolve.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/resolve.c
 
 rowset.o:      $(TOP)/src/rowset.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/rowset.c
 
 select.o:      $(TOP)/src/select.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/select.c
 
 status.o:      $(TOP)/src/status.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/status.c
 
 sqlite3.o:     sqlite3.h sqlite3.c
-       $(TCOMPILE) $(TEMP_STORE) -c sqlite3.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c sqlite3.c
 
 table.o:       $(TOP)/src/table.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/table.c
 
 threads.o:     $(TOP)/src/threads.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/threads.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/threads.c
 
 tokenize.o:    $(TOP)/src/tokenize.c keywordhash.h $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/tokenize.c
 
 treeview.o:    $(TOP)/src/treeview.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/treeview.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/treeview.c
 
 trigger.o:     $(TOP)/src/trigger.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/trigger.c
 
 update.o:      $(TOP)/src/update.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/update.c
 
 upsert.o:      $(TOP)/src/upsert.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/upsert.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/upsert.c
 
 utf.o: $(TOP)/src/utf.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/utf.c
 
 util.o:        $(TOP)/src/util.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/util.c
 
 vacuum.o:      $(TOP)/src/vacuum.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vacuum.c
 
 vdbe.o:        $(TOP)/src/vdbe.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vdbe.c
 
 vdbeapi.o:     $(TOP)/src/vdbeapi.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vdbeapi.c
 
 vdbeaux.o:     $(TOP)/src/vdbeaux.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vdbeaux.c
 
 vdbeblob.o:    $(TOP)/src/vdbeblob.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vdbeblob.c
 
 vdbemem.o:     $(TOP)/src/vdbemem.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vdbemem.c
 
 vdbesort.o:    $(TOP)/src/vdbesort.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbesort.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vdbesort.c
 
 vdbetrace.o:   $(TOP)/src/vdbetrace.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbetrace.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vdbetrace.c
 
 vdbevtab.o:    $(TOP)/src/vdbevtab.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbevtab.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vdbevtab.c
 
 vtab.o:        $(TOP)/src/vtab.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/vtab.c
 
 wal.o: $(TOP)/src/wal.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wal.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/wal.c
 
 walker.o:      $(TOP)/src/walker.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/walker.c
 
 where.o:       $(TOP)/src/where.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/where.c
 
 wherecode.o:   $(TOP)/src/wherecode.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/wherecode.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/wherecode.c
 
 whereexpr.o:   $(TOP)/src/whereexpr.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/whereexpr.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/whereexpr.c
 
 window.o:      $(TOP)/src/window.c $(HDR)
-       $(TCOMPILE) $(TEMP_STORE) -c $(TOP)/src/window.c
+       $(TCOMPILE) $(CFLAGS_libsqlite3) -c $(TOP)/src/window.c
 
 tclsqlite.o:   $(TOP)/src/tclsqlite.c $(HDR)
        $(TCOMPILE) -DUSE_TCL_STUBS=1 $(TCL_INCLUDE_SPEC) \
@@ -963,16 +1010,19 @@ mkkeywordhash$(BEXE): $(TOP)/tool/mkkeywordhash.c
 keywordhash.h: mkkeywordhash$(BEXE)
        ./mkkeywordhash$(BEXE) > $@
 
-
+# Static libsqlite3
+#
 $(libsqlite3.LIB): $(LIBOBJ)
        $(AR) crs $@ $(LIBOBJ)
 lib: $(libsqlite3.LIB)
 all: lib
 
-target_libsqlite3_so_1 = $(libsqlite3.SO)
-target_libsqlite3_so = $(target_libsqlite3_so_$(ENABLE_SHARED))
+# Dynamic libsqlite3
+#
 $(libsqlite3.SO):      $(LIBOBJ)
        $(TLINK_shared) -o $@ $(LIBOBJ) $(LDFLAGS_libsqlite3)
+target_libsqlite3_so_1 = $(libsqlite3.SO)
+target_libsqlite3_so = $(target_libsqlite3_so_$(ENABLE_SHARED))
 so: $(target_libsqlite3_so)
 all: so
 
@@ -988,26 +1038,28 @@ sqlite3-all.c:   sqlite3.c $(TOP)/tool/split-sqlite3c.tcl $(BTCLSH) # has_tclsh84
 # for reasons lost to history but having something to do with libtool
 # (which is not longer used in this tree).
 #
-install-so-1: $(install.libdir) $(libsqlite3.SO)
-       $(INSTALL) $(libsqlite3.SO) $(install.libdir); \
-       cd $(install.libdir); \
-               rm -f $(libsqlite3.SO).3 $(libsqlite3.SO).$(RELEASE); \
-               mv $(libsqlite3.SO) $(libsqlite3.SO).$(RELEASE); \
-               ln -s $(libsqlite3.SO).$(RELEASE) $(libsqlite3.SO).3; \
-               ln -s $(libsqlite3.SO).3 $(libsqlite3.SO)
-install-so-0:
+install-so-1: $(install-dir.lib) $(libsqlite3.SO)
+       $(INSTALL) $(libsqlite3.SO) $(install-dir.lib)
+       @echo "Setting up SO symlinks..."; \
+               cd $(install-dir.lib) || exit $$?; \
+               rm -f $(libsqlite3.SO).3 $(libsqlite3.SO).$(RELEASE) || exit $$?; \
+               mv $(libsqlite3.SO) $(libsqlite3.SO).$(RELEASE) || exit $$?; \
+               ln -s $(libsqlite3.SO).$(RELEASE) $(libsqlite3.SO).3 || exit $$?; \
+               ln -s $(libsqlite3.SO).3 $(libsqlite3.SO) || exit $$?; \
+               ls -la $(libsqlite3.SO) $(libsqlite3.SO).3 $(libsqlite3.SO).$(RELEASE)
+install-so-0 install-so-:
 install: install-so-$(ENABLE_SHARED)
 
 # Install $(libsqlite3.LIB)
 #
-install-lib: $(install.libdir) $(libsqlite3.LIB)
-       $(INSTALL_noexec) $(libsqlite3.LIB) $(install.libdir)
+install-lib: $(install-dir.lib) $(libsqlite3.LIB)
+       $(INSTALL_noexec) $(libsqlite3.LIB) $(install-dir.lib)
 install: install-lib
 
 # Install C header files
 #
-install-includes: sqlite3.h $(install.includedir)
-       $(INSTALL_noexec) sqlite3.h "$(TOP)/src/sqlite3ext.h" $(install.includedir)
+install-includes: sqlite3.h $(install-dir.include)
+       $(INSTALL_noexec) sqlite3.h "$(TOP)/src/sqlite3ext.h" $(install-dir.include)
 install: install-includes
 
 # libtclsqlite3...
@@ -1024,7 +1076,7 @@ $(libtclsqlite3.SO): tclsqlite.o $(libsqlite3.LIB)
 libtcl:        $(target_libtclsqlite3)
 all:   libtcl
 
-install.tcldir = "$(DESTDIR)$(TCLLIBDIR)"
+install.tcldir = $(DESTDIR)$(TCLLIBDIR)
 install-tcl-1: install-lib $(target_libtclsqlite3) pkgIndex.tcl
        @if [ "x$(DESTDIR)" = "x$(install.tcldir)" ]; then echo "TCLLIBDIR is not set." 1>&2; exit 1; fi
        $(INSTALL) -d $(install.tcldir)
@@ -1126,8 +1178,10 @@ TESTFIXTURE_SRC = $(TESTSRC) $(TOP)/src/tclsqlite.c
 TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION))
 
 testfixture$(TEXE):    has_tclconfig has_tclsh85 $(TESTFIXTURE_SRC)
-       $(TLINK) -DSQLITE_NO_SYNC=1 $(TEMP_STORE) $(TESTFIXTURE_FLAGS) \
-               -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) $(LDFLAGS_libsqlite3) $(TCL_INCLUDE_SPEC)
+       $(TLINK) -DSQLITE_NO_SYNC=1 $(TESTFIXTURE_FLAGS) \
+               -o $@ $(TESTFIXTURE_SRC) \
+               $(TCL_LIB_SPEC) $(TCL_INCLUDE_SPEC) \
+               $(CFLAGS_libsqlite3) $(LDFLAGS_libsqlite3)
 
 coretestprogs: testfixture$(BEXE) sqlite3$(BEXE)
 
@@ -1234,7 +1288,7 @@ sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl \
        $(BTCLSH) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqlite3_analyzer.c.in >sqlite3_analyzer.c
 
 sqlite3_analyzer$(TEXE): has_tclconfig sqlite3_analyzer.c
-       $(TLINK) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TCL_INCLUDE_SPEC) $(LDFLAGS_libsqlite3)
+       $(TLINK) sqlite3_analyzer.c -o $@ $(TCL_LIB_SPEC) $(TCL_INCLUDE_SPEC) $(LDFLAGS_libsqlite3)
 
 sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl \
             $(TOP)/ext/misc/appendvfs.c $(TOP)/tool/mkccode.tcl \
@@ -1242,7 +1296,7 @@ sqltclsh.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/sqltclsh.tcl \
        $(BTCLSH) $(TOP)/tool/mkccode.tcl $(TOP)/tool/sqltclsh.c.in >sqltclsh.c
 
 sqltclsh$(TEXE): has_tclconfig sqltclsh.c
-       $(TLINK) sqltclsh.c -o $@ $(LIBTCL) $(LDFLAGS_libsqlite3)
+       $(TLINK) sqltclsh.c -o $@ $(TCL_LIB_SPEC) $(LDFLAGS_libsqlite3)
 
 sqlite3_expert$(TEXE): $(TOP)/ext/expert/sqlite3expert.h $(TOP)/ext/expert/sqlite3expert.c \
                        $(TOP)/ext/expert/expert.c sqlite3.c
@@ -1263,7 +1317,7 @@ sqlite3_checker.c:        $(CHECKER_DEPS) has_tclsh85
        $(BTCLSH) $(TOP)/tool/mkccode.tcl $(TOP)/ext/repair/sqlite3_checker.c.in >$@
 
 sqlite3_checker$(TEXE):        has_tclconfig sqlite3_checker.c
-       $(TLINK) sqlite3_checker.c -o $@ $(LIBTCL) $(LDFLAGS_libsqlite3)
+       $(TLINK) sqlite3_checker.c -o $@ $(TCL_LIB_SPEC) $(LDFLAGS_libsqlite3)
 
 dbdump$(TEXE): $(TOP)/ext/misc/dbdump.c sqlite3.lo
        $(TLINK) -DDBDUMP_STANDALONE -o $@ \
@@ -1343,7 +1397,9 @@ tool-zip: testfixture$(TEXE) sqlite3$(TEXE) sqldiff$(TEXE) \
             sqlite3_analyzer$(TEXE) sqlite3_rsync$(TEXE) $(TOP)/tool/mktoolzip.tcl
        strip sqlite3$(TEXE) sqldiff$(TEXE) sqlite3_analyzer$(TEXE) sqlite3_rsync$(TEXE)
        ./testfixture$(TEXE) $(TOP)/tool/mktoolzip.tcl
-
+clean-tool-zip:
+       rm -f sqlite-tools-*.zip
+clean: clean-tool-zip
 #XX# TODO: adapt the autoconf amalgamation for autosetup
 #XX#
 #XX## Build the amalgamation-autoconf package.  The amalamgation-tarball target builds
@@ -1378,20 +1434,27 @@ threadtest5: sqlite3.c $(TOP)/test/threadtest5.c
        $(TLINK) $(TOP)/test/threadtest5.c sqlite3.c -o $@ $(LDFLAGS_libsqlite3)
 
 sqlite3$(TEXE):        shell.c sqlite3.c
-       $(TCCX) $(CFLAGS_readline) $(SHELL_OPT) -o $@ \
+       $(TCCX) $(CFLAGS_READLINE) $(SHELL_OPT) -o $@ \
                shell.c sqlite3.c \
                $(LDFLAGS_libsqlite3) $(LDFLAGS_READLINE)
+#
+# Build sqlite3$(TEXE) by default except in wasi-sdk builds.  Yes, the
+# semantics of 0 and 1 are confusingly swapped here.
+#
+target_sqlite3_shell_1 =
+target_sqlite3_shell_0 = sqlite3$(TEXE)
+all: $(target_sqlite3_shell_$(HAVE_WASI_SDK))
 
-install-cli-0: sqlite3$(TEXT) $(install.bindir)
-       $(INSTALL) -s sqlite3$(TEXT) $(install.bindir)
-install-cli-1:
-install: install-cli-$(HAVE_WASI_SDK)
+install-shell-0: sqlite3$(TEXT) $(install-dir.bin)
+       $(INSTALL) -s sqlite3$(TEXT) $(install-dir.bin)
+install-shell-1 install-shell-:
+install: install-shell-$(HAVE_WASI_SDK)
 
 sqldiff$(TEXE):        $(TOP)/tool/sqldiff.c $(TOP)/ext/misc/sqlite3_stdio.h sqlite3.o sqlite3.h
        $(TLINK) $(CFLAGS_stdio3) -o $@ $(TOP)/tool/sqldiff.c sqlite3.o $(LDFLAGS_libsqlite3)
 
-install-diff: sqldiff$(TEXE) $(install.bindir)
-       $(INSTALL) -s sqldiff$(TEXT) $(install.bindir)
+install-diff: sqldiff$(TEXE) $(install-dir.bin)
+       $(INSTALL) -s sqldiff$(TEXT) $(install-dir.bin)
 #install: install-diff
 
 dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.o sqlite3.h
@@ -1411,10 +1474,20 @@ RSYNC_OPT = \
 sqlite3_rsync$(TEXE):  $(RSYNC_SRC)
        $(TCCX) -o $@ $(RSYNC_OPT) $(RSYNC_SRC) $(LDFLAGS_libsqlite3)
 
-install-rsync: sqlite3_rsync$(TEXE) $(install.bindir)
-       $(INSTALL) sqlite3_rsync$(TEXT) $(install.bindir)
+install-rsync: sqlite3_rsync$(TEXE) $(install-dir.bin)
+       $(INSTALL) sqlite3_rsync$(TEXT) $(install-dir.bin)
 #install: install-rsync
 
+install-man1: $(install-dir.man1)
+       $(INSTALL_noexec) $(TOP)/sqlite3.1 $(install-dir.man1)
+install: install-man1
+
+#
+# sqlite3.pc is typically generated by the configure script but could
+# conceivably be generated by hand.
+install-pc: sqlite3.pc $(install-dir.pkgconfig)
+       $(INSTALL_noexec) sqlite3.pc $(install-dir.pkgconfig)
+
 scrub$(TEXE):  $(TOP)/ext/misc/scrub.c sqlite3.o
        $(TLINK) -o $@ -I. -DSCRUB_STANDALONE \
                $(TOP)/ext/misc/scrub.c sqlite3.o $(LDFLAGS_libsqlite3)
@@ -1647,11 +1720,11 @@ tidy:
        rm -f LogEst$(TEXE) fts3view$(TEXE) rollback-test$(TEXE) showdb$(TEXE)
        rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
        rm -f wordcount$(TEXE) changeset$(TEXE) version-info$(TEXE)
-       rm -f *.dll *.lib *.exp *.pc *.vsix *.so *.dylib pkgIndex.tcl
+       rm -f *.exp *.vsix pkgIndex.tcl
        rm -f sqlite3_analyzer$(TEXE) sqlite3_rsync$(TEXE) sqlite3_expert$(TEXE)
        rm -f mptester$(TEXE) rbu$(TEXE)        srcck1$(TEXE)
        rm -f fuzzershell$(TEXE) fuzzcheck$(TEXE) sqldiff$(TEXE) dbhash$(TEXE)
-       rm -f dbfuzz$(TEXE) dbfuzz2$(TEXE) dbfuzz2-asan$(TEXE) dbfuzz2-msan$(TEXE)
+       rm -f dbfuzz$(TEXE) dbfuzz2$(TEXE)
        rm -f fuzzcheck-asan$(TEXE) fuzzcheck-ubsan$(TEXE) ossshell$(TEXE)
        rm -f sessionfuzz$(TEXE)
        rm -f threadtest5$(TEXE)
@@ -1664,10 +1737,6 @@ tidy:
 #
 clean: tidy
        rm -rf omittest* testrunner* testdir*
-       -gmake -C ext/wasm distclean 2>/dev/null; true
 
 # Clean up everything.  No exceptions.
 distclean:     clean
-       rm -f sqlite_cfg.h config.log config.status $(JIMSH) Makefile
-       rm -f $(TOP)/tool/emcc.sh
-       -gmake -C ext/wasm distclean 2>/dev/null; true
index 57deec006a3c0e6c016cbffd80b82e117d4c3282..d690074f974f196f4fefe68f8e38f9ae154ce7a2 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,9 +1,9 @@
-C More\sbuild\scleanups\sand\sget\sit\sworking\swith\sBSD\smake\s(which\sapparently\sdoes\snot\ssupport\s$<\sand\sbehaves\sslightly\sdifferently\sthan\sgmake\swith\sX?=Y).
-D 2024-10-19T20:53:46.370
+C Generic\sbuild\scleanups\sand\sreorgs.
+D 2024-10-20T01:09:51.225
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
-F Makefile.in 6df46358ff2db2a88d18f8d827513d87a60525d75e3156a32220bf6f23344a03
+F Makefile.in 70a3accb7281cde5c9b8aac9501e1a1e4f935e567820fe58c2ee98e612a4cace
 F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
 F Makefile.msc 58b69eda1faad5d475092b8aeffab9156ee4901a82db089b166607f2ec907ee4
 F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
@@ -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 9573eee350d0fde25473d4a221e99d6bc818296ee59a06dd6e1770ac501a0da9
+F auto.def 573b50cfefc60cecb28548519ad7105c5af07ae611204d05a842339fc95986d1
 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
 F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
@@ -48,7 +48,7 @@ F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795f
 F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
 F autosetup/cc.tcl 7e2fe943ae9d45cf39e9f5b05b6230df8e719415edea5af06c30eb68680bde14
 F autosetup/default.auto 5cdf016de2140e50f1db190a02039dc42fb390af1dda4cc4853e3042a9ef0e82
-F autosetup/hwaci-common.tcl 940f337970affdc3958c49620cb4565f3e47956cbd65bb5c42f7d121699e2301
+F autosetup/hwaci-common.tcl 43fb22444faf261e7b23078cd15eaa235d59b2baefba1834750f79fcc4966e9d
 F autosetup/jimsh0.c 1b5fe91fffcddbc29f2b16acb80f1650632ea2edbe8336b8155ef7b4c66f6d8d
 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
 F autosetup/system.tcl 3a39d6e0b3bfba526fd39afe07c1d0d325e5a31925013a1ba7c671e1128e31bb
@@ -711,7 +711,7 @@ F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b5
 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
 F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
-F main.mk 5ca16e37a99044ef67f386e96a2ce5b39e0adcb8ecae0e709131c5a968eebb2a
+F main.mk 6b6d1deaa55692b21903573b24f2215dea8068cab5626928a3fed8ed86ec314f
 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
@@ -722,7 +722,7 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
 F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
 F sqlite3.1 acdff36db796e2d00225b911d3047d580cd136547298435426ce9d40347973cc
 F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
-F sqlite_cfg.h.in e820a04b0ea3da638858927513f5ac8a5e8b9a822b531ebfeeac32a2fa396dcd
+F sqlite_cfg.h.in be1d075cf77134d53fdf5cc2c0919842e7e02a648c66a56e735af25ccdcaff91
 F src/alter.c aa93e37e4a36a0525bbb2a2aeda20d2018f0aa995542c7dc658e031375e3f532
 F src/analyze.c 9a8b67239d899ac12289db5db3f5bfe7f7a0ad1277f80f87ead1d048085876eb
 F src/attach.c 08235ab62ed5ccc93c22bf36e640d19effcd632319615851bccf724ec9341333
@@ -2172,7 +2172,7 @@ F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6
 F tool/mksqlite3c.tcl c6acfdf4e4ef93478ff3ce3cd593e17abb03f446036ce710c3156bcfa18665e0
 F tool/mksqlite3h.tcl d391cff7cad0a372ee1406faee9ccc7dad9cb80a0c95cae0f73d10dd26e06762
 F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
-F tool/mktoolzip.tcl 1b3383c6cd1ca3e1bfdf157d1383f29d6264b9600c381e682789c83617dc1014
+F tool/mktoolzip.tcl 34b4e92be544f820e2cc26f143f7d5aec511e826ec394cc82969a5dcf7c7a27c
 F tool/mkvsix.tcl 67b40996a50f985a573278eea32fc5a5eb6110bdf14d33f1d8086e48c69e540a
 F tool/offsets.c 8ed2b344d33f06e71366a9b93ccedaa38c096cc1dbd4c3c26ad08c6115285845
 F tool/omittest-msvc.tcl d6b8f501ac1d7798c4126065030f89812379012cad98a1735d6d7221492abc08
@@ -2240,8 +2240,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 09905ed094f7102dbb4fc81b059452c50b48b0f3a2bd9736bed364b0639d89d7
-R 126cdd45532fc2c4fa2ebf63ee339ba7
+P dcf4fc78fb2813d37eb56c358009f1e5225f28a0c85c710c8127db330efaf319
+R 5d187fc41a2a5eefcf1982b38f70e6e6
 U stephan
-Z 1f20d077d4fd19ab2a63a6f4aa9c0e5c
+Z 98274b66f6dd84bbce9457a00b5c9351
 # Remove this line to create a well-formed Fossil manifest.
index daa62969d1f588b9709f2e3fed2d67bfb00aafe0..cd182c78984cd27f95e8b18446c782ffbea63808 100644 (file)
@@ -1 +1 @@
-dcf4fc78fb2813d37eb56c358009f1e5225f28a0c85c710c8127db330efaf319
+365a3d71cf9e0be11e7b3e90b6500142619102d8321c1d6f8111f37117a57929
index 8a6b5cc7a3c88910672febc7bf4f34020b8c2395..be6329e34186cbc3d11842f9add8c313109114a1 100644 (file)
 
 /* Define to the home page for this package. */
 /*#undef PACKAGE_URL*/
-#define PACKAGE_URL ""
+#define PACKAGE_URL @PACKAGE_URL@
 
 /* Define to the version of this package. */
 /*#undef PACKAGE_VERSION*/
index a5951168a80ebba72f912f5773c2ea6252e331c3..c22318441e13e816f1dca8f7c19f9158345160f4 100644 (file)
@@ -10,6 +10,7 @@
 #     sqlite3                 -- the SQLite CLI
 #     sqldiff                 -- Program to diff two databases
 #     sqlite3_analyzer        -- Space analyzer
+#     sqlite3_rsync           -- Remote db sync
 #
 switch $tcl_platform(os) {
   {Windows NT} {