From e284ceac2b10133ca916bbae8055f040607b506c Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Fri, 3 Mar 2023 13:21:49 +0100 Subject: [PATCH 1/2] libext4_utils.mk: modifications to make it build in yocto environment 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 and header to the OUT_DIR Signed-off-by: Nisha Parrakat --- debian/libext4_utils.mk | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/debian/libext4_utils.mk b/debian/libext4_utils.mk index 868e790..2e93158 100644 --- a/debian/libext4_utils.mk +++ b/debian/libext4_utils.mk @@ -1,3 +1,4 @@ +include ../../rules_yocto.mk NAME = libext4_utils ext4_utils_SOURCES := \ @@ -17,14 +18,16 @@ CPPFLAGS += \ -Iext4_utils/include \ -Ilibfec/include \ -Isquashfs_utils \ - -I/usr/include/android \ + -I/usr/include/android -I$(OUT_DIR)/usr/include \ -D_GNU_SOURCE -DFEC_NO_KLOG -DSQUASHFS_NO_KLOG -D_LARGEFILE64_SOURCE LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ - -L/usr/lib/$(DEB_HOST_MULTIARCH)/android \ + -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ \ -lbase -lsparse -lselinux build: $(SOURCES) - mkdir --parents $(OUT_DIR) - $(CC) $^ -o $(OUT_DIR)/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) - ln -s $(NAME).so.0 $(OUT_DIR)/$(NAME).so + mkdir --parents $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/ + $(CC) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so + cp -r ext4_utils/include/* $(OUT_DIR)/usr/include/ + -- 2.36.1.vfs.0.0