Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gcc: cleanup lib installation #1

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/gcc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down