]> code.ossystems Code Review - openembedded-core.git/commitdiff
Fix multiarch DISTRO_FEATURE
authorJulian Pidancet <julian.pidancet@gmail.com>
Thu, 1 Dec 2011 00:01:56 +0000 (00:01 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Nov 2011 23:35:13 +0000 (23:35 +0000)
Make get_gcc_multiarch_setting more elegant. Use a dictionnary
to store the config options and replace bb.data.getVar with d.getVar.
Remove i686 from the architecture list because it doesn't seem
to be a valid TARGET_ARCH any more in OE.
Configure gdb (gdb and gdb-cross) with --enable-64-bit-bfd if
multiarch DISTRO_FEATURE is present

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/gcc/gcc-common.inc
meta/recipes-devtools/gdb/gdb-common.inc

index 7ec2f7e4636a1702924271da037018cd382ada95..fe112d9d0a37bed2c1beaba53256db4ca6881359 100644 (file)
@@ -22,13 +22,16 @@ def get_gcc_mips_plt_setting(bb, d):
     return ""
 
 def get_gcc_multiarch_setting(bb, d):
-    if 'multiarch' in bb.data.getVar('DISTRO_FEATURES',d,1).split() :
-        if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'i586', 'i686' ] :
-            return "--enable-targets=all"
-        if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'powerpc' ] :
-            return "--enable-targets=powerpc64"
-        if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'sparc' ] :
-            return "--enable-targets=all"
+    target_arch = d.getVar('TARGET_ARCH', True)
+    multiarch_options = {
+        "i586":    "--enable-targets=all",
+        "powerpc": "--enable-targets=powerpc64",
+        "sparc":   "--enable-targets=all",
+    }
+
+    if 'multiarch' in d.getVar('DISTRO_FEATURES', True).split() :
+        if target_arch in multiarch_options :
+            return multiarch_options[target_arch]
     return ""
 
 # We really need HOST_SYS here for some packages and TARGET_SYS for others.
index e01b57cc8799e5da0abd081290bef559bb068b12..d728139f62d935293d6f5589e23751e6779bbfc6 100644 (file)
@@ -41,6 +41,7 @@ EXPAT = "--without-expat"
 EXTRA_OECONF = "--disable-gdbtk --disable-tui --disable-x \
                 --with-curses --disable-multilib --with-system-readline --disable-sim \
                 ${GDBPROPREFIX} --with-libelf=${STAGING_DIR_TARGET} ${EXPAT} \
+                ${@base_contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)} \
                "
 
 GDBPROPREFIX = "--program-prefix=''"