[oe-commits] Khem Raj : autotools.bbclass: Specify a value of sysroot instead of asking the compiler

git version control git at git.openembedded.org
Sun Oct 24 02:00:21 UTC 2010


Module: openembedded.git
Branch: master
Commit: 60075ae81e0bd95aa83adcb49b74ca4694cd80a2
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=60075ae81e0bd95aa83adcb49b74ca4694cd80a2

Author: Khem Raj <raj.khem at gmail.com>
Date:   Fri Oct 22 15:10:08 2010 -0700

autotools.bbclass: Specify a value of sysroot instead of asking the compiler

If we just use --with-libtool-sysroot then it asks the compiler at
configure time to supply the sysroot which will not work with external
toolchains because they may have different default sysroot encoded into
them. Therefore we specify the sysroot so the configure can use that
value and not depend upon compiler to supply one.

We do not do it for native recipes as the native compiler should
fall back to /usr prefix and not solely depend on sysroot otherwise
we end up staging everything in native sysroot before we start to build
target recipes

Signed-off-by: Khem Raj <raj.khem at gmail.com>

---

 classes/autotools.bbclass |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass
index 97bc47c..3d8bcb5 100644
--- a/classes/autotools.bbclass
+++ b/classes/autotools.bbclass
@@ -57,6 +57,14 @@ def autotools_set_crosscompiling(d):
 		return " cross_compiling=yes"
 	return ""
 
+def append_libtool_sysroot(d):
+	if bb.data.getVar('LIBTOOL_HAS_SYSROOT', d, 1) == "yes":
+		if bb.data.getVar('BUILD_SYS', d, 1) == bb.data.getVar('HOST_SYS', d, 1):
+			return '--with-libtool-sysroot'
+		else:
+			return '--with-libtool-sysroot=${STAGING_DIR}/${MULTIMACH_HOST_SYS}'
+	return ''
+
 # EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
 
 CONFIGUREOPTS = " --build=${BUILD_SYS} \
@@ -76,7 +84,7 @@ CONFIGUREOPTS = " --build=${BUILD_SYS} \
 		  --oldincludedir=${oldincludedir} \
 		  --infodir=${infodir} \
 		  --mandir=${mandir} \
-		  ${@["","--with-libtool-sysroot"][bb.data.getVar('LIBTOOL_HAS_SYSROOT', d, 1) == "yes"]} \
+		  ${@append_libtool_sysroot(d)} \
 		"
 
 oe_runconf () {





More information about the Openembedded-commits mailing list