summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/selinux/android-tools/android-tools/core/0010-patching-simg2img.mk-to-build-in-yocto-environment.patch
blob: aa60058c9e654ca581b4778fa832d37d17c522bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From 08441cf4334b911dba8c493dca3b1e2166c7d322 Mon Sep 17 00:00:00 2001
From: Etienne Cordonnier <ecordonnier@snap.com>
Date: Fri, 3 Mar 2023 13:34:34 +0100
Subject: [PATCH 10/15] patching simg2img.mk to build in yocto environment.

Changes include:
Introduced an output folder which will keep all the outputs from the
android-tools.

Adding an include file that is setting the common flags.
Changed the cppflag to include the headers from other components
of android-tools

Modified LDflags so that the libraries that are coming from other android-tools
are searched in the output folder.

Modified the build rule so that it outputs the binary to the OUT_DIR

Signed-off-by: Nisha Parrakat <Nisha.Parrakat@kpit.com>

Upstream-Status: Pending
---
 debian/simg2img.mk | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/debian/simg2img.mk b/debian/simg2img.mk
index 07fb56b4..d319c87e 100644
--- a/debian/simg2img.mk
+++ b/debian/simg2img.mk
@@ -1,13 +1,14 @@
+include ../../rules_yocto.mk
 NAME = simg2img
 SOURCES = simg2img.cpp sparse_crc32.cpp
 SOURCES := $(foreach source, $(SOURCES), libsparse/$(source))
 CPPFLAGS += -Ilibsparse/include -Iinclude -std=gnu++17
-LDFLAGS += -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-           -Wl,-rpath-link=. \
-           -L. -lsparse
+LDFLAGS += -Wl,-rpath=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \
+           -Wl,-rpath-link=$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android \
+           -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -lsparse
 
 build: $(SOURCES)
-	$(CXX) $^ -o libsparse/$(NAME) $(CPPFLAGS) $(LDFLAGS)
+	$(CXX) $^ -o $(OUT_DIR)/usr/bin/$(NAME) $(CPPFLAGS) $(LDFLAGS)
 
 clean:
-	$(RM) libsparse/$(NAME)
+	$(RM) $(OUT_DIR)/usr/bin/$(NAME)
-- 
2.36.1.vfs.0.0