blob: ca666f2fff667c4cd1013deddca65f5967240c3a [file] [log] [blame]
#Basic Configuration
DESCRIPTION = "libsncfg module is a SNCFG configuration service and interface library."
SECTION = "base"
LICENSE = "MediaTekProprietary"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e1696b147d49d491bcb4da1a57173fff"
DEPENDS = "custom platform-libs-common platform-libs-header virtual/crypt"
MTK_SRC = "${BACH_SRC}/libsncfg"
WORKONSRC = "${MTK_SRC}"
BB_INCLUDE_ADD = "--sysroot=${STAGING_DIR_HOST} -I ${STAGING_DIR_HOST}/usr/include"
BB_LDFLAGS_ADD = "--sysroot=${STAGING_DIR_HOST} -Wl,--hash-style=gnu"
LIBPATH = "${base_libdir}"
inherit deploy workonsrc
#Parameters passed to do_compile()
EXTRA_OEMAKE = "'CROSS=${TARGET_PREFIX}'\
'PROJECT=${PROJ}'\
'TARGET_PLATFORM=${TARGET_PLATFORM}' \
'PREFIX=${BACH_PREFIX}'\
'PACKAGE_ARCH=${PACKAGE_ARCH}'\
'LIBPATH=${LIBPATH}'\
'LINUX_KERNEL=${LINUX_KERNEL}'\
'PLATFORM_CHIP=${PLATFORM_CHIP}'\
'BB_INCLUDE_ADD=${BB_INCLUDE_ADD}'\
'BB_LDFLAGS_ADD=${BB_LDFLAGS_ADD}'\
'APSIM_PRJ=${APSIM}'"
FILES_${PN} = "${base_libdir}/libsncfg.so\
${base_bindir}\
${base_sbindir}\
/mnt\
/tmp\
/etc/rc.d\
/usr/bin \
/usr/cfg \
/usr/trans \
/usr/reinit_reason \
/test"
FILES_${PN}-dev = "${includedir} \
${bindir_crossscripts}"
FILES_${PN}-staticdev = "${base_libdir}/libsncfg.a"
FILES_${PN}-dbg = "${base_libdir}/.debug \
/usr/src/debug \
${base_sbindir}/.debug"
#Skip strip check in QA test.
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
INSANE_SKIP_${PN} += "already-stripped"
INSANE_SKIP_${PN} += "installed-vs-shipped"
INSANE_SKIP_${PN}-dev += "arch"
do_install () {
oe_runmake install ROOT=${D}
rm -rf ${D}/host
cd ${B}
if [ -d "${WORKONSRC}" ]; then
#Since systemd.bbclass would delete the /etc/init.d DIR, we move the daemons from /etc/init.d to /usr/bin.
install -d ${D}${bindir}
install -m 0755 src/rootfs/sncfgd ${D}${bindir}/sncfgd
install -m 0755 src/rootfs/sncfgd_sc_stage0 ${D}${bindir}/sncfgd_sc_stage0
install -m 0755 src/rootfs/sncfgd_sc_stage1 ${D}${bindir}/sncfgd_sc_stage1
#Pack tools on host.
install -d ${D}${bindir_crossscripts}
install -m 0755 tools/mkcfgpack ${D}${bindir_crossscripts}/mkcfgpack
install -m 0755 tools/uncfgpack ${D}${bindir_crossscripts}/uncfgpack
install -m 0755 libsncfg.so ${D}${base_libdir}/libsncfg.so
#Strip so/bin for reducing rom size
${STRIP} --remove-section=.comment --remove-section=.note --strip-unneeded ${D}${base_libdir}/libsncfg.so
${STRIP} --remove-section=.comment --remove-section=.note ${D}${base_sbindir}/sncfgd
${STRIP} --remove-section=.comment --remove-section=.note ${D}${base_sbindir}/apinfo
else
install -d ${D}${bindir}
install -m 0755 ./${bindir}/sncfgd ${D}${bindir}/sncfgd
install -m 0755 ./${bindir}/sncfgd_sc_stage0 ${D}${bindir}/sncfgd_sc_stage0
install -m 0755 ./${bindir}/sncfgd_sc_stage1 ${D}${bindir}/sncfgd_sc_stage1
install -d ${D}${bindir_crossscripts}
cp -af .${bindir_crossscripts}/mkcfgpack ${D}${bindir_crossscripts}/mkcfgpack
cp -af .${bindir_crossscripts}/uncfgpack ${D}${bindir_crossscripts}/uncfgpack
fi
if [ -d "${D}/include" ]; then
install -d ${D}${includedir}
cp -af ${D}/include/* ${D}${includedir}
rm -rf ${D}/include
#delete the prop_properties.h
rm -rf ${D}${includedir}/sncfg/cutils/properties.h
fi
}
SYSROOT_PREPROCESS_FUNCS_append_class-target = "cfgpack_sysroot_preprocess"
cfgpack_sysroot_preprocess () {
cd ${B}
#Pack tools on host.
if [ -d "${WORKONSRC}" ]; then
install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
install -m 0755 tools/mkcfgpack ${SYSROOT_DESTDIR}${bindir_crossscripts}/mkcfgpack
install -m 0755 tools/uncfgpack ${SYSROOT_DESTDIR}${bindir_crossscripts}/uncfgpack
else
install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
install -m 0755 ./${bindir_crossscripts}/mkcfgpack ${SYSROOT_DESTDIR}${bindir_crossscripts}/mkcfgpack
install -m 0755 ./${bindir_crossscripts}/uncfgpack ${SYSROOT_DESTDIR}${bindir_crossscripts}/uncfgpack
fi
}
addtask bachclean
do_bachclean () {
oe_runmake clean
}