source: trunk/dports/lang/gcc46/Portfile

Last change on this file was 148394, checked in by ryandesign@…, 19 months ago

gcc43, gcc44, gcc45, gcc46, gcc47, gcc48, gcc49, gcc5, gcc6, gcc7: change build.target from bootstrap to bootstrap-lean to use less disk space during the build

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.4 KB
Line 
1# $Id: Portfile 148394 2016-05-07 00:56:38Z ryandesign@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            9
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:cctools \
52                    path:lib/pkgconfig/cloog-isl.pc:cloog \
53                    port:gmp \
54                    port:ld64 \
55                    path:lib/libgcc/libgcc_s.1.dylib:libgcc \
56                    port:libiconv \
57                    port:libmpc \
58                    port:mpfr \
59                    port:ppl
60depends_run         port:gcc_select
61
62depends_skip_archcheck-append gcc_select ld64 cctools
63license_noconflict  gmp mpfr ppl libmpc
64
65patchfiles          gcc-4.6-cloog_lang_c.patch \
66                    enable_libstdcxx_time_yes.patch
67
68# Don't check Darwin kernel version (GCC PR target/61407
69# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61407>).
70patchfiles-append   remove-kernel-version-check.patch
71
72# Handle OS X deployment targets correctly (GCC PR target/63810
73# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810>).
74patchfiles-append   macosx-version-min.patch
75
76# Don't link with "-flat_namespace -undefined suppress" on Yosemite and
77# later (#45483).
78patchfiles-append   yosemite-libtool.patch
79
80set major           [join [lrange [split ${version} .-] 0 1] .]
81
82post-extract {
83    copy ${distpath}/${ecj} ${worksrcpath}/ecj.jar
84}
85
86platform darwin {
87    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
88}
89
90configure.dir       ${workpath}/build
91configure.cmd       ${worksrcpath}/configure
92# 'java' and 'go' lead to compilation errors on 10.5/XCode 3.x
93configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran \
94                    --libdir=${prefix}/lib/${name} \
95                    --includedir=${prefix}/include/${name} \
96                    --infodir=${prefix}/share/info \
97                    --mandir=${prefix}/share/man \
98                    --datarootdir=${prefix}/share/gcc-${major} \
99                    --with-local-prefix=${prefix} \
100                    --with-libiconv-prefix=${prefix} \
101                    --with-system-zlib \
102                    --disable-nls \
103                    --program-suffix=-mp-${major} \
104                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
105                    --with-gmp=${prefix} \
106                    --with-mpfr=${prefix} \
107                    --with-mpc=${prefix} \
108                    --with-ppl=${prefix} \
109                    --with-cloog=${prefix} --enable-cloog-backend=isl \
110                    --disable-cloog-version-check \
111                    --enable-stage1-checking \
112                    --disable-multilib \
113                    --enable-lto \
114                    --enable-libstdcxx-time \
115                    --with-build-config=bootstrap-debug \
116                    --with-as=${prefix}/bin/as \
117                    --with-ld=${prefix}/bin/ld \
118                    --with-ar=${prefix}/bin/ar \
119                    --with-bugurl=https://trac.macports.org/newticket
120# remove this asap when upstream implements a check for ppl 1.0
121configure.args-append --disable-ppl-version-check
122
123configure.env-append \
124                    AR_FOR_TARGET=${prefix}/bin/ar \
125                    AS_FOR_TARGET=${prefix}/bin/as \
126                    LD_FOR_TARGET=${prefix}/bin/ld \
127                    NM_FOR_TARGET=${prefix}/bin/nm \
128                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
129                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
130                    STRIP_FOR_TARGET=${prefix}/bin/strip \
131                    OTOOL=${prefix}/bin/otool \
132                    OTOOL64=${prefix}/bin/otool
133
134pre-configure {
135    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
136
137    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
138    file mkdir ${configure.dir}
139}
140
141# http://trac.macports.org/ticket/29067
142compiler.blacklist-append gcc-4.0
143
144# http://trac.macports.org/ticket/29104
145compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
146
147# "-stdlib" would be passed on to the bootstrap compiler if present
148configure.cxx_stdlib
149
150build.dir           ${configure.dir}
151build.target        bootstrap-lean
152use_parallel_build  yes
153
154destroot.target     install install-info-host
155
156post-destroot {
157    # install/copy ffitarget.h only if we have it
158    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
159        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
160    }
161
162    file delete ${destroot}${prefix}/share/info/dir
163
164    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
165        set extension [file extension ${file}]
166        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
167       
168        file rename ${file} ${newfile}
169    }
170
171    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} {
172        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
173        # https://trac.macports.org/ticket/40098
174        # https://trac.macports.org/ticket/40100
175        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
176            delete ${destroot}${prefix}/lib/${name}/${dylib}
177            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
178        }
179
180        if {[variant_isset universal]} {
181            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
182                if {[file exists ${archdir}/${dylib}]} {
183                    delete ${archdir}/${dylib}
184                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
185                }
186            }
187        }
188    }
189}
190
191select.group        gcc
192select.file         ${filespath}/mp-${name}
193
194platform darwin 8 {
195    # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45248
196    configure.args-append --with-dwarf2
197}
198
199platform powerpc {
200    configure.universal_archs ppc ppc64
201}
202platform i386 {
203    configure.universal_archs i386 x86_64
204}
205variant universal {
206    configure.args-delete --disable-multilib
207}
208# the generated compiler doesn't accept -arch
209configure.env-append CPP="${configure.cc} -E"
210build.env-append CPP="${configure.cc} -E"
211configure.cc-append [get_canonical_archflags]
212configure.cc_archflags
213configure.cxx_archflags
214configure.objc_archflags
215configure.ld_archflags
216configure.universal_cflags
217configure.universal_cxxflags
218configure.universal_ldflags
219configure.universal_args
220
221livecheck.type      regex
222livecheck.url       http://ftp.gnu.org/gnu/gcc/
223livecheck.regex     gcc-(${major}\\.\[0-9.\]+)/
Note: See TracBrowser for help on using the repository browser.