Sometimes all you want to run is the Python shell. In this case you can tick the
option in menuconfig so that the library provides the main() function for you.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
string "Temp directory location"
default "/tmp"
+config LIBPYTHON3_MAIN_FUNCTION
+ bool "Provide main function"
+ default n
+
endif
LIBPYTHON3_SRCS-y += $(LIBPYTHON3_BASE)/init.c|unikraft
LIBPYTHON3_SRCS-y += $(LIBPYTHON3_BASE)/modules_config.c|unikraft
LIBPYTHON3_SRCS-y += $(LIBPYTHON3_BASE)/stubs.c|unikraft
+LIBPYTHON3_SRCS-$(CONFIG_LIBPYTHON3_MAIN_FUNCTION) += $(LIBPYTHON3_BASE)/main.c|unikraft
################################################################################
# Python core
--- /dev/null
+#define Py_BUILD_CORE
+#include <Python.h>
+
+int main(int argc, char *argv[])
+{
+ return _Py_UnixMain(argc, argv);
+}
+