summaryrefslogtreecommitdiff
path: root/db/sqlite3/src/Makefile.in
blob: f6563bd7628c2e8115ab3d435e98639e61a09f91 (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
121
122
123
124
125
126
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

DEPTH		= @DEPTH@
topsrcdir	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= @srcdir@

include $(DEPTH)/config/autoconf.mk

SHORT_LIBNAME    = mozsqlt3
ifdef MOZ_FOLD_LIBS
FORCE_STATIC_LIB = 1
else
FORCE_SHARED_LIB = 1
endif
VISIBILITY_FLAGS =
LIB_IS_C_ONLY    = 1

ifeq ($(OS_ARCH),WINNT)
DEFFILE = $(CURDIR)/sqlite-processed.def
RCFILE  = sqlite.rc
RESFILE = sqlite.res

GARBAGE += \
  sqlite-version.h \
  $(DEFFILE) \
  $(NULL)

# We generate the appropriate version header file with our python script.
sqlite-version.h: sqlite-version.py sqlite3.h
	$(PYTHON) $^ > $@

# We have to preprocess our def file because we need different symbols in debug
# builds exposed that are not built in non-debug builds.
$(DEFFILE): sqlite.def
	@$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
	  $(srcdir)/sqlite.def > $(DEFFILE)

export:: sqlite-version.h
endif

ifeq (Darwin,$(OS_TARGET))
# On OSX, with jemalloc enabled, having sqlite linked against mozglue
# causes crashes in NSS standalone tools.
MOZ_GLUE_LDFLAGS =
endif

# XXX Force -O2 optimisation on Mac because using the default -O3 causes
# crashes. See bug 676499.
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
MODULE_OPTIMIZE_FLAGS = -O2
endif

# Force /O2 optimisation on Windows because using the default /O1 causes
# crashes with MSVC2005 and PGO. See bug 719584.
ifeq ($(OS_ARCH),WINNT)
MODULE_OPTIMIZE_FLAGS = -O2
endif

CSRCS = \
  sqlite3.c \
  $(NULL)

# -DSQLITE_SECURE_DELETE=1 will cause SQLITE to 0-fill delete data so we
# don't have to vacuum to make sure the data is not visible in the file.
# -DSQLITE_ENABLE_FTS3=1 enables the full-text index module.
# -DSQLITE_CORE=1 statically links that module into the SQLite library.
# -DSQLITE_DEFAULT_PAGE_SIZE=32768 and SQLITE_MAX_DEFAULT_PAGE_SIZE=32768
# increases the page size from 1k, see bug 416330.  It must be kept in sync with
# the value of PREF_TS_PAGESIZE_DEFAULT in mozStorageService.cpp.  The value can
# be overridden on a per-platform basis through the use of the PREF_TS_PAGESIZE
# hidden preference.  If that preference is missing or invalid then this value
# will be used.
# -DSQLITE_MAX_SCHEMA_RETRY increases the times SQLite may try to reparse
# statements when the schema changes. This is important when supporting lots of
# concurrent connections, especially when they use shared cache.
# Note: Be sure to update the configure.in checks when these change!
DEFINES = \
  -DSQLITE_SECURE_DELETE=1 \
  -DSQLITE_THREADSAFE=1 \
  -DSQLITE_CORE=1 \
  -DSQLITE_ENABLE_FTS3=1 \
  -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
  -DSQLITE_DEFAULT_PAGE_SIZE=32768 \
  -DSQLITE_MAX_DEFAULT_PAGE_SIZE=32768 \
  -DSQLITE_MAX_SCHEMA_RETRY=25 \
  $(NULL)

# -DSQLITE_ENABLE_LOCKING_STYLE=1 to help with AFP folders
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
DEFINES += -DSQLITE_ENABLE_LOCKING_STYLE=1
endif

# Turn on SQLite's assertions in debug builds.
ifdef MOZ_DEBUG
DEFINES += -DSQLITE_DEBUG=1
endif

# disable PGO for Sun Studio
ifdef SOLARIS_SUNPRO_CC
NO_PROFILE_GUIDED_OPTIMIZE = 1
endif

ifeq ($(OS_TARGET),Android)
# default to user readable only to fit Android security model
DEFINES += -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600
endif

# Force using malloc_usable_size when building with jemalloc because _msize
# causes assertions on Win64. See bug 719579.
ifeq ($(OS_ARCH),WINNT)
ifdef MOZ_MEMORY
DEFINES += \
  -DHAVE_MALLOC_USABLE_SIZE \
  -DSQLITE_WITHOUT_MSIZE \
  $(NULL)
endif
endif

include $(topsrcdir)/config/rules.mk

# next line allows use of MOZ_OBJDIR in .mozconfig with older gcc on BeOS, maybe others
LOCAL_INCLUDES += -I$(srcdir)