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

Last change on this file since 97687 was 97687, checked in by jeremyhu@…, 7 years ago

gcc4?: Add a new libstdcxx (and libstdcxx-devel) port to provide the GNU C++ runtime. Note that it is not compatible with the host C++ runtime, but at least now we're not in a situation where each gcc port has its own conflicting runtime. See #35770 for more discussion.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.8 KB
Line 
1# $Id: Portfile 97687 2012-09-12 04:41:13Z jeremyhu@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5
6name                gcc48
7subport             libstdcxx-devel {}
8version             4.8-20120909
9revision            3
10platforms           darwin
11categories          lang
12maintainers         mww openmaintainer
13license             GPL-3
14description         The GNU compiler collection, prerelease BETA
15long_description    The GNU compiler collection, including front ends for \
16                    C, C++, Objective-C, Objective-C++, Fortran and Java. \
17                    This is a prerelease BETA version!
18
19homepage            http://gcc.gnu.org/
20master_sites        ftp://ftp.gwdg.de/pub/linux/gcc/snapshots/${version}/ \
21                    ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/snapshots/${version}/ \
22                    ftp://gcc.gnu.org/pub/gcc/snapshots/${version}/ \
23                    http://mirrors-us.seosue.com/gcc/snapshots/${version}/ \
24                    http://gcc.skazkaforyou.com/snapshots/${version}/
25
26distname            gcc-${version}
27
28checksums           rmd160  35cd54340b158c8fcccbf5f4be599f141d60f694 \
29                    sha256  7afd0b9143a541702f767d69610b5648e7e97fdd66b02ca910175e0bad2b31c0
30
31supported_archs     i386 x86_64
32
33use_bzip2           yes
34
35depends_lib         port:gmp port:mpfr port:libiconv port:libmpc port:ppl port:cloog
36depends_run         port:gcc_select port:ld64 port:cctools port:libstdcxx-devel
37
38depends_skip_archcheck-append gcc_select ld64 cctools
39
40set major           4.8
41
42worksrcdir          build
43
44post-extract {
45    file mkdir ${worksrcpath}
46}
47
48platform darwin {
49    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
50}
51
52configure.cmd       ../gcc-${version}/configure
53configure.args      --enable-languages=c,c++,objc,obj-c++,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-ppl=${prefix} \
68                    --with-cloog=${prefix} --enable-cloog-backend=isl \
69                    --enable-stage1-checking \
70                    --disable-multilib \
71                    --enable-lto \
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
92# http://trac.macports.org/ticket/29104
93if {${configure.compiler} == "llvm-gcc-4.2"} {
94    configure.compiler clang
95}
96
97build.target        bootstrap
98use_parallel_build  yes
99
100destroot.target     install install-info-host
101
102# TODO: Optimize this.  We don't need to actually bootstrap gcc to build libstdc++
103if {${subport} == "libstdcxx-devel"} {
104    depends_run-delete port:${subport}
105
106    configure.args-delete --libdir=${prefix}/lib/${name}
107
108    configure.args-delete --enable-languages=c,c++,objc,obj-c++,lto,fortran,java
109    configure.args-append --enable-languages=c++
110
111    destroot.target     install-target-libstdc++-v3
112
113    post-destroot {
114        eval delete [glob ${destroot}${prefix}/lib/*{a,py}]
115        file delete -force ${destroot}${prefix}/share/gcc-${major}
116        file delete -force ${destroot}${prefix}/include/${name}
117    }
118} else {
119post-destroot {
120    file delete -force ${destroot}${prefix}/share/man/man7 \
121        ${destroot}${prefix}/share/info
122    # install/copy ffitarget.h only if we have it
123    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
124        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
125    }
126
127    # http://trac.macports.org/ticket/35770
128    eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
129
130    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
131
132    # This symlink is provided as a transition aide and will be removed
133    # with a future revision of this port.
134    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
135}
136
137select.group        gcc
138select.file         ${filespath}/mp-${name}
139
140}
141
142platform powerpc {
143    configure.universal_archs ppc ppc64
144}
145platform i386 {
146    configure.universal_archs i386 x86_64
147}
148variant universal {
149    configure.args-delete --disable-multilib
150}
151# the generated compiler doesn't accept -arch
152configure.env-append CPP="${configure.cc} -E"
153build.env-append CPP="${configure.cc} -E"
154configure.cc-append [get_canonical_archflags]
155configure.cc_archflags
156configure.cxx_archflags
157configure.objc_archflags
158configure.ld_archflags
159configure.universal_cflags
160configure.universal_cxxflags
161configure.universal_ldflags
162configure.universal_args
163
164livecheck.type      regex
165livecheck.url       ftp://gcc.gnu.org/pub/gcc/snapshots/
166livecheck.regex     LATEST-4.8 -> (4.8-\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.