Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions Config.uk
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
menuconfig LIBSQLITE
bool "SQLite"
bool "libsqlite"
default n
imply LIBUKMMAP
select LIBPOSIX_SYSINFO
depends on HAVE_LIBC
select LIBPTHREAD_EMBEDDED
Comment thread
abhinavkumar1203 marked this conversation as resolved.
help
Enable the SQLite library

if LIBSQLITE
config LIBSQLITE_MAIN_FUNCTION
bool "Provide main function"
default n
config LIBSQLITE_ENABLE_SOMETHING
bool "Some internal sqlite config"
default y
Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated
endif
9 changes: 6 additions & 3 deletions Library.uk
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name := "sqlite"
description := "A C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine."
name := "libsqlite"
Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated
description := "A C-language library that implements a small, fast, self-contained SQL database engine"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove some of the adjectives describing it? 😅

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the name to match the convention.
Screenshot 2025-06-23 at 1 44 41 AM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks the same to me

gitrepo := "https://github.com/sqlite/sqlite.git"
homepage := "https://www.sqlite.org/"
license := "blessing"
version := 3400100 sha256:49112cc7328392aa4e3e5dae0b2f6736d0153430143d21f69327788ff4efe734 https://www.sqlite.org/2022/sqlite-amalgamation-3400100.zip
version := 3500100
hash := sha256:41716b44ac8777188c4c3f1f370f01c9cb9e3b6428eb5c981d086c35de2d9d3f
Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated

$(eval $(call addlib_s,libsqlite,$(CONFIG_LIBSQLITE)))
Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated
65 changes: 37 additions & 28 deletions Makefile.uk
Original file line number Diff line number Diff line change
Expand Up @@ -30,58 +30,67 @@
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

################################################################################
# App registration
################################################################################
$(eval $(call addlib_s,libsqlite,$(CONFIG_LIBSQLITE)))

################################################################################
# Sources
# Versioning and Paths
Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated
################################################################################
LIBSQLITE_VERSION = 3400100
LIBSQLITE_VERSION = 3450300
LIBSQLITE_BASENAME = sqlite-amalgamation-$(LIBSQLITE_VERSION)
LIBSQLITE_URL = https://www.sqlite.org/2022/$(LIBSQLITE_BASENAME).zip
LIBSQLITE_PATCHDIR = $(LIBSQLITE_BASE)/patches
LIBSQLITE_URL = https://www.sqlite.org/2024/$(LIBSQLITE_BASENAME).zip
LIBSQLITE_PATCHDIR = $(LIBSQLITE_BASE)/patches
LIBSQLITE_SRC = $(LIBSQLITE_ORIGIN)/$(LIBSQLITE_BASENAME)
Comment on lines +44 to +46

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I say either align all, or align none in these cases


Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated
$(eval $(call fetch,libsqlite,$(LIBSQLITE_URL)))
$(eval $(call patch,libsqlite,$(LIBSQLITE_PATCHDIR),$(LIBSQLITE_BASENAME)))

################################################################################
# Helpers
################################################################################
LIBSQLITE_SRC = $(LIBSQLITE_ORIGIN)/$(LIBSQLITE_BASENAME)

################################################################################
# Library includes
# Includes
Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated
################################################################################
LIBSQLITE_CINCLUDES-y += -I$(LIBSQLITE_BASE)/include
CINCLUDES-$(CONFIG_LIBSQLITE) += -I$(LIBSQLITE_SRC)
CINCLUDES-$(CONFIG_LIBSQLITE) += -I$(LIBSQLITE_SRC)
CINCLUDES-$(CONFIG_LIBSQLITE) += -I$(LIBSQLITE_BASE)/include
Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated
CXXINCLUDES-$(CONFIG_LIBSQLITE) += -I$(LIBSQLITE_SRC)

################################################################################
# Global flags
# Flags
################################################################################
LIBSQLITE_FLAGS = -D_HAVE_SQLITE_CONFIG_H -DSQLITE_OMIT_LOAD_EXTENSION
LIBSQLITE_FLAGS = -D_HAVE_SQLITE_CONFIG_H \
-DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_LOCALTIME \
-DSQLITE_OS_UNIX=0 \
-DSQLITE_OS_OTHER=1 \
-DSQLITE_THREADSAFE=0
Comment on lines +61 to +66

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to try this out and I'll report back if ok


# Suppress some warnings to make the build process look neater
LIBSQLITE_SUPPRESS_FLAGS-y += -Wno-unused-parameter -Wno-unused-variable \
-Wno-cast-function-type -Wno-char-subscripts
LIBSQLITE_SUPPRESS_FLAGS-y += -Wno-unused-parameter \
-Wno-unused-variable \
Comment thread
abhinavkumar1203 marked this conversation as resolved.
-Wno-cast-function-type \
-Wno-char-subscripts

LIBSQLITE_SUPPRESS_FLAGS-$(call gcc_version_ge,7,0) +=-Wimplicit-fallthrough=0 \
LIBSQLITE_SUPPRESS_FLAGS-$(call gcc_version_ge,7,0) += -Wimplicit-fallthrough=0

LIBSQLITE_CFLAGS-y += $(LIBSQLITE_FLAGS)
LIBSQLITE_CFLAGS-y += $(LIBSQLITE_SUPPRESS_FLAGS-y)
CFLAGS-$(CONFIG_LIBSQLITE) += $(LIBSQLITE_FLAGS)
CFLAGS-$(CONFIG_LIBSQLITE) += $(LIBSQLITE_SUPPRESS_FLAGS-y)
Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated

################################################################################
# Glue code
# Sources
################################################################################
LIBSQLITE_SRCS-$(CONFIG_LIBSQLITE_MAIN_FUNCTION) += $(LIBSQLITE_BASE)/main.c|unikraft
LIBSQLITE_SRCS-y += $(LIBSQLITE_SRC)/sqlite3.c

# Optional: Shell support (CLI app interface, not needed for lib use)
# Uncomment only if your app needs the shell interface (usually not)
# LIBSQLITE_CFLAGS-y += -Dmain=sqlite_main -Dwmain=sqlite_main
# LIBSQLITE_SRCS-y += $(LIBSQLITE_SRC)/shell.c

# Optional: Dummy main.c to satisfy Unikraft if needed
# (Used only if library wants to override main())
# LIBSQLITE_SRCS-$(CONFIG_LIBSQLITE_MAIN_FUNCTION) += $(LIBSQLITE_BASE)/main.c
Comment thread
abhinavkumar1203 marked this conversation as resolved.
Outdated

################################################################################
# SQLite sources
# Object generation
################################################################################
LIBSQLITE_SHELL_FLAGS-y += -Dmain=sqlite_main -Dwmain=sqlite_main

LIBSQLITE_SRCS-y += $(LIBSQLITE_SRC)/shell.c
LIBSQLITE_SRCS-y += $(LIBSQLITE_SRC)/sqlite3.c
LIBSQLITE_OBJS-y := $(LIBSQLITE_SRCS-y:.c=.o)
$(eval $(call addlibobjs,libsqlite,$(LIBSQLITE_OBJS-y)))
Comment thread
abhinavkumar1203 marked this conversation as resolved.