@@ -23,7 +23,7 @@ TOP = @abs_srcdir@
2323#
2424BCC = @BUILD_CC@ @BUILD_CFLAGS@
2525
26- # TCC is the C Compile and options for use in building executables that
26+ # TCC is the C Compile and options for use in building executables that
2727# will run on the target platform. (BCC and TCC are usually the
2828# same unless your are cross-compiling.) Separate CC and CFLAGS macros
2929# are provide so that these aspects of the build process can be changed
@@ -33,10 +33,11 @@ CC = @CC@
3333CFLAGS = @CPPFLAGS@ @CFLAGS@
3434TCC = ${CC} ${CFLAGS} -I. -I${TOP}/src -I${TOP}/ext/rtree -I${TOP}/ext/icu
3535TCC += -I${TOP}/ext/fts3 -I${TOP}/ext/async -I${TOP}/ext/session
36+ TCC += -I${TOP}/ext/userauth
3637
3738# Define this for the autoconf-based build, so that the code knows it can
3839# include the generated config.h
39- #
40+ #
4041TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
4142
4243# Define -DNDEBUG to compile without debugging (i.e., for production usage)
@@ -67,7 +68,7 @@ LIBREADLINE = @TARGET_READLINE_LIBS@
6768TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@
6869
6970# Any target libraries which libsqlite must be linked against
70- #
71+ #
7172TLIBS = @LIBS@ $(LIBS )
7273
7374# Flags controlling use of the in memory btree implementation
@@ -79,8 +80,8 @@ TLIBS = @LIBS@ $(LIBS)
7980TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@
8081
8182# Enable/disable loadable extensions, and other optional features
82- # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
83- # The same set of OMIT and ENABLE flags should be passed to the
83+ # based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
84+ # The same set of OMIT and ENABLE flags should be passed to the
8485# LEMON parser generator and the mkkeywordhash tool as well.
8586OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
8687
@@ -127,8 +128,8 @@ SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
127128# If gcov support was enabled by the configure script, add the appropriate
128129# flags here. It's not always as easy as just having the user add the right
129130# CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which
130- # causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
131- # Supposedly GCC does the right thing if you use --coverage, but in
131+ # causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.
132+ # Supposedly GCC does the right thing if you use --coverage, but in
132133# practice it still fails. See:
133134#
134135# http://www.mail-archive.com/[email protected] /msg26197.html@@ -206,7 +207,7 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
206207 random.lo resolve.lo rowset.lo rtree.lo \
207208 sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
208209 table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
209- update.lo upsert.lo util.lo vacuum.lo \
210+ update.lo userauth.lo upsert.lo util.lo vacuum.lo \
210211 vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
211212 vdbetrace.lo wal.lo walker.lo where.lo wherecode.lo whereexpr.lo \
212213 window.lo utf.lo vtab.lo $(CRYPTOLIBOBJ )
@@ -375,6 +376,9 @@ SRC += \
375376SRC += \
376377 $(TOP ) /ext/session/sqlite3session.c \
377378 $(TOP ) /ext/session/sqlite3session.h
379+ SRC += \
380+ $(TOP ) /ext/userauth/userauth.c \
381+ $(TOP ) /ext/userauth/sqlite3userauth.h
378382SRC += \
379383 $(TOP ) /ext/rbu/sqlite3rbu.h \
380384 $(TOP ) /ext/rbu/sqlite3rbu.c
@@ -445,7 +449,7 @@ TESTSRC = \
445449 $(TOP ) /ext/fts3/fts3_term.c \
446450 $(TOP ) /ext/fts3/fts3_test.c \
447451 $(TOP ) /ext/session/test_session.c \
448- $(TOP ) /ext/rbu/test_rbu.c
452+ $(TOP ) /ext/rbu/test_rbu.c
449453
450454# Statically linked extensions
451455#
@@ -457,6 +461,7 @@ TESTSRC += \
457461 $(TOP ) /ext/misc/closure.c \
458462 $(TOP ) /ext/misc/csv.c \
459463 $(TOP ) /ext/misc/eval.c \
464+ $(TOP ) /ext/misc/explain.c \
460465 $(TOP ) /ext/misc/fileio.c \
461466 $(TOP ) /ext/misc/fuzzer.c \
462467 $(TOP ) /ext/fts5/fts5_tcl.c \
@@ -474,7 +479,8 @@ TESTSRC += \
474479 $(TOP ) /ext/misc/totype.c \
475480 $(TOP ) /ext/misc/unionvtab.c \
476481 $(TOP ) /ext/misc/wholenumber.c \
477- $(TOP ) /ext/misc/zipfile.c
482+ $(TOP ) /ext/misc/zipfile.c \
483+ $(TOP ) /ext/userauth/userauth.c
478484
479485# Source code to the library files needed by the test fixture
480486#
@@ -490,6 +496,7 @@ TESTSRC2 = \
490496 $(TOP ) /src/dbstat.c \
491497 $(TOP ) /src/expr.c \
492498 $(TOP ) /src/func.c \
499+ $(TOP ) /src/global.c \
493500 $(TOP ) /src/insert.c \
494501 $(TOP ) /src/wal.c \
495502 $(TOP ) /src/main.c \
@@ -526,7 +533,7 @@ TESTSRC2 = \
526533 $(TOP ) /ext/fts3/fts3_write.c \
527534 $(TOP ) /ext/async/sqlite3async.c \
528535 $(TOP ) /ext/session/sqlite3session.c \
529- $(TOP ) /ext/misc/stmt.c
536+ $(TOP ) /ext/misc/stmt.c
530537
531538# Header files used by all library source files.
532539#
@@ -579,6 +586,8 @@ EXTHDR += \
579586 $(TOP ) /ext/icu/sqliteicu.h
580587EXTHDR += \
581588 $(TOP ) /ext/rtree/sqlite3rtree.h
589+ EXTHDR += \
590+ $(TOP ) /ext/userauth/sqlite3userauth.h
582591
583592# executables needed for testing
584593#
@@ -598,7 +607,8 @@ FUZZDATA = \
598607 $(TOP ) /test/fuzzdata3.db \
599608 $(TOP ) /test/fuzzdata4.db \
600609 $(TOP ) /test/fuzzdata5.db \
601- $(TOP ) /test/fuzzdata6.db
610+ $(TOP ) /test/fuzzdata6.db \
611+ $(TOP ) /test/fuzzdata7.db
602612
603613# Standard options to testfixture
604614#
@@ -615,13 +625,14 @@ SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
615625SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
616626SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
617627SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
628+ SHELL_OPT += -DSQLITE_ENABLE_DESERIALIZE
618629SHELL_OPT += -DSQLITE_INTROSPECTION_PRAGMAS
619630FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
620631FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ
621632FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
622633FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000
623634FUZZCHECK_SRC = $(TOP ) /test/fuzzcheck.c $(TOP ) /test/ossfuzz.c
624- DBFUZZ_OPT =
635+ DBFUZZ_OPT =
625636
626637# This is the default Makefile target. The objects listed here
627638# are what get build when you type just "make" with no arguments.
@@ -645,9 +656,9 @@ libtclsqlite3.la: tclsqlite.lo libsqlcipher.la
645656 -version-info " 8:6:8" \
646657 -avoid-version
647658
648- sqlcipher$(TEXE ) : shell.c libsqlcipher.la
659+ sqlcipher$(TEXE ) : shell.c sqlite3.c
649660 $(LTLINK ) $(READLINE_FLAGS ) $(SHELL_OPT ) -o $@ \
650- shell.c libsqlcipher.la \
661+ shell.c sqlite3.c \
651662 $(LIBREADLINE ) $(TLIBS ) -rpath " $( libdir) "
652663
653664sqldiff$(TEXE ) : $(TOP ) /tool/sqldiff.c sqlite3.lo sqlite3.h
@@ -683,6 +694,22 @@ sessionfuzz$(TEXE): $(TOP)/test/sessionfuzz.c sqlite3.c sqlite3.h
683694dbfuzz$(TEXE ) : $(TOP ) /test/dbfuzz.c sqlite3.c sqlite3.h
684695 $(LTLINK ) -o $@ $(DBFUZZ_OPT ) $(TOP ) /test/dbfuzz.c sqlite3.c $(TLIBS )
685696
697+ DBFUZZ2_OPTS = \
698+ -DSQLITE_THREADSAFE=0 \
699+ -DSQLITE_OMIT_LOAD_EXTENSION \
700+ -DSQLITE_ENABLE_DESERIALIZE \
701+ -DSQLITE_DEBUG \
702+ -DSQLITE_ENABLE_DBSTAT_VTAB \
703+ -DSQLITE_ENABLE_RTREE \
704+ -DSQLITE_ENABLE_FTS4 \
705+ -DSQLITE_EANBLE_FTS5
706+
707+ dbfuzz2 : $(TOP ) /test/dbfuzz2.c sqlite3.c sqlite3.h
708+ clang-6.0 -I. -g -O0 -fsanitize=fuzzer,undefined,address -o dbfuzz2 \
709+ $(DBFUZZ2_OPTS ) $(TOP ) /test/dbfuzz2.c sqlite3.c
710+ mkdir -p dbfuzz2-dir
711+ cp $(TOP ) /test/dbfuzz2-seed* dbfuzz2-dir
712+
686713mptester$(TEXE ) : sqlite3.lo $(TOP ) /mptest/mptest.c
687714 $(LTLINK ) -o $@ -I. $(TOP ) /mptest/mptest.c sqlite3.lo \
688715 $(TLIBS ) -rpath " $( libdir) "
@@ -1131,7 +1158,10 @@ fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
11311158rtree.lo : $(TOP ) /ext/rtree/rtree.c $(HDR ) $(EXTHDR )
11321159 $(LTCOMPILE ) -DSQLITE_CORE -c $(TOP ) /ext/rtree/rtree.c
11331160
1134- sqlite3session.lo : $(TOP ) /ext/session/sqlite3session.c $(HDR ) $(EXTHDR )
1161+ sqlite3session.lo : $(TOP ) /ext/userauth/userauth.c $(HDR ) $(EXTHDR )
1162+ $(LTCOMPILE ) -DSQLITE_CORE -c $(TOP ) /ext/userauth/userauth.c
1163+
1164+ userauth.lo : $(TOP ) /ext/session/sqlite3session.c $(HDR ) $(EXTHDR )
11351165 $(LTCOMPILE ) -DSQLITE_CORE -c $(TOP ) /ext/session/sqlite3session.c
11361166
11371167json1.lo : $(TOP ) /ext/misc/json1.c
@@ -1159,7 +1189,7 @@ FTS5_SRC = \
11591189 $(TOP ) /ext/fts5/fts5_varint.c \
11601190 $(TOP ) /ext/fts5/fts5_vocab.c \
11611191
1162- fts5parse.c : $(TOP ) /ext/fts5/fts5parse.y lemon
1192+ fts5parse.c : $(TOP ) /ext/fts5/fts5parse.y lemon
11631193 cp $(TOP ) /ext/fts5/fts5parse.y .
11641194 rm -f fts5parse.h
11651195 ./lemon$(BEXE ) $(OPTS ) fts5parse.y
@@ -1186,7 +1216,7 @@ sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR)
11861216#
11871217TESTFIXTURE_FLAGS = -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
11881218TESTFIXTURE_FLAGS += -DTCLSH_INIT_PROC=sqlite3TestInit
1189- TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
1219+ TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
11901220TESTFIXTURE_FLAGS += -DBUILD_sqlite
11911221TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
11921222TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
@@ -1202,6 +1232,10 @@ testfixture$(TEXE): $(TESTFIXTURE_SRC)
12021232 $(LTLINK ) -DSQLITE_NO_SYNC=1 $(TEMP_STORE ) $(TESTFIXTURE_FLAGS ) \
12031233 -o $@ $(TESTFIXTURE_SRC ) $(LIBTCL ) $(TLIBS )
12041234
1235+ coretestprogs : $(TESTPROGS )
1236+
1237+ testprogs : coretestprogs srcck1$(BEXE ) fuzzcheck$(TEXE ) sessionfuzz$(TEXE )
1238+
12051239# A very detailed test running most or all test cases
12061240fulltest : $(TESTPROGS ) fuzztest
12071241 ./testfixture$(TEXE ) $(TOP ) /test/all.test $(TESTOPTS )
@@ -1261,7 +1295,7 @@ sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl $
12611295sqlite3_analyzer$(TEXE ) : sqlite3_analyzer.c
12621296 $(LTLINK ) sqlite3_analyzer.c -o $@ $(LIBTCL ) $(TLIBS )
12631297
1264- 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
1298+ 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
12651299 $(TCLSH_CMD ) $(TOP ) /tool/mkccode.tcl $(TOP ) /tool/sqltclsh.c.in > sqltclsh.c
12661300
12671301sqltclsh$(TEXE ) : sqltclsh.c
@@ -1308,6 +1342,9 @@ showshm$(TEXE): $(TOP)/tool/showshm.c
13081342changeset$(TEXE ) : $(TOP ) /ext/session/changeset.c sqlite3.lo
13091343 $(LTLINK ) -o $@ $(TOP ) /ext/session/changeset.c sqlite3.lo $(TLIBS )
13101344
1345+ changesetfuzz$(TEXE ) : $(TOP ) /ext/session/changesetfuzz.c sqlite3.lo
1346+ $(LTLINK ) -o $@ $(TOP ) /ext/session/changesetfuzz.c sqlite3.lo $(TLIBS )
1347+
13111348rollback-test$(TEXE ) : $(TOP ) /tool/rollback-test.c sqlite3.lo
13121349 $(LTLINK ) -o $@ $(TOP ) /tool/rollback-test.c sqlite3.lo $(TLIBS )
13131350
@@ -1328,7 +1365,7 @@ KV_OPT += -DSQLITE_DIRECT_OVERFLOW_READ
13281365kvtest$(TEXE ) : $(TOP ) /test/kvtest.c sqlite3.c
13291366 $(LTLINK ) $(KV_OPT ) -o $@ $(TOP ) /test/kvtest.c sqlite3.c $(TLIBS )
13301367
1331- rbu$(EXE ) : $(TOP ) /ext/rbu/rbu.c $(TOP ) /ext/rbu/sqlite3rbu.c sqlite3.lo
1368+ rbu$(EXE ) : $(TOP ) /ext/rbu/rbu.c $(TOP ) /ext/rbu/sqlite3rbu.c sqlite3.lo
13321369 $(LTLINK ) -I. -o $@ $(TOP ) /ext/rbu/rbu.c sqlite3.lo $(TLIBS )
13331370
13341371loadfts$(EXE ) : $(TOP ) /tool/loadfts.c libsqlite3.la
@@ -1356,7 +1393,7 @@ snapshot-tarball: sqlite3.c
13561393# The next two rules are used to support the "threadtest" target. Building
13571394# threadtest runs a few thread-safety tests that are implemented in C. This
13581395# target is invoked by the releasetest.tcl script.
1359- #
1396+ #
13601397THREADTEST3_SRC = $(TOP ) /test/threadtest3.c \
13611398 $(TOP ) /test/tt3_checkpoint.c \
13621399 $(TOP ) /test/tt3_index.c \
@@ -1370,7 +1407,7 @@ threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC)
13701407threadtest : threadtest3$(TEXE )
13711408 ./threadtest3$(TEXE )
13721409
1373- releasetest :
1410+ releasetest :
13741411 $(TCLSH_CMD ) $(TOP ) /test/releasetest.tcl
13751412
13761413# Standard install and cleanup targets
0 commit comments