diff options
author | Tony Theodore <tonyt@logyst.com> | 2013-05-23 14:35:29 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2013-06-01 12:28:02 (GMT) |
commit | b974ef08d8b4fc555259eb49c9e34ef69c411948 (patch) | |
tree | 3d87088e9b6469153e5f33e9fc035410e9d08c3b /src/gcc.mk | |
parent | 95e37fbe7e528bc61e324bde2608046db66521c3 (diff) | |
download | mxe-b974ef08d8b4fc555259eb49c9e34ef69c411948.zip mxe-b974ef08d8b4fc555259eb49c9e34ef69c411948.tar.gz mxe-b974ef08d8b4fc555259eb49c9e34ef69c411948.tar.bz2 |
add mingw-w64 runtime and pthreads implementation, update related toolchain files
Diffstat (limited to 'src/gcc.mk')
-rw-r--r-- | src/gcc.mk | 70 |
1 files changed, 64 insertions, 6 deletions
@@ -8,7 +8,7 @@ $(PKG)_SUBDIR := gcc-$($(PKG)_VERSION) $(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_URL_2 := ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE) -$(PKG)_DEPS := mingwrt w32api binutils gcc-gmp gcc-mpc gcc-mpfr +$(PKG)_DEPS := mingwrt w32api mingw-w64 binutils gcc-gmp gcc-mpc gcc-mpfr define $(PKG)_UPDATE $(WGET) -q -O- 'http://ftp.gnu.org/gnu/gcc/?C=M;O=D' | \ @@ -17,7 +17,7 @@ define $(PKG)_UPDATE tail -1 endef -define $(PKG)_BUILD +define $(PKG)_PRE_CONFIGURE # unpack support libraries cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-gmp) mv '$(1)/$(gcc-gmp_SUBDIR)' '$(1)/gmp' @@ -25,8 +25,10 @@ define $(PKG)_BUILD mv '$(1)/$(gcc-mpc_SUBDIR)' '$(1)/mpc' cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpfr) mv '$(1)/$(gcc-mpfr_SUBDIR)' '$(1)/mpfr' +endef - # build GCC and support libraries +define $(PKG)_CONFIGURE + # configure gcc and support libraries mkdir '$(1).build' cd '$(1).build' && '$(1)/configure' \ --target='$(TARGET)' \ @@ -40,7 +42,7 @@ define $(PKG)_BUILD --with-gnu-as \ --disable-nls \ --disable-shared \ - --disable-sjlj-exceptions \ + --disable-multilib \ --without-x \ --disable-win32-registry \ --enable-threads=win32 \ @@ -49,9 +51,9 @@ define $(PKG)_BUILD --with-mpfr-include='$(1)/mpfr/src' \ --with-mpfr-lib='$(1).build/mpfr/src/.libs' \ $(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'") - $(MAKE) -C '$(1).build' -j '$(JOBS)' - $(MAKE) -C '$(1).build' -j 1 install +endef +define $(PKG)_POST_BUILD # create pkg-config script (echo '#!/bin/sh'; \ echo 'PKG_CONFIG_PATH="$$PKG_CONFIG_PATH_$(subst -,_,$(TARGET))" PKG_CONFIG_LIBDIR='\''$(PREFIX)/$(TARGET)/lib/pkgconfig'\'' exec pkg-config --static "$$@"') \ @@ -78,3 +80,59 @@ define $(PKG)_BUILD echo 'set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug|Release|RelWithDebInfo|MinSizeRel")') \ > '$(CMAKE_TOOLCHAIN_FILE)' endef + +define $(PKG)_POST_BUILD_mingw32 + # create pkg-config files + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig' + (echo 'Name: gl'; \ + echo 'Version: 0'; \ + echo 'Description: OpenGL'; \ + echo 'Libs: -lopengl32';) \ + > '$(PREFIX)/$(TARGET)/lib/pkgconfig/gl.pc' + + (echo 'Name: glu'; \ + echo 'Version: 0'; \ + echo 'Description: OpenGL'; \ + echo 'Libs: -lglu32';) \ + > '$(PREFIX)/$(TARGET)/lib/pkgconfig/glu.pc' +endef + +define $(PKG)_BUILD_i686-pc-mingw32 + # build full cross gcc + $($(PKG)_PRE_CONFIGURE) \ + $($(PKG)_CONFIGURE) \ + --disable-sjlj-exceptions + $(MAKE) -C '$(1).build' -j '$(JOBS)' + $(MAKE) -C '$(1).build' -j 1 install + $($(PKG)_POST_BUILD) + $($(PKG)_POST_BUILD_mingw32) +endef + +define $(PKG)_BUILD_mingw-w64 + # build standalone gcc + $($(PKG)_PRE_CONFIGURE) \ + $($(PKG)_CONFIGURE) + $(MAKE) -C '$(1).build' -j '$(JOBS)' all-gcc + $(MAKE) -C '$(1).build' -j 1 install-gcc + + # build mingw-w64-crt + cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,mingw-w64) + mkdir '$(1).crt-build' + cd '$(1).crt-build' && '$(1)/$(mingw-w64_SUBDIR)/mingw-w64-crt/configure' \ + --host='$(TARGET)' \ + --prefix='$(PREFIX)/$(TARGET)' \ + mxe-config-opts + $(MAKE) -C '$(1).crt-build' -j '$(JOBS)' + $(MAKE) -C '$(1).crt-build' -j 1 install + + # build rest of gcc + cd '$(1).build' + $(MAKE) -C '$(1).build' -j '$(JOBS)' + $(MAKE) -C '$(1).build' -j 1 install + + $($(PKG)_POST_BUILD) + $($(PKG)_POST_BUILD_mingw32) +endef + +$(PKG)_BUILD_x86_64-w64-mingw32 = $(subst mxe-config-opts,--disable-lib32,$($(PKG)_BUILD_mingw-w64)) +$(PKG)_BUILD_i686-w64-mingw32 = $(subst mxe-config-opts,--disable-lib64,$($(PKG)_BUILD_mingw-w64)) |