From 192709ca26dde9653f45b5fae4d91362522c9d93 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 17 Sep 2009 01:05:15 +0100 Subject: 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 --- meta/packages/gcc/gcc-configure-common.inc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'meta/packages/gcc/gcc-configure-common.inc') diff --git a/meta/packages/gcc/gcc-configure-common.inc b/meta/packages/gcc/gcc-configure-common.inc index 9a64f542a8..e6052a9ef5 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 } -- cgit v1.2.3-54-g00ecf