summaryrefslogtreecommitdiffstats
path: root/Makefile.32
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.32')
-rwxr-xr-xMakefile.32148
1 files changed, 122 insertions, 26 deletions
diff --git a/Makefile.32 b/Makefile.32
index f93ee36..1a02177 100755
--- a/Makefile.32
+++ b/Makefile.32
@@ -151,17 +151,27 @@ ifneq ($(LOCAL_INST_PATH),)
endif
prepare:
+ rm -Rf $(UNPACK_DIR)
mkdir -p $(UNPACK_DIR)
tar -zxf $(SOURCE_DIR)/gcc-$(VERSION_GCC).tar.gz -C $(UNPACK_DIR)/
+ # Patches from https://gcc-mcf.lhmouse.com/ ...
cd $(UNPACK_DIR)/gcc-$(VERSION_GCC) && \
- patch -p1 < $(PATCHES_DIR)/windows-lrealpath-no-force-lowercase-nor-backslash.patch
+ patch -p1 < $(PATCHES_DIR)/0002-Relocate-libintl.patch && \
+ patch -p1 < $(PATCHES_DIR)/0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch && \
+ patch -p1 < $(PATCHES_DIR)/0004-Windows-Use-not-in-progpath-and-leave-case-as-is.patch && \
+ patch -p1 < $(PATCHES_DIR)/0006-Windows-New-feature-to-allow-overriding.patch && \
+ patch -p1 < $(PATCHES_DIR)/0008-Prettify-linking-no-undefined.patch && \
+ patch -p1 < $(PATCHES_DIR)/0010-Fix-using-large-PCH.patch && \
+ patch -p1 < $(PATCHES_DIR)/0014-clone_function_name_1-Retain-any-stdcall-suffix.patch
tar -zxf $(SOURCE_DIR)/gdb-$(VERSION_GDB).tar.gz -C $(UNPACK_DIR)/
cd $(UNPACK_DIR)/gdb-$(VERSION_GDB) && \
- patch -p1 < $(PATCHES_DIR)/windows-lrealpath-no-force-lowercase-nor-backslash.patch
+ patch -p1 < $(PATCHES_DIR)/0004-Windows-Use-not-in-progpath-and-leave-case-as-is.patch
tar -jxf $(SOURCE_DIR)/binutils-$(VERSION_BINUTILS).tar.bz2 -C $(UNPACK_DIR)/
cd $(UNPACK_DIR)/binutils-$(VERSION_BINUTILS) && \
- patch -p1 < $(PATCHES_DIR)/windows-lrealpath-no-force-lowercase-nor-backslash.patch
+ patch -p1 < $(PATCHES_DIR)/0004-Windows-Use-not-in-progpath-and-leave-case-as-is.patch
tar -jxf $(SOURCE_DIR)/mingw-w64-v$(VERSION_MINGW).tar.bz2 -C $(UNPACK_DIR)/
+ cd $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/widl && \
+ patch -p0 < $(PATCHES_DIR)/mingw-tools-widl-realloc.patch
tar -jxf $(SOURCE_DIR)/mpfr-$(VERSION_MPFR).tar.bz2 -C $(UNPACK_DIR)/
tar -jxf $(SOURCE_DIR)/isl-$(VERSION_ISL).tar.bz2 -C $(UNPACK_DIR)/
tar -zxf $(SOURCE_DIR)/mpc-$(VERSION_MPC).tar.gz -C $(UNPACK_DIR)/
@@ -178,6 +188,7 @@ prepare:
rm -Rf $(UNPACK_DIR)/gcc-$(VERSION_GCC)/isl
mv $(UNPACK_DIR)/isl-$(VERSION_ISL) $(UNPACK_DIR)/gcc-$(VERSION_GCC)/isl
+
build-common:
mkdir -p $(BUILD_DIR)
@@ -234,7 +245,6 @@ lingcc-gcc:
--build=$(ARCH32) \
--target=$(ARCH32) \
--with-sysroot=/ \
- --enable-threads=posix \
--with-pkgversion=$(GCC_PKGVERSION) \
--prefix=$(INST_BASE)/gcc-$(VERSION_GCC) \
--disable-nls \
@@ -246,6 +256,8 @@ lingcc-gcc:
--enable-languages=$(LANGUAGES) \
--without-included-gettext \
--enable-threads=posix \
+ --disable-sjlj-exceptions \
+ --with-dwarf2 \
--enable-shared \
--enable-static \
--disable-werror \
@@ -305,6 +317,7 @@ xgcc-all:
make -f Makefile.32 xgcc-mingw-pass1
make -f Makefile.32 xgcc-gcc-pass1
make -f Makefile.32 xgcc-mingw-pass2
+ make -f Makefile.32 xgcc-pthread
make -f Makefile.32 xgcc-gcc-pass2
make -f Makefile.32 xgcc-finish
make -f Makefile.32 xgcc-gdb
@@ -379,8 +392,10 @@ xgcc-gcc-pass1:
--enable-static \
--disable-werror \
--with-tune-64=core2 \
- --enable-threads=win32 \
--disable-multilib \
+ --enable-threads=posix \
+ --disable-sjlj-exceptions \
+ --with-dwarf2 \
--enable-clocale=gnu \
--enable-version-specific-runtime-libs \
--enable-fully-dynamic-string && \
@@ -406,6 +421,22 @@ xgcc-mingw-pass2:
make $(JOBS) && \
make $(JOBS) install
+xgcc-pthread:
+ mkdir -p $(BUILD_DIR)/winpthreads
+ cd $(BUILD_DIR)/winpthreads && \
+ export PATH=$(XGCC_INST_DIR)/bin:$(PATH) && \
+ LDLAGS="-static-libgcc -static-libstdc++" \
+ CFLAGS="-m32 -O2 -pipe" \
+ CXXFLAGS="-m32 -O2 -pipe" \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-libraries/winpthreads/configure \
+ --prefix=$(XGCC_INST_DIR)/$(XGCC_TARGET32) \
+ --host=$(XGCC_TARGET32) && \
+ make $(JOBS) clean && \
+ make $(JOBS) && \
+ make $(JOBS) install
+ mv -f $(XGCC_INST_DIR)/$(XGCC_TARGET32)/bin/libwinpthread-1.dll \
+ $(XGCC_INST_DIR)/$(XGCC_TARGET32)/lib
+
xgcc-gcc-pass2:
cd $(BUILD_DIR)/gcc && \
make $(JOBS) && \
@@ -451,6 +482,8 @@ xgcc-gdb:
--build=$(ARCH32) \
--host=$(ARCH32) && \
make $(JOBS) && make $(JOBS) install
+
+
xgcc-reimp:
rm -Rf $(BUILD_DIR)/reimp
@@ -460,30 +493,40 @@ xgcc-reimp:
make X=""
cp -f $(BUILD_DIR)/reimp/src/reimp $(XGCC_INST_DIR)/bin/$(XGCC_TARGET32)-reimp
+
xgcc-genpeimg:
rm -Rf $(BUILD_DIR)/genpeimg
+ mkdir -p $(BUILD_DIR)/genpeimg
cd $(BUILD_DIR)/ && \
- tar -zxf $(SOURCE_DIR)/genpeimg.tar.gz
export PATH=$(GCC_BINPATH):$(PATH) && \
- CC=$(GCC) CXX=$(GXX) \
cd $(BUILD_DIR)/genpeimg && \
+ CC=$(GCC) CXX=$(GXX) \
LDLAGS="-static-libgcc" \
CFLAGS="-m32 -pipe -Werror=implicit-fallthrough=0" \
- ./configure && \
- make
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/genpeimg/configure \
+ --prefix=$(XGCC_INST_DIR) \
+ --target=$(XGCC_TARGET32) \
+ --build=$(ARCH32) \
+ --host=$(ARCH32) && \
+ make && \
+ make install
cp -f $(BUILD_DIR)/genpeimg/genpeimg $(XGCC_INST_DIR)/bin/$(XGCC_TARGET32)-genpeimg
xgcc-gendef:
rm -Rf $(BUILD_DIR)/gendef
- cd $(BUILD_DIR)/ && \
- tar -zxf $(SOURCE_DIR)/gendef.tar.gz
+ mkdir -p $(BUILD_DIR)/gendef
export PATH=$(GCC_BINPATH):$(PATH) && \
CC=$(GCC) CXX=$(GXX) \
cd $(BUILD_DIR)/gendef && \
CFLAGS="-m32 -pipe -Werror=implicit-fallthrough=0" \
LDLAGS="-static-libgcc" \
- ./configure && \
- make
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/gendef/configure \
+ --prefix=$(XGCC_INST_DIR) \
+ --target=$(XGCC_TARGET32) \
+ --build=$(ARCH32) \
+ --host=$(ARCH32) && \
+ make && \
+ make install
cp -f $(BUILD_DIR)/gendef/gendef $(XGCC_INST_DIR)/bin/$(XGCC_TARGET32)-gendef
xgcc-zlib:
@@ -538,13 +581,17 @@ wingcc-all:
#
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-binutils
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-mingw
+ make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-pthread
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-gcc
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-finish
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-zlib
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-bzip2
+ make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-reimp
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-gendef
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-genpeimg
- make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-reimp
+ make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-genidl
+ make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-genlib
+ make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-widl
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-gdb
make PLATFORM=x86-mingw32 -f Makefile.32 wingcc-pack
@@ -599,6 +646,19 @@ wingcc-mingw:
make $(JOBS) install
cd $(WINGCC_INST_DIR) && rm -f mingw && ln -s $(XGCC_TARGET32) mingw
+wingcc-pthread:
+ rm -Rf $(BUILD_DIR)/winpthreads && mkdir -p $(BUILD_DIR)/winpthreads
+ cd $(BUILD_DIR)/winpthreads && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
+ CC=$(XGCC32) CXX=$(XGPP32) \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-libraries/winpthreads/configure \
+ --prefix=$(WINGCC_INST_DIR)/$(XGCC_TARGET32) \
+ --host=$(XGCC_TARGET32) && \
+ make $(JOBS) && \
+ make $(JOBS) install
+ cp -f $(WINGCC_INST_DIR)/$(XGCC_TARGET32)/bin/libwinpthread-1.dll \
+ $(WINGCC_INST_DIR)/$(XGCC_TARGET32)/lib
+
wingcc-gcc:
rm -Rf $(BUILD_DIR)/gcc && mkdir -p $(BUILD_DIR)/gcc
cd $(BUILD_DIR)/gcc && \
@@ -613,6 +673,9 @@ wingcc-gcc:
--host=$(XGCC_TARGET32) \
--target=$(XGCC_TARGET32) \
--enable-languages=$(LANGUAGES) \
+ --enable-threads=posix \
+ --disable-sjlj-exceptions \
+ --with-dwarf2 \
--with-gcc \
--with-gnu-ld \
--with-gnu-as \
@@ -684,35 +747,68 @@ wingcc-gmake:
make && make install
cp -f $(WINGCC_INST_DIR)/bin/make.exe $(WINGCC_INST_DIR)/bin/$(XGCC_TARGET32)-make.exe
-
wingcc-genpeimg:
rm -Rf $(BUILD_DIR)/genpeimg
- cd $(BUILD_DIR)/ && \
- tar -zxf $(SOURCE_DIR)/genpeimg.tar.gz
+ mkdir -p $(BUILD_DIR)/genpeimg
cd $(BUILD_DIR)/genpeimg && \
- export PATH=$(PWD)/inst.x86-linux/gcc-$(VERSION_GCC)/bin:$(XGCC_BINPATH):$(PATH) && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
CC=$(XGCC32) CXX=$(XGPP32) genpeimg_CFLAGS="" CFLAGS="-O3 -g -Werror=implicit-fallthrough=0"\
- ./configure \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/genpeimg/configure \
--host=$(XGCC_TARGET32) && \
make
cp -f $(BUILD_DIR)/genpeimg/genpeimg.exe \
- $(WINGCC_INST_DIR)/bin/genpeimg.exe
- cp -f $(BUILD_DIR)/genpeimg/genpeimg.exe \
$(WINGCC_INST_DIR)/bin/$(XGCC_TARGET32)-genpeimg.exe
wingcc-gendef:
rm -Rf $(BUILD_DIR)/gendef
- cd $(BUILD_DIR)/ && \
- tar -zxf $(SOURCE_DIR)/gendef.tar.gz
+ mkdir -p $(BUILD_DIR)/gendef && \
cd $(BUILD_DIR)/gendef && \
- export PATH=$(PWD)/inst.x86-linux/gcc-$(VERSION_GCC)/bin:$(XGCC_BINPATH):$(PATH) && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
CC=$(XGCC32) CXX=$(XGPP32) genpeimg_CFLAGS="" CFLAGS="-O3 -g -Wno-error=cast-function-type -Werror=implicit-fallthrough=0"\
- ./configure \
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/gendef/configure \
--host=$(XGCC_TARGET32) && \
make
- cp -f $(BUILD_DIR)/gendef/gendef.exe $(WINGCC_INST_DIR)/bin/gendef.exe
cp -f $(BUILD_DIR)/gendef/gendef.exe $(WINGCC_INST_DIR)/bin/$(XGCC_TARGET32)-gendef.exe
+wingcc-genidl:
+ rm -Rf $(BUILD_DIR)/genidl
+ mkdir -p $(BUILD_DIR)/genidl
+ cd $(BUILD_DIR)/genidl && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
+ CC=$(XGCC32) CXX=$(XGPP32) CFLAGS="-O3 -g -Wno-error=cast-function-type -Werror=implicit-fallthrough=0"\
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/genidl/configure \
+ --prefix=$(WINGCC_INST_DIR) \
+ --host=$(XGCC_TARGET32) && \
+ make && \
+ make install
+
+wingcc-genlib:
+ rm -Rf $(BUILD_DIR)/genlib
+ mkdir -p $(BUILD_DIR)/genlib
+ cd $(BUILD_DIR)/genlib && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
+ CC=$(XGCC32) CXX=$(XGPP32) CFLAGS="-O3 -g -Wno-error=cast-function-type -Werror=implicit-fallthrough=0"\
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/genlib/configure \
+ --prefix=$(WINGCC_INST_DIR) \
+ --host=$(XGCC_TARGET32) && \
+ make && \
+ make install
+
+wingcc-widl:
+ cd $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/widl && \
+ autoconf
+ rm -Rf $(BUILD_DIR)/widl
+ mkdir -p $(BUILD_DIR)/widl
+ cd $(BUILD_DIR)/widl && \
+ export PATH=$(XGCC_BINPATH):$(PATH) && \
+ ac_cv_func_malloc_0_nonnull=yes CC=$(XGCC32) CXX=$(XGPP32) CFLAGS="-O3 -g -Wno-error=cast-function-type -Werror=implicit-fallthrough=0"\
+ $(UNPACK_DIR)/mingw-w64-v$(VERSION_MINGW)/mingw-w64-tools/widl/configure \
+ --prefix=$(WINGCC_INST_DIR) \
+ --host=$(XGCC_TARGET32) && \
+ make && \
+ make install
+
+
wingcc-zlib:
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) && rm -Rf zlib-$(VERSION_ZLIB)