2014-09-15 22:50:10 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This shell script is used to fake Python. Gdb wants to be passed a
|
|
|
|
# Python interpreter, to run its own python-config.py program, which
|
|
|
|
# uses sysconfig. However, when cross-compiling, this doesn't work
|
|
|
|
# well since we would have to use the host Python, whose sysconfig
|
|
|
|
# module would return host values.
|
|
|
|
#
|
|
|
|
# As recommended at
|
|
|
|
# https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport,
|
|
|
|
# this wrapper shell script can be used as a replacement. It ignores
|
|
|
|
# the python-config.py script passed as first arguments, and
|
|
|
|
# "emulates" its behavior.
|
|
|
|
|
|
|
|
if [ $# -ne 2 ] ; then
|
|
|
|
echo "Bad # args." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-12-31 10:53:11 +01:00
|
|
|
if [ -z "${BR_PYTHON_VERSION}" ]; then
|
|
|
|
echo "Environment variable BR_PYTHON_VERSION not set." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-09-15 22:50:10 +02:00
|
|
|
# The first argument is the path to python-config.py, ignore it.
|
|
|
|
|
|
|
|
case "$2" in
|
|
|
|
--includes)
|
2020-12-31 10:53:11 +01:00
|
|
|
echo "-I${STAGING_DIR}/usr/include/python${BR_PYTHON_VERSION}"
|
2020-12-31 10:53:10 +01:00
|
|
|
;;
|
2014-09-15 22:50:10 +02:00
|
|
|
--ldflags)
|
2020-12-31 10:53:11 +01:00
|
|
|
echo "-lpthread -ldl -lutil -lm -lpython${BR_PYTHON_VERSION}"
|
2020-12-31 10:53:10 +01:00
|
|
|
;;
|
2014-09-15 22:50:10 +02:00
|
|
|
--exec-prefix)
|
2020-12-31 10:53:10 +01:00
|
|
|
echo "/usr"
|
|
|
|
;;
|
2014-09-15 22:50:10 +02:00
|
|
|
*)
|
2020-12-31 10:53:10 +01:00
|
|
|
echo "Bad arg $2." >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
2014-09-15 22:50:10 +02:00
|
|
|
esac
|