|
| 1 | + |
| 2 | +# |
| 3 | +# The BSD 3-Clause License. http://www.opensource.org/licenses/BSD-3-Clause |
| 4 | +# |
| 5 | +# This file is part of MinGW-W64(mingw-builds: https://github.com/niXman/mingw-builds) project. |
| 6 | +# Copyright (c) 2011-2017 by niXman (i dotty nixman doggy gmail dotty com) |
| 7 | +# Copyright (c) 2012-2015 by Alexpux (alexpux doggy gmail dotty com) |
| 8 | +# All rights reserved. |
| 9 | +# |
| 10 | +# Project: MinGW-W64 ( http://sourceforge.net/projects/mingw-w64/ ) |
| 11 | +# |
| 12 | +# Redistribution and use in source and binary forms, with or without |
| 13 | +# modification, are permitted provided that the following conditions are met: |
| 14 | +# - Redistributions of source code must retain the above copyright |
| 15 | +# notice, this list of conditions and the following disclaimer. |
| 16 | +# - Redistributions in binary form must reproduce the above copyright |
| 17 | +# notice, this list of conditions and the following disclaimer in |
| 18 | +# the documentation and/or other materials provided with the distribution. |
| 19 | +# - Neither the name of the 'MinGW-W64' nor the names of its contributors may |
| 20 | +# be used to endorse or promote products derived from this software |
| 21 | +# without specific prior written permission. |
| 22 | +# |
| 23 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 24 | +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 25 | +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 26 | +# A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 27 | +# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY |
| 28 | +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 29 | +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 30 | +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 31 | +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 32 | +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
| 33 | +# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 34 | +# |
| 35 | + |
| 36 | +# ************************************************************************** |
| 37 | + |
| 38 | +PKG_VERSION=6.4.0 |
| 39 | +PKG_NAME=gcc-${PKG_VERSION} |
| 40 | +PKG_DIR_NAME=gcc-${PKG_VERSION} |
| 41 | +PKG_TYPE=.tar.xz |
| 42 | +PKG_URLS=( |
| 43 | + "https://ftp.gnu.org/gnu/gcc/gcc-${PKG_VERSION}/gcc-${PKG_VERSION}${PKG_TYPE}" |
| 44 | +) |
| 45 | + |
| 46 | +PKG_PRIORITY=main |
| 47 | + |
| 48 | +# |
| 49 | + |
| 50 | +PKG_EXECUTE_AFTER_UNCOMPRESS=( |
| 51 | + "[[ ! -f libgcc/config/i386/enable-execute-stack.c ]] && cp libgcc/config/i386/enable-execute-stack-mingw32.c libgcc/config/i386/enable-execute-stack.c" |
| 52 | +) |
| 53 | + |
| 54 | +# |
| 55 | + |
| 56 | +PKG_PATCHES=( |
| 57 | + gcc/gcc-4.7-stdthreads.patch |
| 58 | + gcc/gcc-5.1-iconv.patch |
| 59 | + gcc/gcc-4.8-libstdc++export.patch |
| 60 | + gcc/gcc-4.8.2-build-more-gnattools.mingw.patch |
| 61 | + gcc/gcc-4.8.2-fix-for-windows-not-minding-non-existant-parent-dirs.patch |
| 62 | + gcc/gcc-4.8.2-windows-lrealpath-no-force-lowercase-nor-backslash.patch |
| 63 | + gcc/gcc-4.9.1-enable-shared-gnat-implib.mingw.patch |
| 64 | + gcc/gcc-5.1.0-make-xmmintrin-header-cplusplus-compatible.patch |
| 65 | + gcc/gcc-5.2-fix-mingw-pch.patch |
| 66 | + gcc/gcc-5-dwarf-regression.patch |
| 67 | + gcc/gcc-5.1.0-fix-libatomic-building-for-threads=win32.patch |
| 68 | + gcc/gcc-6-ktietz-libgomp.patch |
| 69 | + gcc/gcc-6.1-disable-weak-refs.patch |
| 70 | + gcc/gcc-7-filesystem.patch |
| 71 | + gcc/gcc-libgomp-ftime64.patch |
| 72 | +) |
| 73 | + |
| 74 | +# |
| 75 | + |
| 76 | +PKG_CONFIGURE_FLAGS=( |
| 77 | + --host=$HOST |
| 78 | + --build=$BUILD |
| 79 | + --target=$TARGET |
| 80 | + # |
| 81 | + --prefix=$MINGWPREFIX |
| 82 | + --with-sysroot=$PREFIX |
| 83 | + #--with-gxx-include-dir=$MINGWPREFIX/$TARGET/include/c++ |
| 84 | + # |
| 85 | + $LINK_TYPE_GCC |
| 86 | + # |
| 87 | + $( [[ $USE_MULTILIB == yes ]] \ |
| 88 | + && echo "--enable-targets=all --enable-multilib" \ |
| 89 | + || echo "--disable-multilib" \ |
| 90 | + ) |
| 91 | + --enable-languages=$ENABLE_LANGUAGES,lto |
| 92 | + --enable-libstdcxx-time=yes |
| 93 | + --enable-threads=$THREADS_MODEL |
| 94 | + --enable-libgomp |
| 95 | + --enable-libatomic |
| 96 | + --enable-lto |
| 97 | + --enable-graphite |
| 98 | + --enable-checking=release |
| 99 | + --enable-fully-dynamic-string |
| 100 | + --enable-version-specific-runtime-libs |
| 101 | + --enable-libstdcxx-filesystem-ts=yes |
| 102 | + $( [[ $EXCEPTIONS_MODEL == dwarf ]] \ |
| 103 | + && echo "--disable-sjlj-exceptions --with-dwarf2" \ |
| 104 | + ) |
| 105 | + $( [[ $EXCEPTIONS_MODEL == sjlj ]] \ |
| 106 | + && echo "--enable-sjlj-exceptions" \ |
| 107 | + ) |
| 108 | + # |
| 109 | + --disable-libstdcxx-pch |
| 110 | + --disable-libstdcxx-debug |
| 111 | + $( [[ $BOOTSTRAPING == yes ]] \ |
| 112 | + && echo "--enable-bootstrap" \ |
| 113 | + || echo "--disable-bootstrap" \ |
| 114 | + ) |
| 115 | + --disable-rpath |
| 116 | + --disable-win32-registry |
| 117 | + --disable-nls |
| 118 | + --disable-werror |
| 119 | + --disable-symvers |
| 120 | + # |
| 121 | + --with-gnu-as |
| 122 | + --with-gnu-ld |
| 123 | + # |
| 124 | + $PROCESSOR_OPTIMIZATION |
| 125 | + $PROCESSOR_TUNE |
| 126 | + # |
| 127 | + --with-libiconv |
| 128 | + --with-system-zlib |
| 129 | + --with-{gmp,mpfr,mpc,isl}=$PREREQ_DIR/$HOST-$LINK_TYPE_SUFFIX |
| 130 | + --with-pkgversion="\"$BUILD_ARCHITECTURE-$THREADS_MODEL-$EXCEPTIONS_MODEL${REV_STRING}, $MINGW_W64_PKG_STRING\"" |
| 131 | + --with-bugurl=$BUG_URL |
| 132 | + # |
| 133 | + CFLAGS="\"$COMMON_CFLAGS\"" |
| 134 | + CXXFLAGS="\"$COMMON_CXXFLAGS\"" |
| 135 | + CPPFLAGS="\"$COMMON_CPPFLAGS\"" |
| 136 | + LDFLAGS="\"$COMMON_LDFLAGS $( [[ $BUILD_ARCHITECTURE == i686 ]] && echo -Wl,--large-address-aware )\"" |
| 137 | +) |
| 138 | + |
| 139 | +# |
| 140 | + |
| 141 | +PKG_MAKE_FLAGS=( |
| 142 | + -j$JOBS |
| 143 | + all |
| 144 | +) |
| 145 | + |
| 146 | +# |
| 147 | + |
| 148 | +PKG_INSTALL_FLAGS=( |
| 149 | + -j1 |
| 150 | + DESTDIR=$BASE_BUILD_DIR |
| 151 | + $( [[ $STRIP_ON_INSTALL == yes ]] && echo install-strip || echo install ) |
| 152 | +) |
| 153 | + |
| 154 | +# ************************************************************************** |
0 commit comments