Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
17 changes: 12 additions & 5 deletions Config.uk
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
imply LIBUKMMAP
select LIBPOSIX_SYSINFO
depends on HAVE_LIBC
select LIBPTHREAD_EMBEDDED
Comment on lines +1 to +4
Copy link
Member

Choose a reason for hiding this comment

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

These need to sit inside the menuconfig option. Did kraft menuconfig even work?


menuconfig LIBSQLITE
bool "SQLite"
bool "libsqlite"
default n
help
Enable the SQLite library

config LIBSQLITE_ENABLE_SHELL
bool "Enable SQLite shell (CLI) interface"
default n
imply LIBUKMMAP
select LIBPOSIX_SYSINFO
depends on HAVE_LIBC
select LIBPTHREAD_EMBEDDED

if LIBSQLITE
config LIBSQLITE_MAIN_FUNCTION
Expand Down
5 changes: 3 additions & 2 deletions Library.uk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name := "sqlite"
description := "A C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine."
description := "A C-language library that implements a small, fast, self-contained SQL database engine"
Copy link
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
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
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 sha256:41716b44ac8777188c4c3f1f370f01c9cb9e3b6428eb5c981d086c35de2d9d3f https://www.sqlite.org/2025/sqlite-amalgamation-3500100.zip

52 changes: 31 additions & 21 deletions Makefile.uk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
# 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
Expand All @@ -40,18 +39,15 @@ $(eval $(call addlib_s,libsqlite,$(CONFIG_LIBSQLITE)))
################################################################################
# Sources
################################################################################
LIBSQLITE_VERSION = 3400100
LIBSQLITE_VERSION = 3500100
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/2025/$(LIBSQLITE_BASENAME).zip
LIBSQLITE_PATCHDIR = $(LIBSQLITE_BASE)/patches
LIBSQLITE_SRC = $(LIBSQLITE_ORIGIN)/$(LIBSQLITE_BASENAME)
Comment on lines +44 to +46
Copy link
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


$(eval $(call fetch,libsqlite,$(LIBSQLITE_URL)))
$(eval $(call patch,libsqlite,$(LIBSQLITE_PATCHDIR),$(LIBSQLITE_BASENAME)))

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

################################################################################
# Library includes
################################################################################
Expand All @@ -60,28 +56,42 @@ CINCLUDES-$(CONFIG_LIBSQLITE) += -I$(LIBSQLITE_SRC)
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
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 \
-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)

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

# Optional: Shell support (CLI app interface, not needed for lib use)
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
LIBSQLITE_SRCS-$(CONFIG_LIBSQLITE_MAIN_FUNCTION) += $(LIBSQLITE_BASE)/main.c

################################################################################
# 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)))
$(eval $(call addlib_s,libsqlite,$(CONFIG_LIBSQLITE)))
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be placed up top? I'm looking at Nginx https://github.com/unikraft/lib-nginx/blob/staging/Makefile.uk#L37-L40

Copy link
Author

@abhinavkumar1203 abhinavkumar1203 Jun 22, 2025

Choose a reason for hiding this comment

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

Moved the addlibobjs and addlib_s logic up top for consistency with other Unikraft libraries

Copy link
Member

Choose a reason for hiding this comment

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

but they are in the same place?