mirror of
https://github.com/radareorg/radare2-rlang.git
synced 2026-11-08 17:43:46 -10:00
38 lines
649 B
Bash
Executable File
38 lines
649 B
Bash
Executable File
#!/bin/sh
|
|
# python-config wrapper trying to fix the python versioning hell
|
|
# -- pancake
|
|
|
|
PCS="${PYTHON_CONFIG}
|
|
python3-config
|
|
python38-config
|
|
python3.8-config
|
|
python37-config
|
|
python3.7-config
|
|
python36-config
|
|
python3.6-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
|
|
|
|
output=`"${PYCFG}" "$@"` \
|
|
&& echo $output || echo $output 1>&2 | sed \
|
|
-e 's/-arch [^\ ]*//g' \
|
|
-e 's, s ,,g' \
|
|
-e 's,-mn[^\ ]*,,g' \
|
|
-e 's,-fn[^\ ]*,,g' \
|
|
-e 's,-Wstrict-prototypes,,g' 2>/dev/null
|