Costin Lupu [Wed, 16 Oct 2019 14:22:44 +0000 (17:22 +0300)]
Config.uk: Add configuration options for extensions
We currently configure the following extensions: XML parsing with Expat lib,
decimal operations with libmpdec, SSL, UUID and zlib. Sqlite will be
automatically supported when the external library will be released.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Costin Lupu [Wed, 16 Oct 2019 14:22:43 +0000 (17:22 +0300)]
Provide main() function if configured to do so
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>
Costin Lupu [Wed, 16 Oct 2019 14:22:42 +0000 (17:22 +0300)]
Makefile.uk: Add rule for creating root filesystem
The Python interpreter needs a filesystem where to keep its libraries. This
patch creates a Python virtual environment and installs the Python 3 standard
library in /lib/python3.7 directory. For creating the filesystem the following
command has to be run:
$ make python-rootfs path=<directory>
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro> Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
This file is copied from a './Modules/config.c' of a Linux build and it contains
the modules init functions and their registration as Python extensions. We
commented the registration of the modules that we do not support yet. They
should be enabled back when we will add support for them by porting the
underlying native libraries.
_sysconfigdata.py contains all the configuration data used by the interpreter at
runtime. This patch adds the slightly changed file generated by a ./configure
run.
pyconfig.h is generated when running ./configure and it contains the features
that are available on the build machine. This is copied from a local build.
In the original build, there are two kinds of sources: for core functionality
and for extensions. Each of them has a different set of compiler flags. In
order to emulate the same behavior, we define two libraries: 'python3-core' and
'python3-extensions'. Please notice that we still keep a 'python3' library as
the main logical library.