From f2bad2e0bf2704d261bb7552b561d30be8c27c9c Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 30 Sep 2023 09:54:20 +0200 Subject: [PATCH] package/gcc/gcc-final: split lib install by target/staging Right now the library installation was split between installation of static libs vs. shared libs. In preparation for additional rework, it makes more sense to split it between target installation and staging installation. For staging installation we simply install $(lib)* so that both static and shared libraries are copied. For target installation, we only install when shared libraries are used, and we copy $(lib).so* Signed-off-by: Thomas Petazzoni Signed-off-by: Romain Naour --- package/gcc/gcc-final/gcc-final.mk | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk index 7951b0f1a9..c6ed0e35b9 100644 --- a/package/gcc/gcc-final/gcc-final.mk +++ b/package/gcc/gcc-final/gcc-final.mk @@ -168,28 +168,25 @@ endif HOST_GCC_FINAL_USR_LIBS += $(call qstrip,$(BR2_TOOLCHAIN_EXTRA_LIBS)) -define HOST_GCC_FINAL_INSTALL_STATIC_LIBS +define HOST_GCC_FINAL_INSTALL_STAGING_LIBS $(foreach lib,$(HOST_GCC_FINAL_LIBS), \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).a \ + cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib)* \ $(STAGING_DIR)/lib/ ) $(foreach lib,$(HOST_GCC_FINAL_USR_LIBS), \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).a \ + cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib)* \ $(STAGING_DIR)/usr/lib/ ) endef ifeq ($(BR2_STATIC_LIBS),) -define HOST_GCC_FINAL_INSTALL_SHARED_LIBS +define HOST_GCC_FINAL_INSTALL_TARGET_LIBS + mkdir -p $(TARGET_DIR)/lib $(TARGET_DIR)/usr/lib $(foreach lib,$(HOST_GCC_FINAL_LIBS), \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).so* \ - $(STAGING_DIR)/lib/ && \ cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).so* \ $(TARGET_DIR)/lib/ ) $(foreach lib,$(HOST_GCC_FINAL_USR_LIBS), \ - cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).so* \ - $(STAGING_DIR)/usr/lib/ && \ cp -dpf $(HOST_GCC_FINAL_GCC_LIB_DIR)/$(lib).so* \ $(TARGET_DIR)/usr/lib/ ) @@ -197,9 +194,8 @@ endef endif define HOST_GCC_FINAL_INSTALL_LIBS - mkdir -p $(TARGET_DIR)/lib $(TARGET_DIR)/usr/lib - $(HOST_GCC_FINAL_INSTALL_STATIC_LIBS) - $(HOST_GCC_FINAL_INSTALL_SHARED_LIBS) + $(HOST_GCC_FINAL_INSTALL_STAGING_LIBS) + $(HOST_GCC_FINAL_INSTALL_TARGET_LIBS) endef HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBS