summaryrefslogtreecommitdiff
path: root/recipes/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/gcc')
-rw-r--r--recipes/gcc/gcc-4.4.1.inc43
-rw-r--r--recipes/gcc/gcc-configure-common.inc18
-rw-r--r--recipes/gcc/gcc-configure-cross.inc6
3 files changed, 17 insertions, 50 deletions
diff --git a/recipes/gcc/gcc-4.4.1.inc b/recipes/gcc/gcc-4.4.1.inc
index 9bc4d17dd6..f32f749ce6 100644
--- a/recipes/gcc/gcc-4.4.1.inc
+++ b/recipes/gcc/gcc-4.4.1.inc
@@ -30,46 +30,3 @@ EXTRA_OECONF_BASE = " --enable-libssp \
--disable-libmudflap"
EXTRA_OECONF_append_linux-uclibc = " ${@base_contains('TARGET_ARCH', 'powerpc', '--disable-decimal-float --without-long-double-128', '',d)}"
-do_configure () {
- # Setup these vars for cross building only
- # ... because foo_FOR_TARGET apparently gets misinterpreted inside the
- # gcc build stuff when the build is producing a cross compiler - i.e.
- # when the 'current' target is the 'host' system, and the host is not
- # the target (because the build is actually making a cross compiler!)
- if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
- export CC_FOR_TARGET="${CC}"
- export GCC_FOR_TARGET="${CC}"
- export CXX_FOR_TARGET="${CXX}"
- export AS_FOR_TARGET="${HOST_PREFIX}as"
- export LD_FOR_TARGET="${HOST_PREFIX}ld"
- export NM_FOR_TARGET="${HOST_PREFIX}nm"
- export AR_FOR_TARGET="${HOST_PREFIX}ar"
- export GFORTRAN_FOR_TARGET="gfortran"
- export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
- fi
- export CC_FOR_BUILD="${BUILD_CC}"
- export CXX_FOR_BUILD="${BUILD_CXX}"
- export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
- export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
- export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
- export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
- export ARCH_FLAGS_FOR_TARGET="${ARCH_FLAGS_FOR_TARGET}"
-
- # Make sure LDFLAGS are honored.
- sed -i 's/^LDFLAGS = $/LDFLAGS = @LDFLAGS@/' ${S}/Makefile.in
- 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
-
- #echo "#define STANDARD_INCLUDE_DIR \"${layout_includedir}\"" >> ${S}/gcc/defaults.h
-
- oe_runconf
-
- # make sure that no @LDFLAG@ is left in the generated Makefile
- sed -i "s/@LDFLAGS@//g" ${B}/Makefile
-}
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
diff --git a/recipes/gcc/gcc-configure-cross.inc b/recipes/gcc/gcc-configure-cross.inc
index aa4174edc4..b526ff3cc4 100644
--- a/recipes/gcc/gcc-configure-cross.inc
+++ b/recipes/gcc/gcc-configure-cross.inc
@@ -7,12 +7,16 @@ EXTRA_OECONF_PATHS = "--with-local-prefix=${STAGING_DIR_TARGET}${layout_prefix}
--with-sysroot=${STAGING_DIR_TARGET} \
--with-build-sysroot=${STAGING_DIR_TARGET}"
-do_compile_prepend () {
+do_configure_prepend () {
export CC="${BUILD_CC}"
export AR_FOR_TARGET="${TARGET_SYS}-ar"
+ export AS_FOR_TARGET="${TARGET_SYS}-as"
export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
export LD_FOR_TARGET="${TARGET_SYS}-ld"
export NM_FOR_TARGET="${TARGET_SYS}-nm"
+ export OBJDUMP_FOR_TARGET="${TARGET_SYS}-objdump"
+ export OBJCOPY_FOR_TARGET="${TARGET_SYS}-objcopy"
+ export STRIP_FOR_TARGET="${TARGET_SYS}-strip"
export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc ${TARGET_CC_ARCH}"
}