source: trunk/dports/lang/gcc48/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: 6.5 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 125551 2014-09-20 23:11:55Z ryandesign@macports.org $
3
4PortSystem 1.0
5PortGroup select 1.0
6PortGroup compiler_blacklist_versions 1.0
7PortGroup conflicts_build 1.0
8
9name                gcc48
10
11# Whenever this port is bumped for version/revision, please revbump dragonegg-*-gcc-4.8
12epoch               2
13version             4.8.3
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
44set major           4.8
45
46platform darwin {
47    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
48}
49
50configure.dir       ${workpath}/build
51configure.cmd       ${worksrcpath}/configure
52configure.args      --enable-languages=c,c++,objc,obj-c++,lto,fortran,java \
53                    --libdir=${prefix}/lib/${name} \
54                    --includedir=${prefix}/include/${name} \
55                    --infodir=${prefix}/share/info \
56                    --mandir=${prefix}/share/man \
57                    --datarootdir=${prefix}/share/gcc-${major} \
58                    --with-local-prefix=${prefix} \
59                    --with-system-zlib \
60                    --disable-nls \
61                    --program-suffix=-mp-${major} \
62                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
63                    --with-gmp=${prefix} \
64                    --with-mpfr=${prefix} \
65                    --with-mpc=${prefix} \
66                    --with-cloog=${prefix} --enable-cloog-backend=isl \
67                    --disable-cloog-version-check \
68                    --enable-stage1-checking \
69                    --disable-multilib \
70                    --enable-lto \
71                    --enable-libstdcxx-time \
72                    --with-as=${prefix}/bin/as \
73                    --with-ld=${prefix}/bin/ld \
74                    --with-ar=${prefix}/bin/ar \
75                    --with-bugurl=https://trac.macports.org/newticket
76
77configure.env-append \
78                    AR_FOR_TARGET=${prefix}/bin/ar \
79                    AS_FOR_TARGET=${prefix}/bin/as \
80                    LD_FOR_TARGET=${prefix}/bin/ld \
81                    NM_FOR_TARGET=${prefix}/bin/nm \
82                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
83                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
84                    STRIP_FOR_TARGET=${prefix}/bin/strip \
85                    OTOOL=${prefix}/bin/otool \
86                    OTOOL64=${prefix}/bin/otool
87
88pre-configure {
89    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
90
91    # TODO: Remove when base automatically creates configure.dir (2.2.1?).
92    file mkdir ${configure.dir}
93}
94
95# http://trac.macports.org/ticket/29067
96compiler.blacklist-append gcc-4.0
97
98# http://trac.macports.org/ticket/29104
99compiler.blacklist-append {llvm-gcc-4.2 < 2336.1}
100
101# "-stdlib" would be passed on to the bootstrap compiler if present
102configure.cxx_stdlib
103
104# https://trac.macports.org/ticket/43869
105conflicts_build-append libunwind-headers
106
107build.dir           ${configure.dir}
108build.target        bootstrap
109use_parallel_build  yes
110
111destroot.target     install install-info-host
112
113post-destroot {
114    file delete ${destroot}${prefix}/share/info/dir
115
116    foreach file [glob ${destroot}${prefix}/share/{info,man/man7}/*] {
117        set extension [file extension ${file}]
118        set newfile [regsub "${extension}$" ${file} "-mp-${major}${extension}"]
119
120        file rename ${file} ${newfile}
121    }
122
123    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} {
124        # Different OS versions (eg: Leopard) or architectures (eg: PPC) don't produce all the dylibs
125        # https://trac.macports.org/ticket/40098
126        # https://trac.macports.org/ticket/40100
127        if {[file exists ${destroot}${prefix}/lib/${name}/${dylib}]} {
128            delete ${destroot}${prefix}/lib/${name}/${dylib}
129            ln -s ${prefix}/lib/libgcc/${dylib} ${destroot}${prefix}/lib/${name}/${dylib}
130        }
131
132        if {[variant_isset universal]} {
133            foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
134                if {[file exists ${archdir}/${dylib}]} {
135                    delete ${archdir}/${dylib}
136                    ln -s ${prefix}/lib/libgcc/${dylib} ${archdir}/${dylib}
137                }
138            }
139        }
140    }
141}
142
143select.group        gcc
144select.file         ${filespath}/mp-${name}
145
146platform powerpc {
147    configure.universal_archs ppc ppc64
148}
149platform i386 {
150    configure.universal_archs i386 x86_64
151}
152variant universal {
153    configure.args-delete --disable-multilib
154}
155# the generated compiler doesn't accept -arch
156configure.env-append CPP="${configure.cc} -E"
157build.env-append CPP="${configure.cc} -E"
158configure.cc-append [get_canonical_archflags]
159configure.cc_archflags
160configure.cxx-append ${configure.cxx_archflags}
161configure.cxx_archflags
162configure.objc_archflags
163configure.ld_archflags
164configure.universal_cflags
165configure.universal_cxxflags
166configure.universal_ldflags
167configure.universal_args
168
169livecheck.type      regex
170livecheck.url       http://gcc.gnu.org/gcc-4.8/
171livecheck.regex     GCC (4\\.8\\.\[0-9\])
Note: See TracBrowser for help on using the repository browser.