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

[UNIKRAFT/PYTHON3 1/1] Fix sqlite module



This patch fixes the sqlite module. Python now compiles when
the sqlite extension is selected from menuconfig.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxx>
---
 Makefile.uk      | 19 ++++++++++---------
 modules_config.c |  4 ++++
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/Makefile.uk b/Makefile.uk
index efd58a1..c718b3c 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -419,15 +419,16 @@ LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/sha512module.c
 LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/socketmodule.c
 # TODO enable LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/spwdmodule.c
 ifeq ($(CONFIG_LIBPYTHON3_EXTENSION_SQLITE),y)
-LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/cache.c
-LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/connection.c
-LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/cursor.c
-LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/_sqlite/microprotocols.c
-LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/module.c
-LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/_sqlite/prepare_protocol.c
-LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/row.c
-LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/statement.c
-LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/util.c
+LIBPYTHON3_EXTENSIONS_CFLAGS-y    += -DMODULE_NAME="\"sqlite3\""
+LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/_sqlite/cache.c|sqlite
+LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/_sqlite/connection.c|sqlite
+LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/_sqlite/cursor.c|sqlite
+LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/_sqlite/microprotocols.c|sqlite
+LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/_sqlite/module.c|sqlite
+LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/_sqlite/prepare_protocol.c|sqlite
+LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/row.c|sqlite
+LIBPYTHON3_EXTENSIONS_SRCS-y += 
$(LIBPYTHON3_SRC)/Modules/_sqlite/statement.c|sqlite
+LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_sqlite/util.c|sqlite
 endif
 LIBPYTHON3_EXTENSIONS_SRCS-$(CONFIG_LIBPYTHON3_EXTENSION_SSL) += 
$(LIBPYTHON3_SRC)/Modules/_ssl.c
 LIBPYTHON3_EXTENSIONS_SRCS-y += $(LIBPYTHON3_SRC)/Modules/_struct.c
diff --git a/modules_config.c b/modules_config.c
index 7772d00..1bb591c 100644
--- a/modules_config.c
+++ b/modules_config.c
@@ -145,6 +145,10 @@ extern PyObject* PyInit_zipimport(void);
 #ifdef CONFIG_LIBZLIB
 extern PyObject* PyInit_zlib(void);
 #endif
+#if CONFIG_LIBPYTHON3_EXTENSION_SQLITE
+extern PyObject* PyInit__sqlite3(void);
+#endif
+
 /* Unikraft Marker end */
 /* -- ADDMODULE MARKER 1 -- */
 
-- 
2.27.0




 


Rackspace

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