2011-09-10 00:19:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# find root
|
2013-12-20 01:10:36 +00:00
|
|
|
cd `dirname $PWD/$0`
|
|
|
|
./clone-r2-bindings.sh
|
|
|
|
cd ..
|
2011-09-10 00:19:06 +00:00
|
|
|
|
|
|
|
. ./sys/CONFIG
|
2013-05-02 21:49:58 +00:00
|
|
|
echo =============
|
2011-09-19 10:08:50 +00:00
|
|
|
cat sys/CONFIG
|
2013-05-02 21:49:58 +00:00
|
|
|
echo =============
|
2011-09-10 00:19:06 +00:00
|
|
|
|
2013-05-02 21:49:58 +00:00
|
|
|
[ -z "${PREFIX}" ] && PREFIX=/usr
|
2012-09-18 17:04:30 +00:00
|
|
|
ID=`id -u`
|
|
|
|
if [ "$ID" = 0 ]; then
|
|
|
|
SUDO=
|
|
|
|
else
|
|
|
|
SUDO=sudo
|
|
|
|
fi
|
2013-05-02 21:49:58 +00:00
|
|
|
[ -n "${NOSUDO}" ] && SUDO=
|
2012-09-18 17:04:30 +00:00
|
|
|
|
2011-12-05 00:09:15 +00:00
|
|
|
export PYTHON
|
2013-05-12 21:37:31 +00:00
|
|
|
export DESTDIR
|
2011-09-19 10:08:50 +00:00
|
|
|
export PYTHON_VERSION
|
2011-09-10 00:19:06 +00:00
|
|
|
export PYTHON_CONFIG
|
2011-09-19 10:08:50 +00:00
|
|
|
echo "Using PYTHON_VERSION ${PYTHON_VERSION}"
|
|
|
|
PYTHON_CONFIG="python${PYTHON_VERSION}-config"
|
|
|
|
echo "Using PYTHON_CONFIG ${PYTHON_CONFIG}"
|
|
|
|
echo
|
2011-09-10 00:19:06 +00:00
|
|
|
|
|
|
|
cd r2-bindings
|
2013-05-02 21:49:58 +00:00
|
|
|
./configure --prefix=${PREFIX} --enable=python || exit 1
|
2013-05-12 21:37:31 +00:00
|
|
|
${SUDO} make install-vapi DESTDIR=${DESTDIR} || exit 1
|
2011-09-10 00:19:06 +00:00
|
|
|
cd python
|
|
|
|
make clean
|
2011-12-05 00:09:15 +00:00
|
|
|
make PYTHON=${PYTHON}
|
2013-06-09 22:28:55 +00:00
|
|
|
[ "$1" != '--no-install' ] && \
|
|
|
|
${SUDO} make install PYTHON=${PYTHON} \
|
|
|
|
PYTHON_VERSION=${PYTHON_VERSION} DESTDIR=${DESTDIR}
|