From ce236e031e04e0a4477cab2c83f66416f57f4517 Mon Sep 17 00:00:00 2001 From: stephan Date: Thu, 24 Oct 2024 04:34:39 +0000 Subject: [PATCH] Generic build cleanups. FossilOrigin-Name: be7b32a77f58ae3eb15cb828385035e63236b7e6c0669f90f2321f0509f0de1b --- Makefile.in | 38 +++++++++++---------- Makefile.linux-generic | 25 ++++++++++++-- main.mk | 76 +++++++++++++++++++++++------------------- manifest | 16 ++++----- manifest.uuid | 2 +- 5 files changed, 95 insertions(+), 62 deletions(-) diff --git a/Makefile.in b/Makefile.in index ac8fa6b925..6e1398a6e7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -127,10 +127,9 @@ TCC.sqlite += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite CFLAGS_JIMSH = @CFLAGS_JIMSH@ JIMSH = $(TOP)/jimsh$(TEXE) -# BTCLSH is the tclsh-compatible app used for running various code -# generators and other in-tree tools, as opposed to the TCL-based -# tests, which must be built and run using the canonical TCL -# distribution. +# +# $(BTCLSH) is documented in main.mk. +# BTCLSH = @BTCLSH@ $(BTCLSH): @@ -151,11 +150,14 @@ TCC += $(OPT_FEATURE_FLAGS) #XX# serve different purposes. TCC += $(OPTS) -# Version numbers and release number for the SQLite being compiled. # -# VERSION = @VERSION@ +# Release (X.Y.Z) and version (X.Y) numbers for the SQLite being +# compiled. +# RELEASE = @RELEASE@ +# VERSION = @VERSION@ # we don't currently use this anywhere +# # Filename extensions for binaries and libraries # BEXE = @BUILD_EXEEXT@ @@ -165,21 +167,25 @@ TDLL = @TARGET_DLLEXT@ BLIB = @BUILD_LIBEXT@ TLIB = @TARGET_LIBEXT@ -# The following variable is "1" if the configure script was able to locate -# the tclConfig.sh file. It is an empty string otherwise. When this -# variable is "1", the TCL extension library (libtclsqlite3.so) is built -# and installed. +# +# $(HAVE_TCL) is 1 if the configure script was able to locate the +# tclConfig.sh file, else it is 0. When this variable is 1, the TCL +# extension library (libtclsqlite3.so) and related testing apps are +# built. # HAVE_TCL = @HAVE_TCL@ -# This is the command to use for tclsh - normally just "tclsh", but we may -# know the specific version we want to use. This must point to the canonical -# TCL interpreter, not JimTCL. +# +# $(TCLSH_CMD) is the command to use for tclsh - normally just +# "tclsh", but we may know the specific version we want to use. This +# must point to a canonical TCL interpreter, not JimTCL. # TCLSH_CMD = @TCLSH_CMD@ TCL_CONFIG_SH = @TCL_CONFIG_SH@ +# # TCL config info from tclConfig.sh +# TCL_INCLUDE_SPEC = @TCL_INCLUDE_SPEC@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ @@ -188,11 +194,13 @@ TCL_VERSION = @TCL_VERSION@ TCLLIB_RPATH = @TCLLIB_RPATH@ TCLLIBDIR = @TCLLIBDIR@ +# # Additional options when running tests using testrunner.tcl # This is usually either blank, or else --status # TSTRNNR_OPTS = @TSTRNNR_OPTS@ +# # Where do we want to install the tcl plugin # TCLLIBDIR = @TCLLIBDIR@ @@ -217,10 +225,6 @@ TCOMPILE_EXTRAS += $(CFLAGS_GCOV$(USE_GCOV)) TLINK_EXTRAS += $(LDFLAGS_GCOV$(USE_GCOV)) # -# You should not have to change anything below this line -################################################################################ -# - # Vars with the AS_ prefix are specifically related to AutoSetup. # # AS_AUTO_DEF is the main configure script. diff --git a/Makefile.linux-generic b/Makefile.linux-generic index e019a3dc7c..712a7392da 100644 --- a/Makefile.linux-generic +++ b/Makefile.linux-generic @@ -10,15 +10,36 @@ # alternative. Create a copy of this file, edit the parameters # below and type "make". # -#### The toplevel directory of the source tree. This is the directory -# that contains this "Makefile.in" and the "configure.in" script. +# Maintenance note: because this is the template for Linux systems, it +# is assumed that the platform has GNU make and this file takes +# advantage of that. +# +#### +# +# $(TOP) = The toplevel directory of the source tree. This is the +# directory that contains this "Makefile.in" and "auto.def". # TOP ?= . +# +# $(CFLAGS) will be used when compiling the library and most +# utilities. Generally speaking, it must contain -fPIC on Linux +# systems. +# CFLAGS += -fPIC +# +# $(SHELL_OPT) contains CFLAGS for building the sqlite3 CLI shell. +# See main.mk for other potentially-relevant vars which may need +# tweaking, like $(LDFLAGS_READLINE). +# SHELL_OPT ?= -DHAVE_READLINE=1 +# +# Library's version number. +# +RELEASE ?= $(shell cat $(TOP)/VERSION 2>/dev/null) + # You should not have to change anything below this line ############################################################################### include $(TOP)/main.mk diff --git a/main.mk b/main.mk index e53f259028..1acc62ce78 100644 --- a/main.mk +++ b/main.mk @@ -3,7 +3,7 @@ ############################################################################### # 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. +# this one (as documented below). # # Maintenance reminders: # @@ -11,30 +11,31 @@ # POSIX Make compatible. "bmake" (BSD make) is available on most # Linux systems, so compatibility is relatively easy to test. # -#XX# Lines starting with #XX# are TODOs for the port to autosetup -# # The variables listed below must be defined before this script is # invoked. This file will use defaults, very possibly invalid, for any # which are not defined. ######################################################################## # -# $(RELEASE) = -# -# The MAJOR.MINOR.PATCH version number of this build. -RELEASE ?= MAJOR.MINOR.PATCH -# # $(TOP) = # # The toplevel directory of the source tree. For canonical builds # this is the directory that contains this "Makefile.in" and the # "configure.in" script. For out-of-tree builds, this will differ # from $(PWD). +# TOP ?= $(PWD) # +# $(RELEASE) = +# +# The MAJOR.MINOR.PATCH version number of this build. +# +RELEASE ?= +# # $(BCC) = # # C Compiler and options for use in building executables that will run # on the platform that is doing the build. +# BCC ?= $(CC) # # $(TCC) = @@ -43,12 +44,12 @@ BCC ?= $(CC) # on the target platform. This is usually the same as BCC, unless you # are cross-compiling. Note that it should only contain flags which # are used by _all_ build targets. Flags needed only by specific -# targets are defined elsewhere. +# targets are defined elsewhere and applied on a per-target basis. +# TCC ?= $(BCC) # # $(AR) = -# Tool used to build a static library from object files, including -# its arguments needed for doing so. +# Tool used to build a static library from object files. # AR ?= ar # @@ -56,11 +57,13 @@ AR ?= ar # # File extension for executables on the build platform. ".exe" for # Windows and "" everywhere else. +# BEXE ?= # # $(BDLL) and $(BLIB) = # # The DLL resp. static library counterparts of $(BEXE). +# BDLL ?= .so BLIB ?= .lib # @@ -68,17 +71,20 @@ BLIB ?= .lib # # File extension for executables on the target platform. ".exe" for # Windows and "" everywhere else. +# TEXE ?= # # $(TDLL) and $(TLIB) = # # The DLL resp. static library counterparts of $(TEXE). +# TDLL ?= .so TLIB ?= .lib # # $(TCLSH_CMD) = # # The canonical tclsh. +# TCLSH_CMD ?= tclsh # # JimTCL is part of the autosetup suite and is suitable for all @@ -89,6 +95,9 @@ TCLSH_CMD ?= tclsh # to build it with another option enabled for use with the various # code generators. # +# JIMSH requires a leading path component, even if it's ./, so that it +# can be used as a shell command. +# CFLAGS_JIMSH ?= -DHAVE_REALPATH JIMSH ?= ./jimsh$(TEXE) # @@ -114,7 +123,7 @@ BTCLSH ?= $(JIMSH) LDFLAGS_ZLIB ?= -lz LDFLAGS_MATH ?= -lm LDFLAGS_RPATH ?= -Wl,-rpath -Wl,$(prefix)/lib -LDFLAGS_READLINE ?= -lreadline +LDFLAGS_READLINE ?= -lreadline # these vary wildly across platforms CFLAGS_READLINE ?= LDFLAGS_PTHREAD ?= -lpthread LDFLAGS_DLOPEN ?= -ldl @@ -191,8 +200,10 @@ 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 ?= # # $(HAVE_WASI_SDK) = @@ -203,6 +214,19 @@ TCLLIB_RPATH ?= # HAVE_WASI_SDK ?= 0 # +# $(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. +# +CFLAGS_libsqlite3 ?= $(CFLAGS) +# +# $(TCC.sqlite) is $(TCC) 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. +# +TCC.sqlite ?= $(TCC) +# # ... and many, many more. Sane defaults are selected where possible. # # With the above-described defined, the rest of this make script will @@ -211,7 +235,10 @@ HAVE_WASI_SDK ?= 0 all: sqlite3.h sqlite3.c ######################################################################## -# Modifying what follows should not be necessary for most builds. +######################################################################## +# Modifying anything after this point should not be necessary for most +# builds. +######################################################################## ######################################################################## # @@ -226,13 +253,6 @@ INSTALL.noexec = $(INSTALL) -m 0644 # TCOMPILE = $(TCC) $(TCOMPILE_EXTRAS) -# -# $(TCC.sqlite) is $(TCC) 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 by the configure-generated -# makefile, so should not be overwritten here. -# -TCC.sqlite ?= $(TCC) # # $(CFLAGS_intree_includes) = -I... flags relevant specifically to # this tree, including any subdirectories commonly needed for building @@ -253,7 +273,7 @@ TCC.extension = $(TCOMPILE) -I. -I$(TOP)/src -DSQLITE_CORE # $(TLINK) = compiler invocation for when the target will be an # executable. # -# $(TLINK_EXTRAS) = config-specific flags for $(TLINK) +# $(TLINK_EXTRAS) = optional config-specific flags for $(TLINK) # TLINK = $(TCC.sqlite) $(TLINK_EXTRAS) # @@ -261,19 +281,6 @@ TLINK = $(TCC.sqlite) $(TLINK_EXTRAS) # TLINK.shared = $(TLINK) $(LDFLAGS_SHOBJ) -# -# $(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. -# -CFLAGS_libsqlite3 ?= $(CFLAGS) -DSQLITE_TEMP_STORE=1 - # # LDFLAGS_libsqlite3 should be used with any target which either # results in building libsqlite3.so, compiles sqlite3.c directly, or @@ -348,6 +355,7 @@ $(MAKE_SANITY_CHECK): $(MAKEFILE_LIST) @if [ x = "x$(TOP)" ]; then echo "Missing TOP var" 1>&2; exit 1; fi @if [ ! -d "$(TOP)" ]; then echo "$(TOP) is not a directory" 1>&2; exit 1; fi @if [ ! -f "$(TOP)/auto.def" ]; then echo "$(TOP) does not appear to be the top-most source dir" 1>&2; exit 1; fi + @if [ x = "x$(RELEASE)" ] then; then echo "RELEASE must be set to the library's X.Y.Z-format version number" 1>&2; exit 1; fi @if [ x = "x$(BCC)" ]; then echo "Missing BCC var" 1>&2; exit 1; fi @if [ x = "x$(TCC)" ]; then echo "Missing TCC var" 1>&2; exit 1; fi @if [ x = "x$(RELEASE)" ]; then echo "Missing RELEASE var" 1>&2; exit 1; fi diff --git a/manifest b/manifest index ed50768a13..40ee1c6bdf 100644 --- a/manifest +++ b/manifest @@ -1,10 +1,10 @@ -C Get\sMakefile.linux-generic\s(formerly\sMakefile.linux-gcc)\sworking\swith\sjimsh\sin\sout-of-tree\sbuilds.\sPass\son\s-DHAVE_READLINE=1\sto\sthe\ssqlite3\sshell\sif\sconfigure\sdetects\sit. -D 2024-10-24T03:50:40.281 +C Generic\sbuild\scleanups. +D 2024-10-24T04:34:39.658 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 57258abc6688381871956cd35dcd3017f56b7161487845597971597ff0b36d6f -F Makefile.linux-generic c44f7d97a1289b218a41299e4e9d120599ae86d1c61dfff49f1040a111fdfb08 w Makefile.linux-gcc +F Makefile.in e5cd4b271a3ffbe4fd4c13ca8852d82352a4db9e9003b412d81437d0d4309f23 +F Makefile.linux-generic e79bf7b51f2cc7513f0f673070ad528f3311ba178599f257cb4d04bbd968f497 F Makefile.msc 58b69eda1faad5d475092b8aeffab9156ee4901a82db089b166607f2ec907ee4 F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159 F VERSION 0db40f92c04378404eb45bff93e9e42c148c7e54fd3da99469ed21e22411f5a6 @@ -707,7 +707,7 @@ F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b5 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk bed344fb2a0fc6f096d556db166b146582f814cdf3cb85042e7efd458acd1ec4 +F main.mk 803569231944f6221794d4df9bd2623547f093570b8f0538767eca1cfa4a6566 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2236,8 +2236,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 85b2c73ccb85d7f5830a6fac692b380c5c79e7a54ee3fc6fc37343fa23816ef8 -R 294cb6b174d7e2114f1ad6f2164ffdf3 +P a555ff6dbc2ded5a9c65c8ef483f3197298848a580dda25ba0b721ba13167ad4 +R 3e8eef5052286b2a46e0f9665a9d13cf U stephan -Z 2ba08cb783ad323f3f33b67e1c19037f +Z 75f0c66b04971012069339b49ca2dbc2 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 147cd3bf76..2d335ed780 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a555ff6dbc2ded5a9c65c8ef483f3197298848a580dda25ba0b721ba13167ad4 +be7b32a77f58ae3eb15cb828385035e63236b7e6c0669f90f2321f0509f0de1b