summaryrefslogtreecommitdiff
path: root/recipes/gcc/gcc-configure-common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/gcc/gcc-configure-common.inc')
-rw-r--r--recipes/gcc/gcc-configure-common.inc18
1 files changed, 12 insertions, 6 deletions
diff --git a/recipes/gcc/gcc-configure-common.inc b/recipes/gcc/gcc-configure-common.inc
index 1c605a132d..a0a7dfab74 100644
--- a/recipes/gcc/gcc-configure-common.inc
+++ b/recipes/gcc/gcc-configure-common.inc
@@ -81,12 +81,18 @@ do_configure () {
(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 = ${layout_includedir}" > ${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
-
- echo "#define STANDARD_INCLUDE_DIR \"${layout_includedir}\"" >> ${S}/gcc/defaults.h
+ if [ "${HOST_SYS}" != "${TARGET_SYS}" ]; then
+ # splice our idea of where the headers live into gcc's world
+ echo "NATIVE_SYSTEM_HEADER_DIR = ${layout_includedir}" > ${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 \"${layout_includedir}\"" >> ${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
+ fi
oe_runconf