Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save qyot27/7234575 to your computer and use it in GitHub Desktop.
Save qyot27/7234575 to your computer and use it in GitHub Desktop.
0001-Update-to-GCC-4.8.2-and-add-sysinstall_compat-option.patch
From 6da1955027696c8eb7786fc0846dd89afed0a383 Mon Sep 17 00:00:00 2001
From: Stephen Hutchinson <[email protected]>
Date: Wed, 30 Oct 2013 10:18:22 -0400
Subject: [PATCH] Update to GCC 4.8.2 and add sysinstall_compat option
---
mingw-w64-build-3.5.0 | 42 +++++++++++++++++++++++++++++-------------
1 file changed, 29 insertions(+), 13 deletions(-)
diff --git a/mingw-w64-build-3.5.0 b/mingw-w64-build-3.5.0
index 283defa..df73ee2 100644
--- a/mingw-w64-build-3.5.0
+++ b/mingw-w64-build-3.5.0
@@ -1,6 +1,6 @@
#!/bin/bash
-script_ver='3.5.0'
+script_ver='3.5.0.1'
################################################################################
# MingGW-w64 Build Script
################################################################################
@@ -71,10 +71,11 @@ cpu_count="$(grep -c processor /proc/cpuinfo)"
uname_m="$(uname -m)"
target_i686='i686-w64-mingw32'
target_x86_64='x86_64-w64-mingw32'
+sysinstall_compat='no'
## Versions
mingw_w64_release_ver='3.0.0'
-gcc_release_ver='4.8.1'
+gcc_release_ver='4.8.2'
gcc_old_release_ver='4.7.3'
mpfr_release_ver='3.1.2'
mpc_release_ver='1.0.1'
@@ -138,6 +139,8 @@ Compile Options:
'build', 'source', and 'packages' directories will
be removed.
--enable-gendef compile the MinGW-w64 tools gendef.
+ --sysinstall-compat prepare the toolchain directories to be compatible
+ with a system install at a later time.
Report bugs to <[email protected]>.
EOF
@@ -555,15 +558,21 @@ clean_build
mkdir -p 'headers' 'crt'
cd 'headers' || exit 1
-"$mingw_w64_source_dir/mingw-w64-$mingw_w64_ver/mingw-w64-headers/configure" --enable-sdk=all --build="$system_type" --host="$mingw_w64_target" --prefix="$mingw_w64_prefix" || exit 1
+if [[ "$sysinstall_compat" = 'yes' ]]; then
+ "$mingw_w64_source_dir/mingw-w64-$mingw_w64_ver/mingw-w64-headers/configure" --enable-sdk=all --build="$system_type" --host="$mingw_w64_target" --prefix="$mingw_w64_prefix/$mingw_w64_target" || exit 1
+ else
+ "$mingw_w64_source_dir/mingw-w64-$mingw_w64_ver/mingw-w64-headers/configure" --enable-sdk=all --build="$system_type" --host="$mingw_w64_target" --prefix="$mingw_w64_prefix" || exit 1
+fi
make install || exit 1
cd "$mingw_w64_prefix" || exit 1
ln -s "./$mingw_w64_target" './mingw'
-if [[ ! -d "./$mingw_w64_target/include" ]]; then
- cd "./$mingw_w64_target" || exit 1
- ln -s '../include' './include'
- cd "$mingw_w64_prefix" || exit 1
+if [[ "$sysinstall_compat" = 'no' ]]; then
+ if [[ ! -d "./$mingw_w64_target/include" ]]; then
+ cd "./$mingw_w64_target" || exit 1
+ ln -s '../include' './include'
+ cd "$mingw_w64_prefix" || exit 1
+ fi
fi
build_gmp
@@ -599,15 +608,21 @@ make install-gcc || exit 1
# Build mingw-w64 CRT
cd "$mingw_w64_build_dir/crt" || exit 1
-"$mingw_w64_source_dir/mingw-w64-$mingw_w64_ver/mingw-w64-crt/configure" --build="$system_type" --host="$mingw_w64_target" --prefix="$mingw_w64_prefix" --with-sysroot="$mingw_w64_prefix" || exit 1
+if [[ "$sysinstall_compat" = 'yes' ]]; then
+ "$mingw_w64_source_dir/mingw-w64-$mingw_w64_ver/mingw-w64-crt/configure" --build="$system_type" --host="$mingw_w64_target" --prefix="$mingw_w64_prefix/$mingw_w64_target" --with-sysroot="$mingw_w64_prefix/$mingw_w64_target" || exit 1
+ else
+ "$mingw_w64_source_dir/mingw-w64-$mingw_w64_ver/mingw-w64-crt/configure" --build="$system_type" --host="$mingw_w64_target" --prefix="$mingw_w64_prefix" --with-sysroot="$mingw_w64_prefix" || exit 1
+fi
make -j "$cpu_count" || exit 1
make install || exit 1
-cd "$mingw_w64_prefix" || exit 1
-mv "./$mingw_w64_target/lib/"* './lib/'
-rm -fr "./$mingw_w64_target/lib"
-cd "./$mingw_w64_target"
-ln -s '../lib' './lib'
+if [[ "$sysinstall_compat" = 'no' ]]; then
+ cd "$mingw_w64_prefix" || exit 1
+ mv "./$mingw_w64_target/lib/"* './lib/'
+ rm -fr "./$mingw_w64_target/lib"
+ cd "./$mingw_w64_target"
+ ln -s '../lib' './lib'
+fi
# Build GCC
cd "$packages_dir/gcc/build" || exit 1
@@ -1136,6 +1151,7 @@ while true; do
--threads=* ) thread_lib="${1#*=}"; shift ;;
--clean-build ) clean_build='yes'; shift ;;
--enable-gendef ) enable_gendef='yes'; shift ;;
+ --sysinstall-compat ) sysinstall_compat='yes'; shift;;
-- ) shift; break ;;
-* ) printf 'Error, unknown option: "%s".\n' "$1"; exit 1 ;;
* ) break ;;
--
1.7.11.msysgit.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment