Patchwork gdb: move version selection from gdb.mk to Config.in.host

login
register
mail settings
Submitter Arnout Vandecappelle
Date Jan. 29, 2014, 9:44 p.m.
Message ID <1391031881-19546-1-git-send-email-arnout@mind.be>
Download mbox | patch
Permalink /patch/315231/
State Accepted
Commit fda818390b5e6a585608f4523356eafa0c587f53
Headers show

Comments

Arnout Vandecappelle - Jan. 29, 2014, 9:44 p.m.
This avoids duplication of the version selection between these two files.

Cc: Spenser Gilliland <spenser@gillilanding.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Warning: I have not really tested this!

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/gdb/Config.in.host | 14 +++++++++-----
 package/gdb/gdb.mk         | 14 --------------
 2 files changed, 9 insertions(+), 19 deletions(-)
Spenser Gilliland - Jan. 30, 2014, 1:29 a.m.
Arnout,

> This avoids duplication of the version selection between these two files.
>
> Cc: Spenser Gilliland <spenser@gillilanding.com>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> Warning: I have not really tested this!
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  package/gdb/Config.in.host | 14 +++++++++-----
>  package/gdb/gdb.mk         | 14 --------------
>  2 files changed, 9 insertions(+), 19 deletions(-)
>
> diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
> index d5e7814..9c0c78c 100644
> --- a/package/gdb/Config.in.host
> +++ b/package/gdb/Config.in.host
> @@ -51,15 +51,19 @@ choice
>
>  endchoice
>
> +endif
> +
> +# If cross-gdb is not enabled, the latest working version is chosen.
>  config BR2_GDB_VERSION
>         string
> -       default "6.6a"     if BR2_GDB_VERSION_6_6
> -       default "6.7.1-avr32-2.1.5" if BR2_GDB_VERSION_6_7_1_AVR32_2_1_5
> +       depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
> +       default "6.6a"     if BR2_GDB_VERSION_6_6 || \
> +                             (!BR2_PACKAGE_HOST_GDB && BR2_bfin)
> +       default "6.7.1-avr32-2.1.5" if BR2_GDB_VERSION_6_7_1_AVR32_2_1_5 || \
> +                                   (!BR2_PACKAGE_HOST_GDB && BR2_avr32)
>         default "7.2a"     if BR2_GDB_VERSION_7_2
>         default "7.3.1"    if BR2_GDB_VERSION_7_3
>         default "7.4.1"    if BR2_GDB_VERSION_7_4
> -       default "7.5.1"    if BR2_GDB_VERSION_7_5
> +       default "7.5.1"    if BR2_GDB_VERSION_7_5 || !BR2_PACKAGE_HOST_GDB
>         default "f25a1952afd054205f9471e449c1f7ca5b271b7c" if BR2_arc
>         default "6be65fb56ea6694a9260733a536a023a1e2d4d57" if BR2_microblaze
> -
> -endif
> diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
> index d06b61b..69fb3ba 100644
> --- a/package/gdb/gdb.mk
> +++ b/package/gdb/gdb.mk
> @@ -7,20 +7,6 @@
>  GDB_VERSION = $(call qstrip,$(BR2_GDB_VERSION))
>  GDB_SITE    = $(BR2_GNU_MIRROR)/gdb
>
> -# When no version is defined, it means that cross-gdb for the host has
> -# not been enabled, and we will only build gdbserver or gdb for the
> -# target. In this case, use the latest available version
> -# automatically.
> -ifeq ($(GDB_VERSION),)
> -ifeq ($(BR2_bfin),y)
> -GDB_VERSION = 6.6a
> -else ifeq ($(BR2_avr32),y)
> -GDB_VERSION = 6.7.1-avr32-2.1.5
> -else
> -GDB_VERSION = 7.5.1
> -endif
> -endif
> -
>  ifeq ($(BR2_arc),y)
>  GDB_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,gdb,$(GDB_VERSION))
>  GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
> --
> 1.8.5.3
>

This seems like a much better approach.  I'll run it through some
tests and get back to you.

Spenser
Arnout Vandecappelle - Jan. 30, 2014, 7:57 a.m.
On 30/01/14 02:29, Spenser Gilliland wrote:
> Arnout,
>
>> This avoids duplication of the version selection between these two files.
>>
>> Cc: Spenser Gilliland <spenser@gillilanding.com>
>> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>> ---
>> Warning: I have not really tested this!
[snip]
>
> This seems like a much better approach.  I'll run it through some
> tests and get back to you.
>
> Spenser

  Can you take it over and include it in your series? And test it, of 
course :-)

  Regards,
  Arnout
Thomas Petazzoni - Feb. 3, 2014, 9:32 p.m.
Dear Arnout Vandecappelle (Essensium/Mind),

On Wed, 29 Jan 2014 22:44:41 +0100, Arnout Vandecappelle
(Essensium/Mind) wrote:
> This avoids duplication of the version selection between these two files.
> 
> Cc: Spenser Gilliland <spenser@gillilanding.com>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> Warning: I have not really tested this!
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  package/gdb/Config.in.host | 14 +++++++++-----
>  package/gdb/gdb.mk         | 14 --------------
>  2 files changed, 9 insertions(+), 19 deletions(-)

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

I haven't actually built this, but I've done some testing by looking at
the .config file, and it indeed contains a proper BR2_GDB_VERSION value
even when a cross-gdb is not being built. Therefore, I'm fairly
confident that this patch is OK to be applied.

Thomas
Peter Korsgaard - Feb. 8, 2014, 10:11 p.m.
On Wed, Jan 29, 2014 at 10:44 PM, Arnout Vandecappelle
(Essensium/Mind) <arnout@mind.be> wrote:
> This avoids duplication of the version selection between these two files.
>
> Cc: Spenser Gilliland <spenser@gillilanding.com>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> Warning: I have not really tested this!
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Committed, thanks.

--
Bye, Peter Korsgaard

Patch

diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index d5e7814..9c0c78c 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -51,15 +51,19 @@  choice
 
 endchoice
 
+endif
+
+# If cross-gdb is not enabled, the latest working version is chosen.
 config BR2_GDB_VERSION
 	string
-	default "6.6a"     if BR2_GDB_VERSION_6_6
-	default "6.7.1-avr32-2.1.5" if BR2_GDB_VERSION_6_7_1_AVR32_2_1_5
+	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
+	default "6.6a"     if BR2_GDB_VERSION_6_6 || \
+	                      (!BR2_PACKAGE_HOST_GDB && BR2_bfin)
+	default "6.7.1-avr32-2.1.5" if BR2_GDB_VERSION_6_7_1_AVR32_2_1_5 || \
+                                   (!BR2_PACKAGE_HOST_GDB && BR2_avr32)
 	default "7.2a"     if BR2_GDB_VERSION_7_2
 	default "7.3.1"    if BR2_GDB_VERSION_7_3
 	default "7.4.1"    if BR2_GDB_VERSION_7_4
-	default "7.5.1"    if BR2_GDB_VERSION_7_5
+	default "7.5.1"    if BR2_GDB_VERSION_7_5 || !BR2_PACKAGE_HOST_GDB
 	default "f25a1952afd054205f9471e449c1f7ca5b271b7c" if BR2_arc
 	default "6be65fb56ea6694a9260733a536a023a1e2d4d57" if BR2_microblaze
-
-endif
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index d06b61b..69fb3ba 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -7,20 +7,6 @@ 
 GDB_VERSION = $(call qstrip,$(BR2_GDB_VERSION))
 GDB_SITE    = $(BR2_GNU_MIRROR)/gdb
 
-# When no version is defined, it means that cross-gdb for the host has
-# not been enabled, and we will only build gdbserver or gdb for the
-# target. In this case, use the latest available version
-# automatically.
-ifeq ($(GDB_VERSION),)
-ifeq ($(BR2_bfin),y)
-GDB_VERSION = 6.6a
-else ifeq ($(BR2_avr32),y)
-GDB_VERSION = 6.7.1-avr32-2.1.5
-else
-GDB_VERSION = 7.5.1
-endif
-endif
-
 ifeq ($(BR2_arc),y)
 GDB_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,gdb,$(GDB_VERSION))
 GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz