blob: f4e38fc448545d61083d9bf49a5beba41f5a2018 [file] [log] [blame]
xf.li3dd53742024-09-27 00:06:23 -07001inherit externalsrc package systemd
2
3DESCRIPTION = "autosuspend.service"
xf.li39d99112024-09-28 04:05:58 -07004LICENSE = "CLOSED"
xf.li3dd53742024-09-27 00:06:23 -07005
xf.li3dd53742024-09-27 00:06:23 -07006LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=44d8d2b6296ca24bcd4894bb7155bf27"
xf.li39d99112024-09-28 04:05:58 -07007DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp libsctel libatutils libatreg liblynq-sim"
xf.li3dd53742024-09-27 00:06:23 -07008
xf.li39d99112024-09-28 04:05:58 -07009WORKONSRC = "${TOPDIR}/../src/lynq/framework/lynq-autosuspend"
10FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/framework/:"
11SRC_URI = " \
12 file://lynq-autosuspend \
13 "
14SRC-DIR = "${S}/../lynq-autosuspend"
xf.li3dd53742024-09-27 00:06:23 -070015EXTRA_OEMAKE = "'TARGET_PLATFORM = ${TARGET_PLATFORM}'"
16
17TARGET_CC_ARCH += "${LDFLAGS}"
xf.li3dd53742024-09-27 00:06:23 -070018SYSTEMD_PACKAGES = "${PN}"
19SYSTEMD_SERVICE_${PN} = "autosuspend.service"
20FILES_${PN} += "${systemd_unitdir}/system/autosuspend.service"
xf.li39d99112024-09-28 04:05:58 -070021
xf.li3dd53742024-09-27 00:06:23 -070022#INHIBIT_PACKAGE_STRIP = "1"
23do_compile () {
24
25 #${CXX} -Wall ${LOCAL_C_INCLUDES} autosuspend.c autosuspend_wakeup_count.c main.c ${LOCAL_LIBS} -o ${EXECUTABLE}
26 if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then
xf.li39d99112024-09-28 04:05:58 -070027 oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
xf.li3dd53742024-09-27 00:06:23 -070028 else
xf.li39d99112024-09-28 04:05:58 -070029 oe_runmake all -C ${SRC-DIR} ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
xf.li3dd53742024-09-27 00:06:23 -070030 fi
31}
32
33do_install() {
34 install -d ${D}${bindir}/
xf.li39d99112024-09-28 04:05:58 -070035 install -m 0755 ${SRC-DIR}/autosuspend ${D}${bindir}/
xf.li3dd53742024-09-27 00:06:23 -070036 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
37 install -d ${D}${systemd_unitdir}/system/
38 install -m 0644 ${B}/autosuspend.service ${D}${systemd_unitdir}/system
xf.li39d99112024-09-28 04:05:58 -070039 else
xf.li3dd53742024-09-27 00:06:23 -070040 install -d ${D}${sysconfdir}/init.d
xf.li39d99112024-09-28 04:05:58 -070041 install -m 0755 ${SRC-DIR}/lynq-autosuspend.sh ${D}${sysconfdir}/init.d/
42 install -d ${D}${sysconfdir}/rcS.d
43 ln -s ../init.d/lynq-autosuspend.sh ${D}${sysconfdir}/rcS.d/S82lynq-autosuspend-service
xf.li3dd53742024-09-27 00:06:23 -070044 fi
45
xf.li3dd53742024-09-27 00:06:23 -070046}
47
48
49
50
51
52