[1/1] package/gdb: don't remove support files if python chosen

Message ID 1523389042-66122-1-git-send-email-jzaddach@cisco.com
State New
Headers show
Series
  • [1/1] package/gdb: don't remove support files if python chosen
Related show

Commit Message

Jonas Zaddach April 10, 2018, 7:37 p.m.
If one wants to use GDB with python support on the target, you need the support
files installed by GDB. These get usually deleted to save some space, so I just
wrapped the Makefile code deleting them in a conditional block depending on if
python support is active or not.

Signed-off-by: Jonas Zaddach <jzaddach@cisco.com>
---
 package/gdb/gdb.mk | 2 ++
 1 file changed, 2 insertions(+)

Comments

Arnout Vandecappelle April 18, 2018, 10:40 p.m. | #1
On 10-04-18 21:37, Jonas Zaddach wrote:
> If one wants to use GDB with python support on the target, you need the support
> files installed by GDB. These get usually deleted to save some space, so I just
> wrapped the Makefile code deleting them in a conditional block depending on if
> python support is active or not.
> 
> Signed-off-by: Jonas Zaddach <jzaddach@cisco.com>
> ---
>  package/gdb/gdb.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
> index 7e86ba0..5c915da 100644
> --- a/package/gdb/gdb.mk
> +++ b/package/gdb/gdb.mk
> @@ -164,11 +164,13 @@ endif
>  
>  # This removes some unneeded Python scripts and XML target description
>  # files that are not useful for a normal usage of the debugger.

 Are the XML files also needed, or only the .py files?

 It's especially surprising that you'd need those syscalls files for different
architectures than the target...

 But anyway, it's just about 200K.

 One small nit: I'd leave the comment within the condition. Otherwise:

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout

> +ifneq ($(BR2_PACKAGE_GDB_PYTHON),y)
>  define GDB_REMOVE_UNNEEDED_FILES
>  	$(RM) -rf $(TARGET_DIR)/usr/share/gdb
>  endef
>  
>  GDB_POST_INSTALL_TARGET_HOOKS += GDB_REMOVE_UNNEEDED_FILES
> +endif
>  
>  # This installs the gdbserver somewhere into the $(HOST_DIR) so that
>  # it becomes an integral part of the SDK, if the toolchain generated
>

Patch

diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 7e86ba0..5c915da 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -164,11 +164,13 @@  endif
 
 # This removes some unneeded Python scripts and XML target description
 # files that are not useful for a normal usage of the debugger.
+ifneq ($(BR2_PACKAGE_GDB_PYTHON),y)
 define GDB_REMOVE_UNNEEDED_FILES
 	$(RM) -rf $(TARGET_DIR)/usr/share/gdb
 endef
 
 GDB_POST_INSTALL_TARGET_HOOKS += GDB_REMOVE_UNNEEDED_FILES
+endif
 
 # This installs the gdbserver somewhere into the $(HOST_DIR) so that
 # it becomes an integral part of the SDK, if the toolchain generated