summaryrefslogtreecommitdiffstats
path: root/src/gcc.mk
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2017-02-05 08:57:28 (GMT)
committerGitHub <noreply@github.com>2017-02-05 08:57:28 (GMT)
commit27facf1c6fcb7973781568dde9b0c1072e28f669 (patch)
treef5bd8ffbb147bc4c1853c8f695a736b45e9b78d7 /src/gcc.mk
parent90df394cecf53403dea4e90cdcabd7ba4d566732 (diff)
parentb1b913196993fa00ca9914224bca3528ca6c3aef (diff)
downloadmxe-build-2017-02-11.zip
mxe-build-2017-02-11.tar.gz
mxe-build-2017-02-11.tar.bz2
Merge pull request #1659 from tonytheodore/gcc5-fixbuild-2017-02-11
Cleanups and fixes after gcc5 update
Diffstat (limited to 'src/gcc.mk')
-rw-r--r--src/gcc.mk90
1 files changed, 40 insertions, 50 deletions
diff --git a/src/gcc.mk b/src/gcc.mk
index e352d44..31e8d28 100644
--- a/src/gcc.mk
+++ b/src/gcc.mk
@@ -12,8 +12,6 @@ $(PKG)_URL := http://ftp.gnu.org/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)
$(PKG)_URL_2 := ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_DEPS := binutils mingw-w64
-$(PKG)_FILE_$(BUILD) :=
-
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://ftp.gnu.org/gnu/gcc/?C=M;O=D' | \
$(SED) -n 's,.*<a href="gcc-\([0-9][^"]*\)/".*,\1,p' | \
@@ -23,8 +21,7 @@ endef
define $(PKG)_CONFIGURE
# configure gcc
- mkdir '$(1).build'
- cd '$(1).build' && '$(1)/configure' \
+ cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
--target='$(TARGET)' \
--build='$(BUILD)' \
--prefix='$(PREFIX)' \
@@ -45,85 +42,78 @@ define $(PKG)_CONFIGURE
--with-isl='$(PREFIX)/$(BUILD)' \
--with-mpc='$(PREFIX)/$(BUILD)' \
--with-mpfr='$(PREFIX)/$(BUILD)' \
- --with-cloog='$(PREFIX)/$(BUILD)' \
--with-as='$(PREFIX)/bin/$(TARGET)-as' \
--with-ld='$(PREFIX)/bin/$(TARGET)-ld' \
--with-nm='$(PREFIX)/bin/$(TARGET)-nm' \
$(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'")
endef
-define $(PKG)_POST_BUILD
- # - no non-trivial way to configure installation of *.dlls
- # each sudbir has it's own variations of variables like:
- # `toolexeclibdir` `install-toolexeclibLTLIBRARIES` etc.
- # and maintaining those would be cumbersome
- # - need to keep `--enable-version-specific-runtime-libs` otherwise
- # libraries go directly into $(PREFIX)/$(TARGET)/lib and are
- # harder to cleanup
- # - 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/'
- -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
# install mingw-w64 headers
- $(call PREPARE_PKG_SOURCE,mingw-w64,$(1))
- mkdir '$(1).headers-build'
- cd '$(1).headers-build' && '$(1)/$(mingw-w64_SUBDIR)/mingw-w64-headers/configure' \
+ $(call PREPARE_PKG_SOURCE,mingw-w64,$(BUILD_DIR))
+ mkdir '$(BUILD_DIR).headers'
+ cd '$(BUILD_DIR).headers' && '$(BUILD_DIR)/$(mingw-w64_SUBDIR)/mingw-w64-headers/configure' \
--host='$(TARGET)' \
--prefix='$(PREFIX)/$(TARGET)' \
--enable-sdk=all \
--enable-idl \
--enable-secure-api \
$(mingw-w64-headers_CONFIGURE_OPTS)
- $(MAKE) -C '$(1).headers-build' install
+ $(MAKE) -C '$(BUILD_DIR).headers' install
# build standalone gcc
$($(PKG)_CONFIGURE)
- $(MAKE) -C '$(1).build' -j '$(JOBS)' all-gcc
- $(MAKE) -C '$(1).build' -j 1 $(INSTALL_STRIP_TOOLCHAIN)-gcc
+ $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' all-gcc
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_TOOLCHAIN)-gcc
# build mingw-w64-crt
- mkdir '$(1).crt-build'
- cd '$(1).crt-build' && '$(1)/$(mingw-w64_SUBDIR)/mingw-w64-crt/configure' \
+ mkdir '$(BUILD_DIR).crt'
+ cd '$(BUILD_DIR).crt' && '$(BUILD_DIR)/$(mingw-w64_SUBDIR)/mingw-w64-crt/configure' \
--host='$(TARGET)' \
--prefix='$(PREFIX)/$(TARGET)' \
@gcc-crt-config-opts@
- $(MAKE) -C '$(1).crt-build' -j '$(JOBS)' || $(MAKE) -C '$(1).crt-build' -j '$(JOBS)'
- $(MAKE) -C '$(1).crt-build' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
+ $(MAKE) -C '$(BUILD_DIR).crt' -j '$(JOBS)' || $(MAKE) -C '$(BUILD_DIR).crt' -j '$(JOBS)'
+ $(MAKE) -C '$(BUILD_DIR).crt' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
# build posix threads
- mkdir '$(1).pthread-build'
- cd '$(1).pthread-build' && '$(1)/$(mingw-w64_SUBDIR)/mingw-w64-libraries/winpthreads/configure' \
+ mkdir '$(BUILD_DIR).pthreads'
+ cd '$(BUILD_DIR).pthreads' && '$(BUILD_DIR)/$(mingw-w64_SUBDIR)/mingw-w64-libraries/winpthreads/configure' \
$(MXE_CONFIGURE_OPTS)
- $(MAKE) -C '$(1).pthread-build' -j '$(JOBS)' || $(MAKE) -C '$(1).pthread-build' -j '$(JOBS)'
- $(MAKE) -C '$(1).pthread-build' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
+ $(MAKE) -C '$(BUILD_DIR).pthreads' -j '$(JOBS)' || $(MAKE) -C '$(BUILD_DIR).pthreads' -j '$(JOBS)'
+ $(MAKE) -C '$(BUILD_DIR).pthreads' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
# build rest of gcc
- cd '$(1).build'
- $(MAKE) -C '$(1).build' -j '$(JOBS)'
- $(MAKE) -C '$(1).build' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
+ $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
+
+ $($(PKG)_POST_BUILD)
+endef
- # shared libgcc isn't installed to version-specific locations
- # so install correctly to simplify cleanup
+define $(PKG)_POST_BUILD
+ # - no non-trivial way to configure installation of *.dlls
+ # each sudbir has it's own variations of variables like:
+ # `toolexeclibdir` `install-toolexeclibLTLIBRARIES` etc.
+ # and maintaining those would be cumbersome
+ # - shared libgcc isn't installed to version-specific locations
+ # - need to keep `--enable-version-specific-runtime-libs` otherwise
+ # libraries go directly into $(PREFIX)/$(TARGET)/lib and are
+ # harder to cleanup
+ # - 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),
- $(MAKE) -C '$(1).build/$(TARGET)/libgcc' -j 1 \
+ $(MAKE) -C '$(BUILD_DIR)/$(TARGET)/libgcc' -j 1 \
toolexecdir='$(PREFIX)/$(TARGET)/bin' \
SHLIB_SLIBDIR_QUAL= \
- install-shared)
+ install-shared
+ mv -v '$(PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)/'*.dll '$(PREFIX)/$(TARGET)/bin/'
+ -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/')
- $($(PKG)_POST_BUILD)
+ # cc1libdir isn't passed to subdirs so install correctly and rm
+ $(MAKE) -C '$(BUILD_DIR)/libcc1' -j 1 install cc1libdir='$(PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)'
+ -rm -f '$(PREFIX)/lib/'libcc1*
endef
$(PKG)_BUILD_x86_64-w64-mingw32 = $(subst @gcc-crt-config-opts@,--disable-lib32,$($(PKG)_BUILD_mingw-w64))
$(PKG)_BUILD_i686-w64-mingw32 = $(subst @gcc-crt-config-opts@,--disable-lib64,$($(PKG)_BUILD_mingw-w64))
-
-define $(PKG)_BUILD_$(BUILD)
- for f in c++ cpp g++ gcc gcov; do \
- ln -sf "`which $$f`" '$(PREFIX)/bin/$(TARGET)'-$$f ; \
- done
-endef