From 60075ae81e0bd95aa83adcb49b74ca4694cd80a2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 22 Oct 2010 15:10:08 -0700 Subject: [PATCH] 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 --- classes/autotools.bbclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass index 97bc47c2b5..3d8bcb55e2 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 () { -- 2.39.5