From 9020e9e0e53cd249a96fc48ee801dce6c28c9316 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Thu, 12 Nov 2015 17:40:24 +1100 Subject: gcc: cleanup lib installation --- src/gcc.mk | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gcc.mk b/src/gcc.mk index 9ac33c6..be8d5f6 100644 --- a/src/gcc.mk +++ b/src/gcc.mk @@ -53,11 +53,13 @@ endef define $(PKG)_POST_BUILD # TODO: find a way to configure the installation of these correctly - rm -f $(addprefix $(PREFIX)/$(TARGET)/bin/, c++ g++ gcc gfortran) - -mv '$(PREFIX)/lib/gcc/$(TARGET)/lib/'* '$(PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)/' - -mv '$(PREFIX)/lib/gcc/$(TARGET)/'*.dll '$(PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)/' - -cp '$(PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)/'*.dll '$(PREFIX)/$(TARGET)/bin/' - -cp '$(PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)/'*.dll.a '$(PREFIX)/$(TARGET)/lib/' + # ignore rm failure as parallel build may have cleaned up, but + # don't wildcard all libs so future additions will be detected + $(and $(BUILD_SHARED), + mv -v '$(PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)/'*.dll '$(PREFIX)/$(TARGET)/bin/gcc-$($(PKG)_VERSION)/' + -rm -v '$(PREFIX)/lib/gcc/$(TARGET)/'libgcc_s*.dll + -rm -v '$(PREFIX)/lib/gcc/$(TARGET)/lib/'libgcc_s*.a + -rmdir '$(PREFIX)/lib/gcc/$(TARGET)/lib/') endef define $(PKG)_BUILD_mingw-w64 @@ -97,6 +99,14 @@ define $(PKG)_BUILD_mingw-w64 $(MAKE) -C '$(1).build' -j '$(JOBS)' $(MAKE) -C '$(1).build' -j 1 install + # shared libgcc isn't installed to version-specific locations + # so install correctly to avoid clobbering with multiple versions + $(and $(BUILD_SHARED), + $(MAKE) -C '$(1).build/$(TARGET)/libgcc' -j 1 \ + toolexecdir='$(PREFIX)/$(TARGET)/bin/gcc-$($(PKG)_VERSION)' \ + SHLIB_SLIBDIR_QUAL= \ + install-shared) + $($(PKG)_POST_BUILD) endef -- cgit v0.12