Fossil SCM

Add the ability to use a repository that is in a database protected by the [http://www.hwaci.com/sw/sqlite/see.html|SQLite Encryption Extension (SEE)]. SEE is proprietary code and is not included in this tree, but if a user has a copy of SEE, with this change she can compile a version of Fossil that uses it.

drh 2016-04-22 18:08 trunk merge
Commit ed871fb5fabd163534279dbc68add79ca2c20b84
--- Makefile.in
+++ Makefile.in
@@ -41,10 +41,11 @@
4141
LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
4242
TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H
4343
INSTALLDIR = $(DESTDIR)@prefix@/bin
4444
USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
4545
USE_LINENOISE = @USE_LINENOISE@
46
+USE_SEE = @USE_SEE@
4647
FOSSIL_ENABLE_MINIZ = @FOSSIL_ENABLE_MINIZ@
4748
4849
include $(SRCDIR)/main.mk
4950
5051
distclean: clean
5152
--- Makefile.in
+++ Makefile.in
@@ -41,10 +41,11 @@
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45 USE_LINENOISE = @USE_LINENOISE@
 
46 FOSSIL_ENABLE_MINIZ = @FOSSIL_ENABLE_MINIZ@
47
48 include $(SRCDIR)/main.mk
49
50 distclean: clean
51
--- Makefile.in
+++ Makefile.in
@@ -41,10 +41,11 @@
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45 USE_LINENOISE = @USE_LINENOISE@
46 USE_SEE = @USE_SEE@
47 FOSSIL_ENABLE_MINIZ = @FOSSIL_ENABLE_MINIZ@
48
49 include $(SRCDIR)/main.mk
50
51 distclean: clean
52
+7
--- auto.def
+++ auto.def
@@ -15,10 +15,11 @@
1515
with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
1616
with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
1717
with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
1818
with-tcl-private-stubs=0
1919
=> {Enable Tcl integration via private stubs mechanism}
20
+ with-see=0 => {Enable the SQLite Encryption Extension (SEE)}
2021
internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
2122
static=0 => {Link a static executable}
2223
fusefs=1 => {Disable the Fuse Filesystem}
2324
fossil-debug=0 => {Build with fossil debugging enabled}
2425
json=0 => {Build with fossil JSON API enabled}
@@ -38,10 +39,11 @@
3839
define EXTRA_CFLAGS ""
3940
define EXTRA_LDFLAGS ""
4041
define USE_SYSTEM_SQLITE 0
4142
define USE_LINENOISE 0
4243
define FOSSIL_ENABLE_MINIZ 0
44
+define USE_SEE 0
4345
4446
# This procedure is a customized version of "cc-check-function-in-lib",
4547
# that does not modify the LIBS variable. Its use prevents prematurely
4648
# pulling in libraries that will be added later anyhow (e.g. "-ldl").
4749
proc check-function-in-lib {function libs {otherlibs {}}} {
@@ -132,10 +134,15 @@
132134
133135
if {[opt-bool fossil-debug]} {
134136
define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
135137
msg-result "Debugging support enabled"
136138
}
139
+
140
+if {[opt-bool with-see]} {
141
+ define USE_SEE 1
142
+ msg-result "Enabling encryption support"
143
+}
137144
138145
if {[opt-bool json]} {
139146
# Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
140147
# is required in the CFLAGS because json*.c
141148
# have #ifdef guards around the whole file without
142149
--- auto.def
+++ auto.def
@@ -15,10 +15,11 @@
15 with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
16 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
17 with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
18 with-tcl-private-stubs=0
19 => {Enable Tcl integration via private stubs mechanism}
 
20 internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
21 static=0 => {Link a static executable}
22 fusefs=1 => {Disable the Fuse Filesystem}
23 fossil-debug=0 => {Build with fossil debugging enabled}
24 json=0 => {Build with fossil JSON API enabled}
@@ -38,10 +39,11 @@
38 define EXTRA_CFLAGS ""
39 define EXTRA_LDFLAGS ""
40 define USE_SYSTEM_SQLITE 0
41 define USE_LINENOISE 0
42 define FOSSIL_ENABLE_MINIZ 0
 
43
44 # This procedure is a customized version of "cc-check-function-in-lib",
45 # that does not modify the LIBS variable. Its use prevents prematurely
46 # pulling in libraries that will be added later anyhow (e.g. "-ldl").
47 proc check-function-in-lib {function libs {otherlibs {}}} {
@@ -132,10 +134,15 @@
132
133 if {[opt-bool fossil-debug]} {
134 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
135 msg-result "Debugging support enabled"
136 }
 
 
 
 
 
137
138 if {[opt-bool json]} {
139 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
140 # is required in the CFLAGS because json*.c
141 # have #ifdef guards around the whole file without
142
--- auto.def
+++ auto.def
@@ -15,10 +15,11 @@
15 with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages}
16 with-tcl:path => {Enable Tcl integration, with Tcl in the specified path}
17 with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism}
18 with-tcl-private-stubs=0
19 => {Enable Tcl integration via private stubs mechanism}
20 with-see=0 => {Enable the SQLite Encryption Extension (SEE)}
21 internal-sqlite=1 => {Don't use the internal SQLite, use the system one}
22 static=0 => {Link a static executable}
23 fusefs=1 => {Disable the Fuse Filesystem}
24 fossil-debug=0 => {Build with fossil debugging enabled}
25 json=0 => {Build with fossil JSON API enabled}
@@ -38,10 +39,11 @@
39 define EXTRA_CFLAGS ""
40 define EXTRA_LDFLAGS ""
41 define USE_SYSTEM_SQLITE 0
42 define USE_LINENOISE 0
43 define FOSSIL_ENABLE_MINIZ 0
44 define USE_SEE 0
45
46 # This procedure is a customized version of "cc-check-function-in-lib",
47 # that does not modify the LIBS variable. Its use prevents prematurely
48 # pulling in libraries that will be added later anyhow (e.g. "-ldl").
49 proc check-function-in-lib {function libs {otherlibs {}}} {
@@ -132,10 +134,15 @@
134
135 if {[opt-bool fossil-debug]} {
136 define-append EXTRA_CFLAGS -DFOSSIL_DEBUG
137 msg-result "Debugging support enabled"
138 }
139
140 if {[opt-bool with-see]} {
141 define USE_SEE 1
142 msg-result "Enabling encryption support"
143 }
144
145 if {[opt-bool json]} {
146 # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON
147 # is required in the CFLAGS because json*.c
148 # have #ifdef guards around the whole file without
149
+37 -1
--- src/db.c
+++ src/db.c
@@ -870,18 +870,43 @@
870870
db_tolocal_function, 0, 0);
871871
sqlite3_create_function(db, "fromLocal", 0, SQLITE_UTF8, 0,
872872
db_fromlocal_function, 0, 0);
873873
}
874874
875
+/*
876
+** If the database file zDbFile has a name that suggests that it is
877
+** encrypted, then prompt for the encryption key and return it in the
878
+** blob *pKey. Or, if the encryption key has previously been requested,
879
+** just return a copy of the previous result.
880
+*/
881
+static void db_encryption_key(
882
+ const char *zDbFile, /* Name of the database file */
883
+ Blob *pKey /* Put the encryption key here */
884
+){
885
+ blob_init(pKey, 0, 0);
886
+ if( sqlite3_strglob("*efossil", zDbFile)==0 ){
887
+ static char *zSavedKey = 0;
888
+ if( zSavedKey ){
889
+ blob_set(pKey, zSavedKey);
890
+ }else{
891
+ char *zPrompt = mprintf("\rencryption key for '%s': ", zDbFile);
892
+ prompt_for_password(zPrompt, pKey, 0);
893
+ fossil_free(zPrompt);
894
+ zSavedKey = fossil_strdup(blob_str(pKey));
895
+ }
896
+ }
897
+}
898
+
875899
876900
/*
877901
** Open a database file. Return a pointer to the new database
878902
** connection. An error results in process abort.
879903
*/
880904
LOCAL sqlite3 *db_open(const char *zDbName){
881905
int rc;
882906
sqlite3 *db;
907
+ Blob key;
883908
884909
if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
885910
rc = sqlite3_open_v2(
886911
zDbName, &db,
887912
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
@@ -888,10 +913,17 @@
888913
g.zVfsName
889914
);
890915
if( rc!=SQLITE_OK ){
891916
db_err("[%s]: %s", zDbName, sqlite3_errmsg(db));
892917
}
918
+ db_encryption_key(zDbName, &key);
919
+ if( blob_size(&key)>0 ){
920
+ char *zCmd = sqlite3_mprintf("PRAGMA key(%Q)", blob_str(&key));
921
+ sqlite3_exec(db, zCmd, 0, 0, 0);
922
+ sqlite3_free(zCmd);
923
+ }
924
+ blob_reset(&key);
893925
sqlite3_busy_timeout(db, 5000);
894926
sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */
895927
sqlite3_create_function(db, "user", 0, SQLITE_UTF8, 0, db_sql_user, 0, 0);
896928
sqlite3_create_function(db, "cgi", 1, SQLITE_UTF8, 0, db_sql_cgi, 0, 0);
897929
sqlite3_create_function(db, "cgi", 2, SQLITE_UTF8, 0, db_sql_cgi, 0, 0);
@@ -921,11 +953,15 @@
921953
/*
922954
** zDbName is the name of a database file. Attach zDbName using
923955
** the name zLabel.
924956
*/
925957
void db_attach(const char *zDbName, const char *zLabel){
926
- db_multi_exec("ATTACH DATABASE %Q AS %Q", zDbName, zLabel);
958
+ Blob key;
959
+ db_encryption_key(zDbName, &key);
960
+ db_multi_exec("ATTACH DATABASE %Q AS %Q KEY %Q",
961
+ zDbName, zLabel, blob_str(&key));
962
+ blob_reset(&key);
927963
}
928964
929965
/*
930966
** zDbName is the name of a database file. If no other database
931967
** file is open, then open this one. If another database file is
932968
--- src/db.c
+++ src/db.c
@@ -870,18 +870,43 @@
870 db_tolocal_function, 0, 0);
871 sqlite3_create_function(db, "fromLocal", 0, SQLITE_UTF8, 0,
872 db_fromlocal_function, 0, 0);
873 }
874
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
875
876 /*
877 ** Open a database file. Return a pointer to the new database
878 ** connection. An error results in process abort.
879 */
880 LOCAL sqlite3 *db_open(const char *zDbName){
881 int rc;
882 sqlite3 *db;
 
883
884 if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
885 rc = sqlite3_open_v2(
886 zDbName, &db,
887 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
@@ -888,10 +913,17 @@
888 g.zVfsName
889 );
890 if( rc!=SQLITE_OK ){
891 db_err("[%s]: %s", zDbName, sqlite3_errmsg(db));
892 }
 
 
 
 
 
 
 
893 sqlite3_busy_timeout(db, 5000);
894 sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */
895 sqlite3_create_function(db, "user", 0, SQLITE_UTF8, 0, db_sql_user, 0, 0);
896 sqlite3_create_function(db, "cgi", 1, SQLITE_UTF8, 0, db_sql_cgi, 0, 0);
897 sqlite3_create_function(db, "cgi", 2, SQLITE_UTF8, 0, db_sql_cgi, 0, 0);
@@ -921,11 +953,15 @@
921 /*
922 ** zDbName is the name of a database file. Attach zDbName using
923 ** the name zLabel.
924 */
925 void db_attach(const char *zDbName, const char *zLabel){
926 db_multi_exec("ATTACH DATABASE %Q AS %Q", zDbName, zLabel);
 
 
 
 
927 }
928
929 /*
930 ** zDbName is the name of a database file. If no other database
931 ** file is open, then open this one. If another database file is
932
--- src/db.c
+++ src/db.c
@@ -870,18 +870,43 @@
870 db_tolocal_function, 0, 0);
871 sqlite3_create_function(db, "fromLocal", 0, SQLITE_UTF8, 0,
872 db_fromlocal_function, 0, 0);
873 }
874
875 /*
876 ** If the database file zDbFile has a name that suggests that it is
877 ** encrypted, then prompt for the encryption key and return it in the
878 ** blob *pKey. Or, if the encryption key has previously been requested,
879 ** just return a copy of the previous result.
880 */
881 static void db_encryption_key(
882 const char *zDbFile, /* Name of the database file */
883 Blob *pKey /* Put the encryption key here */
884 ){
885 blob_init(pKey, 0, 0);
886 if( sqlite3_strglob("*efossil", zDbFile)==0 ){
887 static char *zSavedKey = 0;
888 if( zSavedKey ){
889 blob_set(pKey, zSavedKey);
890 }else{
891 char *zPrompt = mprintf("\rencryption key for '%s': ", zDbFile);
892 prompt_for_password(zPrompt, pKey, 0);
893 fossil_free(zPrompt);
894 zSavedKey = fossil_strdup(blob_str(pKey));
895 }
896 }
897 }
898
899
900 /*
901 ** Open a database file. Return a pointer to the new database
902 ** connection. An error results in process abort.
903 */
904 LOCAL sqlite3 *db_open(const char *zDbName){
905 int rc;
906 sqlite3 *db;
907 Blob key;
908
909 if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName);
910 rc = sqlite3_open_v2(
911 zDbName, &db,
912 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
@@ -888,10 +913,17 @@
913 g.zVfsName
914 );
915 if( rc!=SQLITE_OK ){
916 db_err("[%s]: %s", zDbName, sqlite3_errmsg(db));
917 }
918 db_encryption_key(zDbName, &key);
919 if( blob_size(&key)>0 ){
920 char *zCmd = sqlite3_mprintf("PRAGMA key(%Q)", blob_str(&key));
921 sqlite3_exec(db, zCmd, 0, 0, 0);
922 sqlite3_free(zCmd);
923 }
924 blob_reset(&key);
925 sqlite3_busy_timeout(db, 5000);
926 sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */
927 sqlite3_create_function(db, "user", 0, SQLITE_UTF8, 0, db_sql_user, 0, 0);
928 sqlite3_create_function(db, "cgi", 1, SQLITE_UTF8, 0, db_sql_cgi, 0, 0);
929 sqlite3_create_function(db, "cgi", 2, SQLITE_UTF8, 0, db_sql_cgi, 0, 0);
@@ -921,11 +953,15 @@
953 /*
954 ** zDbName is the name of a database file. Attach zDbName using
955 ** the name zLabel.
956 */
957 void db_attach(const char *zDbName, const char *zLabel){
958 Blob key;
959 db_encryption_key(zDbName, &key);
960 db_multi_exec("ATTACH DATABASE %Q AS %Q KEY %Q",
961 zDbName, zLabel, blob_str(&key));
962 blob_reset(&key);
963 }
964
965 /*
966 ** zDbName is the name of a database file. If no other database
967 ** file is open, then open this one. If another database file is
968
+16 -3
--- src/main.mk
+++ src/main.mk
@@ -529,10 +529,23 @@
529529
LINENOISE_DEF. = $(LINENOISE_DEF.0)
530530
LINENOISE_OBJ.0 =
531531
LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
532532
LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
533533
534
+# The USE_SEE variable may be undefined, 0 or 1. If undefined or
535
+# 0, ordinary SQLite is used. If 1, then sqlite3-see.c (not part of
536
+# the source tree) is used and extra flags are provided to enable
537
+# the SQLite Encryption Extension.
538
+SQLITE3_SRC.1 = sqlite3-see.c
539
+SQLITE3_SRC.0 = sqlite3.c
540
+SQLITE3_SRC. = sqlite3.c
541
+SQLITE3_SRC = $(SRCDIR)/$(SQLITE3_SRC.$(USE_SEE))
542
+SEE_FLAGS.1 = -DSQLITE_HAS_CODEC
543
+SEE_FLAGS.0 =
544
+SEE_FLAGS. =
545
+SEE_FLAGS = $(SEE_FLAGS.$(USE_SEE))
546
+
534547
535548
EXTRAOBJ = \
536549
$(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
537550
$(MINIZ_OBJ.$(FOSSIL_ENABLE_MINIZ)) \
538551
$(LINENOISE_OBJ.$(USE_LINENOISE)) \
@@ -1640,13 +1653,13 @@
16401653
$(OBJDIR)/zip.o: $(OBJDIR)/zip_.c $(OBJDIR)/zip.h $(SRCDIR)/config.h
16411654
$(XTCC) -o $(OBJDIR)/zip.o -c $(OBJDIR)/zip_.c
16421655
16431656
$(OBJDIR)/zip.h: $(OBJDIR)/headers
16441657
1645
-$(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
1646
- $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $@
1647
-
1658
+$(OBJDIR)/sqlite3.o: $(SQLITE3_SRC)
1659
+ $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) $(SEE_FLAGS) \
1660
+ -c $(SQLITE3_SRC) -o $@
16481661
$(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
16491662
$(XTCC) $(SHELL_OPTIONS) $(SHELL_CFLAGS) $(LINENOISE_DEF.$(USE_LINENOISE)) -c $(SRCDIR)/shell.c -o $@
16501663
16511664
$(OBJDIR)/linenoise.o: $(SRCDIR)/linenoise.c $(SRCDIR)/linenoise.h
16521665
$(XTCC) -c $(SRCDIR)/linenoise.c -o $@
16531666
--- src/main.mk
+++ src/main.mk
@@ -529,10 +529,23 @@
529 LINENOISE_DEF. = $(LINENOISE_DEF.0)
530 LINENOISE_OBJ.0 =
531 LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
532 LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
533
 
 
 
 
 
 
 
 
 
 
 
 
 
534
535 EXTRAOBJ = \
536 $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
537 $(MINIZ_OBJ.$(FOSSIL_ENABLE_MINIZ)) \
538 $(LINENOISE_OBJ.$(USE_LINENOISE)) \
@@ -1640,13 +1653,13 @@
1640 $(OBJDIR)/zip.o: $(OBJDIR)/zip_.c $(OBJDIR)/zip.h $(SRCDIR)/config.h
1641 $(XTCC) -o $(OBJDIR)/zip.o -c $(OBJDIR)/zip_.c
1642
1643 $(OBJDIR)/zip.h: $(OBJDIR)/headers
1644
1645 $(OBJDIR)/sqlite3.o: $(SRCDIR)/sqlite3.c
1646 $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) -c $(SRCDIR)/sqlite3.c -o $@
1647
1648 $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
1649 $(XTCC) $(SHELL_OPTIONS) $(SHELL_CFLAGS) $(LINENOISE_DEF.$(USE_LINENOISE)) -c $(SRCDIR)/shell.c -o $@
1650
1651 $(OBJDIR)/linenoise.o: $(SRCDIR)/linenoise.c $(SRCDIR)/linenoise.h
1652 $(XTCC) -c $(SRCDIR)/linenoise.c -o $@
1653
--- src/main.mk
+++ src/main.mk
@@ -529,10 +529,23 @@
529 LINENOISE_DEF. = $(LINENOISE_DEF.0)
530 LINENOISE_OBJ.0 =
531 LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
532 LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
533
534 # The USE_SEE variable may be undefined, 0 or 1. If undefined or
535 # 0, ordinary SQLite is used. If 1, then sqlite3-see.c (not part of
536 # the source tree) is used and extra flags are provided to enable
537 # the SQLite Encryption Extension.
538 SQLITE3_SRC.1 = sqlite3-see.c
539 SQLITE3_SRC.0 = sqlite3.c
540 SQLITE3_SRC. = sqlite3.c
541 SQLITE3_SRC = $(SRCDIR)/$(SQLITE3_SRC.$(USE_SEE))
542 SEE_FLAGS.1 = -DSQLITE_HAS_CODEC
543 SEE_FLAGS.0 =
544 SEE_FLAGS. =
545 SEE_FLAGS = $(SEE_FLAGS.$(USE_SEE))
546
547
548 EXTRAOBJ = \
549 $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \
550 $(MINIZ_OBJ.$(FOSSIL_ENABLE_MINIZ)) \
551 $(LINENOISE_OBJ.$(USE_LINENOISE)) \
@@ -1640,13 +1653,13 @@
1653 $(OBJDIR)/zip.o: $(OBJDIR)/zip_.c $(OBJDIR)/zip.h $(SRCDIR)/config.h
1654 $(XTCC) -o $(OBJDIR)/zip.o -c $(OBJDIR)/zip_.c
1655
1656 $(OBJDIR)/zip.h: $(OBJDIR)/headers
1657
1658 $(OBJDIR)/sqlite3.o: $(SQLITE3_SRC)
1659 $(XTCC) $(SQLITE_OPTIONS) $(SQLITE_CFLAGS) $(SEE_FLAGS) \
1660 -c $(SQLITE3_SRC) -o $@
1661 $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h
1662 $(XTCC) $(SHELL_OPTIONS) $(SHELL_CFLAGS) $(LINENOISE_DEF.$(USE_LINENOISE)) -c $(SRCDIR)/shell.c -o $@
1663
1664 $(OBJDIR)/linenoise.o: $(SRCDIR)/linenoise.c $(SRCDIR)/linenoise.h
1665 $(XTCC) -c $(SRCDIR)/linenoise.c -o $@
1666
+16 -2
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -358,10 +358,23 @@
358358
LINENOISE_DEF.1 = -DHAVE_LINENOISE
359359
LINENOISE_DEF. = $(LINENOISE_DEF.0)
360360
LINENOISE_OBJ.0 =
361361
LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
362362
LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
363
+
364
+# The USE_SEE variable may be undefined, 0 or 1. If undefined or
365
+# 0, ordinary SQLite is used. If 1, then sqlite3-see.c (not part of
366
+# the source tree) is used and extra flags are provided to enable
367
+# the SQLite Encryption Extension.
368
+SQLITE3_SRC.1 = sqlite3-see.c
369
+SQLITE3_SRC.0 = sqlite3.c
370
+SQLITE3_SRC. = sqlite3.c
371
+SQLITE3_SRC = $(SRCDIR)/$(SQLITE3_SRC.$(USE_SEE))
372
+SEE_FLAGS.1 = -DSQLITE_HAS_CODEC
373
+SEE_FLAGS.0 =
374
+SEE_FLAGS. =
375
+SEE_FLAGS = $(SEE_FLAGS.$(USE_SEE))
363376
}]
364377
365378
writeln [string map [list <<<NEXT_LINE>>> \\] {
366379
EXTRAOBJ = <<<NEXT_LINE>>>
367380
$(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) <<<NEXT_LINE>>>
@@ -421,12 +434,13 @@
421434
writeln "\$(OBJDIR)/$s.o:\t\$(OBJDIR)/${s}_.c \$(OBJDIR)/$s.h$extra_h($s)\$(SRCDIR)/config.h"
422435
writeln "\t\$(XTCC) -o \$(OBJDIR)/$s.o -c \$(OBJDIR)/${s}_.c\n"
423436
writeln "\$(OBJDIR)/$s.h:\t\$(OBJDIR)/headers\n"
424437
}
425438
426
-writeln "\$(OBJDIR)/sqlite3.o:\t\$(SRCDIR)/sqlite3.c"
427
-writeln "\t\$(XTCC) \$(SQLITE_OPTIONS) \$(SQLITE_CFLAGS) -c \$(SRCDIR)/sqlite3.c -o \$@\n"
439
+writeln "\$(OBJDIR)/sqlite3.o:\t\$(SQLITE3_SRC)"
440
+writeln "\t\$(XTCC) \$(SQLITE_OPTIONS) \$(SQLITE_CFLAGS) \$(SEE_FLAGS) \\"
441
+writeln "\t\t-c \$(SQLITE3_SRC) -o $@"
428442
429443
writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h"
430444
writeln "\t\$(XTCC) \$(SHELL_OPTIONS) \$(SHELL_CFLAGS) \$(LINENOISE_DEF.\$(USE_LINENOISE)) -c \$(SRCDIR)/shell.c -o \$@\n"
431445
432446
writeln "\$(OBJDIR)/linenoise.o:\t\$(SRCDIR)/linenoise.c \$(SRCDIR)/linenoise.h"
433447
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -358,10 +358,23 @@
358 LINENOISE_DEF.1 = -DHAVE_LINENOISE
359 LINENOISE_DEF. = $(LINENOISE_DEF.0)
360 LINENOISE_OBJ.0 =
361 LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
362 LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
 
 
 
 
 
 
 
 
 
 
 
 
 
363 }]
364
365 writeln [string map [list <<<NEXT_LINE>>> \\] {
366 EXTRAOBJ = <<<NEXT_LINE>>>
367 $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) <<<NEXT_LINE>>>
@@ -421,12 +434,13 @@
421 writeln "\$(OBJDIR)/$s.o:\t\$(OBJDIR)/${s}_.c \$(OBJDIR)/$s.h$extra_h($s)\$(SRCDIR)/config.h"
422 writeln "\t\$(XTCC) -o \$(OBJDIR)/$s.o -c \$(OBJDIR)/${s}_.c\n"
423 writeln "\$(OBJDIR)/$s.h:\t\$(OBJDIR)/headers\n"
424 }
425
426 writeln "\$(OBJDIR)/sqlite3.o:\t\$(SRCDIR)/sqlite3.c"
427 writeln "\t\$(XTCC) \$(SQLITE_OPTIONS) \$(SQLITE_CFLAGS) -c \$(SRCDIR)/sqlite3.c -o \$@\n"
 
428
429 writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h"
430 writeln "\t\$(XTCC) \$(SHELL_OPTIONS) \$(SHELL_CFLAGS) \$(LINENOISE_DEF.\$(USE_LINENOISE)) -c \$(SRCDIR)/shell.c -o \$@\n"
431
432 writeln "\$(OBJDIR)/linenoise.o:\t\$(SRCDIR)/linenoise.c \$(SRCDIR)/linenoise.h"
433
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -358,10 +358,23 @@
358 LINENOISE_DEF.1 = -DHAVE_LINENOISE
359 LINENOISE_DEF. = $(LINENOISE_DEF.0)
360 LINENOISE_OBJ.0 =
361 LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o
362 LINENOISE_OBJ. = $(LINENOISE_OBJ.0)
363
364 # The USE_SEE variable may be undefined, 0 or 1. If undefined or
365 # 0, ordinary SQLite is used. If 1, then sqlite3-see.c (not part of
366 # the source tree) is used and extra flags are provided to enable
367 # the SQLite Encryption Extension.
368 SQLITE3_SRC.1 = sqlite3-see.c
369 SQLITE3_SRC.0 = sqlite3.c
370 SQLITE3_SRC. = sqlite3.c
371 SQLITE3_SRC = $(SRCDIR)/$(SQLITE3_SRC.$(USE_SEE))
372 SEE_FLAGS.1 = -DSQLITE_HAS_CODEC
373 SEE_FLAGS.0 =
374 SEE_FLAGS. =
375 SEE_FLAGS = $(SEE_FLAGS.$(USE_SEE))
376 }]
377
378 writeln [string map [list <<<NEXT_LINE>>> \\] {
379 EXTRAOBJ = <<<NEXT_LINE>>>
380 $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) <<<NEXT_LINE>>>
@@ -421,12 +434,13 @@
434 writeln "\$(OBJDIR)/$s.o:\t\$(OBJDIR)/${s}_.c \$(OBJDIR)/$s.h$extra_h($s)\$(SRCDIR)/config.h"
435 writeln "\t\$(XTCC) -o \$(OBJDIR)/$s.o -c \$(OBJDIR)/${s}_.c\n"
436 writeln "\$(OBJDIR)/$s.h:\t\$(OBJDIR)/headers\n"
437 }
438
439 writeln "\$(OBJDIR)/sqlite3.o:\t\$(SQLITE3_SRC)"
440 writeln "\t\$(XTCC) \$(SQLITE_OPTIONS) \$(SQLITE_CFLAGS) \$(SEE_FLAGS) \\"
441 writeln "\t\t-c \$(SQLITE3_SRC) -o $@"
442
443 writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h"
444 writeln "\t\$(XTCC) \$(SHELL_OPTIONS) \$(SHELL_CFLAGS) \$(LINENOISE_DEF.\$(USE_LINENOISE)) -c \$(SRCDIR)/shell.c -o \$@\n"
445
446 writeln "\$(OBJDIR)/linenoise.o:\t\$(SRCDIR)/linenoise.c \$(SRCDIR)/linenoise.h"
447

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button