rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | #Basic Configuration |
| 2 | DESCRIPTION = "spmeta" |
| 3 | SECTION = "base" |
| 4 | LICENSE = "MediaTekProprietary" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e1696b147d49d491bcb4da1a57173fff" |
| 6 | MTK_SRC = "${TOPDIR}/../src/devtools/sp_meta" |
| 7 | SP_PREFIX = "${STAGING_INCDIR}/install" |
| 8 | LINUX_KERNEL = "linux-4.4" |
| 9 | |
| 10 | WORKONSRC = "${MTK_SRC}" |
| 11 | BB_CFLAGS_ADD = "--sysroot=${STAGING_DIR_HOST} -g" |
| 12 | BB_LDFLAGS_ADD = "--sysroot=${STAGING_DIR_HOST}" |
| 13 | |
| 14 | BB_INCLUDE_ADD = "-I${MTK_SRC}/common/inc \ |
| 15 | -I${STAGING_DIR_HOST} \ |
| 16 | -I${STAGING_INCDIR} \ |
| 17 | " |
| 18 | |
| 19 | inherit deploy workonsrc |
| 20 | |
| 21 | #Parameters passed to do_compile() |
| 22 | |
| 23 | |
| 24 | EXTRA_OEMAKE = "CROSS=${TARGET_PREFIX} \ |
| 25 | PREFIX=${SP_PREFIX} \ |
| 26 | PACKAGE_ARCH=${PACKAGE_ARCH} \ |
| 27 | BB_INCLUDE_ADD=${BB_INCLUDE_ADD} \ |
| 28 | BB_LDFLAGS_ADD=${BB_LDFLAGS_ADD} \ |
| 29 | LINUX_KERNEL=${LINUX_KERNEL}" |
| 30 | |
| 31 | FILES_${PN} = "${base_libdir}/*.so\ |
| 32 | ${base_bindir}\ |
| 33 | ${base_sbindir}\ |
| 34 | /mnt\ |
| 35 | /tmp\ |
| 36 | /etc\ |
| 37 | /test" |
| 38 | |
| 39 | FILES_${PN}-dev = "${includedir}" |
| 40 | |
| 41 | FILES_${PN}-staticdev = "${base_libdir}/*.a" |
| 42 | |
| 43 | FILES_${PN}-doc = "/doc" |
| 44 | |
| 45 | FILES_${PN}-dbg = "/usr/src/debug \ |
| 46 | ${base_bindir}/.debug \ |
| 47 | ${base_libdir}/.debug \ |
| 48 | ${base_sbindir}/.debug" |
| 49 | |
| 50 | #Skip strip check in QA test. |
| 51 | INSANE_SKIP_${PN} += "already-stripped" |
| 52 | |
| 53 | |
| 54 | do_compile () { |
| 55 | unset LDFLAGS |
| 56 | if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then |
| 57 | oe_runmake all ROOT=${STAGING_DIR_HOST} CFLAGS="${BB_CFLAGS_ADD} -mhard-float" |
| 58 | else |
| 59 | oe_runmake all ROOT=${STAGING_DIR_HOST} CFLAGS="${BB_CFLAGS_ADD}" |
| 60 | fi |
| 61 | } |
| 62 | |
| 63 | do_install () { |
| 64 | oe_runmake install ROOT=${D} |
| 65 | |
| 66 | if [ -d "${D}/include" ]; then |
| 67 | install -d ${D}${includedir} |
| 68 | cp -af ${D}/include/* ${D}${includedir} |
| 69 | rm -rf ${D}/include |
| 70 | fi |
| 71 | } |
| 72 | inherit systemd |
| 73 | SYSTEMD_PACKAGES = "${PN}" |
| 74 | SYSTEMD_SERVICE_${PN} = "keymonitor.service" |
| 75 | FILES_${PN} += "${systemd_unitdir}/system/keymonitor.service" |
| 76 | do_install_append(){ |
| 77 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 78 | install -d ${D}${systemd_unitdir}/system/ |
| 79 | install -m 0644 ${B}/lib/systemd/system/keymonitor.service ${D}${systemd_unitdir}/system |
| 80 | fi |
| 81 | } |
| 82 | addtask bachclean |
| 83 | do_bachclean () { |
| 84 | oe_runmake clean |
| 85 | } |