michael@0: # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- michael@0: # vim: set filetype=python: michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: NO_VISIBILITY_FLAGS = True michael@0: michael@0: EXPORTS += [ michael@0: 'sqlite3.h', michael@0: ] michael@0: michael@0: LIBRARY_NAME = 'mozsqlite3' michael@0: michael@0: SOURCES += [ michael@0: 'sqlite3.c', michael@0: ] michael@0: michael@0: if CONFIG['MOZ_FOLD_LIBS']: michael@0: FORCE_STATIC_LIB = True michael@0: else: michael@0: FORCE_SHARED_LIB = True michael@0: michael@0: # -DSQLITE_SECURE_DELETE=1 will cause SQLITE to 0-fill delete data so we michael@0: # don't have to vacuum to make sure the data is not visible in the file. michael@0: # -DSQLITE_ENABLE_FTS3=1 enables the full-text index module. michael@0: # -DSQLITE_CORE=1 statically links that module into the SQLite library. michael@0: # -DSQLITE_DEFAULT_PAGE_SIZE=32768 and SQLITE_MAX_DEFAULT_PAGE_SIZE=32768 michael@0: # increases the page size from 1k, see bug 416330. It must be kept in sync with michael@0: # the value of PREF_TS_PAGESIZE_DEFAULT in mozStorageService.cpp. The value can michael@0: # be overridden on a per-platform basis through the use of the PREF_TS_PAGESIZE michael@0: # hidden preference. If that preference is missing or invalid then this value michael@0: # will be used. michael@0: # -DSQLITE_MAX_SCHEMA_RETRY increases the times SQLite may try to reparse michael@0: # statements when the schema changes. This is important when supporting lots of michael@0: # concurrent connections, especially when they use shared cache. michael@0: # Note: Be sure to update the configure.in checks when these change! michael@0: for var in ('SQLITE_SECURE_DELETE', 'SQLITE_THREADSAFE', 'SQLITE_CORE', michael@0: 'SQLITE_ENABLE_FTS3', 'SQLITE_ENABLE_UNLOCK_NOTIFY'): michael@0: DEFINES[var] = 1 michael@0: michael@0: DEFINES['SQLITE_DEFAULT_PAGE_SIZE'] = 32768 michael@0: DEFINES['SQLITE_MAX_DEFAULT_PAGE_SIZE'] = 32768 michael@0: DEFINES['SQLITE_MAX_SCHEMA_RETRY'] = 25 michael@0: michael@0: # -DSQLITE_WIN32_GETVERSIONEX=0 avoids using deprecated functions. michael@0: # SQLite will just assume we are running on NT kinds of Windows. That's fine michael@0: # because we don't support Win9x. michael@0: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': michael@0: DEFINES['SQLITE_WIN32_GETVERSIONEX'] = 0 michael@0: michael@0: # -DSQLITE_ENABLE_LOCKING_STYLE=1 to help with AFP folders michael@0: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': michael@0: DEFINES['SQLITE_ENABLE_LOCKING_STYLE'] = 1 michael@0: michael@0: # Turn on SQLite's assertions in debug builds. michael@0: if CONFIG['MOZ_DEBUG']: michael@0: DEFINES['SQLITE_DEBUG'] = 1 michael@0: michael@0: if CONFIG['OS_TARGET'] == 'Android': michael@0: # default to user readable only to fit Android security model michael@0: DEFINES['SQLITE_DEFAULT_FILE_PERMISSIONS'] = '0600' michael@0: michael@0: # Force using malloc_usable_size when building with jemalloc because _msize michael@0: # causes assertions on Win64. See bug 719579. michael@0: if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_MEMORY']: michael@0: DEFINES['HAVE_MALLOC_USABLE_SIZE'] = True michael@0: DEFINES['SQLITE_WITHOUT_MSIZE'] = True michael@0: michael@0: # disable PGO for Sun Studio michael@0: if CONFIG['SOLARIS_SUNPRO_CC']: michael@0: NO_PGO = True michael@0: michael@0: if CONFIG['OS_ARCH'] == 'WINNT': michael@0: RCFILE = 'sqlite.rc' michael@0: RESFILE = 'sqlite.res' michael@0: michael@0: # Suppress warnings in third-party code. michael@0: if CONFIG['GNU_CC']: michael@0: CFLAGS += [ michael@0: '-Wno-sign-compare', michael@0: '-Wno-type-limits', michael@0: ]