2010-03-31 11:09:14 +00:00
|
|
|
DEPENDS = "virtual/${TARGET_PREFIX}binutils ${NATIVEDEPS}"
|
2009-12-22 15:41:01 +00:00
|
|
|
DEPENDS += "virtual/${TARGET_PREFIX}libc-initial gettext-native"
|
2008-07-24 20:30:37 +00:00
|
|
|
PROVIDES = "virtual/${TARGET_PREFIX}gcc-intermediate"
|
|
|
|
PACKAGES = ""
|
|
|
|
|
2011-01-18 04:50:39 +00:00
|
|
|
CROSS_TARGET_SYS_DIR_append = ".${PN}"
|
|
|
|
|
2008-07-24 20:30:37 +00:00
|
|
|
# This is intended to be a -very- basic config
|
|
|
|
# sysroot is needed in case we use libc-initial
|
2011-06-27 15:51:16 +00:00
|
|
|
#
|
|
|
|
# Glibc won't compile with gold, and building glibc is the whole point of
|
|
|
|
# this recipe. So we select ld.bfd explicitly here if gold is the distro's
|
|
|
|
# preferred linker.
|
2009-09-16 22:09:44 +00:00
|
|
|
EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
|
2008-07-24 20:30:37 +00:00
|
|
|
--enable-shared \
|
|
|
|
--disable-multilib \
|
|
|
|
--disable-threads \
|
|
|
|
--enable-languages=c \
|
2010-07-30 21:05:16 +00:00
|
|
|
${OPTSPACE} \
|
2008-07-24 20:30:37 +00:00
|
|
|
--program-prefix=${TARGET_PREFIX} \
|
2011-01-25 00:34:09 +00:00
|
|
|
--with-sysroot=${STAGING_DIR_TCBOOTSTRAP} \
|
|
|
|
--with-build-sysroot=${STAGING_DIR_TCBOOTSTRAP} \
|
2010-03-31 16:28:08 +00:00
|
|
|
${EXTRA_OECONF_INTERMEDIATE} \
|
2011-06-27 15:51:16 +00:00
|
|
|
${@get_gcc_fpu_setting(bb, d)} \
|
|
|
|
${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)}"
|
2008-07-24 20:30:37 +00:00
|
|
|
|
2011-01-18 08:17:58 +00:00
|
|
|
do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST} ${SYSROOT_DESTDIR}/${STAGING_DIR_TARGET}/${target_base_libdir}"
|
2011-01-25 00:34:09 +00:00
|
|
|
do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST} ${STAGING_DIR_TCBOOTSTRAP}/${target_base_libdir}"
|
2011-01-18 08:17:58 +00:00
|
|
|
|
2010-03-29 21:27:13 +00:00
|
|
|
do_compile () {
|
|
|
|
oe_runmake
|
|
|
|
}
|
|
|
|
|
2008-07-24 20:30:37 +00:00
|
|
|
do_install () {
|
2009-11-16 23:36:11 +00:00
|
|
|
oe_runmake 'DESTDIR=${D}' install
|
2010-07-23 17:03:09 +00:00
|
|
|
install -d ${D}${target_base_libdir}/
|
|
|
|
mv ${D}${exec_prefix}/${TARGET_SYS}/lib/* ${D}${target_base_libdir}/
|
2011-01-18 04:50:39 +00:00
|
|
|
|
|
|
|
# We don't really need this (here shares/ contains man/, info/, locale/).
|
|
|
|
rm -rf ${D}${datadir}/
|
|
|
|
|
|
|
|
# We use libiberty from binutils
|
2011-07-04 14:37:18 +00:00
|
|
|
find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
|
|
|
|
find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
|
2011-01-18 04:50:39 +00:00
|
|
|
|
|
|
|
# Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
|
|
|
|
# found. These need to be relative paths so they work in different locations.
|
|
|
|
dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
|
|
|
|
install -d $dest
|
|
|
|
for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
|
|
|
|
ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
|
|
|
|
done
|
2008-07-24 20:30:37 +00:00
|
|
|
}
|
2011-01-26 10:04:46 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Override the default sysroot staging copy since this won't look like a target system
|
|
|
|
#
|
|
|
|
sysroot_stage_all() {
|
|
|
|
sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
|
|
|
|
install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/
|
|
|
|
install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/
|
|
|
|
mv ${SYSROOT_DESTDIR}${target_base_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/ || true
|
|
|
|
mv ${SYSROOT_DESTDIR}${target_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/ || true
|
|
|
|
}
|
|
|
|
|