-# NOTE: termux_step_host_build may not be called if host build is cached.
-export TERMUX_ORIG_PATH=$PATH
-export PATH=$TERMUX_PKG_HOSTBUILD_DIR:$PATH
-termux_step_host_build () {
- # We need a host-built Parser/pgen binary, copied into cross-compile build in termux_step_post_configure() below
- $TERMUX_PKG_SRCDIR/configure
- make Parser/pgen
- # We need a python$_MAJOR_VERSION binary to be picked up by configure check:
- make
- rm -f python$_MAJOR_VERSION # Remove symlink if already exists to get a newer timestamp
- ln -s python python$_MAJOR_VERSION
-}
-
-termux_step_post_configure () {
- cp $TERMUX_PKG_HOSTBUILD_DIR/Parser/pgen $TERMUX_PKG_BUILDDIR/Parser/pgen
- cp $TERMUX_PKG_HOSTBUILD_DIR/Programs/_freeze_importlib $TERMUX_PKG_BUILDDIR/Programs/_freeze_importlib
- $TERMUX_TOUCH -d "next hour" $TERMUX_PKG_BUILDDIR/Parser/pgen
- $TERMUX_TOUCH -d "next hour" $TERMUX_PKG_BUILDDIR/Programs/_freeze_importlib
+termux_step_pre_configure() {
+ # Needed when building with clang, as setup.py only probes
+ # gcc for include paths when finding headers for determining
+ # if extension modules should be built (specifically, the
+ # zlib extension module is not built without this):
+ CPPFLAGS+=" -I$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include"
+ LDFLAGS+=" -L$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib"