summaryrefslogtreecommitdiff
path: root/chromium/third_party/sqlite/patches/0001-test-SQLite-tests-compiling-on-Linux.patch
blob: 09e1e559f4a04f6562cac432cf36d99b44d2e8f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
From 35703557681c70acd710c1ee83f1ef54eef06df8 Mon Sep 17 00:00:00 2001
From: Scott Hess <shess@chromium.org>
Date: Fri, 16 Jan 2015 10:24:30 -0800
Subject: [PATCH 01/10] [test] SQLite tests compiling on Linux.

---
 third_party/sqlite/src/Makefile.linux-gcc | 41 ++++++++++++++++++++++---------
 third_party/sqlite/src/main.mk            |  2 +-
 2 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/third_party/sqlite/src/Makefile.linux-gcc b/third_party/sqlite/src/Makefile.linux-gcc
index 1491a4b..a1dec21 100644
--- a/third_party/sqlite/src/Makefile.linux-gcc
+++ b/third_party/sqlite/src/Makefile.linux-gcc
@@ -14,7 +14,7 @@
 #### The toplevel directory of the source tree.  This is the directory
 #    that contains this "Makefile.in" and the "configure.in" script.
 #
-TOP = ../sqlite
+TOP = ..
 
 #### C Compiler and options for use in building executables that
 #    will run on the platform that is doing the build.
@@ -32,19 +32,19 @@ USLEEP = -DHAVE_USLEEP=1
 #    multi-threaded program, then define the following macro
 #    appropriately:
 #
-#THREADSAFE = -DTHREADSAFE=1
-THREADSAFE = -DTHREADSAFE=0
+THREADSAFE = -DTHREADSAFE=1
+#THREADSAFE = -DTHREADSAFE=0
 
 #### Specify any extra linker options needed to make the library
 #    thread safe
 #
-#THREADLIB = -lpthread
-THREADLIB = 
+THREADLIB = -lpthread
+#THREADLIB = 
 
 #### Specify any extra libraries needed to access required functions.
 #
 #TLIBS = -lrt    # fdatasync on Solaris 8
-TLIBS = 
+TLIBS = -ldl
 
 #### Leave SQLITE_DEBUG undefined for maximum speed.  Use SQLITE_DEBUG=1
 #    to check for memory leaks.  Use SQLITE_DEBUG=2 to print a log of all
@@ -58,7 +58,24 @@ TLIBS =
 #OPTS = -DSQLITE_DEBUG=1
 #OPTS = 
 OPTS = -DNDEBUG=1
-OPTS += -DHAVE_FDATASYNC=1
+#OPTS += -DHAVE_FDATASYNC=1
+
+# These flags match those for SQLITE_CFLAGS in config.mk.
+
+OPTS += -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600
+OPTS += -DHAVE_USLEEP=1
+
+# Additional SQLite tests.
+OPTS += -DSQLITE_MEMDEBUG=1
+
+# Don't include these ones, they break the SQLite tests.
+#  -DSQLITE_OMIT_ATTACH=1 \
+#  -DSQLITE_OMIT_LOAD_EXTENSION=1 \
+#  -DSQLITE_OMIT_VACUUM=1 \
+#  -DSQLITE_TRANSACTION_DEFAULT_IMMEDIATE=1 \
+
+# TODO(shess) I can't see why I need this setting.
+OPTS += -DOS_UNIX=1
 
 #### The suffix to add to executable files.  ".exe" for windows.
 #    Nothing for unix.
@@ -70,7 +87,7 @@ EXE =
 #    will run on the target platform.  This is usually the same
 #    as BCC, unless you are cross-compiling.
 #
-TCC = gcc -O6
+TCC = gcc -Os
 #TCC = gcc -g -O0 -Wall
 #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage
 #TCC = /opt/mingw/bin/i386-mingw32-gcc -O6
@@ -91,16 +108,16 @@ SHPREFIX = lib
 
 #### Extra compiler options needed for programs that use the TCL library.
 #
-#TCL_FLAGS =
+TCL_FLAGS = -I/usr/include/tcl8.6
 #TCL_FLAGS = -DSTATIC_BUILD=1
-TCL_FLAGS = -I/home/drh/tcltk/8.5linux
+#TCL_FLAGS = -I/home/drh/tcltk/8.5linux
 #TCL_FLAGS = -I/home/drh/tcltk/8.5win -DSTATIC_BUILD=1
 #TCL_FLAGS = -I/home/drh/tcltk/8.3hpux
 
 #### Linker options needed to link against the TCL library.
 #
-#LIBTCL = -ltcl -lm -ldl
-LIBTCL = /home/drh/tcltk/8.5linux/libtcl8.5g.a -lm -ldl
+LIBTCL = -ltcl8.6 -lm -ldl
+#LIBTCL = /home/drh/tcltk/8.5linux/libtcl8.5g.a -lm -ldl
 #LIBTCL = /home/drh/tcltk/8.5win/libtcl85s.a -lmsvcrt
 #LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc
 
diff --git a/third_party/sqlite/src/main.mk b/third_party/sqlite/src/main.mk
index e6ca1ac..fcc0270 100644
--- a/third_party/sqlite/src/main.mk
+++ b/third_party/sqlite/src/main.mk
@@ -714,7 +714,7 @@ sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl
 	echo "; return zMainloop; }" >> $@
 
 sqlite3_analyzer$(EXE): sqlite3_analyzer.c
-	$(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB) 
+	$(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS) $(THREADLIB)
 
 # Rules to build the 'testfixture' application.
 #
-- 
2.7.0