source: trunk/dports/lang/gcc48/Portfile @ 127093

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

gcc48: Fix dynamic symbol lookup on Yosemite (#45483)

The Libtool MACOSX_DEPLOYMENT_TARGET bug strikes again. See
https://trac.macports.org/ticket/44596#comment:35 for details.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.4 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 127093 2014-10-21 00:12:49Z larryv@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.3
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}/ \
25                    ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \
26                    ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \
27                    ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
28                    gnu:gcc/gcc-${version}
29
30distname            gcc-${version}
31use_bzip2           yes
32
33checksums           rmd160  2c7214ff607cbe822282c04d1d6f9fea765c82c5 \
34                    sha256  6a8e4f11b185f4fe2ed9d7fc053e80f8c7e73f800c045f51f9d8bea33f080f1e
35
36depends_lib         port:gmp port:mpfr port:libiconv port:libmpc path:lib/pkgconfig/cloog-isl.pc:cloog path:lib/libgcc/libgcc_s.1.dylib:libgcc port:ld64 port:cctools
37depends_run         port:gcc_select
38
39depends_skip_archcheck-append gcc_select ld64 cctools
40license_noconflict  gmp mpfr ppl libmpc
41
42patchfiles          patch-10.10.diff \
43                    yosemite-symbol-lookup.patch
44
45set major           4.8
46
47platform darwin {
48    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
49}
50
51configure.dir       ${workpath}/build
52configure.cmd       ${worksrcpath}/configure
53configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran,java \
54                    --libdir=${prefix}/lib/${name} \
55                    --includedir=${prefix}/include/${name} \
56                    --infodir=${prefix}/share/info \
57                    --mandir=${prefix}/share/man \
58                    --datarootdir=${prefix}/share/gcc-${major} \
59                    --with-local-prefix=${prefix} \
60                    --with-system-zlib \
61                    --disable-nls \
62                    --program-suffix=-mp-${major} \
63                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
64                    --with-gmp=${prefix} \
65                    --with-mpfr=${prefix} \
66                    --with-mpc=${prefix} \
67                    --with-cloog=${prefix} --enable-cloog-backend=isl \
68                    --disable-cloog-version-check \
69                    --enable-stage1-checking \
70                    --disable-multilib \
71                    --enable-lto \
72                    --enable-libstdcxx-time \
73                    --with-as=${prefix}/bin/as \
74                    --with-ld=${prefix}/bin/ld \
75                    --with-ar=${prefix}/bin/ar \
76                    --with-bugurl=https://trac.macports.org/newticket
77
78configure.env-append \
79                    AR_FOR_TARGET=${prefix}/bin/ar \
80                    AS_FOR_TARGET=${prefix}/bin/as \
81                    LD_FOR_TARGET=${prefix}/bin/ld \
82                    NM_FOR_TARGET=${prefix}/bin/nm \
83                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
84                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
85                    STRIP_FOR_TARGET=${prefix}/bin/strip \
86                    OTOOL=${prefix}/bin/otool \
87                    OTOOL64=${prefix}/bin/otool
88
89pre-configure {
90    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
91
92    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
93    file mkdir ${configure.dir}
94}
95
96# http://trac.macports.org/ticket/29067
97compiler.blacklist-append gcc-4.0
98
99# http://trac.macports.org/ticket/29104
100compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
101
102# "-stdlib" would be passed on to the bootstrap compiler if present
103configure.cxx_stdlib
104
105build.dir           ${configure.dir}
106build.target        bootstrap
107use_parallel_build  yes
108
109destroot.target     install install-info-host
110
111post-destroot {
112    file delete ${destroot}${prefix}/share/info/dir
113
114    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
115        set extension [file extension ${file}]
116        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
117
118        file rename ${file} ${newfile}
119    }
120
121    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} {
122        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
123        # https://trac.macports.org/ticket/40098
124        # https://trac.macports.org/ticket/40100
125        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
126            delete ${destroot}${prefix}/lib/${name}/${dylib}
127            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
128        }
129
130        if {[variant_isset universal]} {
131            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
132                if {[file exists ${archdir}/${dylib}]} {
133                    delete ${archdir}/${dylib}
134                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
135                }
136            }
137        }
138    }
139}
140
141select.group        gcc
142select.file         ${filespath}/mp-${name}
143
144platform powerpc {
145    configure.universal_archs ppc ppc64
146}
147platform i386 {
148    configure.universal_archs i386 x86_64
149}
150variant universal {
151    configure.args-delete --disable-multilib
152}
153# the generated compiler doesn't accept -arch
154configure.env-append CPP="${configure.cc} -E"
155build.env-append CPP="${configure.cc} -E"
156configure.cc-append [get_canonical_archflags]
157configure.cc_archflags
158configure.cxx-append ${configure.cxx_archflags}
159configure.cxx_archflags
160configure.objc_archflags
161configure.ld_archflags
162configure.universal_cflags
163configure.universal_cxxflags
164configure.universal_ldflags
165configure.universal_args
166
167livecheck.type      regex
168livecheck.url       http://gcc.gnu.org/gcc-4.8/
169livecheck.regex     GCC (4\\.8\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.