Since 251bd8d
, ToaruOS-NIH's C library has been capable of building Python using the following steps:
-
Install Python 3.6 locally. Python requires that you have the same version as you trying to build when cross-compiling.
-
Activate the ToaruOS toolchain so that
i686-pc-toaru-gcc
is in your path:source util/activate.sh
-
Clone the
nih
branch ofhttps://github.com/klange/cpython
to a directory. -
Configure Python as follows:
./configure --disable-ipv6 --enable-shared --host=i686-pc-toaru --build=i686 --prefix=/usr/python ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_func_dlopen=yes ac_cv_func_wait3=no ac_cv_var_tzname=no ac_cv_func_unsetenv=no ac_cv_var_putenv=no ac_cv_header_sys_lock_h=no ac_cv_header_sys_param_h=no ac_cv_header_sys_resource_h=no ac_cv_header_libintl_h=no ac_cv_func_sigaction=no
-
Run
make
to build Python. -
Install Python to the the ToaruOS filesystem base directory:
make DESTDIR="$TOOLCHAIN/../base" commoninstall bininstall
-
Return to your ToaruOS checkout and run the following to clean up unused parts of the Python installation and reduce its size:
util/fix-python.sh