toolchain: gdb: Add optional python support
[openwrt/openwrt.git] / toolchain / gdb / Makefile
index 05e3c7de3c3d9fec0b0fee0891c20b25c62b35d7..2708eff869808121065aeca86bd89d8cf68e274d 100644 (file)
@@ -36,7 +36,6 @@ HOST_CONFIGURE_ARGS = \
        --without-included-gettext \
        --enable-threads \
        --with-expat \
-       --without-python \
        --disable-unit-tests \
        --disable-ubsan \
        --disable-binutils \
@@ -44,11 +43,21 @@ HOST_CONFIGURE_ARGS = \
        --disable-gas \
        --disable-sim
 
+ifneq ($(CONFIG_GDB_PYTHON),)
+  HOST_CONFIGURE_ARGS+= --with-python
+else
+  HOST_CONFIGURE_ARGS:= --without-python
+endif
+
 define Host/Install
        mkdir -p $(TOOLCHAIN_DIR)/bin
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
        ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
        strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
+       mkdir -p $(TOOLCHAIN_DIR)/share/gdb
+       -cp -R $(HOST_BUILD_DIR)/gdb/data-directory/python $(TOOLCHAIN_DIR)/share/gdb/
+       cp -R $(HOST_BUILD_DIR)/gdb/data-directory/syscalls $(TOOLCHAIN_DIR)/share/gdb/
+       cp -R $(HOST_BUILD_DIR)/gdb/data-directory/system-gdbinit $(TOOLCHAIN_DIR)/share/gdb/
 endef
 
 define Host/Clean