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

Last change on this file since 127045 was 127045, checked in by mfeiri@…, 5 years ago

gcc43, gcc44, gcc45, gcc46, gcc47, gcc48, gcc49, gcc5: build conflict with libunwind-headers resolved in r127042

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