2022-02-05 14:23:32 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
|
|
|
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
2023-10-23 22:46:49 +00:00
|
|
|
# Copyright (C) 2023-present - The JELOS Project (https://github.com/JustEnoughLinuxOS)
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
PKG_NAME="sqlite"
|
2023-08-24 09:53:35 +00:00
|
|
|
PKG_VERSION="3.42.0"
|
2023-05-10 22:28:28 +00:00
|
|
|
PKG_VERSION_SQLITE="${PKG_VERSION/./}00"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_LICENSE="PublicDomain"
|
|
|
|
PKG_SITE="https://www.sqlite.org/"
|
2023-05-10 22:28:28 +00:00
|
|
|
PKG_URL="https://www.sqlite.org/2023/${PKG_NAME}-autoconf-${PKG_VERSION_SQLITE/./0}.tar.gz"
|
2023-01-10 22:11:33 +00:00
|
|
|
PKG_DEPENDS_HOST="ccache:host autoconf:host automake:host"
|
2022-02-05 14:23:32 +00:00
|
|
|
PKG_DEPENDS_TARGET="toolchain ncurses"
|
|
|
|
PKG_LONGDESC="An Embeddable SQL Database Engine."
|
|
|
|
# libsqlite3.a(sqlite3.o): requires dynamic R_X86_64_PC32 reloc against 'sqlite3_stricmp' which may overflow at runtime
|
|
|
|
PKG_BUILD_FLAGS="+pic +pic:host -parallel"
|
|
|
|
|
|
|
|
PKG_CONFIGURE_OPTS_TARGET="--disable-static \
|
|
|
|
--enable-shared \
|
|
|
|
--disable-readline \
|
|
|
|
--enable-threadsafe \
|
|
|
|
--enable-dynamic-extensions \
|
|
|
|
--with-gnu-ld"
|
|
|
|
|
|
|
|
pre_configure_target() {
|
|
|
|
# sqlite fails to compile with fast-math link time optimization.
|
2023-01-10 22:11:33 +00:00
|
|
|
CFLAGS=$(echo ${CFLAGS} | sed -e "s|-Ofast|-O3|g")
|
|
|
|
CFLAGS=$(echo ${CFLAGS} | sed -e "s|-ffast-math||g")
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# This option adds additional logic to the ANALYZE command and to the query planner
|
|
|
|
# that can help SQLite to chose a better query plan under certain situations. The
|
|
|
|
# ANALYZE command is enhanced to collect histogram data from each index and store
|
2023-01-10 22:11:33 +00:00
|
|
|
# that data in the sqlite_stat4 table. The query planner will then use the histogram
|
2022-02-05 14:23:32 +00:00
|
|
|
# data to help it make better index choices.
|
2023-01-10 22:11:33 +00:00
|
|
|
CFLAGS+=" -DSQLITE_ENABLE_STAT4"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# When this C-preprocessor macro is defined, SQLite includes some additional APIs
|
|
|
|
# that provide convenient access to meta-data about tables and queries. The APIs that
|
|
|
|
# are enabled by this option are:
|
|
|
|
# - sqlite3_column_database_name()
|
|
|
|
# - sqlite3_column_database_name16()
|
|
|
|
# - sqlite3_column_table_name()
|
|
|
|
# - sqlite3_column_table_name16()
|
|
|
|
# - sqlite3_column_origin_name()
|
|
|
|
# - sqlite3_column_origin_name16()
|
|
|
|
# - sqlite3_table_column_metadata()
|
2023-01-10 22:11:33 +00:00
|
|
|
CFLAGS+=" -DSQLITE_ENABLE_COLUMN_METADATA=1"
|
2022-02-05 14:23:32 +00:00
|
|
|
|
|
|
|
# This macro sets the default limit on the amount of memory that will be used for
|
|
|
|
# memory-mapped I/O for each open database file. If the N is zero, then memory
|
|
|
|
# mapped I/O is disabled by default. This compile-time limit and the
|
|
|
|
# SQLITE_MAX_MMAP_SIZE can be modified at start-time using the
|
|
|
|
# sqlite3_config(SQLITE_CONFIG_MMAP_SIZE) call, or at run-time using the
|
|
|
|
# mmap_size pragma.
|
2023-01-10 22:11:33 +00:00
|
|
|
CFLAGS+=" -DSQLITE_TEMP_STORE=3 -DSQLITE_DEFAULT_MMAP_SIZE=268435456"
|
2022-02-05 14:23:32 +00:00
|
|
|
}
|