radare2/r2-bindings/python-wrapper
pancake 0f8ca271f7 * Add 'python-wrapper' to use python2 in install-python target
* Use adaptative vmenus for Vv (needs proper refactor)
* Minor fix in r_cons_readchar()
2012-06-26 15:21:48 +02:00

35 lines
544 B
Bash
Executable File

#!/bin/sh
# python wrapper trying to fix the python versioning hell
# -- pancake
PCS="${PYTHON_CONFIG}
python2
python25
python2.5
python26
python2.6
python27
python2.7
python28
python2.8
python"
PYCFG=""
for a in ${PCS} ; do
$a --help >/dev/null 2>&1
if [ $? = 0 ]; then
PYCFG=$a
PY3=`$a --version 2>&1 | grep 'Python 3'`
[ -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