radare2/r2-bindings/python-config-wrapper
pancake 131bad53d1 * Honor PYTHON_CONFIG in r2-bindings
- Allows to specify which version of python you want to use
  - Update README document
2011-09-03 02:09:59 +02:00

35 lines
573 B
Bash
Executable File

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