gcc-configure-common.inc: Fiddle with NATIVE_SYSTEM_HEADER_DIR only form cross gcc...
authorKhem Raj <raj.khem@gmail.com>
Sat, 12 Sep 2009 20:05:20 +0000 (13:05 -0700)
committerKhem Raj <raj.khem@gmail.com>
Sat, 12 Sep 2009 23:18:53 +0000 (16:18 -0700)
* target gcc does not like the NATIVE_SYSTEM_HEADER_DIR being tweaked.
  for now conditionalize it so it gets included only for cross builds
  it could be that target gcc for micro wont work because it needs headers
  in /usr/include and the actual headers are in /include

Signed-off-by: Khem Raj <raj.khem@gmail.com>
recipes/gcc/gcc-configure-common.inc

index fb792a8..a0a7dfa 100644 (file)
@@ -80,16 +80,20 @@ do_configure () {
        sed -i 's/^LDFLAGS = $/LDFLAGS = @LDFLAGS@/' ${S}/Makefile.tpl
 
        (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
-       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
+
+       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
 
        # make sure that no @LDFLAG@ is left in the generated Makefile