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.
Commit
ed871fb5fabd163534279dbc68add79ca2c20b84
Parent
4abf607937fac8e…
5 files changed
+1
+7
+37
-1
+16
-3
+16
-2
+1
| --- Makefile.in | ||
| +++ Makefile.in | ||
| @@ -41,10 +41,11 @@ | ||
| 41 | 41 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 42 | 42 | TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H |
| 43 | 43 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 44 | 44 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 45 | 45 | USE_LINENOISE = @USE_LINENOISE@ |
| 46 | +USE_SEE = @USE_SEE@ | |
| 46 | 47 | FOSSIL_ENABLE_MINIZ = @FOSSIL_ENABLE_MINIZ@ |
| 47 | 48 | |
| 48 | 49 | include $(SRCDIR)/main.mk |
| 49 | 50 | |
| 50 | 51 | distclean: clean |
| 51 | 52 |
| --- 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 |
M
auto.def
+7
| --- auto.def | ||
| +++ auto.def | ||
| @@ -15,10 +15,11 @@ | ||
| 15 | 15 | with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages} |
| 16 | 16 | with-tcl:path => {Enable Tcl integration, with Tcl in the specified path} |
| 17 | 17 | with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism} |
| 18 | 18 | with-tcl-private-stubs=0 |
| 19 | 19 | => {Enable Tcl integration via private stubs mechanism} |
| 20 | + with-see=0 => {Enable the SQLite Encryption Extension (SEE)} | |
| 20 | 21 | internal-sqlite=1 => {Don't use the internal SQLite, use the system one} |
| 21 | 22 | static=0 => {Link a static executable} |
| 22 | 23 | fusefs=1 => {Disable the Fuse Filesystem} |
| 23 | 24 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 24 | 25 | json=0 => {Build with fossil JSON API enabled} |
| @@ -38,10 +39,11 @@ | ||
| 38 | 39 | define EXTRA_CFLAGS "" |
| 39 | 40 | define EXTRA_LDFLAGS "" |
| 40 | 41 | define USE_SYSTEM_SQLITE 0 |
| 41 | 42 | define USE_LINENOISE 0 |
| 42 | 43 | define FOSSIL_ENABLE_MINIZ 0 |
| 44 | +define USE_SEE 0 | |
| 43 | 45 | |
| 44 | 46 | # This procedure is a customized version of "cc-check-function-in-lib", |
| 45 | 47 | # that does not modify the LIBS variable. Its use prevents prematurely |
| 46 | 48 | # pulling in libraries that will be added later anyhow (e.g. "-ldl"). |
| 47 | 49 | proc check-function-in-lib {function libs {otherlibs {}}} { |
| @@ -132,10 +134,15 @@ | ||
| 132 | 134 | |
| 133 | 135 | if {[opt-bool fossil-debug]} { |
| 134 | 136 | define-append EXTRA_CFLAGS -DFOSSIL_DEBUG |
| 135 | 137 | msg-result "Debugging support enabled" |
| 136 | 138 | } |
| 139 | + | |
| 140 | +if {[opt-bool with-see]} { | |
| 141 | + define USE_SEE 1 | |
| 142 | + msg-result "Enabling encryption support" | |
| 143 | +} | |
| 137 | 144 | |
| 138 | 145 | if {[opt-bool json]} { |
| 139 | 146 | # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON |
| 140 | 147 | # is required in the CFLAGS because json*.c |
| 141 | 148 | # have #ifdef guards around the whole file without |
| 142 | 149 |
| --- 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 |
M
src/db.c
+37
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -870,18 +870,43 @@ | ||
| 870 | 870 | db_tolocal_function, 0, 0); |
| 871 | 871 | sqlite3_create_function(db, "fromLocal", 0, SQLITE_UTF8, 0, |
| 872 | 872 | db_fromlocal_function, 0, 0); |
| 873 | 873 | } |
| 874 | 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 | + | |
| 875 | 899 | |
| 876 | 900 | /* |
| 877 | 901 | ** Open a database file. Return a pointer to the new database |
| 878 | 902 | ** connection. An error results in process abort. |
| 879 | 903 | */ |
| 880 | 904 | LOCAL sqlite3 *db_open(const char *zDbName){ |
| 881 | 905 | int rc; |
| 882 | 906 | sqlite3 *db; |
| 907 | + Blob key; | |
| 883 | 908 | |
| 884 | 909 | if( g.fSqlTrace ) fossil_trace("-- sqlite3_open: [%s]\n", zDbName); |
| 885 | 910 | rc = sqlite3_open_v2( |
| 886 | 911 | zDbName, &db, |
| 887 | 912 | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, |
| @@ -888,10 +913,17 @@ | ||
| 888 | 913 | g.zVfsName |
| 889 | 914 | ); |
| 890 | 915 | if( rc!=SQLITE_OK ){ |
| 891 | 916 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 892 | 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); | |
| 893 | 925 | sqlite3_busy_timeout(db, 5000); |
| 894 | 926 | sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */ |
| 895 | 927 | sqlite3_create_function(db, "user", 0, SQLITE_UTF8, 0, db_sql_user, 0, 0); |
| 896 | 928 | sqlite3_create_function(db, "cgi", 1, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| 897 | 929 | sqlite3_create_function(db, "cgi", 2, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| @@ -921,11 +953,15 @@ | ||
| 921 | 953 | /* |
| 922 | 954 | ** zDbName is the name of a database file. Attach zDbName using |
| 923 | 955 | ** the name zLabel. |
| 924 | 956 | */ |
| 925 | 957 | 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); | |
| 927 | 963 | } |
| 928 | 964 | |
| 929 | 965 | /* |
| 930 | 966 | ** zDbName is the name of a database file. If no other database |
| 931 | 967 | ** file is open, then open this one. If another database file is |
| 932 | 968 |
| --- 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 @@ | ||
| 529 | 529 | LINENOISE_DEF. = $(LINENOISE_DEF.0) |
| 530 | 530 | LINENOISE_OBJ.0 = |
| 531 | 531 | LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o |
| 532 | 532 | LINENOISE_OBJ. = $(LINENOISE_OBJ.0) |
| 533 | 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 | + | |
| 534 | 547 | |
| 535 | 548 | EXTRAOBJ = \ |
| 536 | 549 | $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \ |
| 537 | 550 | $(MINIZ_OBJ.$(FOSSIL_ENABLE_MINIZ)) \ |
| 538 | 551 | $(LINENOISE_OBJ.$(USE_LINENOISE)) \ |
| @@ -1640,13 +1653,13 @@ | ||
| 1640 | 1653 | $(OBJDIR)/zip.o: $(OBJDIR)/zip_.c $(OBJDIR)/zip.h $(SRCDIR)/config.h |
| 1641 | 1654 | $(XTCC) -o $(OBJDIR)/zip.o -c $(OBJDIR)/zip_.c |
| 1642 | 1655 | |
| 1643 | 1656 | $(OBJDIR)/zip.h: $(OBJDIR)/headers |
| 1644 | 1657 | |
| 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 $@ | |
| 1648 | 1661 | $(OBJDIR)/shell.o: $(SRCDIR)/shell.c $(SRCDIR)/sqlite3.h |
| 1649 | 1662 | $(XTCC) $(SHELL_OPTIONS) $(SHELL_CFLAGS) $(LINENOISE_DEF.$(USE_LINENOISE)) -c $(SRCDIR)/shell.c -o $@ |
| 1650 | 1663 | |
| 1651 | 1664 | $(OBJDIR)/linenoise.o: $(SRCDIR)/linenoise.c $(SRCDIR)/linenoise.h |
| 1652 | 1665 | $(XTCC) -c $(SRCDIR)/linenoise.c -o $@ |
| 1653 | 1666 |
| --- 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 @@ | ||
| 358 | 358 | LINENOISE_DEF.1 = -DHAVE_LINENOISE |
| 359 | 359 | LINENOISE_DEF. = $(LINENOISE_DEF.0) |
| 360 | 360 | LINENOISE_OBJ.0 = |
| 361 | 361 | LINENOISE_OBJ.1 = $(OBJDIR)/linenoise.o |
| 362 | 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)) | |
| 363 | 376 | }] |
| 364 | 377 | |
| 365 | 378 | writeln [string map [list <<<NEXT_LINE>>> \\] { |
| 366 | 379 | EXTRAOBJ = <<<NEXT_LINE>>> |
| 367 | 380 | $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) <<<NEXT_LINE>>> |
| @@ -421,12 +434,13 @@ | ||
| 421 | 434 | writeln "\$(OBJDIR)/$s.o:\t\$(OBJDIR)/${s}_.c \$(OBJDIR)/$s.h$extra_h($s)\$(SRCDIR)/config.h" |
| 422 | 435 | writeln "\t\$(XTCC) -o \$(OBJDIR)/$s.o -c \$(OBJDIR)/${s}_.c\n" |
| 423 | 436 | writeln "\$(OBJDIR)/$s.h:\t\$(OBJDIR)/headers\n" |
| 424 | 437 | } |
| 425 | 438 | |
| 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 $@" | |
| 428 | 442 | |
| 429 | 443 | writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c \$(SRCDIR)/sqlite3.h" |
| 430 | 444 | writeln "\t\$(XTCC) \$(SHELL_OPTIONS) \$(SHELL_CFLAGS) \$(LINENOISE_DEF.\$(USE_LINENOISE)) -c \$(SRCDIR)/shell.c -o \$@\n" |
| 431 | 445 | |
| 432 | 446 | writeln "\$(OBJDIR)/linenoise.o:\t\$(SRCDIR)/linenoise.c \$(SRCDIR)/linenoise.h" |
| 433 | 447 |
| --- 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 |