source: trunk/dports/lang/gcc47/Portfile @ 125551

Last change on this file since 125551 was 125551, checked in by ryandesign@…, 6 years ago

gcc43, gcc44, gcc45, gcc46, gcc47, gcc48, gcc49, gcc410: indicate build conflict with libunwind-headers (#43869)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.7 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 125551 2014-09-20 23:11:55Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6PortGroup compiler_blacklist_versions 1.0
7PortGroup conflicts_build 1.0
8
9name                gcc47
10epoch               1
11
12# Whenever this port is bumped for version/revision, please revbump dragonegg-*-gcc-4.7
13version             4.7.4
14revision            1
15platforms           darwin
16categories          lang
17maintainers         mww openmaintainer
18# an exception in the license allows dependents to not be GPL
19license             {GPL-3+ Permissive}
20description         The GNU compiler collection
21long_description    The GNU compiler collection, including front ends for \
22                    C, C++, Objective-C, Objective-C++, Fortran and Java.
23
24homepage            http://gcc.gnu.org/
25master_sites        ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/:gcc \
26                    ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/:gcc \
27                    ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/:gcc \
28                    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/:gcc \
29                    gnu:gcc/gcc-${version}:gcc \
30                    ftp://sourceware.org/pub/java/:ecj \
31                    http://mirrors.kernel.org/sources.redhat.com/java/:ecj \
32                    http://www.mirrorservice.org/sites/sources.redhat.com/pub/java/:ecj \
33                    http://ftp-stud.fht-esslingen.de/pub/Mirrors/sourceware.org/java/:ecj
34
35use_bzip2           yes
36
37set ecj             ecj-4.5.jar
38
39distname            gcc-${version}
40
41distfiles           ${distname}${extract.suffix}:gcc ${ecj}:ecj
42
43extract.only        ${distname}${extract.suffix}
44
45checksums           ${distname}${extract.suffix} \
46                    rmd160  d0a8e421b9c62a923f765b97828b12d5af388199 \
47                    sha256  92e61c6dc3a0a449e62d72a38185fda550168a86702dea07125ebd3ec3996282 \
48                    ${ecj} \
49                    rmd160  d3f4da657f086b6423f74e93f001132f4855368a \
50                    sha256  98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781
51
52depends_lib         port:gmp port:mpfr port:libiconv port:libmpc port:ppl path:lib/pkgconfig/cloog-isl.pc:cloog path:lib/libgcc/libgcc_s.1.dylib:libgcc port:ld64 port:cctools
53depends_run         port:gcc_select
54
55depends_skip_archcheck-append gcc_select ld64 cctools
56license_noconflict  gmp mpfr ppl libmpc
57
58patchfiles          ppc_fde_encoding.diff
59
60set major           4.7
61
62post-extract {
63    copy ${distpath}/${ecj} ${worksrcpath}/ecj.jar
64}
65
66platform darwin {
67    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
68}
69
70configure.dir       ${workpath}/build
71configure.cmd       ${worksrcpath}/configure
72configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran,java \
73                    --libdir=${prefix}/lib/${name} \
74                    --includedir=${prefix}/include/${name} \
75                    --infodir=${prefix}/share/info \
76                    --mandir=${prefix}/share/man \
77                    --datarootdir=${prefix}/share/gcc-${major} \
78                    --with-libiconv-prefix=${prefix} \
79                    --with-local-prefix=${prefix} \
80                    --with-system-zlib \
81                    --disable-nls \
82                    --program-suffix=-mp-${major} \
83                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
84                    --with-gmp=${prefix} \
85                    --with-mpfr=${prefix} \
86                    --with-mpc=${prefix} \
87                    --with-ppl=${prefix} \
88                    --with-cloog=${prefix} --enable-cloog-backend=isl \
89                    --disable-cloog-version-check \
90                    --enable-stage1-checking \
91                    --disable-multilib \
92                    --enable-lto \
93                    --enable-libstdcxx-time \
94                    --with-as=${prefix}/bin/as \
95                    --with-ld=${prefix}/bin/ld \
96                    --with-ar=${prefix}/bin/ar \
97                    --with-bugurl=https://trac.macports.org/newticket
98# remove this asap when upstream implements a check for ppl 1.0
99configure.args-append --disable-ppl-version-check
100
101configure.env-append \
102                    AR_FOR_TARGET=${prefix}/bin/ar \
103                    AS_FOR_TARGET=${prefix}/bin/as \
104                    LD_FOR_TARGET=${prefix}/bin/ld \
105                    NM_FOR_TARGET=${prefix}/bin/nm \
106                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
107                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
108                    STRIP_FOR_TARGET=${prefix}/bin/strip \
109                    OTOOL=${prefix}/bin/otool \
110                    OTOOL64=${prefix}/bin/otool
111
112pre-configure {
113    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
114
115    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
116    file mkdir ${configure.dir}
117}
118
119# http://trac.macports.org/ticket/29067
120compiler.blacklist-append gcc-4.0
121
122# http://trac.macports.org/ticket/29104
123compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
124
125# "-stdlib" would be passed on to the bootstrap compiler if present
126configure.cxx_stdlib
127
128# https://trac.macports.org/ticket/43869
129conflicts_build-append libunwind-headers
130
131build.dir           ${configure.dir}
132build.target        bootstrap
133use_parallel_build  yes
134
135destroot.target     install install-info-host
136
137post-destroot {
138    # install/copy ffitarget.h only if we have it
139    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
140        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
141    }
142
143    file delete ${destroot}${prefix}/share/info/dir
144
145    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
146        set extension [file extension ${file}]
147        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
148       
149        file rename ${file} ${newfile}
150    }
151
152    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} {
153        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
154        # https://trac.macports.org/ticket/40098
155        # https://trac.macports.org/ticket/40100
156        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
157            delete ${destroot}${prefix}/lib/${name}/${dylib}
158            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
159        }
160
161        if {[variant_isset universal]} {
162            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
163                if {[file exists ${archdir}/${dylib}]} {
164                    delete ${archdir}/${dylib}
165                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
166                }
167            }
168        }
169    }
170}
171
172select.group        gcc
173select.file         ${filespath}/mp-${name}
174
175platform powerpc {
176    configure.universal_archs ppc ppc64
177}
178platform i386 {
179    configure.universal_archs i386 x86_64
180}
181variant universal {
182    configure.args-delete --disable-multilib
183}
184# the generated compiler doesn't accept -arch
185configure.env-append CPP="${configure.cc} -E"
186build.env-append CPP="${configure.cc} -E"
187configure.cc-append [get_canonical_archflags]
188configure.cc_archflags
189configure.cxx_archflags
190configure.objc_archflags
191configure.ld_archflags
192configure.universal_cflags
193configure.universal_cxxflags
194configure.universal_ldflags
195configure.universal_args
196
197livecheck.type      regex
198livecheck.url       http://gcc.gnu.org/gcc-4.7/
199livecheck.regex     GCC (4\\.7\\.\[0-9\])
200
Note: See TracBrowser for help on using the repository browser.