summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch')
-rw-r--r--dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch b/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch
new file mode 100644
index 0000000..d2ba525
--- /dev/null
+++ b/dynamic-layers/selinux/android-tools/android-tools/core/0001-patching-adb.mk-to-build-in-yocto-environment.patch
@@ -0,0 +1,62 @@
1From d133fc2c71fb6b0358af453b03bcb6d1874e902a Mon Sep 17 00:00:00 2001
2From: Etienne Cordonnier <ecordonnier@snap.com>
3Date: Fri, 3 Mar 2023 12:25:40 +0100
4Subject: [PATCH 01/15] patching adb.mk to build in yocto environment.
5
6Changes include:
7Introduced an output folder which will keep all the outputs from the
8android-tools.
9
10Adding an include file that is setting the common flags.
11Changed the cppflag to include the headers from other components
12of android-tools
13
14Modified LDflags so that the libraries that are coming from other android-tools
15are searched in the output folder.
16
17Modified the build rule so that it outputs the binary to the OUT_DIR
18
19Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com>
20
21Upstream-Status: Pending
22---
23 debian/adb.mk | 12 +++++++-----
24 1 file changed, 7 insertions(+), 5 deletions(-)
25
26diff --git a/debian/adb.mk b/debian/adb.mk
27index 8dbacf9a..97c9d6ca 100644
28--- a/debian/adb.mk
29+++ b/debian/adb.mk
30@@ -1,3 +1,4 @@
31+include ../../rules_yocto.mk
32 NAME = adb
33
34 SOURCES = client/adb_client.cpp \
35@@ -12,10 +13,10 @@ SOURCES = client/adb_client.cpp \
36
37 SOURCES := $(foreach source, $(SOURCES), adb/$(source))
38 CXXFLAGS += -std=gnu++2a
39-CPPFLAGS += -Iinclude -Iadb -Ibase/include \
40+CPPFLAGS += -Iinclude -Iadb -Ibase/include -I$(OUT_DIR)/usr/include/ \
41 -DADB_VERSION='"$(DEB_VERSION)"' -DADB_HOST=1 -D_GNU_SOURCE
42-LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=. \
43- -lpthread -L. -ladb -lbase
44+LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \
45+ -lpthread -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ -ladb -lbase
46
47 # -latomic should be the last library specified
48 # https://github.com/android/ndk/issues/589
49@@ -24,7 +25,8 @@ ifneq ($(filter armel mipsel,$(DEB_HOST_ARCH)),)
50 endif
51
52 build: $(SOURCES)
53- $(CXX) $^ -o adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
54+ mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb
55+ $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
56
57 clean:
58- $(RM) adb/$(NAME)
59+ $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/adb/$(NAME)
60--
612.36.1.vfs.0.0
62