mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-05-31 01:10:08 +00:00
android-tools: fix native build
* Find libbsd headers when building natively * Disable tools that needs sys/capability.h when building natively * Enhance do_install to work when some tools are disabled Signed-off-by: Koen Kooi <koen.kooi@linaro.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
@@ -65,6 +65,16 @@ do_unpack_extra() {
|
|||||||
|
|
||||||
addtask unpack_extra after do_unpack before do_patch
|
addtask unpack_extra after do_unpack before do_patch
|
||||||
|
|
||||||
|
# Find libbsd headers during native builds
|
||||||
|
CC_append_class-native = " -I${STAGING_INCDIR}"
|
||||||
|
CC_append_class-nativesdk = " -I${STAGING_INCDIR}"
|
||||||
|
|
||||||
|
TOOLS = "adb fastboot ext4_utils mkbootimg adbd"
|
||||||
|
|
||||||
|
# Adb needs sys/capability.h, which is not available for native*
|
||||||
|
TOOLS_class-native = "fastboot ext4_utils mkbootimg"
|
||||||
|
TOOLS_class-nativesdk = "fastboot ext4_utils mkbootimg"
|
||||||
|
|
||||||
do_compile() {
|
do_compile() {
|
||||||
# Setting both variables below causing our makefiles to not work with
|
# Setting both variables below causing our makefiles to not work with
|
||||||
# implicit make rules
|
# implicit make rules
|
||||||
@@ -91,31 +101,42 @@ do_compile() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
tools="adb fastboot ext4_utils mkbootimg adbd"
|
for tool in ${TOOLS}; do
|
||||||
for tool in ${tools}; do
|
|
||||||
mkdir -p ${B}/${tool}
|
mkdir -p ${B}/${tool}
|
||||||
oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool}
|
oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool}
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
|
if [ grep -q "ext4_utils" "${TOOLS}" ] ; then
|
||||||
install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
|
install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
|
||||||
|
install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
|
||||||
|
|
||||||
install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
|
install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
|
||||||
install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
|
install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
|
||||||
install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
|
install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
|
||||||
install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
|
install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
|
||||||
install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
|
install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
|
||||||
install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
|
install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
|
||||||
|
fi
|
||||||
|
|
||||||
install -m0755 ${B}/adb/adb ${D}${bindir}
|
if [ grep -q "adb " "${TOOLS}" ] ; then
|
||||||
install -m0755 ${B}/adbd/adbd ${D}${bindir}
|
install -m0755 ${B}/adb/adb ${D}${bindir}i
|
||||||
install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
|
fi
|
||||||
install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
|
|
||||||
|
|
||||||
install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
|
if [ grep -q "adbd" "${TOOLS}" ] ; then
|
||||||
${D}${systemd_unitdir}/system/android-tools-adbd.service
|
install -m0755 ${B}/adbd/adbd ${D}${bindir}
|
||||||
|
install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
|
||||||
|
${D}${systemd_unitdir}/system/android-tools-adbd.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ grep -q "fastboot" "${TOOLS}" ] ; then
|
||||||
|
install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ grep -q "mkbootimg" "${TOOLS}" ] ; then
|
||||||
|
install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
PACKAGES += "${PN}-fstools"
|
PACKAGES += "${PN}-fstools"
|
||||||
|
|||||||
Reference in New Issue
Block a user