diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /third_party/sqlite3/src/moz.build | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/sqlite3/src/moz.build')
-rw-r--r-- | third_party/sqlite3/src/moz.build | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/third_party/sqlite3/src/moz.build b/third_party/sqlite3/src/moz.build new file mode 100644 index 0000000000..18e306f760 --- /dev/null +++ b/third_party/sqlite3/src/moz.build @@ -0,0 +1,132 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. +NoVisibilityFlags() + +EXPORTS += [ + 'sqlite3.h', +] + +# We allow warnings for third-party code that can be updated from upstream. +AllowCompilerWarnings() + +if CONFIG['MOZ_FOLD_LIBS']: + # When folding libraries, sqlite is actually in the nss library. + FINAL_LIBRARY = 'nss' +else: + # The final library is in config/external/sqlite + FINAL_LIBRARY = 'sqlite' + +DIRS += [ + '../ext' +] + +SOURCES += [ + 'sqlite3.c', +] + +# -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_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. +# Note: Be sure to update the configure.in checks when these change! +for var in ('SQLITE_SECURE_DELETE', 'SQLITE_THREADSAFE', + 'SQLITE_ENABLE_UNLOCK_NOTIFY', 'SQLITE_ENABLE_DBSTAT_VTAB'): + DEFINES[var] = 1 + +DEFINES['SQLITE_DEFAULT_PAGE_SIZE'] = 32768 +DEFINES['SQLITE_MAX_DEFAULT_PAGE_SIZE'] = 32768 + +# -DSQLITE_WIN32_GETVERSIONEX=0 avoids using deprecated functions. +# SQLite will just assume we are running on NT kinds of Windows. That's fine +# because we don't support Win9x. +# -DSQLITE_ALLOW_URI_AUTHORITY=1 enables uri authorities. See bug 879133. +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': + DEFINES['SQLITE_WIN32_GETVERSIONEX'] = 0 + DEFINES['SQLITE_ALLOW_URI_AUTHORITY'] = 1 + +# -DSQLITE_ENABLE_LOCKING_STYLE=1 to help with AFP folders +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + DEFINES['SQLITE_ENABLE_LOCKING_STYLE'] = 1 + +# sqlite defaults this to on on __APPLE_ but it breaks on newer iOS SDKs +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit': + DEFINES['SQLITE_ENABLE_LOCKING_STYLE'] = 0 + +# Turn on SQLite's assertions in debug builds. +if CONFIG['MOZ_DEBUG']: + DEFINES['SQLITE_DEBUG'] = 1 + DEFINES['SQLITE_ENABLE_API_ARMOR'] = True +else: + DEFINES['SQLITE_OMIT_COMPILEOPTION_DIAGS'] = 1 + +if CONFIG['OS_TARGET'] == 'Android': + # default to user readable only to fit Android security model + DEFINES['SQLITE_DEFAULT_FILE_PERMISSIONS'] = '0600' + +# Force using _msize on mingw, as sqlite3 only enables it with MSVC. +if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CC_TYPE'] != 'clang-cl': + DEFINES['SQLITE_USE_MALLOC_H'] = True + DEFINES['SQLITE_USE_MSIZE'] = True + +# Omit unused functions to save some library footprint. +DEFINES['SQLITE_OMIT_DEPRECATED'] = True +DEFINES['SQLITE_OMIT_BUILTIN_TEST'] = True + +# Try to use a MEMORY temp store when possible. That allows for better +# performance and doesn't suffer from a full separate tmp partition. +# Exclude 32bit platforms due to address space fragmentation issues. +if CONFIG['OS_TARGET'] == 'Android': + # On Android there's no tmp partition, so always use a MEMORY temp store. + DEFINES['SQLITE_TEMP_STORE'] = 3 +elif CONFIG['HAVE_64BIT_BUILD']: + # On 64bit platforms default to a MEMORY temp store for performance. + DEFINES['SQLITE_TEMP_STORE'] = 2 + +# Change the default temp files prefix, to easily distinguish files we created +# vs files created by other Sqlite instances in the system. +DEFINES['SQLITE_TEMP_FILE_PREFIX'] = '"mz_etilqs_"' + +# Enabling sqlite math functions +DEFINES['SQLITE_ENABLE_MATH_FUNCTIONS'] = True +if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "Android": + OS_LIBS += [ + "m" + ] + +# 32-bit Android doesn't have the log2() stdlib function +if CONFIG['OS_TARGET'] == 'Android' and not CONFIG['HAVE_64BIT_BUILD']: + DEFINES['HAVE_LOG2'] = 0 + +# Suppress warnings in third-party code. +if CONFIG['CC_TYPE'] in ('clang', 'gcc'): + CFLAGS += [ + '-Wno-sign-compare', + '-Wno-type-limits', + ] + +# Set a default journal size limit. Note an hot journal can grow over this +# limit, but if it does Sqlite will truncate it once it returns being idle. +# Also note growing a journal has a cost, so a too strict limit may affect +# performance. +# Also note this is necessary for safely supporting SQLITE_FCNTL_PERSIST_WAL +# that our base VFS uses, indeed when a journal limit is set, the journal will +# be truncated to 0 on shutdown, reducing the likelihood of corruption if the +# user doesn't move auxiliary files along with the main database. +# This is in bytes. +DEFINES['SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT'] = 1572864 + +# Thunderbird/Mail uses the FTS3 extension, but it's not using enhanced query +# syntax (SQLITE_ENABLE_FTS3_PARENTHESIS) yet. +if CONFIG["MOZ_THUNDERBIRD"] or CONFIG["MOZ_SUITE"]: + DEFINES['SQLITE_ENABLE_FTS3'] = 1 + +# Bug 1878311 - Disable the SQLITE_DIRECT_OVERFLOW_READ optimization due to +# privatebrowsing test failures. +DEFINES['SQLITE_DIRECT_OVERFLOW_READ'] = 0 |