PageRenderTime 27ms CodeModel.GetById 14ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

/db/sqlite3/src/Makefile.in

http://github.com/zpao/v8monkey
Autoconf | 171 lines | 82 code | 23 blank | 66 comment | 0 complexity | 82d29269dbab8410474a1c20f01bcb62 MD5 | raw file
  1#
  2# ***** BEGIN LICENSE BLOCK *****
  3# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4#
  5# The contents of this file are subject to the Mozilla Public License Version
  6# 1.1 (the "License"); you may not use this file except in compliance with
  7# the License. You may obtain a copy of the License at
  8# http://www.mozilla.org/MPL/
  9#
 10# Software distributed under the License is distributed on an "AS IS" basis,
 11# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 12# for the specific language governing rights and limitations under the
 13# License.
 14#
 15# The Original Code is sqlite3 code.
 16#
 17# The Initial Developer of the Original Code is
 18#   sqlite3
 19# Portions created by the Initial Developer are Copyright (C) 2004
 20# the Initial Developer. All Rights Reserved.
 21#
 22# Contributor(s):
 23#   Vladimir Vukicevic <vladimir.vukicevic@oracle.com>
 24#   Shawn Wilsher <me@shawnwilsher.com>
 25#   Ryan VanderMeulen <ryanvm@gmail.com>
 26#
 27# Alternatively, the contents of this file may be used under the terms of
 28# either of the GNU General Public License Version 2 or later (the "GPL"),
 29# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 30# in which case the provisions of the GPL or the LGPL are applicable instead
 31# of those above. If you wish to allow use of your version of this file only
 32# under the terms of either the GPL or the LGPL, and not to allow others to
 33# use your version of this file under the terms of the MPL, indicate your
 34# decision by deleting the provisions above and replace them with the notice
 35# and other provisions required by the GPL or the LGPL. If you do not delete
 36# the provisions above, a recipient may use your version of this file under
 37# the terms of any one of the MPL, the GPL or the LGPL.
 38#
 39# ***** END LICENSE BLOCK *****
 40
 41DEPTH		= ../../..
 42topsrcdir	= @top_srcdir@
 43srcdir		= @srcdir@
 44VPATH		= @srcdir@
 45
 46include $(DEPTH)/config/autoconf.mk
 47
 48MODULE           = sqlite3
 49LIBRARY_NAME     = mozsqlite3
 50SHORT_LIBNAME    = mozsqlt3
 51FORCE_SHARED_LIB = 1
 52VISIBILITY_FLAGS =
 53LIB_IS_C_ONLY    = 1
 54
 55ifeq ($(OS_ARCH),WINNT)
 56ifndef GNU_CC
 57DEFFILE = $(CURDIR)/sqlite-processed.def
 58RCFILE  = sqlite.rc
 59RESFILE = sqlite.res
 60
 61GARBAGE += \
 62  sqlite-version.h \
 63  $(DEFFILE) \
 64  $(NULL)
 65
 66# We generate the appropriate version header file with our python script.
 67sqlite-version.h: sqlite-version.py sqlite3.h
 68	$(PYTHON) $^ > $@
 69
 70# We have to preprocess our def file because we need different symbols in debug
 71# builds exposed that are not built in non-debug builds.
 72$(DEFFILE): sqlite.def
 73	@$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
 74	  $(srcdir)/sqlite.def > $(DEFFILE)
 75
 76export:: sqlite-version.h
 77endif
 78endif
 79
 80ifeq (Darwin,$(OS_TARGET))
 81# On OSX, with jemalloc enabled, having sqlite linked against mozglue
 82# causes crashes in NSS standalone tools.
 83MOZ_GLUE_LDFLAGS =
 84endif
 85
 86# XXX Force -O2 optimisation on Mac because using the default -O3 causes
 87# crashes. See bug 676499.
 88ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 89MODULE_OPTIMIZE_FLAGS = -O2
 90endif
 91
 92# Force /O2 optimisation on Windows because using the default /O1 causes
 93# crashes with MSVC2005 and PGO. See bug 719584.
 94ifeq ($(OS_ARCH),WINNT)
 95MODULE_OPTIMIZE_FLAGS = -O2
 96endif
 97
 98EXPORTS = \
 99  sqlite3.h \
100  $(NULL)
101
102CSRCS = \
103  sqlite3.c \
104  $(NULL)
105
106# -DSQLITE_SECURE_DELETE=1 will cause SQLITE to 0-fill delete data so we
107# don't have to vacuum to make sure the data is not visible in the file.
108# -DSQLITE_ENABLE_FTS3=1 enables the full-text index module.
109# -DSQLITE_CORE=1 statically links that module into the SQLite library.
110# -DSQLITE_DEFAULT_PAGE_SIZE=32768 and SQLITE_MAX_DEFAULT_PAGE_SIZE=32768
111# increases the page size from 1k, see bug 416330.  The value must stay in sync
112# with mozIStorageConnection::DEFAULT_PAGE_SIZE.
113# -DSQLITE_MAX_SCHEMA_RETRY increases the times SQLite may try to reparse
114# statements when the schema changes. This is important when supporting lots of
115# concurrent connections, especially when they use shared cache.
116# Note: Be sure to update the configure.in checks when these change!
117DEFINES = \
118  -DSQLITE_SECURE_DELETE=1 \
119  -DSQLITE_THREADSAFE=1 \
120  -DSQLITE_CORE=1 \
121  -DSQLITE_ENABLE_FTS3=1 \
122  -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
123  -DSQLITE_DEFAULT_PAGE_SIZE=32768 \
124  -DSQLITE_MAX_DEFAULT_PAGE_SIZE=32768 \
125  -DSQLITE_MAX_SCHEMA_RETRY=25 \
126  $(NULL)
127
128# -DSQLITE_ENABLE_LOCKING_STYLE=1 to help with AFP folders
129ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
130DEFINES += -DSQLITE_ENABLE_LOCKING_STYLE=1
131endif
132
133# Turn on SQLite's assertions in debug builds.
134ifdef MOZ_DEBUG
135DEFINES += -DSQLITE_DEBUG=1
136endif
137
138# disable PGO for Sun Studio
139ifdef SOLARIS_SUNPRO_CC
140NO_PROFILE_GUIDED_OPTIMIZE = 1
141endif
142
143ifeq ($(OS_ARCH),OS2)
144ifdef MOZ_OS2_HIGH_MEMORY
145DEFINES += -DOS2_HIGH_MEMORY
146endif
147endif
148
149ifeq ($(OS_TARGET),Android)
150# default to user readable only to fit Android security model
151DEFINES += -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600
152endif
153
154# Force using malloc_usable_size when building with jemalloc because _msize
155# causes assertions on Win64. See bug 719579.
156ifeq ($(OS_ARCH),WINNT)
157ifdef MOZ_MEMORY
158DEFINES += -DHAVE_MALLOC_USABLE_SIZE
159endif
160endif
161
162include $(topsrcdir)/config/rules.mk
163
164# next line allows use of MOZ_OBJDIR in .mozconfig with older gcc on BeOS, maybe others
165LOCAL_INCLUDES += -I$(srcdir)
166
167ifeq ($(OS_ARCH),OS2)
168ADD_TO_DEF_FILE = $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
169       $(srcdir)/sqlite.def | sed -e '1,/^EXPORTS$$/ d' -e 's,sqlite3,_\0,' \
170       -e 's,\ DATA.*$$,,' >> $(DEF_FILE)
171endif