summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
diff options
context:
space:
mode:
authorKoen Kooi <koen.kooi@linaro.org>2016-10-21 09:10:19 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2016-10-26 10:28:40 +0200
commit3587696e114fb650d5c7303b1cb355516c7bb864 (patch)
tree4349932342524af8d7c6de1de240d7e7deaee796 /meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
parente63aa5b05686dc36c6729500f1c0aeef6c49de7e (diff)
downloadmeta-openembedded-3587696e114fb650d5c7303b1cb355516c7bb864.tar.gz
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>
Diffstat (limited to 'meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb')
-rw-r--r--meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb59
1 files changed, 40 insertions, 19 deletions
diff --git a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
index 2dbddf157..1769b6a8a 100644
--- a/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
+++ b/meta-oe/recipes-devtools/android-tools/android-tools_5.1.1.r37.bb
@@ -65,6 +65,16 @@ do_unpack_extra() {
65 65
66addtask unpack_extra after do_unpack before do_patch 66addtask unpack_extra after do_unpack before do_patch
67 67
68# Find libbsd headers during native builds
69CC_append_class-native = " -I${STAGING_INCDIR}"
70CC_append_class-nativesdk = " -I${STAGING_INCDIR}"
71
72TOOLS = "adb fastboot ext4_utils mkbootimg adbd"
73
74# Adb needs sys/capability.h, which is not available for native*
75TOOLS_class-native = "fastboot ext4_utils mkbootimg"
76TOOLS_class-nativesdk = "fastboot ext4_utils mkbootimg"
77
68do_compile() { 78do_compile() {
69 # Setting both variables below causing our makefiles to not work with 79 # Setting both variables below causing our makefiles to not work with
70 # implicit make rules 80 # implicit make rules
@@ -91,31 +101,42 @@ do_compile() {
91 ;; 101 ;;
92 esac 102 esac
93 103
94 tools="adb fastboot ext4_utils mkbootimg adbd" 104 for tool in ${TOOLS}; do
95 for tool in ${tools}; do
96 mkdir -p ${B}/${tool} 105 mkdir -p ${B}/${tool}
97 oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool} 106 oe_runmake -f ${B}/${tool}.mk -C ${B}/${tool}
98 done 107 done
99} 108}
100 109
101do_install() { 110do_install() {
102 install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump 111 if [ grep -q "ext4_utils" "${TOOLS}" ] ; then
103 install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg 112 install -D -p -m0755 ${S}/system/core/libsparse/simg_dump.py ${D}${bindir}/simg_dump
104 113 install -D -p -m0755 ${S}/system/extras/ext4_utils/mkuserimg.sh ${D}${bindir}/mkuserimg
105 install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir} 114
106 install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir} 115 install -m0755 ${B}/ext4_utils/ext2simg ${D}${bindir}
107 install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir} 116 install -m0755 ${B}/ext4_utils/ext4fixup ${D}${bindir}
108 install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir} 117 install -m0755 ${B}/ext4_utils/img2simg ${D}${bindir}
109 install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir} 118 install -m0755 ${B}/ext4_utils/make_ext4fs ${D}${bindir}
110 install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir} 119 install -m0755 ${B}/ext4_utils/simg2img ${D}${bindir}
111 120 install -m0755 ${B}/ext4_utils/simg2simg ${D}${bindir}
112 install -m0755 ${B}/adb/adb ${D}${bindir} 121 fi
113 install -m0755 ${B}/adbd/adbd ${D}${bindir} 122
114 install -m0755 ${B}/fastboot/fastboot ${D}${bindir} 123 if [ grep -q "adb " "${TOOLS}" ] ; then
115 install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir} 124 install -m0755 ${B}/adb/adb ${D}${bindir}i
116 125 fi
117 install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \ 126
118 ${D}${systemd_unitdir}/system/android-tools-adbd.service 127 if [ grep -q "adbd" "${TOOLS}" ] ; then
128 install -m0755 ${B}/adbd/adbd ${D}${bindir}
129 install -D -p -m0644 ${WORKDIR}/android-tools-adbd.service \
130 ${D}${systemd_unitdir}/system/android-tools-adbd.service
131 fi
132
133 if [ grep -q "fastboot" "${TOOLS}" ] ; then
134 install -m0755 ${B}/fastboot/fastboot ${D}${bindir}
135 fi
136
137 if [ grep -q "mkbootimg" "${TOOLS}" ] ; then
138 install -m0755 ${B}/mkbootimg/mkbootimg ${D}${bindir}
139 fi
119} 140}
120 141
121PACKAGES += "${PN}-fstools" 142PACKAGES += "${PN}-fstools"