OLD | NEW |
| (Empty) |
1 From cd533ad27b96a22b97457227c93e73d6eb397a71 Mon Sep 17 00:00:00 2001 | |
2 From: Scott Hess <shess@chromium.org> | |
3 Date: Fri, 16 Jan 2015 13:07:04 -0800 | |
4 Subject: [PATCH 16/23] [fts2][test] Add fts2 to testfixture. | |
5 | |
6 TODO(shess): The main.mk change to build a.out is because under OSX gcc | |
7 is a wrapper for clang, and it reports an error about having multiple | |
8 outputs. Figure out a less hacky solution. | |
9 --- | |
10 third_party/sqlite/src/Makefile.linux-gcc | 1 + | |
11 third_party/sqlite/src/ext/fts2/fts2.c | 6 ++++-- | |
12 third_party/sqlite/src/ext/fts2/fts2_tokenizer.c | 5 ++++- | |
13 third_party/sqlite/src/main.mk | 20 +++++++++++++++++++- | |
14 4 files changed, 28 insertions(+), 4 deletions(-) | |
15 | |
16 diff --git a/third_party/sqlite/src/Makefile.linux-gcc b/third_party/sqlite/src/
Makefile.linux-gcc | |
17 index f60f1a1..026c03c 100644 | |
18 --- a/third_party/sqlite/src/Makefile.linux-gcc | |
19 +++ b/third_party/sqlite/src/Makefile.linux-gcc | |
20 @@ -67,6 +67,7 @@ OPTS = -DNDEBUG=1 | |
21 # These flags match those for SQLITE_CFLAGS in config.mk. | |
22 | |
23 OPTS += -DSQLITE_CORE | |
24 +OPTS += -DSQLITE_ENABLE_FTS2 -DSQLITE_ENABLE_BROKEN_FTS2 | |
25 OPTS += -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 | |
26 OPTS += -DHAVE_USLEEP=1 | |
27 | |
28 diff --git a/third_party/sqlite/src/ext/fts2/fts2.c b/third_party/sqlite/src/ext
/fts2/fts2.c | |
29 index 74c2890..3d9728a 100644 | |
30 --- a/third_party/sqlite/src/ext/fts2/fts2.c | |
31 +++ b/third_party/sqlite/src/ext/fts2/fts2.c | |
32 @@ -310,8 +310,10 @@ | |
33 #include "fts2_hash.h" | |
34 #include "fts2_tokenizer.h" | |
35 #include "sqlite3.h" | |
36 -#include "sqlite3ext.h" | |
37 -SQLITE_EXTENSION_INIT1 | |
38 +#ifndef SQLITE_CORE | |
39 +# include "sqlite3ext.h" | |
40 + SQLITE_EXTENSION_INIT1 | |
41 +#endif | |
42 | |
43 | |
44 /* TODO(shess) MAN, this thing needs some refactoring. At minimum, it | |
45 diff --git a/third_party/sqlite/src/ext/fts2/fts2_tokenizer.c b/third_party/sqli
te/src/ext/fts2/fts2_tokenizer.c | |
46 index f8b0663..a66c37a 100644 | |
47 --- a/third_party/sqlite/src/ext/fts2/fts2_tokenizer.c | |
48 +++ b/third_party/sqlite/src/ext/fts2/fts2_tokenizer.c | |
49 @@ -28,11 +28,14 @@ | |
50 | |
51 #include "sqlite3.h" | |
52 #include "sqlite3ext.h" | |
53 -SQLITE_EXTENSION_INIT1 | |
54 +#ifndef SQLITE_CORE | |
55 + SQLITE_EXTENSION_INIT1 | |
56 +#endif | |
57 | |
58 #include "fts2_hash.h" | |
59 #include "fts2_tokenizer.h" | |
60 #include <assert.h> | |
61 +#include <stddef.h> | |
62 | |
63 /* | |
64 ** Implementation of the SQL scalar function for accessing the underlying | |
65 diff --git a/third_party/sqlite/src/main.mk b/third_party/sqlite/src/main.mk | |
66 index d20103f..5b010c3 100644 | |
67 --- a/third_party/sqlite/src/main.mk | |
68 +++ b/third_party/sqlite/src/main.mk | |
69 @@ -69,6 +69,12 @@ LIBOBJ+= alter.o analyze.o attach.o auth.o \ | |
70 wal.o walker.o where.o utf.o vtab.o | |
71 | |
72 | |
73 +LIBOBJ+= fts2.o \ | |
74 + fts2_hash.o \ | |
75 + fts2_icu.o \ | |
76 + fts2_porter.o \ | |
77 + fts2_tokenizer.o \ | |
78 + fts2_tokenizer1.o | |
79 | |
80 # All of the source code files. | |
81 # | |
82 @@ -305,6 +311,17 @@ TESTSRC2 = \ | |
83 $(TOP)/ext/fts3/fts3_write.c \ | |
84 $(TOP)/ext/async/sqlite3async.c | |
85 | |
86 +TESTSRC2 += \ | |
87 + $(TOP)/ext/fts2/fts2.c \ | |
88 + $(TOP)/ext/fts2/fts2.h \ | |
89 + $(TOP)/ext/fts2/fts2_hash.c \ | |
90 + $(TOP)/ext/fts2/fts2_hash.h \ | |
91 + $(TOP)/ext/fts2/fts2_icu.c \ | |
92 + $(TOP)/ext/fts2/fts2_porter.c \ | |
93 + $(TOP)/ext/fts2/fts2_tokenizer.h \ | |
94 + $(TOP)/ext/fts2/fts2_tokenizer.c \ | |
95 + $(TOP)/ext/fts2/fts2_tokenizer1.c | |
96 + | |
97 # Header files used by all library source files. | |
98 # | |
99 HDR = \ | |
100 @@ -515,7 +532,8 @@ TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -
DSQLITE_CORE | |
101 testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c | |
102 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \ | |
103 $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \ | |
104 - -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) libsqlite3.a $(TLIBS
) | |
105 + $(LIBTCL) $(THREADLIB) libsqlite3.a $(TLIBS) | |
106 + mv a.out testfixture$(EXE) | |
107 | |
108 amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c | |
109 $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \ | |
110 -- | |
111 2.2.1 | |
112 | |
OLD | NEW |