1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Extend sqlite3.c makefile rule to support EXTRA_SRC=list-of-c-files to append to the generated sqlite3.c, as discussed in/around [forum:ccda88cf6f1754c5|forum post ccda88cf6f1754c5].

FossilOrigin-Name: 61676f1e18a405e4f3b6007488f2e68f3f55b312c107359ae5e52929f0c104c8
This commit is contained in:
stephan
2024-02-27 11:02:31 +00:00
7 changed files with 58 additions and 22 deletions

View File

@@ -817,7 +817,8 @@ has_tclsh85:
touch .target_source
sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl src-verify has_tclsh84
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS)
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS) \
$(EXTRA_SRC)
cp tsrc/sqlite3ext.h .
cp $(TOP)/ext/session/sqlite3session.h .
@@ -828,7 +829,8 @@ sqlite3r.c: sqlite3.c sqlite3r.h has_tclsh84
cp $(TOP)/ext/recover/sqlite3recover.c tsrc/
cp $(TOP)/ext/recover/sqlite3recover.h tsrc/
cp $(TOP)/ext/recover/dbdata.c tsrc/
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl --enable-recover $(AMALGAMATION_LINE_MACROS)
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl --enable-recover \
$(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC)
sqlite3ext.h: .target_source
cp tsrc/sqlite3ext.h .

View File

@@ -18,6 +18,13 @@ USE_AMALGAMATION = 1
!ENDIF
# <</mark>>
# Optionally set EXTRA_SRC to a list of C files to append to
# the generated sqlite3.c.
#
!IFNDEF EXTRA_SRC
EXTRA_SRC =
!ENDIF
# Set this non-0 to enable full warnings (-W4, etc) when compiling.
#
!IFNDEF USE_FULLWARN
@@ -1915,7 +1922,7 @@ mptest: mptester.exe
echo > .target_source
sqlite3.c: .target_source sqlite3ext.h sqlite3session.h $(MKSQLITE3C_TOOL) src-verify.exe
$(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS)
$(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS) $(EXTRA_SRC)
sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
$(TCLSH_CMD) $(TOP)\tool\split-sqlite3c.tcl

View File

@@ -18,6 +18,13 @@
TOP = .
# Optionally set EXTRA_SRC to a list of C files to append to
# the generated sqlite3.c.
#
!IFNDEF EXTRA_SRC
EXTRA_SRC =
!ENDIF
# Set this non-0 to enable full warnings (-W4, etc) when compiling.
#
!IFNDEF USE_FULLWARN

View File

@@ -230,7 +230,6 @@ SRC += \
SRC += \
$(TOP)/ext/misc/stmt.c
# FTS5 things
#
FTS5_HDR = \
@@ -661,7 +660,7 @@ target_source: $(SRC) $(TOP)/tool/vdbe-compress.tcl fts5.c
touch target_source
sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl src-verify
tclsh $(TOP)/tool/mksqlite3c.tcl
tclsh $(TOP)/tool/mksqlite3c.tcl $(EXTRA_SRC)
cp tsrc/sqlite3ext.h .
cp $(TOP)/ext/session/sqlite3session.h .
echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
@@ -673,7 +672,7 @@ sqlite3ext.h: target_source
cp tsrc/sqlite3ext.h .
sqlite3.c-debug: target_source $(TOP)/tool/mksqlite3c.tcl src-verify
tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros=1
tclsh $(TOP)/tool/mksqlite3c.tcl --linemacros=1 $(EXTRA_SRC)
echo '#ifndef USE_SYSTEM_SQLITE' >tclsqlite3.c
cat sqlite3.c >>tclsqlite3.c
echo '#endif /* USE_SYSTEM_SQLITE */' >>tclsqlite3.c

View File

@@ -1,11 +1,11 @@
C Allow\s"_"\scharacters\sto\sappear\sbetween\sany\stwo\sdigits\sin\san\sinteger,\sreal\sor\shexadecimal\sSQL\sliteral.
D 2024-02-27T10:52:41.798
C Extend\ssqlite3.c\smakefile\srule\sto\ssupport\sEXTRA_SRC=list-of-c-files\sto\sappend\sto\sthe\sgenerated\ssqlite3.c,\sas\sdiscussed\sin/around\s[forum:ccda88cf6f1754c5|forum\spost\sccda88cf6f1754c5].
D 2024-02-27T11:02:31.114
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F Makefile.in 216eea0cc5a9613d9f4f21402a4b759c2fce2a0cb9567513933562b65e30670b
F Makefile.in 3c4f4879b2301e5486939f68cc64f84430861d246ac11430ff1a1d7347ed5b8c
F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
F Makefile.msc a496ca640052c1e102daaa6e2d2216ae482f22995498c7c9492fd7f841481400
F Makefile.msc 15a875f6016c4200e7093db92365fabb8b32eb09f9e40e1aadeedeecad4050d5
F README.md 6358805260a03ebead84e168bbf3740ddf3f683b477e478567186aa7afb490d3
F VERSION c84541c6a9e8426462176fbb1f9ecb5cfd7d1bb56228053ff7eeba8841673eb6
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
@@ -17,7 +17,7 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
F autoconf/Makefile.msc ac338c36a338f6b49475da71930f45145a181d6b551578d5a7a64f113ef27b2c
F autoconf/Makefile.msc 7ac6c331fc3b8aa57b6782db995b8c0e49230352decd4e2662fd07c06a9ed623
F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7
F autoconf/README.txt 42cfd21d0b19dc7d5d85fb5c405c5f3c6a4c923021c39128f6ba685355d8fd56
F autoconf/configure.ac ec7fa914c5e74ff212fe879f9bb6918e1234497e05facfb641f30c4d5893b277
@@ -670,7 +670,7 @@ F ext/wasm/wasmfs.make 8a4955882aaa0783b3f60a9484a1f0f3d8b6f775c0fcd17c082f31966
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
F main.mk 678f023e03c5dca755570ed964a8355e44a6435f679e3763a6f9fe3d309f9986
F main.mk 2c8b556ba7a4a15f5440663f7b05da221355d1921d5c75298bb50e2bb8081d79
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
@@ -2106,7 +2106,7 @@ F tool/mkshellc.tcl b7adf08b82de60811d2cb6af05ff59fc17e5cd6f3e98743c14eaaa3f8971
F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6d0274f584a7f
F tool/mksqlite3c.tcl 2c760ab786cb509b47f00c96fea82994866cb99f5e046df81c768288f57897b4
F tool/mksqlite3c.tcl c6acfdf4e4ef93478ff3ce3cd593e17abb03f446036ce710c3156bcfa18665e0
F tool/mksqlite3h.tcl d391cff7cad0a372ee1406faee9ccc7dad9cb80a0c95cae0f73d10dd26e06762
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
F tool/mktoolzip.tcl c7a9b685f5131d755e7d941cec50cee7f34178b9e34c9a89811eeb08617f8423
@@ -2175,9 +2175,9 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 85dd79a6edecfc8c6307c6d215998f76dab086aa14528ddc64eb9955501becfd d57407ef59baf699b72c8c4859abfaa7977dd41f6f16eb8fe1d53a68806eb966
R 2bb770f6c73721aa4e91255456fc2d3d
T +closed d57407ef59baf699b72c8c4859abfaa7977dd41f6f16eb8fe1d53a68806eb966
U dan
Z 792e93767edab5c1fae195fbe183eb96
P 0e6700f43f133510c8049b2c5a2610cb3be29da7ed4d39b1fa65dc22c4cf529b 12ff5c5c4162951a29b638a5bc6cffa50e057c5a5e8f5e9c627af5f4ab1e4cdb
R 3761d49c69043110886de38dec3e1778
T +closed 12ff5c5c4162951a29b638a5bc6cffa50e057c5a5e8f5e9c627af5f4ab1e4cdb Closed\sby\sintegrate-merge.
U stephan
Z 795a2e3ba4d03563f379b9c2ce97fa52
# Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
0e6700f43f133510c8049b2c5a2610cb3be29da7ed4d39b1fa65dc22c4cf529b
61676f1e18a405e4f3b6007488f2e68f3f55b312c107359ae5e52929f0c104c8

View File

@@ -17,7 +17,7 @@
# After the "tsrc" directory has been created and populated, run
# this script:
#
# tclsh mksqlite3c.tcl
# tclsh mksqlite3c.tcl [flags] [extra source files]
#
# The amalgamated SQLite code will be written into sqlite3.c
#
@@ -42,6 +42,7 @@ set linemacros 0
set useapicall 0
set enable_recover 0
set srcdir tsrc
set extrasrc [list]
for {set i 0} {$i<[llength $argv]} {incr i} {
set x [lindex $argv $i]
@@ -63,8 +64,10 @@ for {set i 0} {$i<[llength $argv]} {incr i} {
} elseif {[regexp {^-?-((help)|\?)$} $x]} {
puts $help
exit 0
} else {
} elseif {[regexp {^-?-} $x]} {
error "unknown command-line option: $x"
} else {
lappend extrasrc $x
}
}
set in [open $srcdir/sqlite3.h]
@@ -349,6 +352,21 @@ proc copy_file {filename} {
section_comment "End of $tail"
}
# Read the source file named $filename and write it into the
# sqlite3.c output file. The only transformation is the trimming
# of EOL whitespace.
#
proc copy_file_verbatim {filename} {
global out
set in [open $filename r]
set tail [file tail $filename]
section_comment "Begin EXTRA_SRC file $tail"
while {![eof $in]} {
set line [string trimright [gets $in]]
puts $out $line
}
section_comment "End of EXTRA_SRC $tail"
}
# Process the source files. Process files containing commonly
# used subroutines first in order to help the compiler find
@@ -470,13 +488,16 @@ set flist {
sqlite3session.c
fts5.c
stmt.c
}
}
if {$enable_recover} {
lappend flist sqlite3recover.c dbdata.c
}
foreach file $flist {
copy_file $srcdir/$file
}
foreach file $extrasrc {
copy_file_verbatim $file
}
puts $out \
"/* Return the source-id for this library */