1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#!/bin/sh
# python-config wrapper trying to fix the python versioning hell
# -- pancake
PCS="${PYTHON_CONFIG}
python2-config
python28-config
python2.8-config
python27-config
python2.7-config
python26-config
python2.6-config
python25-config
python2.5-config
python-config"
PYCFG=""
for a in ${PCS} ; do
$a --help >/dev/null 2>&1
if [ $? = 0 ]; then
PYCFG=$a
PY3=`$a --libs| grep python3`
[ -z "${PY3}" ] && break
fi
done
[ -z "${PYCFG}" ] && exit 1
if [ "$1" = "-n" ]; then
echo ${PYCFG}
exit 0
fi
${PYCFG} $@ | sed -e 's/-arch [^\s]*//g' | \
sed s,-Wstrict-prototypes,,g 2>/dev/null
|