diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2009-09-17 01:05:15 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2009-09-17 22:25:24 +0100 |
commit | 192709ca26dde9653f45b5fae4d91362522c9d93 (patch) | |
tree | 3f56167c74753d5837d2144e0ba517b604c78068 | |
parent | 7efbf5caf87324687f9515af6fcac0b3267365b3 (diff) | |
download | openembedded-core-192709ca26dde9653f45b5fae4d91362522c9d93.tar.gz openembedded-core-192709ca26dde9653f45b5fae4d91362522c9d93.tar.bz2 openembedded-core-192709ca26dde9653f45b5fae4d91362522c9d93.tar.xz openembedded-core-192709ca26dde9653f45b5fae4d91362522c9d93.zip |
gcc-configure-common: Allow the sysroot layout seen by the compiler to be configured (based on a patch from OE.dev but improved)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r-- | meta/packages/gcc/gcc-configure-common.inc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/meta/packages/gcc/gcc-configure-common.inc b/meta/packages/gcc/gcc-configure-common.inc index 9a64f542a..e6052a9ef 100644 --- a/meta/packages/gcc/gcc-configure-common.inc +++ b/meta/packages/gcc/gcc-configure-common.inc @@ -47,6 +47,9 @@ CPPFLAGS = "" ARCH_FLAGS_FOR_TARGET = "${TARGET_CC_ARCH}" EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'" +SYSTEMHEADERS = "${includedir}" +SYSTEMLIBS1 = "${libdir}/" + do_configure () { # Setup these vars for cross building only # ... because foo_FOR_TARGET apparently gets misinterpreted inside the @@ -72,6 +75,20 @@ do_configure () { export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" (cd ${S} && gnu-configize) || die "failure running gnu-configize" + + # splice our idea of where the headers live into gcc's world + echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${T}/t-oe + sed 's%^tmake_file=.*$%& ${T}/t-oe%' < ${S}/gcc/Makefile.in >${S}/gcc/Makefile.in.new + mv ${S}/gcc/Makefile.in.new ${S}/gcc/Makefile.in + cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${S}/gcc/defaults.h.new + echo "#ifndef STANDARD_INCLUDE_DIR" >> ${S}/gcc/defaults.h.new + echo "#define STANDARD_INCLUDE_DIR \"${SYSTEMHEADERS}\"" >> ${S}/gcc/defaults.h.new + echo "#endif" >> ${S}/gcc/defaults.h.new + echo "#ifndef STANDARD_STARTFILE_PREFIX_2" >> ${S}/gcc/defaults.h.new + echo "#define STANDARD_STARTFILE_PREFIX_2 \"${SYSTEMLIBS1}\"" >> ${S}/gcc/defaults.h.new + echo "#endif" >> ${S}/gcc/defaults.h.new + echo "#endif /* ! GCC_DEFAULTS_H */" >> ${S}/gcc/defaults.h.new + mv ${S}/gcc/defaults.h.new ${S}/gcc/defaults.h oe_runconf } |