# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
PortGroup compiler_blacklist_versions 1.0
PortGroup xcodeversion 1.0
PortGroup conflicts_build 1.0
# an exception in the license allows dependents to not be GPL
license {GPL-3+ Permissive}
description The GNU compiler collection
long_description The GNU compiler collection, including front ends for \
C, C++, Objective-C, Objective-C++, Fortran and Java.
homepage https://gcc.gnu.org/
master_sites ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/:gcc \
ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/:gcc \
ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/:gcc \
ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/:gcc \
gnu:gcc/gcc-${version}:gcc \
ftp://sourceware.org/pub/java/:ecj \
http://mirrors.kernel.org/sources.redhat.com/java/:ecj \
https://www.mirrorservice.org/sites/sources.redhat.com/pub/java/:ecj \
http://ftp-stud.fht-esslingen.de/pub/Mirrors/sourceware.org/java/:ecj
distfiles ${distname}${extract.suffix}:gcc ${ecj}:ecj
extract.only ${distname}${extract.suffix}
checksums ${distname}${extract.suffix} \
rmd160 63fdc006c2289f81df664d1fd9b4124f71732e7b \
sha256 530cea139d82fe542b358961130c69cfde8b3d14556370b65823d2f91f0ced87 \
rmd160 eb1b19d9ac0e9e265bf993f38b9576e3c710e91e \
sha256 9506e75b862f782213df61af67338eb7a23c35ff425d328affc65585477d34cd \
depends_lib port:cctools \
depends_run port:gcc_select \
depends_skip_archcheck-append gcc_select ld64 cctools
license_noconflict gmp mpfr ppl libmpc
# Work around parallel building issue on APFS
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797
patchfiles-append notparallel-install-headers.patch
# Provide linkage for MacPorts libiconv in gcj
patchfiles-append gcj-libiconv-linkage.patch
# work around bug in 10.13 headers
patchfiles-append headers-10.13-fix.patch
# See https://trac.macports.org/ticket/53662 for a similar issue
patchfiles-append patch-libisl.diff
ln -s ${prefix}/libexec/isl18/include/isl ${worksrcpath}/gcc
patchfiles-append patch-gcj-unwind.diff
if {[vercmp ${xcodeversion} 10.2] >= 0} {
# https://trac.macports.org/ticket/58260
# Patch for Xcode bug, taken from
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89864#c43
# https://github.com/Homebrew/homebrew-core/pull/39134/files
patchfiles-append xcode-bug-_Atomic-fix.patch