blob: a3df67fe167420b8ebd05ebaffeb6f9899364f07 [file] [log] [blame]
xf.li3dd53742024-09-27 00:06:23 -07001inherit externalsrc package systemd
2
3DESCRIPTION = "autosuspend.service"
4
xf.lia06dd222024-10-14 09:07:20 +00005LICENSE = "MobileTekProprietary"
xf.li3dd53742024-09-27 00:06:23 -07006LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=44d8d2b6296ca24bcd4894bb7155bf27"
7
xf.lia06dd222024-10-14 09:07:20 +00008SRC_URI = "file://autosuspend.c file://LICENSE \
9 file://autosuspend.h \
10 file://autosuspend_ops.h \
11 file://autosuspend_wakeup_count.c \
12 file://main.c \
13 file://autosuspend.service \
14 file://lynq-autosuspend.sh \
15 file://makefile \
16"
17
xf.li3dd53742024-09-27 00:06:23 -070018EXTRA_OEMAKE = "'TARGET_PLATFORM = ${TARGET_PLATFORM}'"
19
20TARGET_CC_ARCH += "${LDFLAGS}"
xf.lia06dd222024-10-14 09:07:20 +000021
22LOCAL_C_INCLUDES = "-I. "
23
24DEPENDS = "liblynq-log liblynq-uci"
25DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp libsctel libatutils libatreg liblynq-sim"
26LOCAL_LIBS = "-L. -ldl -lstdc++ -lpthread -llog"
27SOURCES = "$(wildcard *.c )"
28
29OBJECTS = "$(SOURCES:.c=.o)"
30
31EXECUTABLE = "autosuspend"
32S = "${WORKDIR}"
33TARGET_CC_ARCH += "${LDFLAGS}"
xf.li3dd53742024-09-27 00:06:23 -070034SYSTEMD_PACKAGES = "${PN}"
35SYSTEMD_SERVICE_${PN} = "autosuspend.service"
36FILES_${PN} += "${systemd_unitdir}/system/autosuspend.service"
37#INHIBIT_PACKAGE_STRIP = "1"
38do_compile () {
39
40 #${CXX} -Wall ${LOCAL_C_INCLUDES} autosuspend.c autosuspend_wakeup_count.c main.c ${LOCAL_LIBS} -o ${EXECUTABLE}
41 if test "${PACKAGE_ARCH}" = "cortexa7hf-vfp-vfpv4-neon" || test "${PACKAGE_ARCH}" = "cortexa7hf-neon-vfpv4"; then
xf.lia06dd222024-10-14 09:07:20 +000042 oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST} -mhard-float"
xf.li3dd53742024-09-27 00:06:23 -070043 else
xf.lia06dd222024-10-14 09:07:20 +000044 oe_runmake all ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
xf.li3dd53742024-09-27 00:06:23 -070045 fi
46}
47
48do_install() {
49 install -d ${D}${bindir}/
xf.lia06dd222024-10-14 09:07:20 +000050 echo "Installing image PN ${PN}"
51 echo "Installing image systemd_unitdir ${systemd_unitdir}"
52 echo "Installing image D ${D}"
53 echo "Installing image B ${B}"
xf.li3dd53742024-09-27 00:06:23 -070054 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
55 install -d ${D}${systemd_unitdir}/system/
56 install -m 0644 ${B}/autosuspend.service ${D}${systemd_unitdir}/system
xf.lia06dd222024-10-14 09:07:20 +000057 else
xf.li3dd53742024-09-27 00:06:23 -070058 install -d ${D}${sysconfdir}/init.d
xf.lia06dd222024-10-14 09:07:20 +000059 install -m 0755 ${S}/lynq-autosuspend.sh ${D}${sysconfdir}/init.d/
60 install -d ${D}${sysconfdir}/rcS.d
61 ln -s ../init.d/lynq-autosuspend.sh ${D}${sysconfdir}/rcS.d/S82lynq-autosuspend-service
xf.li3dd53742024-09-27 00:06:23 -070062 fi
63
xf.lia06dd222024-10-14 09:07:20 +000064 install -m 0755 ${S}/autosuspend ${D}${bindir}/
65 install -d ${D}${includedir}
xf.li3dd53742024-09-27 00:06:23 -070066}
67
68
69
70
71
72