2
# This Source Code Form is subject to the terms of the Mozilla Public
3
# License, v. 2.0. If a copy of the MPL was not distributed with this
4
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
topsrcdir = @top_srcdir@
11
include $(DEPTH)/config/autoconf.mk
14
LIBRARY_NAME = mozsqlite3
15
SHORT_LIBNAME = mozsqlt3
20
ifeq ($(OS_ARCH),WINNT)
22
DEFFILE = $(CURDIR)/sqlite-processed.def
31
# We generate the appropriate version header file with our python script.
32
sqlite-version.h: sqlite-version.py sqlite3.h
35
# We have to preprocess our def file because we need different symbols in debug
36
# builds exposed that are not built in non-debug builds.
37
$(DEFFILE): sqlite.def
38
@$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
39
$(srcdir)/sqlite.def > $(DEFFILE)
41
export:: sqlite-version.h
45
ifeq (Darwin,$(OS_TARGET))
46
# On OSX, with jemalloc enabled, having sqlite linked against mozglue
47
# causes crashes in NSS standalone tools.
51
# XXX Force -O2 optimisation on Mac because using the default -O3 causes
52
# crashes. See bug 676499.
53
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
54
MODULE_OPTIMIZE_FLAGS = -O2
57
# Force /O2 optimisation on Windows because using the default /O1 causes
58
# crashes with MSVC2005 and PGO. See bug 719584.
59
ifeq ($(OS_ARCH),WINNT)
60
MODULE_OPTIMIZE_FLAGS = -O2
71
# -DSQLITE_SECURE_DELETE=1 will cause SQLITE to 0-fill delete data so we
72
# don't have to vacuum to make sure the data is not visible in the file.
73
# -DSQLITE_ENABLE_FTS3=1 enables the full-text index module.
74
# -DSQLITE_CORE=1 statically links that module into the SQLite library.
75
# -DSQLITE_DEFAULT_PAGE_SIZE=32768 and SQLITE_MAX_DEFAULT_PAGE_SIZE=32768
76
# increases the page size from 1k, see bug 416330. The value must stay in sync
77
# with mozIStorageConnection::DEFAULT_PAGE_SIZE.
78
# -DSQLITE_MAX_SCHEMA_RETRY increases the times SQLite may try to reparse
79
# statements when the schema changes. This is important when supporting lots of
80
# concurrent connections, especially when they use shared cache.
81
# Note: Be sure to update the configure.in checks when these change!
83
-DSQLITE_SECURE_DELETE=1 \
84
-DSQLITE_THREADSAFE=1 \
86
-DSQLITE_ENABLE_FTS3=1 \
87
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
88
-DSQLITE_DEFAULT_PAGE_SIZE=32768 \
89
-DSQLITE_MAX_DEFAULT_PAGE_SIZE=32768 \
90
-DSQLITE_MAX_SCHEMA_RETRY=25 \
93
# -DSQLITE_ENABLE_LOCKING_STYLE=1 to help with AFP folders
94
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
95
DEFINES += -DSQLITE_ENABLE_LOCKING_STYLE=1
98
# Turn on SQLite's assertions in debug builds.
100
DEFINES += -DSQLITE_DEBUG=1
103
# disable PGO for Sun Studio
104
ifdef SOLARIS_SUNPRO_CC
105
NO_PROFILE_GUIDED_OPTIMIZE = 1
108
ifeq ($(OS_ARCH),OS2)
109
ifdef MOZ_OS2_HIGH_MEMORY
110
DEFINES += -DOS2_HIGH_MEMORY
114
ifeq ($(OS_TARGET),Android)
115
# default to user readable only to fit Android security model
116
DEFINES += -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600
119
# Force using malloc_usable_size when building with jemalloc because _msize
120
# causes assertions on Win64. See bug 719579.
121
ifeq ($(OS_ARCH),WINNT)
124
-DHAVE_MALLOC_USABLE_SIZE \
125
-DSQLITE_WITHOUT_MSIZE \
130
include $(topsrcdir)/config/rules.mk
132
# next line allows use of MOZ_OBJDIR in .mozconfig with older gcc on BeOS, maybe others
133
LOCAL_INCLUDES += -I$(srcdir)
135
ifeq ($(OS_ARCH),OS2)
136
ADD_TO_DEF_FILE = $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
137
$(srcdir)/sqlite.def | sed -e '1,/^EXPORTS$$/ d' -e 's,sqlite3,_\0,' \
138
-e 's,\ DATA.*$$,,' >> $(DEF_FILE)