gcc-cross-initial.inc 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. DEPENDS = "virtual/${TARGET_PREFIX}binutils ${NATIVEDEPS}"
  2. PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
  3. PACKAGES = ""
  4. INHIBIT_AUTOTOOLS_DEPS = "1"
  5. INHIBIT_DEFAULT_DEPS = "1"
  6. # We still need gnu-config-native
  7. DEPENDS_prepend = "gnu-config-native autoconf-native "
  8. PN = "gcc-cross-initial-${TARGET_ARCH}"
  9. CROSS_TARGET_SYS_DIR_append = ".${PN}"
  10. # This is intended to be a -very- basic config
  11. # sysroot is needed in case we use libc-initial
  12. EXTRA_OECONF = "\
  13. --with-newlib \
  14. --without-headers \
  15. --disable-shared \
  16. --disable-threads \
  17. --disable-multilib \
  18. --disable-__cxa_atexit \
  19. --enable-languages=c \
  20. --program-prefix=${TARGET_PREFIX} \
  21. --with-sysroot=/not/exist \
  22. --with-build-sysroot=${STAGING_DIR_TARGET} \
  23. ${EXTRA_OECONF_INITIAL} \
  24. ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
  25. ${EXTRA_OECONF_GCC_FLOAT} \
  26. ${@get_gcc_ppc_plt_settings(bb, d)} \
  27. "
  28. EXTRA_OECONF += "--with-native-system-header-dir=${SYSTEMHEADERS}"
  29. do_compile () {
  30. oe_runmake all-gcc configure-target-libgcc
  31. }
  32. do_install () {
  33. ( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h )
  34. oe_runmake 'DESTDIR=${D}' install-gcc
  35. # We don't really need this (here shares/ contains man/, info/, locale/).
  36. rm -rf ${D}${datadir}/
  37. # We use libiberty from binutils
  38. find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
  39. find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
  40. # Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
  41. # found. These need to be relative paths so they work in different locations.
  42. dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
  43. install -d $dest
  44. useld=${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '.bfd', '', d)}
  45. ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld${useld} ${dest}ld
  46. for t in ar as nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
  47. ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
  48. done
  49. # fixed limits.h infact includes the so called real limits.h
  50. # which should come from libc but when we build libc-initial
  51. # then bunch of configure tests include fixed limits.h which in turn
  52. # includes real limits.h but this real limits.h is not staged yet
  53. # so we overwirte the generated include-fixed/limits.h for gcc-cross-initial
  54. # to get rid references to real limits.h
  55. cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include/limits.h
  56. }
  57. #
  58. # Override the default sysroot staging copy since this won't look like a target system
  59. #
  60. sysroot_stage_all() {
  61. sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
  62. install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/
  63. install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/
  64. mv ${SYSROOT_DESTDIR}${target_base_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/ || true
  65. mv ${SYSROOT_DESTDIR}${target_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/ || true
  66. }
  67. do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/"
  68. do_populate_sysroot[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/${PN}"
  69. inherit nopackages
  70. COMPILERINITIAL = "-initial"
  71. # We really only want this built by things that need it, not any recrdeptask
  72. deltask do_build