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 | poky-192709ca26dde9653f45b5fae4d91362522c9d93.tar.gz |
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 9a64f542a8..e6052a9ef5 100644 --- a/meta/packages/gcc/gcc-configure-common.inc +++ b/meta/packages/gcc/gcc-configure-common.inc | |||
@@ -47,6 +47,9 @@ CPPFLAGS = "" | |||
47 | ARCH_FLAGS_FOR_TARGET = "${TARGET_CC_ARCH}" | 47 | ARCH_FLAGS_FOR_TARGET = "${TARGET_CC_ARCH}" |
48 | EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'" | 48 | EXTRA_OEMAKE += "ARCH_FLAGS_FOR_TARGET='${ARCH_FLAGS_FOR_TARGET}'" |
49 | 49 | ||
50 | SYSTEMHEADERS = "${includedir}" | ||
51 | SYSTEMLIBS1 = "${libdir}/" | ||
52 | |||
50 | do_configure () { | 53 | do_configure () { |
51 | # Setup these vars for cross building only | 54 | # Setup these vars for cross building only |
52 | # ... because foo_FOR_TARGET apparently gets misinterpreted inside the | 55 | # ... because foo_FOR_TARGET apparently gets misinterpreted inside the |
@@ -72,6 +75,20 @@ do_configure () { | |||
72 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" | 75 | export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}" |
73 | export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" | 76 | export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}" |
74 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" | 77 | (cd ${S} && gnu-configize) || die "failure running gnu-configize" |
78 | |||
79 | # splice our idea of where the headers live into gcc's world | ||
80 | echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${T}/t-oe | ||
81 | sed 's%^tmake_file=.*$%& ${T}/t-oe%' < ${S}/gcc/Makefile.in >${S}/gcc/Makefile.in.new | ||
82 | mv ${S}/gcc/Makefile.in.new ${S}/gcc/Makefile.in | ||
83 | cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${S}/gcc/defaults.h.new | ||
84 | echo "#ifndef STANDARD_INCLUDE_DIR" >> ${S}/gcc/defaults.h.new | ||
85 | echo "#define STANDARD_INCLUDE_DIR \"${SYSTEMHEADERS}\"" >> ${S}/gcc/defaults.h.new | ||
86 | echo "#endif" >> ${S}/gcc/defaults.h.new | ||
87 | echo "#ifndef STANDARD_STARTFILE_PREFIX_2" >> ${S}/gcc/defaults.h.new | ||
88 | echo "#define STANDARD_STARTFILE_PREFIX_2 \"${SYSTEMLIBS1}\"" >> ${S}/gcc/defaults.h.new | ||
89 | echo "#endif" >> ${S}/gcc/defaults.h.new | ||
90 | echo "#endif /* ! GCC_DEFAULTS_H */" >> ${S}/gcc/defaults.h.new | ||
91 | mv ${S}/gcc/defaults.h.new ${S}/gcc/defaults.h | ||
75 | oe_runconf | 92 | oe_runconf |
76 | } | 93 | } |
77 | 94 | ||