From ae2bf1925fe02ea040005df27842c77c6d02b051 Mon Sep 17 00:00:00 2001 From: Etienne Cordonnier Date: Fri, 3 Mar 2023 13:39:24 +0100 Subject: [PATCH 13/15] patching libziparchive.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 Upstream-Status: Pending --- debian/libziparchive.mk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/libziparchive.mk b/debian/libziparchive.mk index 803ea58e..6a697059 100644 --- a/debian/libziparchive.mk +++ b/debian/libziparchive.mk @@ -1,3 +1,4 @@ +include ../../rules_yocto.mk NAME = libziparchive SOURCES = zip_archive.cc \ zip_archive_stream_entry.cc\ @@ -5,14 +6,15 @@ SOURCES = zip_archive.cc \ SOURCES := $(foreach source, $(SOURCES), libziparchive/$(source)) CXXFLAGS += -std=gnu++17 CPPFLAGS += -DZLIB_CONST -D_FILE_OFFSET_BITS=64 \ - -Iinclude -Ibase/include -Ilibziparchive/include + -Iinclude -Ibase/include -Ilibziparchive/include -I$(OUT_DIR)/usr/include/ LDFLAGS += -shared -Wl,-soname,$(NAME).so.0 \ -Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \ - -lz -L. -llog -lbase + -lz -L$(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android -llog -lbase build: $(SOURCES) - $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) - ln -s $(NAME).so.0 $(NAME).so + $(CXX) $^ -o $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) + ln -sf $(NAME).so.0 $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so + cp -r libziparchive/include/* $(OUT_DIR)/usr/include/ clean: - $(RM) $(NAME).so* + $(RM) $(OUT_DIR)/usr/lib/$(DEB_HOST_MULTIARCH)/android/$(NAME).so* -- 2.36.1.vfs.0.0