source: trunk/dports/lang/gcc46/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.8 KB
Line 
1# $Id: Portfile 125551 2014-09-20 23:11:55Z ryandesign@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5PortGroup compiler_blacklist_versions 1.0
6PortGroup conflicts_build 1.0
7
8name                gcc46
9epoch               1
10
11# Whenever this port is bumped for version/revision, please revbump dragonegg-3.[012] and dragonegg-*-gcc-4.6
12version             4.6.4
13revision            6
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++, and Fortran.
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                    md5     b407a3d1480c11667f293bfb1f17d1a4 \
46                    rmd160  6a58b053812cf75622bc4579e020cd9471f46916 \
47                    sha256  35af16afa0b67af9b8eb15cafb76d2bc5f568540552522f5dc2c88dd45d977e8 \
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          gcc-4.6-cloog_lang_c.patch enable_libstdcxx_time_yes.patch
59
60set major           4.6
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
72# 'java' and 'go' lead to compilation errors on 10.5/XCode 3.x
73configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran \
74                    --libdir=${prefix}/lib/${name} \
75                    --includedir=${prefix}/include/${name} \
76                    --infodir=${prefix}/share/info \
77                    --mandir=${prefix}/share/man \
78                    --datarootdir=${prefix}/share/gcc-${major} \
79                    --with-local-prefix=${prefix} \
80                    --with-libiconv-prefix=${prefix} \
81                    --with-system-zlib \
82                    --disable-nls \
83                    --program-suffix=-mp-${major} \
84                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
85                    --with-gmp=${prefix} \
86                    --with-mpfr=${prefix} \
87                    --with-mpc=${prefix} \
88                    --with-ppl=${prefix} \
89                    --with-cloog=${prefix} --enable-cloog-backend=isl \
90                    --disable-cloog-version-check \
91                    --enable-stage1-checking \
92                    --disable-multilib \
93                    --enable-lto \
94                    --enable-libstdcxx-time \
95                    --with-as=${prefix}/bin/as \
96                    --with-ld=${prefix}/bin/ld \
97                    --with-ar=${prefix}/bin/ar \
98                    --with-bugurl=https://trac.macports.org/newticket
99# remove this asap when upstream implements a check for ppl 1.0
100configure.args-append --disable-ppl-version-check
101
102configure.env-append \
103                    AR_FOR_TARGET=${prefix}/bin/ar \
104                    AS_FOR_TARGET=${prefix}/bin/as \
105                    LD_FOR_TARGET=${prefix}/bin/ld \
106                    NM_FOR_TARGET=${prefix}/bin/nm \
107                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
108                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
109                    STRIP_FOR_TARGET=${prefix}/bin/strip \
110                    OTOOL=${prefix}/bin/otool \
111                    OTOOL64=${prefix}/bin/otool
112
113pre-configure {
114    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
115
116    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
117    file mkdir ${configure.dir}
118}
119
120# http://trac.macports.org/ticket/29067
121compiler.blacklist-append gcc-4.0
122
123# http://trac.macports.org/ticket/29104
124compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
125
126# "-stdlib" would be passed on to the bootstrap compiler if present
127configure.cxx_stdlib
128
129# https://trac.macports.org/ticket/43869
130conflicts_build-append libunwind-headers
131
132build.dir           ${configure.dir}
133build.target        bootstrap
134use_parallel_build  yes
135
136destroot.target     install install-info-host
137
138post-destroot {
139    # install/copy ffitarget.h only if we have it
140    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
141        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
142    }
143
144    file delete ${destroot}${prefix}/share/info/dir
145
146    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
147        set extension [file extension ${file}]
148        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
149       
150        file rename ${file} ${newfile}
151    }
152
153    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 libgomp.1.dylib libssp.0.dylib} {
154        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
155        # https://trac.macports.org/ticket/40098
156        # https://trac.macports.org/ticket/40100
157        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
158            delete ${destroot}${prefix}/lib/${name}/${dylib}
159            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
160        }
161
162        if {[variant_isset universal]} {
163            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
164                if {[file exists ${archdir}/${dylib}]} {
165                    delete ${archdir}/${dylib}
166                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
167                }
168            }
169        }
170    }
171}
172
173select.group        gcc
174select.file         ${filespath}/mp-${name}
175
176platform darwin 8 {
177    # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45248
178    configure.args-append --with-dwarf2
179}
180
181platform powerpc {
182    configure.universal_archs ppc ppc64
183}
184platform i386 {
185    configure.universal_archs i386 x86_64
186}
187variant universal {
188    configure.args-delete --disable-multilib
189}
190# the generated compiler doesn't accept -arch
191configure.env-append CPP="${configure.cc} -E"
192build.env-append CPP="${configure.cc} -E"
193configure.cc-append [get_canonical_archflags]
194configure.cc_archflags
195configure.cxx_archflags
196configure.objc_archflags
197configure.ld_archflags
198configure.universal_cflags
199configure.universal_cxxflags
200configure.universal_ldflags
201configure.universal_args
202
203livecheck.type      regex
204livecheck.url       http://gcc.gnu.org/gcc-4.6/
205livecheck.regex     GCC (4\\.6\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.