@@ -57,6 +57,7 @@ LIBTCL = @TCL_LIB_SPEC@
5757#
5858READLINE_FLAGS = -DHAVE_READLINE=@TARGET_HAVE_READLINE@ @TARGET_READLINE_INC@
5959READLINE_FLAGS += -DHAVE_EDITLINE=@TARGET_HAVE_EDITLINE@
60+ READLINE_FLAGS += -DHAVE_LINENOISE=@TARGET_HAVE_LINENOISE@
6061
6162# The library that programs using readline() must link against.
6263#
@@ -706,6 +707,9 @@ fuzzcheck$(TEXE): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
706707fuzzcheck-asan$(TEXE ) : $(FUZZCHECK_SRC ) sqlite3.c sqlite3.h $(FUZZCHECK_DEP )
707708 $(LTLINK ) -o $@ -fsanitize=address $(FUZZCHECK_OPT ) $(FUZZCHECK_SRC ) sqlite3.c $(TLIBS )
708709
710+ fuzzcheck-ubsan$(TEXE ) : $(FUZZCHECK_SRC ) sqlite3.c sqlite3.h $(FUZZCHECK_DEP )
711+ $(LTLINK ) -o $@ -fsanitize=undefined $(FUZZCHECK_OPT ) $(FUZZCHECK_SRC ) sqlite3.c $(TLIBS )
712+
709713ossshell$(TEXE ) : $(TOP ) /test/ossfuzz.c $(TOP ) /test/ossshell.c sqlite3.c sqlite3.h
710714 $(LTLINK ) -o $@ $(FUZZCHECK_OPT ) $(TOP ) /test/ossshell.c \
711715 $(TOP)/test/ossfuzz.c sqlite3.c $(TLIBS)
@@ -765,13 +769,22 @@ mptest: mptester$(TEXE)
765769 $(MPTEST2 ) --journalmode DELETE
766770
767771
772+ has_tclsh84 :
773+ sh $(TOP ) /tool/cktclsh.sh 8.4 $(TCLSH_CMD )
774+ touch has_tclsh84
775+
776+ has_tclsh85 :
777+ sh $(TOP ) /tool/cktclsh.sh 8.5 $(TCLSH_CMD )
778+ touch has_tclsh85
779+
780+
768781# This target creates a directory named "tsrc" and fills it with
769782# copies of all of the C source code and header files needed to
770783# build on the target system. Some of the C source code and header
771784# files are automatically generated. This target takes care of
772785# all that automatic generation.
773786#
774- .target_source : $(SRC ) $(TOP ) /tool/vdbe-compress.tcl fts5.c
787+ .target_source : $(SRC ) $(TOP ) /tool/vdbe-compress.tcl has_tclsh84 fts5.c
775788 rm -rf tsrc
776789 mkdir tsrc
777790 cp -f $(SRC ) tsrc
@@ -781,15 +794,15 @@ mptest: mptester$(TEXE)
781794 cp fts5.c fts5.h tsrc
782795 touch .target_source
783796
784- sqlite3.c : .target_source $(TOP ) /tool/mksqlite3c.tcl src-verify
797+ sqlite3.c : .target_source $(TOP ) /tool/mksqlite3c.tcl src-verify has_tclsh84
785798 $(TCLSH_CMD ) $(TOP ) /tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS )
786799 cp tsrc/sqlite3ext.h .
787800 cp $(TOP ) /ext/session/sqlite3session.h .
788801
789- sqlite3r.h : sqlite3.h
802+ sqlite3r.h : sqlite3.h has_tclsh84
790803 $(TCLSH_CMD ) $(TOP ) /tool/mksqlite3h.tcl $(TOP ) --enable-recover > sqlite3r.h
791804
792- sqlite3r.c : sqlite3.c sqlite3r.h
805+ sqlite3r.c : sqlite3.c sqlite3r.h has_tclsh84
793806 cp $(TOP ) /ext/recover/sqlite3recover.c tsrc/
794807 cp $(TOP ) /ext/recover/sqlite3recover.h tsrc/
795808 cp $(TOP ) /ext/recover/dbdata.c tsrc/
@@ -804,7 +817,7 @@ tclsqlite3.c: sqlite3.c
804817 echo ' #endif /* USE_SYSTEM_SQLITE */' >> tclsqlite3.c
805818 cat $(TOP ) /src/tclsqlite.c >> tclsqlite3.c
806819
807- sqlite3-all.c : sqlite3.c $(TOP ) /tool/split-sqlite3c.tcl
820+ sqlite3-all.c : sqlite3.c $(TOP ) /tool/split-sqlite3c.tcl has_tclsh84
808821 $(TCLSH_CMD ) $(TOP ) /tool/split-sqlite3c.tcl
809822
810823# Rule to build the amalgamation
@@ -1092,10 +1105,10 @@ tclsqlite3$(TEXE): tclsqlite-shell.lo libsqlite3.la
10921105
10931106# Rules to build opcodes.c and opcodes.h
10941107#
1095- opcodes.c : opcodes.h $(TOP ) /tool/mkopcodec.tcl
1108+ opcodes.c : opcodes.h $(TOP ) /tool/mkopcodec.tcl has_tclsh84
10961109 $(TCLSH_CMD ) $(TOP ) /tool/mkopcodec.tcl opcodes.h > opcodes.c
10971110
1098- opcodes.h : parse.h $(TOP ) /src/vdbe.c $(TOP ) /tool/mkopcodeh.tcl
1111+ opcodes.h : parse.h $(TOP ) /src/vdbe.c $(TOP ) /tool/mkopcodeh.tcl has_tclsh84
10991112 cat parse.h $(TOP ) /src/vdbe.c | $(TCLSH_CMD ) $(TOP ) /tool/mkopcodeh.tcl > opcodes.h
11001113
11011114# Rules to build parse.c and parse.h - the outputs of lemon.
@@ -1106,10 +1119,10 @@ parse.c: $(TOP)/src/parse.y lemon$(BEXE)
11061119 cp $(TOP ) /src/parse.y .
11071120 ./lemon$(BEXE ) $(OPT_FEATURE_FLAGS ) $(OPTS ) -S parse.y
11081121
1109- sqlite3.h : $(TOP ) /src/sqlite.h.in $(TOP ) /manifest mksourceid$(BEXE ) $(TOP ) /VERSION
1122+ sqlite3.h : $(TOP ) /src/sqlite.h.in $(TOP ) /manifest mksourceid$(BEXE ) $(TOP ) /VERSION has_tclsh84
11101123 $(TCLSH_CMD ) $(TOP ) /tool/mksqlite3h.tcl $(TOP ) > sqlite3.h
11111124
1112- sqlite3rc.h : $(TOP ) /src/sqlite3.rc $(TOP ) /VERSION
1125+ sqlite3rc.h : $(TOP ) /src/sqlite3.rc $(TOP ) /VERSION has_tclsh84
11131126 echo ' #ifndef SQLITE_RESOURCE_VERSION' > $@
11141127 echo -n ' #define SQLITE_RESOURCE_VERSION ' >> $@
11151128 cat $(TOP ) /VERSION | $(TCLSH_CMD ) $(TOP ) /tool/replace.tcl exact . , >> $@
@@ -1145,7 +1158,7 @@ SHELL_SRC = \
11451158 $(TOP ) /ext/recover/sqlite3recover.h \
11461159 $(TOP ) /src/test_windirent.c
11471160
1148- shell.c : $(SHELL_SRC ) $(TOP ) /tool/mkshellc.tcl
1161+ shell.c : $(SHELL_SRC ) $(TOP ) /tool/mkshellc.tcl has_tclsh84
11491162 $(TCLSH_CMD ) $(TOP ) /tool/mkshellc.tcl > shell.c
11501163
11511164
@@ -1233,7 +1246,7 @@ fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE)
12331246
12341247fts5parse.h : fts5parse.c
12351248
1236- fts5.c : $(FTS5_SRC )
1249+ fts5.c : $(FTS5_SRC ) has_tclsh84
12371250 $(TCLSH_CMD ) $(TOP ) /ext/fts5/tool/mkfts5c.tcl
12381251 cp $(TOP ) /ext/fts5/fts5.h .
12391252
@@ -1267,7 +1280,7 @@ TESTFIXTURE_SRC1 = sqlite3.c
12671280TESTFIXTURE_SRC = $(TESTSRC ) $(TOP ) /src/tclsqlite.c
12681281TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION ) )
12691282
1270- testfixture$(TEXE ) : $(TESTFIXTURE_SRC )
1283+ testfixture$(TEXE ) : has_tclsh85 $(TESTFIXTURE_SRC )
12711284 $(LTLINK ) -DSQLITE_NO_SYNC=1 $(TEMP_STORE ) $(TESTFIXTURE_FLAGS ) \
12721285 -o $@ $(TESTFIXTURE_SRC ) $(LIBTCL ) $(TLIBS )
12731286
@@ -1291,11 +1304,17 @@ fulltestonly: $(TESTPROGS) fuzztest
12911304 ./testfixture$(TEXE ) $(TOP ) /test/full.test
12921305
12931306# Fuzz testing
1294- fuzztest : fuzzcheck$(TEXE ) $(FUZZDATA ) sessionfuzz$(TEXE ) $(TOP ) /test/sessionfuzz-data1.db
1307+ #
1308+ # WARNING: When the "fuzztest" target is run by the testrunner.tcl script,
1309+ # it does not actually run this code. Instead, it schedules equivalent
1310+ # commands. Therefore, if this target is updated, then code in
1311+ # testrunner_data.tcl (search for "trd_fuzztest_data") must also be updated.
1312+ #
1313+ fuzztest : fuzzcheck$(TEXE ) $(FUZZDATA ) sessionfuzz$(TEXE )
12951314 ./fuzzcheck$(TEXE ) $(FUZZDATA )
12961315 ./sessionfuzz$(TEXE ) run $(TOP ) /test/sessionfuzz-data1.db
12971316
1298- valgrindfuzz : fuzzcheck$(TEXT ) $(FUZZDATA ) sessionfuzz$(TEXE ) $( TOP ) /test/sessionfuzz-data1.db
1317+ valgrindfuzz : fuzzcheck$(TEXT ) $(FUZZDATA ) sessionfuzz$(TEXE )
12991318 valgrind ./fuzzcheck$(TEXE ) --cell-size-check --limit-mem 10M $(FUZZDATA )
13001319 valgrind ./sessionfuzz$(TEXE ) run $(TOP ) /test/sessionfuzz-data1.db
13011320
@@ -1314,10 +1333,10 @@ testrunner: testfixture$(TEXE)
13141333#
13151334devtest : srctree-check testfixture$(TEXE ) fuzztest testrunner
13161335
1317- mdevtest : srctree-check
1336+ mdevtest : srctree-check has_tclsh85
13181337 $(TCLSH_CMD ) $(TOP ) /test/testrunner.tcl mdevtest
13191338
1320- sdevtest :
1339+ sdevtest : has_tclsh85
13211340 $(TCLSH_CMD ) $(TOP ) /test/testrunner.tcl sdevtest
13221341
13231342# Validate that various generated files in the source tree
@@ -1357,13 +1376,13 @@ smoketest: $(TESTPROGS) fuzzcheck$(TEXE)
13571376shelltest : $(TESTPROGS )
13581377 ./testfixture$(TEXT ) $(TOP ) /test/permutations.test shell
13591378
1360- sqlite3_analyzer.c : sqlite3.c $(TOP ) /src/tclsqlite.c $(TOP ) /tool/spaceanal.tcl $(TOP ) /tool/mkccode.tcl $(TOP ) /tool/sqlite3_analyzer.c.in
1379+ sqlite3_analyzer.c : sqlite3.c $(TOP ) /src/tclsqlite.c $(TOP ) /tool/spaceanal.tcl $(TOP ) /tool/mkccode.tcl $(TOP ) /tool/sqlite3_analyzer.c.in has_tclsh85
13611380 $(TCLSH_CMD ) $(TOP ) /tool/mkccode.tcl $(TOP ) /tool/sqlite3_analyzer.c.in > sqlite3_analyzer.c
13621381
13631382sqlite3_analyzer$(TEXE ) : sqlite3_analyzer.c
13641383 $(LTLINK ) sqlite3_analyzer.c -o $@ $(LIBTCL ) $(TLIBS )
13651384
1366- sqltclsh.c : sqlite3.c $(TOP ) /src/tclsqlite.c $(TOP ) /tool/sqltclsh.tcl $(TOP ) /ext/misc/appendvfs.c $(TOP ) /tool/mkccode.tcl $(TOP ) /tool/sqltclsh.c.in
1385+ sqltclsh.c : sqlite3.c $(TOP ) /src/tclsqlite.c $(TOP ) /tool/sqltclsh.tcl $(TOP ) /ext/misc/appendvfs.c $(TOP ) /tool/mkccode.tcl $(TOP ) /tool/sqltclsh.c.in has_tclsh85
13671386 $(TCLSH_CMD ) $(TOP ) /tool/mkccode.tcl $(TOP ) /tool/sqltclsh.c.in > sqltclsh.c
13681387
13691388sqltclsh$(TEXE ) : sqltclsh.c
@@ -1382,7 +1401,7 @@ CHECKER_DEPS =\
13821401 $(TOP ) /ext/misc/btreeinfo.c \
13831402 $(TOP ) /ext/repair/sqlite3_checker.c.in
13841403
1385- sqlite3_checker.c : $(CHECKER_DEPS )
1404+ sqlite3_checker.c : $(CHECKER_DEPS ) has_tclsh85
13861405 $(TCLSH_CMD ) $(TOP ) /tool/mkccode.tcl $(TOP ) /ext/repair/sqlite3_checker.c.in > $@
13871406
13881407sqlite3_checker$(TEXE ) : sqlite3_checker.c
@@ -1468,6 +1487,11 @@ amalgamation-tarball: sqlite3.c sqlite3rc.h
14681487snapshot-tarball : sqlite3.c sqlite3rc.h
14691488 TOP=$(TOP ) sh $(TOP ) /tool/mkautoconfamal.sh --snapshot
14701489
1490+ # Build a ZIP archive containing various command-line tools.
1491+ #
1492+ tool-zip : testfixture sqlite3 sqldiff sqlite3_analyzer $(TOP ) /tool/mktoolzip.tcl
1493+ ./testfixture $(TOP ) /tool/mktoolzip.tcl
1494+
14711495# The next two rules are used to support the "threadtest" target. Building
14721496# threadtest runs a few thread-safety tests that are implemented in C. This
14731497# target is invoked by the releasetest.tcl script.
@@ -1543,6 +1567,7 @@ clean:
15431567 rm -f threadtest5
15441568 rm -f src-verify
15451569 rm -f custom.rws
1570+ rm -f has_tclsh84 has_tclsh85
15461571
15471572distclean : clean
15481573 rm -f sqlite_cfg.h config.log config.status libtool Makefile sqlite3.pc \
@@ -1587,7 +1612,7 @@ fiddle: sqlite3.c shell.c
15871612 @echo ' Updating custom dictionary from tool/custom.txt'
15881613 aspell --lang=en create master ./custom.rws < $<
15891614
1590- misspell : ./custom.rws
1615+ misspell : ./custom.rws has_tclsh84
15911616 $(TCLSH_CMD ) ./tool/spellsift.tcl ./src/* .c ./src/* .h ./src/* .in
15921617
15931618#
0 commit comments