X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fgdb%2Fgdb-python-config;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fgdb%2Fgdb-python-config;h=0f002281d7b0ee7dc48fb16a6694af01a2f0dca7;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/gdb/gdb-python-config b/cirros-testvm/src-cirros/buildroot-2015.05/package/gdb/gdb-python-config new file mode 100755 index 0000000..0f00228 --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/gdb/gdb-python-config @@ -0,0 +1,36 @@ +#!/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 + +# The first argument is the path to python-config.py, ignore it. + +case "$2" in + --includes) + echo "-I${STAGING_DIR}/usr/include/python2.7" + ;; + --ldflags) + echo "-lpthread -ldl -lutil -lm -lpython2.7" + ;; + --exec-prefix) + echo "/usr" + ;; + *) + echo "Bad arg $2." >&2 + exit 1 + ;; +esac