The gdb-python-config simulates a python-2.7, with a hard-coded 2.7
version.
gdb also supports running with python3 nowadays, so prepare the wrapper
to return appropriate values.
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
exit 1
fi
+if [ -z "${BR_PYTHON_VERSION}" ]; then
+ echo "Environment variable BR_PYTHON_VERSION not set." >&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"
+ echo "-I${STAGING_DIR}/usr/include/python${BR_PYTHON_VERSION}"
;;
--ldflags)
- echo "-lpthread -ldl -lutil -lm -lpython2.7"
+ echo "-lpthread -ldl -lutil -lm -lpython${BR_PYTHON_VERSION}"
;;
--exec-prefix)
echo "/usr"
endif
ifeq ($(BR2_PACKAGE_GDB_PYTHON),y)
+# CONF_ENV: for top-level configure; MAKE_ENV: for sub-projects' configure.
+GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
+GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config
GDB_DEPENDENCIES += python
else