Files
Arch-R/packages/lang/Python/build

93 lines
2.5 KiB
Bash
Executable File

#!/bin/sh
. config/options $1
$SCRIPTS/build toolchain
$SCRIPTS/build expat-host
$SCRIPTS/build sqlite
$SCRIPTS/build expat
$SCRIPTS/build openssl
$SCRIPTS/build zlib
$SCRIPTS/build libffi
PY_DISABLED_MODULES="readline _curses _curses_panel _tkinter nis gdbm bsddb _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk"
cd $PKG_BUILD
mkdir -p .objdir-host && cd .objdir-host
setup_toolchain host
OPT="$HOST_CFLAGS" \
../configure --prefix=$ROOT/$TOOLCHAIN \
--enable-shared \
--without-cxx-main \
--with-threads \
--enable-unicode=ucs4 \
make
make install
cp Parser/pgen ./hostpgen
cp python ./hostpython
cd ..
mkdir -p .objdir-target && cd .objdir-target
setup_toolchain target
ac_cv_file_dev_ptc=no \
ac_cv_file_dev_ptmx=yes \
ac_cv_func_lchflags_works=no \
ac_cv_func_chflags_works=no \
ac_cv_func_printf_zd=yes
OPT="$CFLAGS -fno-strict-aliasing" \
../configure --host=$TARGET_NAME \
--build=$HOST_NAME \
--prefix=/usr \
--sysconfdir=/etc \
--enable-shared \
--with-threads \
--enable-unicode=ucs4 \
--disable-ipv6 \
--disable-profiling \
--without-pydebug \
--without-doc-strings \
--without-tsc \
--without-pymalloc \
--without-fpectl \
--without-wctype-functions \
--without-cxx-main \
--with-system-ffi \
make -j1 CC="$TARGET_CC" \
HOSTPYTHON=../.objdir-host/hostpython \
HOSTPGEN=../.objdir-host/hostpgen \
BLDSHARED="$CC -shared" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
CROSS_COMPILE="$TARGET_NAME" \
CROSS_COMPILE_TARGET="yes"
make -j1 CC="$TARGET_CC" \
DESTDIR=$SYSROOT_PREFIX \
HOSTPYTHON=../.objdir-host/hostpython \
HOSTPGEN=../.objdir-host/hostpgen \
BLDSHARED="$CC -shared" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
CROSS_COMPILE="$TARGET_NAME" \
CROSS_COMPILE_TARGET="yes" \
install
cp -R ../Lib ./
$ROOT/$TOOLCHAIN/bin/python -Wi -t ./Lib/compileall.py -f -x test ./Lib
# replace python-config to make sure python uses $SYSROOT_PREFIX
mkdir -p $ROOT/$TOOLCHAIN/bin
rm -rf $ROOT/$TOOLCHAIN/bin/python*-config
sed -e "s:%PREFIX%:$SYSROOT_PREFIX/usr:g" -e "s:%CFLAGS%:$TARGET_CFLAGS:g" \
$ROOT/$PKG_DIR/scripts/python-config > $ROOT/$TOOLCHAIN/bin/python2.6-config
chmod +x $ROOT/$TOOLCHAIN/bin/python2.6-config
ln -s python2.6-config $ROOT/$TOOLCHAIN/bin/python-config