source: trunk/dports/lang/gcc49/Portfile

Last change on this file was 153700, checked in by ryandesign@…, 12 months ago

gcc48: Update to 4.9.4

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.5 KB
Line 
1# -*- 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
2# $Id: Portfile 153700 2016-10-08 09:51:13Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6PortGroup compiler_blacklist_versions 1.0
7
8name                gcc49
9
10epoch               2
11version             4.9.4
12platforms           darwin
13categories          lang
14maintainers         mww openmaintainer
15# an exception in the license allows dependents to not be GPL
16license             {GPL-3+ Permissive}
17description         The GNU compiler collection
18long_description    The GNU compiler collection, including front ends for \
19                    C, C++, Objective-C, Objective-C++, Fortran and Java.
20
21homepage            http://gcc.gnu.org/
22master_sites        ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/ \
23                    ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \
24                    ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \
25                    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
26                    gnu:gcc/gcc-${version}
27
28distname            gcc-${version}
29use_bzip2           yes
30
31checksums           rmd160  180d4aaa9d2c34084f3f01261f8cb00ddb921529 \
32                    sha256  6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092
33
34depends_lib         port:cctools \
35                    path:lib/pkgconfig/cloog-isl.pc:cloog \
36                    port:gmp \
37                    path:lib/pkgconfig/isl.pc:isl \
38                    port:ld64 \
39                    path:lib/libgcc/libgcc_s.1.dylib:libgcc \
40                    port:libiconv \
41                    port:libmpc \
42                    port:mpfr
43depends_run         port:gcc_select
44
45depends_skip_archcheck-append gcc_select ld64 cctools
46license_noconflict  gmp mpfr ppl libmpc
47
48# Handle OS X deployment targets correctly (GCC PR target/63810
49# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810>).
50patchfiles-append   macosx-version-min.patch
51
52# Don't link with "-flat_namespace -undefined suppress" on Yosemite and
53# later (#45483).
54patchfiles-append   yosemite-libtool.patch
55
56set major           [join [lrange [split ${version} .-] 0 1] .]
57
58platform darwin {
59    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
60}
61
62configure.dir       ${workpath}/build
63configure.cmd       ${worksrcpath}/configure
64configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran,java \
65                    --libdir=${prefix}/lib/${name} \
66                    --includedir=${prefix}/include/${name} \
67                    --infodir=${prefix}/share/info \
68                    --mandir=${prefix}/share/man \
69                    --datarootdir=${prefix}/share/gcc-${major} \
70                    --with-local-prefix=${prefix} \
71                    --with-system-zlib \
72                    --disable-nls \
73                    --program-suffix=-mp-${major} \
74                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
75                    --with-gmp=${prefix} \
76                    --with-mpfr=${prefix} \
77                    --with-mpc=${prefix} \
78                    --with-isl=${prefix} --disable-isl-version-check \
79                    --with-cloog=${prefix} --disable-cloog-version-check \
80                    --enable-stage1-checking \
81                    --disable-multilib \
82                    --enable-lto \
83                    --enable-libstdcxx-time \
84                    --with-build-config=bootstrap-debug \
85                    --with-as=${prefix}/bin/as \
86                    --with-ld=${prefix}/bin/ld \
87                    --with-ar=${prefix}/bin/ar \
88                    --with-bugurl=https://trac.macports.org/newticket
89
90configure.env-append \
91                    AR_FOR_TARGET=${prefix}/bin/ar \
92                    AS_FOR_TARGET=${prefix}/bin/as \
93                    LD_FOR_TARGET=${prefix}/bin/ld \
94                    NM_FOR_TARGET=${prefix}/bin/nm \
95                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
96                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
97                    STRIP_FOR_TARGET=${prefix}/bin/strip \
98                    OTOOL=${prefix}/bin/otool \
99                    OTOOL64=${prefix}/bin/otool
100
101pre-configure {
102    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
103
104    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
105    file mkdir ${configure.dir}
106}
107
108# http://trac.macports.org/ticket/29067
109compiler.blacklist-append gcc-4.0
110
111# http://trac.macports.org/ticket/29104
112compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
113
114# Recent versions of Clang emit inconsistent DWARF CIE version
115# information, causing bootstrap comparison failures (#47410). The
116# offending compilers are:
117#   - Apple LLVM 6.1.0 (clang-602.0.49)
118#   - clang-3.7 @3.7-r234122
119#   - clang-3.6 @3.6.0_0
120#   - clang-3.5 @3.5.1_3
121pre-configure {
122    if {(${configure.compiler} eq "clang"
123                && [compiler_blacklist_versions._version_matches clang >= 602.0.49])
124            || [string match {macports-clang-3.[567]} ${configure.compiler}]} {
125        configure.args-append --with-build-config=bootstrap-debug
126    }
127}
128
129# "-stdlib" would be passed on to the bootstrap compiler if present
130configure.cxx_stdlib
131
132build.dir           ${configure.dir}
133build.target        bootstrap-lean
134use_parallel_build  yes
135
136destroot.target     install install-info-host
137
138post-destroot {
139    file delete ${destroot}${prefix}/share/info/dir
140
141    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
142        set extension [file extension ${file}]
143        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
144
145        file rename ${file} ${newfile}
146    }
147
148    foreach dylib {libgcc_ext.10.4.dylib libgcc_ext.10.5.dylib libgcc_s.1.dylib libgfortran.3.dylib libquadmath.0.dylib libstdc++.6.dylib libobjc-gnu.4.dylib libgomp.1.dylib libitm.1.dylib libssp.0.dylib libasan.0.dylib libatomic.1.dylib} {
149        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
150        # https://trac.macports.org/ticket/40098
151        # https://trac.macports.org/ticket/40100
152        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
153            delete ${destroot}${prefix}/lib/${name}/${dylib}
154            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
155        }
156
157        if {[variant_isset universal]} {
158            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
159                if {[file exists ${archdir}/${dylib}]} {
160                    delete ${archdir}/${dylib}
161                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
162                }
163            }
164        }
165    }
166    move ${destroot}${prefix}/lib/${name}/pkgconfig/libgcj-${major}.pc ${destroot}${prefix}/lib/pkgconfig/
167}
168
169select.group        gcc
170select.file         ${filespath}/mp-${name}
171
172platform powerpc {
173    configure.universal_archs ppc ppc64
174}
175platform i386 {
176    configure.universal_archs i386 x86_64
177}
178variant universal {
179    configure.args-delete --disable-multilib
180}
181# the generated compiler doesn't accept -arch
182configure.env-append CPP="${configure.cc} -E"
183build.env-append CPP="${configure.cc} -E"
184configure.cc-append [get_canonical_archflags]
185configure.cc_archflags
186configure.cxx-append ${configure.cxx_archflags}
187configure.cxx_archflags
188configure.objc_archflags
189configure.ld_archflags
190configure.universal_cflags
191configure.universal_cxxflags
192configure.universal_ldflags
193configure.universal_args
194
195livecheck.type      regex
196livecheck.url       http://ftp.gnu.org/gnu/gcc/
197livecheck.regex     gcc-(${major}\\.\[0-9.\]+)/
Note: See TracBrowser for help on using the repository browser.