source: trunk/dports/lang/gcc48/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: 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 148394 2016-05-07 00:56:38Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6PortGroup compiler_blacklist_versions 1.0
7
8name                gcc48
9
10# Whenever this port is bumped for version/revision, please revbump dragonegg-*-gcc-4.8
11epoch               2
12version             4.8.5
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++, Fortran and Java.
21
22homepage            http://gcc.gnu.org/
23master_sites        ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/ \
24                    ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \
25                    ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \
26                    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
27                    gnu:gcc/gcc-${version}
28
29distname            gcc-${version}
30use_bzip2           yes
31
32checksums           rmd160  98e84aa59bd668c4ab58afea9c7a2d1cc0c6ef7e \
33                    sha256  22fb1e7e0f68a63cee631d85b20461d1ea6bda162f03096350e38c8d427ecf23
34
35depends_lib         port:cctools \
36                    path:lib/pkgconfig/cloog-isl.pc:cloog \
37                    port:gmp \
38                    path:lib/pkgconfig/isl.pc:isl \
39                    port:ld64 \
40                    path:lib/libgcc/libgcc_s.1.dylib:libgcc \
41                    port:libiconv \
42                    port:libmpc \
43                    port:mpfr
44depends_run         port:gcc_select
45
46depends_skip_archcheck-append gcc_select ld64 cctools
47license_noconflict  gmp mpfr ppl libmpc
48
49# Handle OS X deployment targets correctly (GCC PR target/63810
50# <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810>).
51patchfiles-append   macosx-version-min.patch
52
53# Don't link with "-flat_namespace -undefined suppress" on Yosemite and
54# later (#45483).
55patchfiles-append   yosemite-libtool.patch
56
57set major           [join [lrange [split ${version} .-] 0 1] .]
58
59platform darwin {
60    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
61}
62
63configure.dir       ${workpath}/build
64configure.cmd       ${worksrcpath}/configure
65configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran,java \
66                    --libdir=${prefix}/lib/${name} \
67                    --includedir=${prefix}/include/${name} \
68                    --infodir=${prefix}/share/info \
69                    --mandir=${prefix}/share/man \
70                    --datarootdir=${prefix}/share/gcc-${major} \
71                    --with-local-prefix=${prefix} \
72                    --with-system-zlib \
73                    --disable-nls \
74                    --program-suffix=-mp-${major} \
75                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
76                    --with-gmp=${prefix} \
77                    --with-mpfr=${prefix} \
78                    --with-mpc=${prefix} \
79                    --with-isl=${prefix} --disable-isl-version-check \
80                    --with-cloog=${prefix} --disable-cloog-version-check \
81                    --enable-stage1-checking \
82                    --disable-multilib \
83                    --enable-lto \
84                    --enable-libstdcxx-time \
85                    --with-build-config=bootstrap-debug \
86                    --with-as=${prefix}/bin/as \
87                    --with-ld=${prefix}/bin/ld \
88                    --with-ar=${prefix}/bin/ar \
89                    --with-bugurl=https://trac.macports.org/newticket
90
91configure.env-append \
92                    AR_FOR_TARGET=${prefix}/bin/ar \
93                    AS_FOR_TARGET=${prefix}/bin/as \
94                    LD_FOR_TARGET=${prefix}/bin/ld \
95                    NM_FOR_TARGET=${prefix}/bin/nm \
96                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
97                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
98                    STRIP_FOR_TARGET=${prefix}/bin/strip \
99                    OTOOL=${prefix}/bin/otool \
100                    OTOOL64=${prefix}/bin/otool
101
102pre-configure {
103    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
104
105    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
106    file mkdir ${configure.dir}
107}
108
109# http://trac.macports.org/ticket/29067
110compiler.blacklist-append gcc-4.0
111
112# http://trac.macports.org/ticket/29104
113compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
114
115# Recent versions of Clang emit inconsistent DWARF CIE version
116# information, causing bootstrap comparison failures (#47410). The
117# offending compilers are:
118#   - Apple LLVM 6.1.0 (clang-602.0.49)
119#   - clang-3.7 @3.7-r234122
120#   - clang-3.6 @3.6.0_0
121#   - clang-3.5 @3.5.1_3
122pre-configure {
123    if {(${configure.compiler} eq "clang"
124                && [compiler_blacklist_versions._version_matches clang >= 602.0.49])
125            || [string match {macports-clang-3.[567]} ${configure.compiler}]} {
126        configure.args-append --with-build-config=bootstrap-debug
127    }
128}
129
130# "-stdlib" would be passed on to the bootstrap compiler if present
131configure.cxx_stdlib
132
133build.dir           ${configure.dir}
134build.target        bootstrap-lean
135use_parallel_build  yes
136
137destroot.target     install install-info-host
138
139post-destroot {
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 libobjc-gnu.4.dylib libgomp.1.dylib libitm.1.dylib libssp.0.dylib libasan.0.dylib libatomic.1.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    move ${destroot}${prefix}/lib/${name}/pkgconfig/libgcj-${major}.pc ${destroot}${prefix}/lib/pkgconfig/
168}
169
170select.group        gcc
171select.file         ${filespath}/mp-${name}
172
173platform powerpc {
174    configure.universal_archs ppc ppc64
175}
176platform i386 {
177    configure.universal_archs i386 x86_64
178}
179variant universal {
180    configure.args-delete --disable-multilib
181}
182# the generated compiler doesn't accept -arch
183configure.env-append CPP="${configure.cc} -E"
184build.env-append CPP="${configure.cc} -E"
185configure.cc-append [get_canonical_archflags]
186configure.cc_archflags
187configure.cxx-append ${configure.cxx_archflags}
188configure.cxx_archflags
189configure.objc_archflags
190configure.ld_archflags
191configure.universal_cflags
192configure.universal_cxxflags
193configure.universal_ldflags
194configure.universal_args
195
196livecheck.type      regex
197livecheck.url       http://ftp.gnu.org/gnu/gcc/
198livecheck.regex     gcc-(${major}\\.\[0-9.\]+)/
Note: See TracBrowser for help on using the repository browser.