[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/SQLITE V4 PATCH 5/6] Provide main() function if configured to do so



We add a config option for enabling the main() function provided by
our SQLite glue code.

Signed-off-by: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>
---
 Config.uk   | 8 +++++++-
 Makefile.uk | 7 +++++++
 main.c      | 6 ++++++
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 main.c

diff --git a/Config.uk b/Config.uk
index 1611ee9..dda1836 100644
--- a/Config.uk
+++ b/Config.uk
@@ -1,7 +1,13 @@
-config LIBSQLITE
+menuconfig LIBSQLITE
     bool "SQLite"
     default y
     select LIBUKMMAP
     select UKSYSINFO
     select LIBNEWLIBC
     select LIBPTHREAD_EMBEDDED
+
+if LIBSQLITE
+config LIBSQLITE_MAIN_FUNCTION
+    bool "Provide main function"
+    default y
+endif
diff --git a/Makefile.uk b/Makefile.uk
index df14c65..f0a7afd 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -73,7 +73,14 @@ LIBSQLITE_CFLAGS-y += $(LIBSQLITE_FLAGS)
 LIBSQLITE_CFLAGS-y += $(LIBSQLITE_SUPPRESS_FLAGS)
 
 
################################################################################
+# Glue code
+################################################################################
+LIBSQLITE_SRCS-$(CONFIG_LIBSQLITE_MAIN_FUNCTION) += 
$(LIBSQLITE_BASE)/main.c|unikraft
+
+################################################################################
 # SQLite sources
 
################################################################################
+LIBSQLITE_SHELL_FLAGS-y += -Dmain=sqlite_main -Dwmain=sqlite_main
+
 LIBSQLITE_SRCS-y += $(LIBSQLITE_SRC)/shell.c
 LIBSQLITE_SRCS-y += $(LIBSQLITE_SRC)/sqlite3.c
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..74822a0
--- /dev/null
+++ b/main.c
@@ -0,0 +1,6 @@
+extern int sqlite_main(int argc, char *argv[]);
+
+int main(int argc, char *argv[])
+{
+    return sqlite_main(argc, argv);
+}
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.