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

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

libstdcxx{,-devel}: Address a possible build failure, See #36116.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.3 KB
Line 
1# $Id: Portfile 97713 2012-09-12 22:33:23Z jeremyhu@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5
6name                gcc48
7subport             libstdcxx-devel {}
8version             4.8-20120909
9revision            4
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    # See http://trac.macports.org/ticket/36116 for why we can't do this yet
112    # configure.args-append --disable-bootstrap
113    # build.target        all
114
115    destroot.target     install-target-libstdc++-v3
116
117    post-destroot {
118        eval delete [glob ${destroot}${prefix}/lib/*{a,py}]
119        file delete -force ${destroot}${prefix}/share/gcc-${major}
120        file delete -force ${destroot}${prefix}/include/${name}
121
122        # base doesn't like the + in this depspec path:lib/libstdc++.dylib:libstdcxx
123        system "touch ${destroot}${prefix}/lib/.libstdcxx"
124
125        # Some linkers don't optimize this unused link away.  TODO: Fix this in the build system
126        system "install_name_tool -change ${prefix}/lib/libgcc_s.1.dylib /usr/lib/libgcc_s.1.dylib ${destroot}${prefix}/lib/libstdc++.6.dylib"
127    }
128} else {
129post-destroot {
130    file delete -force ${destroot}${prefix}/share/man/man7 \
131        ${destroot}${prefix}/share/info
132    # install/copy ffitarget.h only if we have it
133    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
134        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
135    }
136
137    # http://trac.macports.org/ticket/35770
138    eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
139
140    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
141
142    # This symlink is provided as a transition aide and will be removed
143    # with a future revision of this port.
144    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
145}
146
147select.group        gcc
148select.file         ${filespath}/mp-${name}
149
150}
151
152platform powerpc {
153    configure.universal_archs ppc ppc64
154}
155platform i386 {
156    configure.universal_archs i386 x86_64
157}
158variant universal {
159    configure.args-delete --disable-multilib
160}
161# the generated compiler doesn't accept -arch
162configure.env-append CPP="${configure.cc} -E"
163build.env-append CPP="${configure.cc} -E"
164configure.cc-append [get_canonical_archflags]
165configure.cc_archflags
166configure.cxx_archflags
167configure.objc_archflags
168configure.ld_archflags
169configure.universal_cflags
170configure.universal_cxxflags
171configure.universal_ldflags
172configure.universal_args
173
174livecheck.type      regex
175livecheck.url       ftp://gcc.gnu.org/pub/gcc/snapshots/
176livecheck.regex     LATEST-4.8 -> (4.8-\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.