Files
Arch-R/packages/lang/Python/build
Stephan Raue de71016fb4 initial import
2009-03-18 13:02:53 +01:00

133 lines
3.8 KiB
Bash
Executable File

#!/bin/sh
. config/options
$SCRIPTS/build toolchain
#$SCRIPTS/build readline
#$SCRIPTS/build termcap
$SCRIPTS/build sqlite
$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"
PY_BUILD_DIR=`ls -d $ROOT/$BUILD/$1*`
PY_BASE_VERSION=2.6
cd $BUILD/$1*
setup_toolchain host
rm -rf config.cache
CONFIG_SITE= \
OPT="$HOST_CFLAGS" \
./configure --prefix=$ROOT/$TOOLCHAIN \
--without-cxx-main \
--with-threads \
#
OPT="$HOST_CFLAGS" \
make python Parser/pgen
OPT="$HOST_CFLAGS" \
PYTHON_MODULES_INCLUDE=/usr/include \
PYTHON_MODULES_LIB="/lib /lib64 /usr/lib /usr/lib64" \
make HOSTPYTHON=./python sharedmods install
#OPT="$HOST_CFLAGS" \
#make HOSTPYTHON=./python \
# HOSTPGEN=./Parser/pgen \
# install
# Make python-devel multilib-ready (bug #192747, #139911)
#%define _pyconfig32_h pyconfig-32.h
#%define _pyconfig64_h pyconfig-64.h
#%ifarch ppc64 s390x x86_64 ia64 alpha sparc64
#%define _pyconfig_h %{_pyconfig64_h}
#%else
#%define _pyconfig_h %{_pyconfig32_h}
#%endif
#cp $ROOT/$TOOLCHAIN/include/python$PY_BASE_VERSION/pyconfig.h $ROOT/$TOOLCHAIN/include/python$PY_BASE_VERSION/pyconfig-32.h
#cp $ROOT/$TOOLCHAIN/include/python$PY_BASE_VERSION/pyconfig.h $ROOT/$TOOLCHAIN/include/python$PY_BASE_VERSION/pyconfig-64.h
#rm -rf $ROOT/$TOOLCHAIN/include/python$PY_BASE_VERSION/pyconfig.h
#cat > $ROOT/$TOOLCHAIN/include/python$PY_BASE_VERSION/pyconfig.h << EOF
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "pyconfig-32.h"
#elif __WORDSIZE == 64
#include "pyconfig-64.h"
#else
#error "Unknown word size"
#endif
#EOF
#ln -sf ../../libpython$PY_BASE_VERSION.so $ROOT/$TOOLCHAIN/lib/python$PY_BASE_VERSION/config/libpython$PY_BASE_VERSION.so
# Fix for bug 201434: make sure distutils looks at the right pyconfig.h file
#sed -i -e "s/'pyconfig.h'/'pyconfig-32.h'/" $ROOT/$TOOLCHAIN/lib/python$PY_BASE_VERSION/distutils/sysconfig.py
#sed -i -e "s/'pyconfig.h'/'pyconfig-64.h'/" $ROOT/$TOOLCHAIN/lib/python$PY_BASE_VERSION/distutils/sysconfig.py
mv Parser/pgen ./hostpgen
cp python ./hostpython
#mv build hostbuild
make distclean
setup_toolchain target
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no \
ac_cv_lib_readline_readline=no \
ac_cv_printf_zd_format=no \
OPT="$TARGET_CFLAGS -fno-strict-aliasing" \
./configure --host=$TARGET_NAME \
--build=$HOST_NAME \
--prefix=/usr \
--sysconfdir=/etc \
--enable-static \
--disable-shared \
--disable-nls \
--with-threads \
--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 CC=$TARGET_CC \
GNU_HOST=$TARGET_NAME \
GNU_BUILD=$HOST_NAME \
DESTDIR=$SYSROOT_PREFIX \
CROSS_COMPILE=yes \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
PYTHON_MODULES_INCLUDE=$SYSROOT_PREFIX/usr/include \
PYTHON_MODULES_LIB="$SYSROOT_PREFIX/lib $SYSROOT_PREFIX/usr/lib" \
HOSTPYTHON=./hostpython \
HOSTPGEN=./hostpgen
make CC=$TARGET_CC \
GNU_HOST=$TARGET_NAME \
GNU_BUILD=$HOST_NAME \
DESTDIR=$SYSROOT_PREFIX \
CROSS_COMPILE=yes \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
PYTHON_MODULES_INCLUDE=$SYSROOT_PREFIX/usr/include \
PYTHON_MODULES_LIB="$SYSROOT_PREFIX/lib $SYSROOT_PREFIX/usr/lib" \
HOSTPYTHON=./hostpython \
HOSTPGEN=./hostpgen \
install
$STRIP python
$STRIP build/lib*/*.so
$ROOT/$TOOLCHAIN/bin/python -Wi -t Lib/compileall.py -f -x test ./Lib