@@ -46,7 +46,7 @@ TCC += @TCL_INCLUDE_SPEC@
4646
4747# The library that programs using TCL must link against.
4848#
49- LIBTCL = @TCL_LIB_SPEC@ @TCL_LIBS@
49+ LIBTCL = @TCL_LIB_SPEC@
5050
5151# Compiler options needed for programs that use the readline() library.
5252#
@@ -135,12 +135,19 @@ LTLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV))
135135# BEGIN CRYPTO
136136CRYPTOLIBOBJ = \
137137 crypto.lo \
138- crypto_impl.lo
138+ crypto_impl.lo \
139+ crypto_openssl.lo \
140+ crypto_libtomcrypt.lo \
141+ crypto_cc.lo
139142
140143CRYPTOSRC = \
141144 $(TOP ) /src/crypto.h \
145+ $(TOP ) /src/sqlcipher.h \
142146 $(TOP ) /src/crypto.c \
143- $(TOP ) /src/crypto_impl.c
147+ $(TOP ) /src/crypto_impl.c \
148+ $(TOP ) /src/crypto_libtomcrypt.c \
149+ $(TOP ) /src/crypto_openssl.c \
150+ $(TOP ) /src/crypto_cc.c
144151
145152# END CRYPTO
146153
@@ -153,7 +160,7 @@ exec_prefix = @exec_prefix@
153160libdir = @libdir@
154161pkgconfigdir = $(libdir ) /pkgconfig
155162bindir = @bindir@
156- includedir = @includedir@
163+ includedir = @includedir@/sqlcipher
157164INSTALL = @INSTALL@
158165LIBTOOL = ./libtool
159166ALLOWRELEASE = @ALLOWRELEASE@
@@ -179,6 +186,7 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
179186 expr.lo fault.lo fkey.lo \
180187 fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
181188 fts3_porter.lo fts3_snippet.lo fts3_tokenizer.lo fts3_tokenizer1.lo \
189+ fts3_tokenize_vtab.lo \
182190 fts3_unicode.lo fts3_unicode2.lo fts3_write.lo \
183191 func.lo global.lo hash.lo \
184192 icu.lo insert.lo journal.lo legacy.lo loadext.lo \
@@ -329,6 +337,7 @@ SRC += \
329337 $(TOP ) /ext/fts3/fts3_tokenizer.h \
330338 $(TOP ) /ext/fts3/fts3_tokenizer.c \
331339 $(TOP ) /ext/fts3/fts3_tokenizer1.c \
340+ $(TOP ) /ext/fts3/fts3_tokenize_vtab.c \
332341 $(TOP ) /ext/fts3/fts3_unicode.c \
333342 $(TOP ) /ext/fts3/fts3_unicode2.c \
334343 $(TOP ) /ext/fts3/fts3_write.c
@@ -370,8 +379,8 @@ TESTSRC = \
370379 $(TOP ) /src/test_config.c \
371380 $(TOP ) /src/test_demovfs.c \
372381 $(TOP ) /src/test_devsym.c \
382+ $(TOP ) /src/test_fs.c \
373383 $(TOP ) /src/test_func.c \
374- $(TOP ) /src/test_fuzzer.c \
375384 $(TOP ) /src/test_hexio.c \
376385 $(TOP ) /src/test_init.c \
377386 $(TOP ) /src/test_intarray.c \
@@ -392,11 +401,22 @@ TESTSRC = \
392401 $(TOP ) /src/test_tclvar.c \
393402 $(TOP ) /src/test_thread.c \
394403 $(TOP ) /src/test_vfs.c \
395- $(TOP ) /src/test_wholenumber.c \
396404 $(TOP ) /src/test_wsd.c \
397405 $(TOP ) /ext/fts3/fts3_term.c \
398406 $(TOP ) /ext/fts3/fts3_test.c
399407
408+ # Statically linked extensions
409+ #
410+ TESTSRC += \
411+ $(TOP ) /ext/misc/amatch.c \
412+ $(TOP ) /ext/misc/closure.c \
413+ $(TOP ) /ext/misc/fuzzer.c \
414+ $(TOP ) /ext/misc/ieee754.c \
415+ $(TOP ) /ext/misc/nextchar.c \
416+ $(TOP ) /ext/misc/regexp.c \
417+ $(TOP ) /ext/misc/spellfix.c \
418+ $(TOP ) /ext/misc/wholenumber.c
419+
400420# Source code to the library files needed by the test fixture
401421#
402422TESTSRC2 = \
@@ -411,6 +431,7 @@ TESTSRC2 = \
411431 $(TOP ) /src/func.c \
412432 $(TOP ) /src/insert.c \
413433 $(TOP ) /src/wal.c \
434+ $(TOP ) /src/main.c \
414435 $(TOP ) /src/mem5.c \
415436 $(TOP ) /src/os.c \
416437 $(TOP ) /src/os_unix.c \
@@ -489,30 +510,35 @@ EXTHDR += \
489510# This is the default Makefile target. The objects listed here
490511# are what get build when you type just "make" with no arguments.
491512#
492- all : sqlite3.h libsqlite3 .la sqlite3 $(TEXE ) $(HAVE_TCL:1=libtclsqlite3.la )
513+ all : sqlite3.h libsqlcipher .la sqlcipher $(TEXE ) $(HAVE_TCL:1=libtclsqlite3.la )
493514
494515Makefile : $(TOP ) /Makefile.in
495516 ./config.status
496517
497- sqlite3 .pc : $(TOP ) /sqlite3 .pc.in
518+ sqlcipher .pc : $(TOP ) /sqlcipher .pc.in
498519 ./config.status
499520
500- libsqlite3 .la : $(LIBOBJ )
521+ libsqlcipher .la : $(LIBOBJ )
501522 $(LTLINK ) -o $@ $(LIBOBJ ) $(TLIBS ) \
502523 ${ALLOWRELEASE} -rpath " $( libdir) " -version-info " 8:6:8"
503524
504- libtclsqlite3.la : tclsqlite.lo libsqlite3 .la
525+ libtclsqlite3.la : tclsqlite.lo libsqlcipher .la
505526 $(LTLINK ) -o $@ tclsqlite.lo \
506- libsqlite3 .la @TCL_STUB_LIB_SPEC@ $(TLIBS ) \
527+ libsqlcipher .la @TCL_STUB_LIB_SPEC@ $(TLIBS ) \
507528 -rpath " $( TCLLIBDIR) " \
508529 -version-info " 8:6:8" \
509530 -avoid-version
510531
511- sqlite3 $(TEXE ) : $(TOP ) /src/shell.c libsqlite3 .la sqlite3.h
532+ sqlcipher $(TEXE ) : $(TOP ) /src/shell.c libsqlcipher .la sqlite3.h
512533 $(LTLINK ) $(READLINE_FLAGS ) \
513- -o $@ $(TOP ) /src/shell.c libsqlite3 .la \
534+ -o $@ $(TOP ) /src/shell.c libsqlcipher .la \
514535 $(LIBREADLINE ) $(TLIBS ) -rpath " $( libdir) "
515536
537+ mptester$(EXE ) : sqlite3.c $(TOP ) /mptest/mptest.c
538+ $(LTLINK ) -o $@ -I. $(TOP ) /mptest/mptest.c sqlite3.c \
539+ $(TLIBS ) -rpath " $( libdir) "
540+
541+
516542# This target creates a directory named "tsrc" and fills it with
517543# copies of all of the C source code and header files needed to
518544# build on the target system. Some of the C source code and header
@@ -530,6 +556,7 @@ sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
530556
531557sqlite3.c : .target_source $(TOP ) /tool/mksqlite3c.tcl
532558 $(TCLSH_CMD ) $(TOP ) /tool/mksqlite3c.tcl
559+ cp tsrc/shell.c tsrc/sqlite3ext.h .
533560
534561tclsqlite3.c : sqlite3.c
535562 echo ' #ifndef USE_SYSTEM_SQLITE' > tclsqlite3.c
@@ -568,6 +595,12 @@ crypto.lo: $(TOP)/src/crypto.c $(HDR)
568595 $(LTCOMPILE ) -c $(TOP ) /src/crypto.c
569596crypto_impl.lo : $(TOP ) /src/crypto_impl.c $(HDR )
570597 $(LTCOMPILE ) -c $(TOP ) /src/crypto_impl.c
598+ crypto_openssl.lo : $(TOP ) /src/crypto_openssl.c $(HDR )
599+ $(LTCOMPILE ) -c $(TOP ) /src/crypto_openssl.c
600+ crypto_libtomcrypt.lo : $(TOP ) /src/crypto_libtomcrypt.c $(HDR )
601+ $(LTCOMPILE ) -c $(TOP ) /src/crypto_libtomcrypt.c
602+ crypto_cc.lo : $(TOP ) /src/crypto_cc.c $(HDR )
603+ $(LTCOMPILE ) -c $(TOP ) /src/crypto_cc.c
571604# END CRYPTO
572605
573606# Rules to build individual *.o files from files in the src directory.
@@ -788,9 +821,9 @@ tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR)
788821tclsqlite-stubs.lo : $(TOP ) /src/tclsqlite.c $(HDR )
789822 $(LTCOMPILE ) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP ) /src/tclsqlite.c
790823
791- tclsqlite3 $(TEXE ) : tclsqlite-shell.lo libsqlite3 .la
824+ tclsqlcipher $(TEXE ) : tclsqlite-shell.lo libsqlcipher .la
792825 $(LTLINK ) -o $@ tclsqlite-shell.lo \
793- libsqlite3 .la $(LIBTCL )
826+ libsqlcipher .la $(LIBTCL )
794827
795828# Rules to build opcodes.c and opcodes.h
796829#
@@ -870,6 +903,9 @@ fts3_tokenizer.lo: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR)
870903fts3_tokenizer1.lo : $(TOP ) /ext/fts3/fts3_tokenizer1.c $(HDR ) $(EXTHDR )
871904 $(LTCOMPILE ) -DSQLITE_CORE -c $(TOP ) /ext/fts3/fts3_tokenizer1.c
872905
906+ fts3_tokenize_vtab.lo : $(TOP ) /ext/fts3/fts3_tokenize_vtab.c $(HDR ) $(EXTHDR )
907+ $(LTCOMPILE ) -DSQLITE_CORE -c $(TOP ) /ext/fts3/fts3_tokenize_vtab.c
908+
873909fts3_unicode.lo : $(TOP ) /ext/fts3/fts3_unicode.c $(HDR ) $(EXTHDR )
874910 $(LTCOMPILE ) -DSQLITE_CORE -c $(TOP ) /ext/fts3/fts3_unicode.c
875911
@@ -886,30 +922,34 @@ rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
886922# Rules to build the 'testfixture' application.
887923#
888924# If using the amalgamation, use sqlite3.c directly to build the test
889- # fixture. Otherwise link against libsqlite3 .la. (This distinction is
925+ # fixture. Otherwise link against libsqlcipher .la. (This distinction is
890926# necessary because the test fixture requires non-API symbols which are
891927# hidden when the library is built via the amalgamation).
892928#
893929TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
894930TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
895931TESTFIXTURE_FLAGS += -DBUILD_sqlite
896932
897- TESTFIXTURE_SRC0 = $(TESTSRC2 ) libsqlite3 .la
933+ TESTFIXTURE_SRC0 = $(TESTSRC2 ) libsqlcipher .la
898934TESTFIXTURE_SRC1 = sqlite3.c
899- TESTFIXTURE_SRC = $(TESTSRC ) $(TOP ) /src/tclsqlite.c $(TESTFIXTURE_SRC$(USE_AMALGAMATION ) )
935+ TESTFIXTURE_SRC = $(TESTSRC ) $(TOP ) /src/tclsqlite.c
936+ TESTFIXTURE_SRC += $(TESTFIXTURE_SRC$(USE_AMALGAMATION ) )
900937
901938testfixture$(TEXE ) : $(TESTFIXTURE_SRC )
902939 $(LTLINK ) -DSQLITE_NO_SYNC=1 $(TEMP_STORE ) $(TESTFIXTURE_FLAGS ) \
903940 -o $@ $(TESTFIXTURE_SRC ) $(LIBTCL ) $(TLIBS )
904941
905942
906- fulltest : testfixture$(TEXE ) sqlite3 $(TEXE )
943+ fulltest : testfixture$(TEXE ) sqlcipher $(TEXE )
907944 ./testfixture$(TEXE ) $(TOP ) /test/all.test
908945
909- soaktest : testfixture$(TEXE ) sqlite3 $(TEXE )
946+ soaktest : testfixture$(TEXE ) sqlcipher $(TEXE )
910947 ./testfixture$(TEXE ) $(TOP ) /test/all.test -soak=1
911948
912- test : testfixture$(TEXE ) sqlite3$(TEXE )
949+ fulltestonly : testfixture$(TEXE ) sqlcipher$(TEXE )
950+ ./testfixture$(TEXE ) $(TOP ) /test/full.test
951+
952+ test : testfixture$(TEXE ) sqlcipher$(TEXE )
913953 ./testfixture$(TEXE ) $(TOP ) /test/veryquick.test
914954
915955sqlite3_analyzer.c : sqlite3.c $(TOP ) /src/test_stat.c $(TOP ) /src/tclsqlite.c $(TOP ) /tool/spaceanal.tcl
@@ -925,18 +965,18 @@ sqlite3_analyzer$(TEXE): sqlite3_analyzer.c
925965
926966# Standard install and cleanup targets
927967#
928- lib_install : libsqlite3 .la
968+ lib_install : libsqlcipher .la
929969 $(INSTALL ) -d $(DESTDIR )$(libdir )
930- $(LTINSTALL ) libsqlite3 .la $(DESTDIR )$(libdir )
970+ $(LTINSTALL ) libsqlcipher .la $(DESTDIR )$(libdir )
931971
932- install : sqlite3 $(BEXE ) lib_install sqlite3.h sqlite3 .pc ${HAVE_TCL:1=tcl_install}
972+ install : sqlcipher $(BEXE ) lib_install sqlite3.h sqlcipher .pc ${HAVE_TCL:1=tcl_install}
933973 $(INSTALL ) -d $(DESTDIR )$(bindir )
934- $(LTINSTALL ) sqlite3 $(BEXE ) $(DESTDIR )$(bindir )
974+ $(LTINSTALL ) sqlcipher $(BEXE ) $(DESTDIR )$(bindir )
935975 $(INSTALL ) -d $(DESTDIR )$(includedir )
936976 $(INSTALL ) -m 0644 sqlite3.h $(DESTDIR )$(includedir )
937977 $(INSTALL ) -m 0644 $(TOP ) /src/sqlite3ext.h $(DESTDIR )$(includedir )
938978 $(INSTALL ) -d $(DESTDIR )$(pkgconfigdir )
939- $(INSTALL ) -m 0644 sqlite3 .pc $(DESTDIR )$(pkgconfigdir )
979+ $(INSTALL ) -m 0644 sqlcipher .pc $(DESTDIR )$(pkgconfigdir )
940980
941981pkgIndex.tcl :
942982 echo ' package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3.so sqlite3]' > $@
@@ -947,24 +987,26 @@ tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
947987 $(INSTALL ) -m 0644 pkgIndex.tcl $(DESTDIR )$(TCLLIBDIR )
948988
949989clean :
950- rm -f * .lo * .la * .o sqlite3 $(TEXE ) libsqlite3 .la
990+ rm -f * .lo * .la * .o sqlcipher $(TEXE ) libsqlcipher .la
951991 rm -f sqlite3.h opcodes.*
952992 rm -rf .libs .deps
953993 rm -f lemon$(BEXE ) lempar.c parse.* sqlite* .tar.gz
954994 rm -f mkkeywordhash$(BEXE ) keywordhash.h
955- rm -f $(PUBLISH )
956995 rm -f * .da * .bb * .bbg gmon.out
957996 rm -rf quota2a quota2b quota2c
958997 rm -rf tsrc .target_source
959- rm -f tclsqlite3 $(TEXE )
998+ rm -f tclsqlcipher $(TEXE )
960999 rm -f testfixture$(TEXE ) test.db
9611000 rm -f sqlite3.dll sqlite3.lib sqlite3.exp sqlite3.def
9621001 rm -f sqlite3.c
1002+ rm -f sqlite3rc.h
1003+ rm -f shell.c sqlite3ext.h
9631004 rm -f sqlite3_analyzer$(TEXE ) sqlite3_analyzer.c
964- rm -f sqlite-output.vsix
1005+ rm -f sqlite-* -output.vsix
1006+ rm -f mptester mptester.exe
9651007
9661008distclean : clean
967- rm -f config.log config.status libtool Makefile sqlite3 .pc
1009+ rm -f config.log config.status libtool Makefile sqlcipher .pc
9681010
9691011#
9701012# Windows section
0 commit comments