Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 1 | inherit cross-canadian |
| 2 | |
| 3 | require license.inc |
| 4 | |
| 5 | PN = "external-arm-sdk-toolchain-${TARGET_ARCH}" |
| 6 | BPN = "external-arm-sdk-toolchain" |
| 7 | PV = "${EAT_VER_MAIN}" |
| 8 | |
| 9 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" |
| 10 | INHIBIT_PACKAGE_STRIP = "1" |
| 11 | INHIBIT_SYSROOT_STRIP = "1" |
| 12 | INHIBIT_DEFAULT_DEPS = "1" |
| 13 | EXCLUDE_FROM_SHLIBS = "1" |
| 14 | |
| 15 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
| 16 | |
| 17 | # Skip packaging QA checks for prebuilt binaries |
| 18 | INSANE_SKIP:gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} = "dev-so staticdev file-rdeps libdir" |
| 19 | INSANE_SKIP:gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "dev-so file-rdeps" |
| 20 | INSANE_SKIP:binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} = "dev-so file-rdeps" |
| 21 | |
| 22 | # Skip file dependencies in RPM for prebuilt binaries |
| 23 | SKIP_FILEDEPS = "1" |
| 24 | |
| 25 | PROVIDES = "\ |
| 26 | gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} \ |
| 27 | gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} \ |
| 28 | binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} \ |
| 29 | " |
| 30 | |
| 31 | PACKAGES = "\ |
| 32 | gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} \ |
| 33 | gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} \ |
| 34 | binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} \ |
| 35 | " |
| 36 | |
| 37 | # Adjust defaults in line with external toolchain |
| 38 | bindir = "${exec_prefix}/bin" |
| 39 | libdir = "${exec_prefix}/lib" |
| 40 | libexecdir = "${exec_prefix}/libexec" |
| 41 | datadir = "${exec_prefix}/share" |
| 42 | gcclibdir = "${libdir}/gcc" |
| 43 | |
| 44 | FILES:gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} = "\ |
| 45 | ${prefix}/${EAT_TARGET_SYS}/lib/libstdc++.* \ |
| 46 | ${prefix}/${EAT_TARGET_SYS}/lib/libgcc_s.* \ |
| 47 | ${prefix}/${EAT_TARGET_SYS}/lib/libsupc++.* \ |
| 48 | ${prefix}/${EAT_TARGET_SYS}/include \ |
| 49 | ${gcclibdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/* \ |
| 50 | ${bindir}/${TARGET_PREFIX}gcov \ |
| 51 | ${bindir}/${TARGET_PREFIX}gcc* \ |
| 52 | ${bindir}/${TARGET_PREFIX}g++ \ |
| 53 | ${bindir}/${TARGET_PREFIX}cpp \ |
| 54 | ${libexecdir}/* \ |
| 55 | " |
| 56 | |
| 57 | FILES:gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "\ |
| 58 | ${bindir}/${TARGET_PREFIX}gdb* \ |
| 59 | ${datadir}/gdb/* \ |
| 60 | " |
| 61 | |
| 62 | FILES:binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} = "\ |
| 63 | ${prefix}/${EAT_TARGET_SYS}/bin/ld* \ |
| 64 | ${prefix}/${EAT_TARGET_SYS}/bin/objcopy \ |
| 65 | ${prefix}/${EAT_TARGET_SYS}/bin/strip \ |
| 66 | ${prefix}/${EAT_TARGET_SYS}/bin/nm \ |
| 67 | ${prefix}/${EAT_TARGET_SYS}/bin/ranlib \ |
| 68 | ${prefix}/${EAT_TARGET_SYS}/bin/as \ |
| 69 | ${prefix}/${EAT_TARGET_SYS}/bin/ar \ |
| 70 | ${prefix}/${EAT_TARGET_SYS}/bin/objdump \ |
| 71 | ${prefix}/${EAT_TARGET_SYS}/lib/ldscripts/* \ |
| 72 | ${bindir}/${TARGET_PREFIX}ld* \ |
| 73 | ${bindir}/${TARGET_PREFIX}addr2line \ |
| 74 | ${bindir}/${TARGET_PREFIX}objcopy \ |
| 75 | ${bindir}/${TARGET_PREFIX}readelf \ |
| 76 | ${bindir}/${TARGET_PREFIX}strip \ |
| 77 | ${bindir}/${TARGET_PREFIX}nm \ |
| 78 | ${bindir}/${TARGET_PREFIX}ranlib \ |
| 79 | ${bindir}/${TARGET_PREFIX}gprof \ |
| 80 | ${bindir}/${TARGET_PREFIX}as \ |
| 81 | ${bindir}/${TARGET_PREFIX}c++filt \ |
| 82 | ${bindir}/${TARGET_PREFIX}ar \ |
| 83 | ${bindir}/${TARGET_PREFIX}strings \ |
| 84 | ${bindir}/${TARGET_PREFIX}objdump \ |
| 85 | ${bindir}/${TARGET_PREFIX}size \ |
| 86 | " |
| 87 | |
| 88 | DESCRIPTION:gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} = "The GNU cc and gcc C compilers" |
| 89 | DESCRIPTION:gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "gdb - GNU debugger" |
| 90 | DESCRIPTION:binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} = "A GNU collection of binary utilities" |
| 91 | |
| 92 | LICENSE:gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} = "${EAT_GCC_LICENSE}" |
| 93 | LICENSE:gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "${EAT_GDB_LICENSE}" |
| 94 | LICENSE:binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} = "${EAT_BFD_LICENSE}" |
| 95 | |
| 96 | PKGV:gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} = "${EAT_VER_GCC}" |
| 97 | PKGV:gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} = "${EAT_VER_GDB}" |
| 98 | PKGV:binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} = "${EAT_VER_BFD}" |
| 99 | |
| 100 | do_install() { |
| 101 | install -d ${D}${prefix}/${EAT_TARGET_SYS}/bin |
| 102 | install -d ${D}${prefix}/${EAT_TARGET_SYS}/lib |
| 103 | install -d ${D}${prefix}/${EAT_TARGET_SYS}/include |
| 104 | install -d ${D}${bindir} |
| 105 | install -d ${D}${libdir} |
| 106 | install -d ${D}${prefix}/${EAT_TARGET_SYS}/lib/ldscripts |
| 107 | install -d ${D}${libexecdir} |
| 108 | install -d ${D}${datadir}/gdb |
| 109 | install -d ${D}${gcclibdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include |
| 110 | |
| 111 | CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership" |
| 112 | |
| 113 | # gcc |
| 114 | for i in libstdc++.* libgcc_s.* libsupc++.*; do |
| 115 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/${EAT_LIBDIR}/$i ${D}${prefix}/${EAT_TARGET_SYS}/lib |
| 116 | done |
| 117 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/include/* ${D}${prefix}/${EAT_TARGET_SYS}/include |
| 118 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/* ${D}${gcclibdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC} |
| 119 | for i in gcov gcc* g++ cpp; do |
| 120 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}$i ${D}${bindir} |
| 121 | done |
| 122 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/libexec/* ${D}${libexecdir} |
| 123 | |
| 124 | # gdb |
| 125 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}gdb* ${D}${bindir} |
| 126 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/share/gdb/* ${D}${datadir}/gdb/ |
| 127 | |
| 128 | # binutils |
| 129 | for i in ld* objcopy strip nm ranlib as ar objdump; do |
| 130 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/bin/$i ${D}${prefix}/${EAT_TARGET_SYS}/bin |
| 131 | done |
| 132 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/lib/ldscripts/* ${D}${prefix}/${EAT_TARGET_SYS}/lib/ldscripts |
| 133 | for i in ld* addr2line objcopy readelf strip nm ranlib gprof as c++filt ar strings objdump size; do |
| 134 | cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/bin/${TARGET_PREFIX}$i ${D}${bindir} |
| 135 | done |
| 136 | } |
| 137 | |
| 138 | python () { |
| 139 | if not d.getVar("EAT_VER_MAIN", False): |
| 140 | raise bb.parse.SkipPackage("External ARM toolchain not configured (EAT_VER_MAIN not set).") |
| 141 | if d.getVar('TCLIBC', True) != "glibc": |
| 142 | raise bb.parse.SkipPackage("incompatible with %s" % d.getVar('TCLIBC', True)) |
| 143 | } |