special handling of python is needed on any system (linux or osx) if Python is not in /usr/bin, because of libxml2's bizarre handling of this

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@14168 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2013-03-07 12:20:39 +00:00
parent 2875ff6188
commit 949012431d
1 changed files with 23 additions and 22 deletions

View File

@ -187,11 +187,31 @@ mkdir -p $PREFIX
export MAKEFLAGS=-j$parallel
PATH=$PREFIX/bin:$PATH
#
# Check Perl
#
PERLVERSION=`perl -e 'printf "%vd\n", $^V;'`
#
# Check Python presence
#
PYVERS=`python --version 2>&1 | cut -d ' ' -f 2 | cut -b 1-3`
export PYTHONPATH=$PREFIX/lib/python${PYVERS}/site-packages/:${PYTHONPATH:+:$PYTHONPATH}
if python --version 2>&1 | egrep --silent '(2\.7|2\.6)' ; then
:
else
echo "You need at least Python 2.6 to run this script"
exit 1
fi
pythondir=`dirname $(which python)`
if [ $pythondir != "/usr/bin" ] ; then
PYTHONPREFIX=`dirname $pythondir`
fi
OSX=
if uname -a | grep --silent arwin ; then
@ -199,7 +219,6 @@ if uname -a | grep --silent arwin ; then
# its OS X! run for the hills !!
OSX=1
# tell perl to look in our $PREFIX tree for additional perl modules
export PERL5LIB=$PREFIX/System/Library/Perl/$PERLVERSION
@ -213,20 +232,6 @@ if uname -a | grep --silent arwin ; then
# for 10.5 and above, add to LDFLAGS
# "-syslibroot /Developer/SDKs/MacOSX10.4u.sdk"
export MACOSX_DEPLOYMENT_TARGET=10.4
# If the default python is not new enough, set PYTHON to point to a
# suitably new (2.7 or later) version of Python's framework
#
# this is very crude versioning test
if python --version 2>&1 | grep --silent '2\.7' ; then
:
else
if python --version 2>&1 | grep --silent '2\.6' ; then
:
else
echo "You need at least Python 2.6 to run this script"
exit 1
fi
fi
CAIRO_CONF="--enable-xlib=no --enable-quartz=yes --enable-xcb=no"
PANGO_CONF="--without-x"
@ -262,10 +267,6 @@ else
echo "You do not have a new enough version of Python"
exit 1
fi
pythondir=`dirname $(which python)`
if [ $pythondir != "/usr/bin" ] ; then
PYTHON=`dirname $pythondir`
fi
fi
set -e
@ -338,11 +339,11 @@ basic_builder bison
basic_builder expat
#
# this will fail to build python modules if Python is not a system install, so we need to supply --with-python in that case
# libxml2 will fail to build python modules if Python is not a system install, so we need to supply --with-python in that case
#
if [ x$PYTHON != x ] ; then
WITHPYTHON=--with-python=$PYTHON
if [ x$PYTHONPREFIX != x ] ; then
WITHPYTHON=--with-python=$PYTHONPREFIX
fi
tar xf $MOD_libxml2_local_tarball && (cd $MOD_libxml2_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF $WITHPYTHON --with-zlib=$PREFIX && make && make install) || die "libxml2 build failed"