OLD | NEW |
1 From 787cbd4344a6ab9c5915b77dfd02f91697f60b01 Mon Sep 17 00:00:00 2001 | 1 From c7020c4c8f2e786436804819d11ca2e4b9878a5f Mon Sep 17 00:00:00 2001 |
2 From: "tc@google.com" <tc@google.com> | 2 From: "tc@google.com" <tc@google.com> |
3 Date: Tue, 6 Jan 2009 22:39:41 +0000 | 3 Date: Tue, 6 Jan 2009 22:39:41 +0000 |
4 Subject: [PATCH 09/23] Custom shell.c helpers to load Chromium's ICU data. | 4 Subject: [PATCH 07/16] Custom shell.c helpers to load Chromium's ICU data. |
5 | 5 |
6 History uses fts3 with an icu-based segmenter. These changes allow building a | 6 History uses fts3 with an icu-based segmenter. These changes allow building a |
7 sqlite3 binary for Linux or Windows which can read those files. | 7 sqlite3 binary for Linux or Windows which can read those files. |
8 | 8 |
9 Original review URL: https://codereview.chromium.org/42250 | 9 Original review URL: https://codereview.chromium.org/42250 |
10 --- | 10 --- |
11 third_party/sqlite/src/Makefile.linux-gcc | 7 ++++++ | 11 third_party/sqlite/src/Makefile.linux-gcc | 7 ++++++ |
12 third_party/sqlite/src/main.mk | 2 +- | 12 third_party/sqlite/src/main.mk | 2 +- |
13 third_party/sqlite/src/src/shell.c | 10 +++++++++ | 13 third_party/sqlite/src/src/shell.c | 10 +++++++++ |
14 third_party/sqlite/src/src/shell_icu_linux.c | 27 +++++++++++++++++++++++ | 14 third_party/sqlite/src/src/shell_icu_linux.c | 27 +++++++++++++++++++++++ |
(...skipping 14 matching lines...) Expand all Loading... |
29 +ifeq ($(shell uname -s),Darwin) | 29 +ifeq ($(shell uname -s),Darwin) |
30 +SHELL_ICU = | 30 +SHELL_ICU = |
31 +else | 31 +else |
32 +SHELL_ICU = $(TOP)/src/shell_icu_linux.c -licuuc | 32 +SHELL_ICU = $(TOP)/src/shell_icu_linux.c -licuuc |
33 +endif | 33 +endif |
34 + | 34 + |
35 #### The suffix to add to executable files. ".exe" for windows. | 35 #### The suffix to add to executable files. ".exe" for windows. |
36 # Nothing for unix. | 36 # Nothing for unix. |
37 # | 37 # |
38 diff --git a/third_party/sqlite/src/main.mk b/third_party/sqlite/src/main.mk | 38 diff --git a/third_party/sqlite/src/main.mk b/third_party/sqlite/src/main.mk |
39 index 65dd690..d20103f 100644 | 39 index 2189fd6..54b5b35 100644 |
40 --- a/third_party/sqlite/src/main.mk | 40 --- a/third_party/sqlite/src/main.mk |
41 +++ b/third_party/sqlite/src/main.mk | 41 +++ b/third_party/sqlite/src/main.mk |
42 @@ -358,7 +358,7 @@ libsqlite3.a:» $(LIBOBJ) | 42 @@ -395,7 +395,7 @@ libsqlite3.a:» $(LIBOBJ) |
43 | 43 |
44 sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h | 44 sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h |
45 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \ | 45 $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \ |
46 - $(TOP)/src/shell.c \ | 46 - $(TOP)/src/shell.c \ |
47 + $(TOP)/src/shell.c $(SHELL_ICU) \ | 47 + $(TOP)/src/shell.c $(SHELL_ICU) \ |
48 libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB) | 48 libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB) |
49 | 49 |
50 # This target creates a directory named "tsrc" and fills it with | 50 mptester$(EXE):» sqlite3.c $(TOP)/mptest/mptest.c |
51 diff --git a/third_party/sqlite/src/src/shell.c b/third_party/sqlite/src/src/she
ll.c | 51 diff --git a/third_party/sqlite/src/src/shell.c b/third_party/sqlite/src/src/she
ll.c |
52 index aab70b2..ffb4698 100644 | 52 index 3ca4b09..0951481 100644 |
53 --- a/third_party/sqlite/src/src/shell.c | 53 --- a/third_party/sqlite/src/src/shell.c |
54 +++ b/third_party/sqlite/src/src/shell.c | 54 +++ b/third_party/sqlite/src/src/shell.c |
55 @@ -2663,6 +2663,16 @@ int main(int argc, char **argv){ | 55 @@ -3963,6 +3963,16 @@ int main(int argc, char **argv){ |
56 int i; | 56 signal(SIGINT, interrupt_handler); |
57 int rc = 0; | 57 #endif |
58 | 58 |
59 + /* Begin evanm patch. */ | 59 + /* Begin evanm patch. */ |
60 +#if !defined(__APPLE__) | 60 +#if !defined(__APPLE__) |
61 + extern int sqlite_shell_init_icu(); | 61 + extern int sqlite_shell_init_icu(); |
62 + if( !sqlite_shell_init_icu() ){ | 62 + if( !sqlite_shell_init_icu() ){ |
63 + fprintf(stderr, "%s: warning: couldn't find icudt38.dll; " | 63 + fprintf(stderr, "%s: warning: couldn't find icudt38.dll; " |
64 + "queries against ICU FTS tables will fail.\n", argv[0]); | 64 + "queries against ICU FTS tables will fail.\n", argv[0]); |
65 + } | 65 + } |
66 +#endif /* !defined(__APPLE__) */ | 66 +#endif /* !defined(__APPLE__) */ |
67 + /* End evanm patch. */ | 67 + /* End evanm patch. */ |
68 + | 68 + |
69 Argv0 = argv[0]; | 69 /* Do an initial pass through the command-line argument to locate |
70 main_init(&data); | 70 ** the name of the database file, the name of the initialization file, |
71 stdin_is_interactive = isatty(0); | 71 ** the size of the alternative malloc heap, |
72 diff --git a/third_party/sqlite/src/src/shell_icu_linux.c b/third_party/sqlite/s
rc/src/shell_icu_linux.c | 72 diff --git a/third_party/sqlite/src/src/shell_icu_linux.c b/third_party/sqlite/s
rc/src/shell_icu_linux.c |
73 new file mode 100644 | 73 new file mode 100644 |
74 index 0000000..4ad0e42 | 74 index 0000000..4ad0e42 |
75 --- /dev/null | 75 --- /dev/null |
76 +++ b/third_party/sqlite/src/src/shell_icu_linux.c | 76 +++ b/third_party/sqlite/src/src/shell_icu_linux.c |
77 @@ -0,0 +1,27 @@ | 77 @@ -0,0 +1,27 @@ |
78 +/* Copyright 2007 Google Inc. All Rights Reserved. | 78 +/* Copyright 2007 Google Inc. All Rights Reserved. |
79 +**/ | 79 +**/ |
80 + | 80 + |
81 +#include <limits.h> | 81 +#include <limits.h> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 + return 0; | 136 + return 0; |
137 + | 137 + |
138 + err = U_ZERO_ERROR; | 138 + err = U_ZERO_ERROR; |
139 + udata_setCommonData(addr, &err); | 139 + udata_setCommonData(addr, &err); |
140 + | 140 + |
141 + return 1; | 141 + return 1; |
142 +} | 142 +} |
143 -- | 143 -- |
144 2.2.1 | 144 2.2.1 |
145 | 145 |
OLD | NEW |