0f002281d7b0ee7dc48fb16a6694af01a2f0dca7
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / gdb / gdb-python-config
1 #!/bin/sh
2
3 # This shell script is used to fake Python. Gdb wants to be passed a
4 # Python interpreter, to run its own python-config.py program, which
5 # uses sysconfig. However, when cross-compiling, this doesn't work
6 # well since we would have to use the host Python, whose sysconfig
7 # module would return host values.
8 #
9 # As recommended at
10 # https://sourceware.org/gdb/wiki/CrossCompilingWithPythonSupport,
11 # this wrapper shell script can be used as a replacement. It ignores
12 # the python-config.py script passed as first arguments, and
13 # "emulates" its behavior.
14
15 if [ $# -ne 2 ] ; then
16     echo "Bad # args." >&2
17     exit 1
18 fi
19
20 # The first argument is the path to python-config.py, ignore it.
21
22 case "$2" in
23     --includes)
24         echo "-I${STAGING_DIR}/usr/include/python2.7"
25         ;;
26     --ldflags)
27         echo "-lpthread -ldl -lutil -lm -lpython2.7"
28         ;;
29     --exec-prefix)
30         echo "/usr"
31         ;;
32     *)
33         echo "Bad arg $2." >&2
34         exit 1
35         ;;
36 esac