source: trunk/dports/lang/gcc46/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.7 KB
Line 
1# $Id: Portfile 127045 2014-10-19 22:54:11Z mfeiri@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5PortGroup compiler_blacklist_versions 1.0
6
7name                gcc46
8epoch               1
9
10# Whenever this port is bumped for version/revision, please revbump dragonegg-3.[012] and dragonegg-*-gcc-4.6
11version             4.6.4
12revision            6
13platforms           darwin
14categories          lang
15maintainers         mww openmaintainer
16# an exception in the license allows dependents to not be GPL
17license             {GPL-3+ Permissive}
18description         The GNU compiler collection
19long_description    The GNU compiler collection, including front ends for \
20                    C, C++, Objective-C, Objective-C++, and Fortran.
21
22homepage            http://gcc.gnu.org/
23master_sites        ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/:gcc \
24                    ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/:gcc \
25                    ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/:gcc \
26                    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/:gcc \
27                    gnu:gcc/gcc-${version}:gcc \
28                    ftp://sourceware.org/pub/java/:ecj \
29                    http://mirrors.kernel.org/sources.redhat.com/java/:ecj \
30                    http://www.mirrorservice.org/sites/sources.redhat.com/pub/java/:ecj \
31                    http://ftp-stud.fht-esslingen.de/pub/Mirrors/sourceware.org/java/:ecj
32
33use_bzip2           yes
34
35set ecj             ecj-4.5.jar
36
37distname            gcc-${version}
38
39distfiles           ${distname}${extract.suffix}:gcc ${ecj}:ecj
40
41extract.only        ${distname}${extract.suffix}
42
43checksums           ${distname}${extract.suffix} \
44                    md5     b407a3d1480c11667f293bfb1f17d1a4 \
45                    rmd160  6a58b053812cf75622bc4579e020cd9471f46916 \
46                    sha256  35af16afa0b67af9b8eb15cafb76d2bc5f568540552522f5dc2c88dd45d977e8 \
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          gcc-4.6-cloog_lang_c.patch enable_libstdcxx_time_yes.patch
58
59set major           4.6
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
71# 'java' and 'go' lead to compilation errors on 10.5/XCode 3.x
72configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran \
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-local-prefix=${prefix} \
79                    --with-libiconv-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
128build.dir           ${configure.dir}
129build.target        bootstrap
130use_parallel_build  yes
131
132destroot.target     install install-info-host
133
134post-destroot {
135    # install/copy ffitarget.h only if we have it
136    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
137        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
138    }
139
140    file delete ${destroot}${prefix}/share/info/dir
141
142    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
143        set extension [file extension ${file}]
144        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
145       
146        file rename ${file} ${newfile}
147    }
148
149    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} {
150        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
151        # https://trac.macports.org/ticket/40098
152        # https://trac.macports.org/ticket/40100
153        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
154            delete ${destroot}${prefix}/lib/${name}/${dylib}
155            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
156        }
157
158        if {[variant_isset universal]} {
159            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
160                if {[file exists ${archdir}/${dylib}]} {
161                    delete ${archdir}/${dylib}
162                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
163                }
164            }
165        }
166    }
167}
168
169select.group        gcc
170select.file         ${filespath}/mp-${name}
171
172platform darwin 8 {
173    # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45248
174    configure.args-append --with-dwarf2
175}
176
177platform powerpc {
178    configure.universal_archs ppc ppc64
179}
180platform i386 {
181    configure.universal_archs i386 x86_64
182}
183variant universal {
184    configure.args-delete --disable-multilib
185}
186# the generated compiler doesn't accept -arch
187configure.env-append CPP="${configure.cc} -E"
188build.env-append CPP="${configure.cc} -E"
189configure.cc-append [get_canonical_archflags]
190configure.cc_archflags
191configure.cxx_archflags
192configure.objc_archflags
193configure.ld_archflags
194configure.universal_cflags
195configure.universal_cxxflags
196configure.universal_ldflags
197configure.universal_args
198
199livecheck.type      regex
200livecheck.url       http://gcc.gnu.org/gcc-4.6/
201livecheck.regex     GCC (4\\.6\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.