diff options
| -rw-r--r-- | classes/ti-pdk.bbclass | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/classes/ti-pdk.bbclass b/classes/ti-pdk.bbclass new file mode 100644 index 00000000..ae76fdfe --- /dev/null +++ b/classes/ti-pdk.bbclass | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | require recipes-ti/includes/ti-paths.inc | ||
| 2 | require recipes-ti/includes/ti-staging.inc | ||
| 3 | |||
| 4 | inherit perlnative | ||
| 5 | |||
| 6 | DEPENDS = "ti-xdctools ti-cg-xml-native ti-sysbios common-csl-ip-rtos libxml-simple-perl-native gcc-arm-none-eabi-native" | ||
| 7 | |||
| 8 | DEPENDS_append_omap-a15 = " ti-cgt6x-native ti-ccsv6-native" | ||
| 9 | DEPENDS_append_keystone = " ti-cgt6x-native" | ||
| 10 | |||
| 11 | S = "${WORKDIR}/git" | ||
| 12 | B = "${WORKDIR}/build" | ||
| 13 | |||
| 14 | get_build_dir_bash() { | ||
| 15 | if [ -f ${S}/package.xdc ] | ||
| 16 | then | ||
| 17 | grep '^package' ${S}/package.xdc | sed -e 's|\[.*$||' | awk '{ print $2 }' | sed -e 's|\.|/|g' | ||
| 18 | else | ||
| 19 | echo ${S} | ||
| 20 | return 1 | ||
| 21 | fi | ||
| 22 | } | ||
| 23 | |||
| 24 | export CROSS_TOOL_PRFX="arm-none-eabi-" | ||
| 25 | export TOOLCHAIN_PATH_A8 = "${GCC_ARM_NONE_TOOLCHAIN}" | ||
| 26 | export TOOLCHAIN_PATH_A9 = "${GCC_ARM_NONE_TOOLCHAIN}" | ||
| 27 | export TOOLCHAIN_PATH_A15 = "${GCC_ARM_NONE_TOOLCHAIN}" | ||
| 28 | export TOOLCHAIN_PATH_M4 = "${M4_TOOLCHAIN_INSTALL_DIR}" | ||
| 29 | export C6X_GEN_INSTALL_PATH = "${STAGING_DIR_NATIVE}/usr/share/ti/cgt-c6x" | ||
| 30 | |||
| 31 | export ROOTDIR = "${B}" | ||
| 32 | export BIOS_INSTALL_PATH = "${SYSBIOS_INSTALL_DIR}" | ||
| 33 | export XDC_INSTALL_PATH = "${XDC_INSTALL_DIR}" | ||
| 34 | export PDK_INSTALL_PATH = "${PDK_INSTALL_DIR}/packages" | ||
| 35 | |||
| 36 | export XDCPATH = "${XDC_INSTALL_DIR}/packages;${SYSBIOS_INSTALL_DIR}/packages;${PDK_INSTALL_DIR}/packages" | ||
| 37 | export SECTTI="perl ${CG_XML_INSTALL_DIR}/ofd/sectti.pl" | ||
| 38 | |||
| 39 | PARALLEL_XDC = "--jobs=${BB_NUMBER_THREADS}" | ||
| 40 | |||
| 41 | do_configure() { | ||
| 42 | BUILD_DIR=${B}/`get_build_dir_bash` | ||
| 43 | |||
| 44 | mkdir -p ${BUILD_DIR} | ||
| 45 | cp -r ${S}/* ${BUILD_DIR} | ||
| 46 | cd ${BUILD_DIR} | ||
| 47 | |||
| 48 | sed -i "s/\ \"\.\\\\\\\\\"\ +//" src/Module.xs | ||
| 49 | find -name "*.xs" -exec sed -i "s/ofd6x\.exe/ofd6x/" {} \; | ||
| 50 | find -name "*.xs" -exec sed -i "s/sectti\.exe/sectti/" {} \; | ||
| 51 | find -name "*.xs" -exec sed -i "/\.chm/d" {} \; | ||
| 52 | find -name "*.xs" -exec sed -i "s/pasm\_dos/pasm\_linux/" {} \; | ||
| 53 | } | ||
| 54 | |||
| 55 | do_compile() { | ||
| 56 | ${XDC_INSTALL_DIR}/xdc clean ${PARALLEL_XDC} -PR . | ||
| 57 | ${XDC_INSTALL_DIR}/xdc all ${PARALLEL_XDC} XDCARGS="${XDCARGS}" ROOTDIR="${ROOTDIR}" -PR . | ||
| 58 | ${XDC_INSTALL_DIR}/xdc release XDCARGS="${XDCARGS}" -PR . | ||
| 59 | } | ||
| 60 | |||
| 61 | do_install () { | ||
| 62 | install -d ${D}${PDK_INSTALL_DIR_RECIPE}/packages | ||
| 63 | find -name "*.tar" -exec tar xf {} -C ${D}${PDK_INSTALL_DIR_RECIPE}/packages \; | ||
| 64 | } | ||
| 65 | |||
| 66 | FILES_${PN} += "${PDK_INSTALL_DIR_RECIPE}/packages" | ||
