db/sqlite3/src/moz.build

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
michael@0 2 # vim: set filetype=python:
michael@0 3 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 6 NO_VISIBILITY_FLAGS = True
michael@0 7
michael@0 8 EXPORTS += [
michael@0 9 'sqlite3.h',
michael@0 10 ]
michael@0 11
michael@0 12 LIBRARY_NAME = 'mozsqlite3'
michael@0 13
michael@0 14 SOURCES += [
michael@0 15 'sqlite3.c',
michael@0 16 ]
michael@0 17
michael@0 18 if CONFIG['MOZ_FOLD_LIBS']:
michael@0 19 FORCE_STATIC_LIB = True
michael@0 20 else:
michael@0 21 FORCE_SHARED_LIB = True
michael@0 22
michael@0 23 # -DSQLITE_SECURE_DELETE=1 will cause SQLITE to 0-fill delete data so we
michael@0 24 # don't have to vacuum to make sure the data is not visible in the file.
michael@0 25 # -DSQLITE_ENABLE_FTS3=1 enables the full-text index module.
michael@0 26 # -DSQLITE_CORE=1 statically links that module into the SQLite library.
michael@0 27 # -DSQLITE_DEFAULT_PAGE_SIZE=32768 and SQLITE_MAX_DEFAULT_PAGE_SIZE=32768
michael@0 28 # increases the page size from 1k, see bug 416330. It must be kept in sync with
michael@0 29 # the value of PREF_TS_PAGESIZE_DEFAULT in mozStorageService.cpp. The value can
michael@0 30 # be overridden on a per-platform basis through the use of the PREF_TS_PAGESIZE
michael@0 31 # hidden preference. If that preference is missing or invalid then this value
michael@0 32 # will be used.
michael@0 33 # -DSQLITE_MAX_SCHEMA_RETRY increases the times SQLite may try to reparse
michael@0 34 # statements when the schema changes. This is important when supporting lots of
michael@0 35 # concurrent connections, especially when they use shared cache.
michael@0 36 # Note: Be sure to update the configure.in checks when these change!
michael@0 37 for var in ('SQLITE_SECURE_DELETE', 'SQLITE_THREADSAFE', 'SQLITE_CORE',
michael@0 38 'SQLITE_ENABLE_FTS3', 'SQLITE_ENABLE_UNLOCK_NOTIFY'):
michael@0 39 DEFINES[var] = 1
michael@0 40
michael@0 41 DEFINES['SQLITE_DEFAULT_PAGE_SIZE'] = 32768
michael@0 42 DEFINES['SQLITE_MAX_DEFAULT_PAGE_SIZE'] = 32768
michael@0 43 DEFINES['SQLITE_MAX_SCHEMA_RETRY'] = 25
michael@0 44
michael@0 45 # -DSQLITE_WIN32_GETVERSIONEX=0 avoids using deprecated functions.
michael@0 46 # SQLite will just assume we are running on NT kinds of Windows. That's fine
michael@0 47 # because we don't support Win9x.
michael@0 48 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
michael@0 49 DEFINES['SQLITE_WIN32_GETVERSIONEX'] = 0
michael@0 50
michael@0 51 # -DSQLITE_ENABLE_LOCKING_STYLE=1 to help with AFP folders
michael@0 52 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
michael@0 53 DEFINES['SQLITE_ENABLE_LOCKING_STYLE'] = 1
michael@0 54
michael@0 55 # Turn on SQLite's assertions in debug builds.
michael@0 56 if CONFIG['MOZ_DEBUG']:
michael@0 57 DEFINES['SQLITE_DEBUG'] = 1
michael@0 58
michael@0 59 if CONFIG['OS_TARGET'] == 'Android':
michael@0 60 # default to user readable only to fit Android security model
michael@0 61 DEFINES['SQLITE_DEFAULT_FILE_PERMISSIONS'] = '0600'
michael@0 62
michael@0 63 # Force using malloc_usable_size when building with jemalloc because _msize
michael@0 64 # causes assertions on Win64. See bug 719579.
michael@0 65 if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_MEMORY']:
michael@0 66 DEFINES['HAVE_MALLOC_USABLE_SIZE'] = True
michael@0 67 DEFINES['SQLITE_WITHOUT_MSIZE'] = True
michael@0 68
michael@0 69 # disable PGO for Sun Studio
michael@0 70 if CONFIG['SOLARIS_SUNPRO_CC']:
michael@0 71 NO_PGO = True
michael@0 72
michael@0 73 if CONFIG['OS_ARCH'] == 'WINNT':
michael@0 74 RCFILE = 'sqlite.rc'
michael@0 75 RESFILE = 'sqlite.res'
michael@0 76
michael@0 77 # Suppress warnings in third-party code.
michael@0 78 if CONFIG['GNU_CC']:
michael@0 79 CFLAGS += [
michael@0 80 '-Wno-sign-compare',
michael@0 81 '-Wno-type-limits',
michael@0 82 ]

mercurial