2021-05-04 14:39:59 +00:00
|
|
|
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
|
|
|
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
2021-06-12 07:01:55 +00:00
|
|
|
#
|
|
|
|
# OVERVIEW
|
|
|
|
#
|
|
|
|
# SQLite Embedded Database
|
|
|
|
#
|
|
|
|
# NOTES
|
|
|
|
#
|
|
|
|
# Please be warned that locks currently do nothing on Windows since
|
|
|
|
# figuring out how to polyfill them correctly is a work in progress
|
|
|
|
# Further note we currently don't do that thing SQLite does for Mac
|
|
|
|
# file locks so your dbase will only be as reliable as Apple wanted
|
|
|
|
# it to be when they wrote their POSIX file locking implementation.
|
2021-05-04 14:39:59 +00:00
|
|
|
|
|
|
|
PKGS += THIRD_PARTY_SQLITE3
|
|
|
|
|
|
|
|
THIRD_PARTY_SQLITE3_ARTIFACTS += THIRD_PARTY_SQLITE3_A
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
THIRD_PARTY_SQLITE3 = $(THIRD_PARTY_SQLITE3_A_DEPS) $(THIRD_PARTY_SQLITE3_A)
|
2021-05-04 14:39:59 +00:00
|
|
|
THIRD_PARTY_SQLITE3_A = o/$(MODE)/third_party/sqlite3/libsqlite3.a
|
|
|
|
THIRD_PARTY_SQLITE3_A_FILES := $(wildcard third_party/sqlite3/*)
|
|
|
|
THIRD_PARTY_SQLITE3_A_HDRS = $(filter %.h,$(THIRD_PARTY_SQLITE3_A_FILES))
|
2022-07-21 16:16:38 +00:00
|
|
|
THIRD_PARTY_SQLITE3_A_INCS = $(filter %.inc,$(THIRD_PARTY_SQLITE3_A_FILES))
|
2021-05-14 17:18:28 +00:00
|
|
|
THIRD_PARTY_SQLITE3_A_SRCS_C = $(filter %.c,$(THIRD_PARTY_SQLITE3_A_FILES))
|
|
|
|
THIRD_PARTY_SQLITE3_A_SRCS_T = $(filter %.inc,$(THIRD_PARTY_SQLITE3_A_FILES))
|
2021-05-04 14:39:59 +00:00
|
|
|
THIRD_PARTY_SQLITE3_BINS = $(THIRD_PARTY_SQLITE3_COMS) $(THIRD_PARTY_SQLITE3_COMS:%=%.dbg)
|
|
|
|
|
|
|
|
THIRD_PARTY_SQLITE3_A_SRCS = \
|
2021-05-14 17:18:28 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_A_SRCS_C) \
|
|
|
|
$(THIRD_PARTY_SQLITE3_A_SRCS_T)
|
2021-05-04 14:39:59 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_SQLITE3_A_OBJS = \
|
2022-07-21 16:16:38 +00:00
|
|
|
$(filter-out %shell.o,$(THIRD_PARTY_SQLITE3_A_SRCS_C:%.c=o/$(MODE)/%.o))
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_SQLITE3_SHELL_OBJS = \
|
2022-07-21 16:16:38 +00:00
|
|
|
$(filter %shell.o,$(THIRD_PARTY_SQLITE3_A_SRCS_C:%.c=o/$(MODE)/%.o))
|
2021-05-04 14:39:59 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_SQLITE3_COMS = \
|
|
|
|
o/$(MODE)/third_party/sqlite3/sqlite3.com
|
|
|
|
|
|
|
|
THIRD_PARTY_SQLITE3_A_CHECKS = \
|
|
|
|
$(THIRD_PARTY_SQLITE3_A).pkg \
|
|
|
|
$(THIRD_PARTY_SQLITE3_A_HDRS:%=o/$(MODE)/%.ok)
|
|
|
|
|
|
|
|
THIRD_PARTY_SQLITE3_A_DIRECTDEPS = \
|
|
|
|
LIBC_CALLS \
|
|
|
|
LIBC_FMT \
|
|
|
|
LIBC_INTRIN \
|
|
|
|
LIBC_MEM \
|
|
|
|
LIBC_NEXGEN32E \
|
|
|
|
LIBC_RUNTIME \
|
|
|
|
LIBC_STDIO \
|
|
|
|
LIBC_STR \
|
|
|
|
LIBC_STUBS \
|
|
|
|
LIBC_SYSV \
|
|
|
|
LIBC_SYSV_CALLS \
|
2022-09-13 21:57:38 +00:00
|
|
|
LIBC_THREAD \
|
2021-05-04 14:39:59 +00:00
|
|
|
LIBC_TIME \
|
|
|
|
LIBC_TINYMATH \
|
2022-10-17 18:02:04 +00:00
|
|
|
LIBC_ZIPOS \
|
2021-05-04 14:39:59 +00:00
|
|
|
THIRD_PARTY_GDTOA \
|
2021-08-14 18:26:23 +00:00
|
|
|
THIRD_PARTY_LINENOISE \
|
2021-05-04 14:39:59 +00:00
|
|
|
THIRD_PARTY_MUSL \
|
2022-05-12 18:01:58 +00:00
|
|
|
THIRD_PARTY_ZLIB \
|
|
|
|
TOOL_ARGS
|
2021-05-04 14:39:59 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_SQLITE3_A_DEPS := \
|
|
|
|
$(call uniq,$(foreach x,$(THIRD_PARTY_SQLITE3_A_DIRECTDEPS),$($(x))))
|
|
|
|
|
|
|
|
o/$(MODE)/third_party/sqlite3/sqlite3.com.dbg: \
|
|
|
|
$(THIRD_PARTY_SQLITE3_A_DEPS) \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_SHELL_OBJS) \
|
2022-07-21 16:16:38 +00:00
|
|
|
o/$(MODE)/third_party/sqlite3/shell.o \
|
2021-06-12 07:01:55 +00:00
|
|
|
o/$(MODE)/third_party/sqlite3/shell.pkg \
|
2021-05-04 14:39:59 +00:00
|
|
|
$(CRT) \
|
2021-10-02 15:17:04 +00:00
|
|
|
$(APE_NO_MODIFY_SELF)
|
2022-07-21 16:16:38 +00:00
|
|
|
@$(APELINK)
|
2021-05-04 14:39:59 +00:00
|
|
|
|
2022-08-21 07:17:20 +00:00
|
|
|
o/$(MODE)/third_party/sqlite3/sqlite3.com: \
|
|
|
|
o/$(MODE)/third_party/sqlite3/sqlite3.com.dbg \
|
|
|
|
o/$(MODE)/third_party/zip/zip.com \
|
|
|
|
o/$(MODE)/tool/build/symtab.com
|
|
|
|
@$(MAKE_OBJCOPY)
|
|
|
|
@$(MAKE_SYMTAB_CREATE)
|
|
|
|
@$(MAKE_SYMTAB_ZIP)
|
|
|
|
|
2021-05-04 14:39:59 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_A): \
|
|
|
|
third_party/sqlite3/ \
|
|
|
|
$(THIRD_PARTY_SQLITE3_A).pkg \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_A_OBJS)
|
2021-05-04 14:39:59 +00:00
|
|
|
|
|
|
|
$(THIRD_PARTY_SQLITE3_A).pkg: \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_A_OBJS) \
|
2021-05-04 14:39:59 +00:00
|
|
|
$(foreach x,$(THIRD_PARTY_SQLITE3_A_DIRECTDEPS),$($(x)_A).pkg)
|
|
|
|
|
2021-06-12 07:01:55 +00:00
|
|
|
o/$(MODE)/third_party/sqlite3/shell.pkg: \
|
|
|
|
$(THIRD_PARTY_SQLITE3_SHELL_OBJS) \
|
|
|
|
$(foreach x,$(THIRD_PARTY_SQLITE3_A_DIRECTDEPS),$($(x)_A).pkg)
|
|
|
|
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
# https://www.sqlite.org/compile.html
|
|
|
|
THIRD_PARTY_SQLITE3_FLAGS = \
|
|
|
|
-DNDEBUG \
|
|
|
|
-DSQLITE_CORE \
|
|
|
|
-DSQLITE_OS_UNIX \
|
|
|
|
-DBUILD_sqlite \
|
|
|
|
-DHAVE_USLEEP \
|
2022-03-24 07:05:59 +00:00
|
|
|
-DHAVE_READLINK \
|
2022-05-14 11:33:58 +00:00
|
|
|
-DHAVE_FCHOWN \
|
2022-03-24 07:05:59 +00:00
|
|
|
-DHAVE_LSTAT \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
-DHAVE_GMTIME_R \
|
|
|
|
-DHAVE_FDATASYNC \
|
|
|
|
-DHAVE_STRCHRNUL \
|
|
|
|
-DHAVE_LOCALTIME_R \
|
|
|
|
-DHAVE_MALLOC_USABLE_SIZE \
|
2022-09-13 21:57:38 +00:00
|
|
|
-DSQLITE_THREADSAFE=1 \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
-DSQLITE_MAX_EXPR_DEPTH=0 \
|
|
|
|
-DSQLITE_DEFAULT_MEMSTATUS=0 \
|
|
|
|
-DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 \
|
|
|
|
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
|
2021-06-12 07:01:55 +00:00
|
|
|
-DSQLITE_OMIT_UTF16 \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
-DSQLITE_OMIT_TCL_VARIABLE \
|
|
|
|
-DSQLITE_OMIT_LOAD_EXTENSION \
|
|
|
|
-DSQLITE_OMIT_SHARED_CACHE \
|
|
|
|
-DSQLITE_OMIT_AUTOINIT \
|
|
|
|
-DSQLITE_OMIT_GET_TABLE \
|
|
|
|
-DSQLITE_HAVE_C99_MATH_FUNCS \
|
2022-06-17 09:44:22 +00:00
|
|
|
-DSQLITE_ENABLE_MATH_FUNCTIONS \
|
|
|
|
-DSQLITE_ENABLE_JSON1 \
|
2022-11-08 20:53:37 +00:00
|
|
|
-DSQLITE_ENABLE_DESERIALIZE \
|
|
|
|
-DSQLITE_ENABLE_PREUPDATE_HOOK \
|
|
|
|
-DSQLITE_ENABLE_SESSION
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
|
2022-10-07 10:11:07 +00:00
|
|
|
ifeq ($(MODE),dbg)
|
|
|
|
THIRD_PARTY_SQLITE3_CPPFLAGS_DEBUG = -DSQLITE_DEBUG
|
|
|
|
endif
|
|
|
|
|
2022-08-11 01:00:45 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_A_OBJS): private \
|
2021-05-14 17:18:28 +00:00
|
|
|
OVERRIDE_CFLAGS += \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_FLAGS) \
|
2022-10-07 10:11:07 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_CPPFLAGS_DEBUG) \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
|
2022-08-11 01:00:45 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_SHELL_OBJS): private \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
$(THIRD_PARTY_SQLITE3_FLAGS) \
|
2022-10-07 10:11:07 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_CPPFLAGS_DEBUG) \
|
2021-05-14 17:18:28 +00:00
|
|
|
-DHAVE_READLINE=0 \
|
|
|
|
-DHAVE_EDITLINE=0 \
|
|
|
|
-DSQLITE_HAVE_ZLIB \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
-DSQLITE_ENABLE_IOTRACE \
|
|
|
|
-DSQLITE_ENABLE_COLUMN_METADATA \
|
2021-05-04 14:39:59 +00:00
|
|
|
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
|
|
|
|
-DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \
|
|
|
|
-DSQLITE_ENABLE_STMTVTAB \
|
|
|
|
-DSQLITE_ENABLE_DBPAGE_VTAB \
|
|
|
|
-DSQLITE_ENABLE_DBSTAT_VTAB \
|
|
|
|
-DSQLITE_ENABLE_BYTECODE_VTAB \
|
|
|
|
-DSQLITE_ENABLE_OFFSET_SQL_FUNC \
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
-DSQLITE_ENABLE_DESERIALIZE \
|
|
|
|
-DSQLITE_ENABLE_FTS3 \
|
|
|
|
-DSQLITE_ENABLE_FTS4 \
|
|
|
|
-DSQLITE_ENABLE_FTS5 \
|
|
|
|
-DSQLITE_ENABLE_RTREE \
|
|
|
|
-DSQLITE_ENABLE_GEOPOLY \
|
2021-08-14 18:26:23 +00:00
|
|
|
-DHAVE_LINENOISE
|
2021-05-04 14:39:59 +00:00
|
|
|
|
2021-06-24 19:31:26 +00:00
|
|
|
o//third_party/sqlite3/parse.o \
|
|
|
|
o//third_party/sqlite3/select.o \
|
|
|
|
o//third_party/sqlite3/pragma.o \
|
2022-08-11 01:00:45 +00:00
|
|
|
o//third_party/sqlite3/vdbe.o: private \
|
2021-06-24 19:31:26 +00:00
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-Os
|
|
|
|
|
2022-08-11 01:00:45 +00:00
|
|
|
o/$(MODE)/third_party/sqlite3/shell.o: private \
|
2022-06-17 09:44:22 +00:00
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-DSTACK_FRAME_UNLIMITED
|
|
|
|
|
2021-06-16 02:52:02 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_A_OBJS) \
|
2022-08-11 01:00:45 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_SHELL_OBJS): private \
|
2021-06-16 02:52:02 +00:00
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-fdata-sections \
|
|
|
|
-ffunction-sections
|
|
|
|
|
2021-10-02 15:17:04 +00:00
|
|
|
# use smaller relocations for indirect branches
|
|
|
|
o/$(MODE)/third_party/sqlite3/expr.o \
|
|
|
|
o/$(MODE)/third_party/sqlite3/printf.o \
|
2022-08-11 01:00:45 +00:00
|
|
|
o/$(MODE)/third_party/sqlite3/parse.o: private \
|
2021-10-02 15:17:04 +00:00
|
|
|
OVERRIDE_CFLAGS += \
|
|
|
|
-fpie
|
|
|
|
|
2022-08-11 01:00:45 +00:00
|
|
|
o/$(MODE)/third_party/sqlite3/shell.o: private QUOTA = -M512m -C16 -L180
|
|
|
|
o/$(MODE)/third_party/sqlite3/vdbe.o: private QUOTA = -M1024m
|
|
|
|
o/$(MODE)/third_party/sqlite3/vdbe.shell.o: private QUOTA = -M1024m
|
|
|
|
o/$(MODE)/third_party/sqlite3/fts5.o: private QUOTA = -M512m -C16
|
|
|
|
o/$(MODE)/third_party/sqlite3/fts5.shell.o: private QUOTA = -M512m -C16 -L180
|
2021-08-15 00:16:33 +00:00
|
|
|
|
2022-07-21 16:16:38 +00:00
|
|
|
o/$(MODE)/third_party/sqlite3/rtree.o: \
|
|
|
|
third_party/sqlite3/rtree.c \
|
|
|
|
third_party/sqlite3/geopoly.inc \
|
|
|
|
third_party/gdtoa/gdtoa.h
|
|
|
|
|
|
|
|
o/$(MODE)/third_party/sqlite3/rtree.shell.o: \
|
|
|
|
third_party/sqlite3/rtree.shell.c \
|
|
|
|
third_party/sqlite3/geopoly.inc \
|
|
|
|
third_party/gdtoa/gdtoa.h
|
|
|
|
|
2021-05-14 17:18:28 +00:00
|
|
|
THIRD_PARTY_SQLITE3_LIBS = $(foreach x,$(THIRD_PARTY_SQLITE3_ARTIFACTS),$($(x)))
|
|
|
|
THIRD_PARTY_SQLITE3_SRCS = $(foreach x,$(THIRD_PARTY_SQLITE3_ARTIFACTS),$($(x)_SRCS))
|
2021-06-12 07:01:55 +00:00
|
|
|
THIRD_PARTY_SQLITE3_HDRS = $(foreach x,$(THIRD_PARTY_SQLITE3_ARTIFACTS),$($(x)_HDRS))
|
2022-07-21 16:16:38 +00:00
|
|
|
THIRD_PARTY_SQLITE3_INCS = $(foreach x,$(THIRD_PARTY_SQLITE3_ARTIFACTS),$($(x)_INCS))
|
2021-05-14 17:18:28 +00:00
|
|
|
THIRD_PARTY_SQLITE3_CHECKS = $(foreach x,$(THIRD_PARTY_SQLITE3_ARTIFACTS),$($(x)_CHECKS))
|
|
|
|
THIRD_PARTY_SQLITE3_OBJS = $(foreach x,$(THIRD_PARTY_SQLITE3_ARTIFACTS),$($(x)_OBJS))
|
2021-09-28 05:58:51 +00:00
|
|
|
|
2021-05-14 17:18:28 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_OBJS): third_party/sqlite3/sqlite3.mk
|
Tune SQLite build for redbean (#97)
redbean lua handlers that perform sql queries can do 400k qps.
We now use a separate compile-time options for SQLite, when building the
SQLite shell versus building the production web serving code. It doesn't
seem appropriate for something like redbean to include backups, progress
callbacks, query completion, profiling, EXPLAIN, ALTER, ANALYZE, VACUUM,
etc. since those tasks are better left to the sqlite3.com shell program.
Lua SQLite pointer APIs have been removed since we're not using threads.
The Lua APIs for installing update / commit / rollback hooks are removed
due to a general sense of disagreement and an overall lack of comfort.
Full-Text Search and R*Tree are as large as the rest of SQLite combined.
Turning those off keeps redbean under 1mb when built for MODE=tiny which
is nice for marketing purposes.
If you need something that was removed, file an issue, and we'll add it.
2021-06-10 15:00:08 +00:00
|
|
|
$(THIRD_PARTY_SQLITE3_SHELL_OBJS): third_party/sqlite3/sqlite3.mk
|
2021-05-14 17:18:28 +00:00
|
|
|
|
2021-05-04 14:39:59 +00:00
|
|
|
.PHONY: o/$(MODE)/third_party/sqlite3
|
|
|
|
o/$(MODE)/third_party/sqlite3: \
|
|
|
|
$(THIRD_PARTY_SQLITE3_BINS) \
|
|
|
|
$(THIRD_PARTY_SQLITE3_CHECKS)
|