Patchwork [1/2] autotools: set _FOR_BUILD variables here

login
register
mail settings
Submitter Ross Burton
Date Nov. 9, 2012, 10:09 a.m.
Message ID <8f832804399ec12aa916174e6de9a8a222bfc182.1352455397.git.ross.burton@intel.com>
Download mbox | patch
Permalink /patch/38841/
State Accepted
Commit 85bfe3c931d7ef5ee461251abb6772564733e072
Headers show

Comments

Ross Burton - Nov. 9, 2012, 10:09 a.m.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/classes/autotools.bbclass |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

Patch

diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index b97d74b..ca981ec 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -34,6 +34,21 @@  EXTRA_AUTORECONF = "--exclude=autopoint"
 
 export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}"
 
+# When building tools for use at build-time it's recommended for the build
+# system to use these variables when cross-compiling.
+# (http://sources.redhat.com/autobook/autobook/autobook_270.html)
+export CPP_FOR_BUILD = "${BUILD_CPP}"
+export CPPFLAGS_FOR_BUILD = "${BUILD_CPPFLAGS}"
+
+export CC_FOR_BUILD = "${BUILD_CC}"
+export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
+
+export CXX_FOR_BUILD = "${BUILD_CXX}"
+export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
+
+export LD_FOR_BUILD = "${BUILD_LD}"
+export LDFLAGS_FOR_BUILD = "${BUILD_LDFLAGS}"
+
 def autotools_set_crosscompiling(d):
     if not bb.data.inherits_class('native', d):
         return " cross_compiling=yes"