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

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

gcc*: Add build dependency on compiler if needed

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 8.4 KB
Line 
1# $Id: Portfile 102108 2013-01-28 06:22:45Z jeremyhu@macports.org $
2
3PortSystem 1.0
4PortGroup select 1.0
5
6name                gcc48
7subport             libstdcxx-devel {}
8
9# Remove the revision in libstdcxx-devel when bumping
10version             4.8-20130120
11platforms           darwin
12categories          lang
13maintainers         mww openmaintainer
14license             GPL-3
15description         The GNU compiler collection, prerelease BETA
16long_description    The GNU compiler collection, including front ends for \
17                    C, C++, Objective-C, Objective-C++, Fortran and Java. \
18                    This is a prerelease BETA version!
19
20homepage            http://gcc.gnu.org/
21master_sites        http://gcc.petsads.us/snapshots/${version} \
22                    ftp://ftp.gwdg.de/pub/linux/gcc/snapshots/${version}/ \
23                    ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/snapshots/${version}/ \
24                    ftp://gcc.gnu.org/pub/gcc/snapshots/${version}/ \
25                    http://mirrors-us.seosue.com/gcc/snapshots/${version}/ \
26                    http://gcc.skazkaforyou.com/snapshots/${version}/
27
28distname            gcc-${version}
29
30checksums           rmd160  f858b83ae98927d9ccd16531208390589c087c57 \
31                    sha256  c360f7ea2d6f0ee4aa59699c521aa2662d574f889513f8bb67be126b03389d29
32
33supported_archs     i386 x86_64
34
35use_bzip2           yes
36
37depends_lib         port:gmp port:mpfr port:libiconv port:libmpc port:ppl port:cloog
38depends_run         port:gcc_select port:ld64 port:cctools port:libstdcxx-devel
39
40depends_skip_archcheck-append gcc_select ld64 cctools
41license_noconflict  gmp mpfr ppl
42
43patchfiles          libstdc++-configure-timespec.patch
44patch.dir           ${workpath}/gcc-${version}
45
46set major           4.8
47
48worksrcdir          build
49
50post-extract {
51    file mkdir ${worksrcpath}
52}
53
54platform darwin {
55    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
56}
57
58configure.cmd       ../gcc-${version}/configure
59configure.args      --enable-languages=c,c++,objc,obj-c++,fortran,java \
60                    --libdir=${prefix}/lib/${name} \
61                    --includedir=${prefix}/include/${name} \
62                    --infodir=${prefix}/share/info \
63                    --mandir=${prefix}/share/man \
64                    --datarootdir=${prefix}/share/gcc-${major} \
65                    --with-local-prefix=${prefix} \
66                    --with-system-zlib \
67                    --disable-nls \
68                    --program-suffix=-mp-${major} \
69                    --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
70                    --with-gmp=${prefix} \
71                    --with-mpfr=${prefix} \
72                    --with-mpc=${prefix} \
73                    --with-ppl=${prefix} \
74                    --with-cloog=${prefix} --enable-cloog-backend=isl \
75                    --disable-cloog-version-check \
76                    --enable-stage1-checking \
77                    --disable-multilib \
78                    --enable-lto \
79                    --enable-libstdcxx-time \
80                    --with-as=${prefix}/bin/as \
81                    --with-ld=${prefix}/bin/ld \
82                    --with-ar=${prefix}/bin/ar \
83                    --with-bugurl=https://trac.macports.org/newticket
84
85configure.env-append \
86                    AR_FOR_TARGET=${prefix}/bin/ar \
87                    AS_FOR_TARGET=${prefix}/bin/as \
88                    LD_FOR_TARGET=${prefix}/bin/ld \
89                    NM_FOR_TARGET=${prefix}/bin/nm \
90                    OBJDUMP_FOR_TARGET=${prefix}/bin/objdump \
91                    RANLIB_FOR_TARGET=${prefix}/bin/ranlib \
92                    STRIP_FOR_TARGET=${prefix}/bin/strip \
93                    OTOOL=${prefix}/bin/otool \
94                    OTOOL64=${prefix}/bin/otool
95
96pre-configure {
97    configure.args-append --with-pkgversion="MacPorts ${name} ${version}_${revision}${portvariants}"
98}
99
100# http://trac.macports.org/ticket/29067
101compiler.blacklist-append gcc-4.0
102
103# http://trac.macports.org/ticket/29104
104if {[vercmp $xcodeversion 4.2] < 0} {
105    compiler.blacklist-append llvm-gcc-4.2
106}
107
108# TODO: base should do this: http://trac.macports.org/ticket/32542
109if {[portconfigure::compiler_is_port ${configure.compiler}]} {
110    depends_build-append port:$portconfigure::compiler_name_map(${configure.compiler})
111    depends_skip_archcheck-append $portconfigure::compiler_name_map(${configure.compiler})
112}
113
114build.target        bootstrap
115use_parallel_build  yes
116
117destroot.target     install install-info-host
118
119# TODO: Optimize this.  We don't need to actually bootstrap gcc to build libstdc++
120if {${subport} == "libstdcxx-devel"} {
121    revision        1
122
123    conflicts       libstdcxx
124
125    patchfiles-append  force-static-gcc.patch
126
127    depends_run-delete port:${subport}
128
129    configure.args-delete --libdir=${prefix}/lib/${name}
130
131    configure.args-delete --enable-languages=c,c++,objc,obj-c++,lto,fortran,java
132    configure.args-append --enable-languages=c++
133
134    # See http://trac.macports.org/ticket/36116 for why we can't do this yet
135    # configure.args-append --disable-bootstrap
136    # build.target        all
137
138    destroot.target     install-target-libstdc++-v3
139
140    post-destroot {
141        eval file delete [glob ${destroot}${prefix}/lib/*{a,py}]
142        eval file delete [glob ${destroot}${prefix}/lib/libgcc*]
143        file delete -force ${destroot}${prefix}/lib/gcc
144        file delete -force ${destroot}${prefix}/share/gcc-${major}
145        file delete -force ${destroot}${prefix}/include/${name}
146
147        # Don't install the linktime symlink.  The compilers will place this
148        # in their libdir, and we don't want to break other toolchains by having
149        # them link against this libstdc++ (at least not until it is built on
150        # top of libc++abi).
151        file delete ${destroot}${prefix}/lib/libstdc++.dylib
152
153        # For compatibility.  Delete this eventually.
154        system "touch ${destroot}${prefix}/lib/.libstdcxx"
155
156        if {[variant_isset universal]} {
157            foreach archdir [glob ${destroot}${prefix}/lib/*/] {
158                if {[file exists ${archdir}/libstdc++.6.dylib]} {
159                    system "install_name_tool -id ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib"
160                    system "lipo -create -output ${destroot}${prefix}/lib/libstdc++.6.dylib~ ${destroot}${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib && mv ${destroot}${prefix}/lib/libstdc++.6.dylib~ ${destroot}${prefix}/lib/libstdc++.6.dylib"
161                }
162                file delete -force ${archdir}
163            }
164        }
165    }
166} else {
167post-destroot {
168    file delete -force ${destroot}${prefix}/share/man/man7 \
169        ${destroot}${prefix}/share/info
170    # install/copy ffitarget.h only if we have it
171    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
172        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
173    }
174
175    if {[variant_isset universal]} {
176        foreach archdir [glob ${destroot}${prefix}/lib/${name}/*/] {
177            if {[file exists ${archdir}/libstdc++.6.dylib]} {
178                eval delete [glob ${archdir}/libstdc++*]
179
180                # This symlink is provided as a transition aide and will be removed
181                # with a future revision of this port.
182                ln -s ${prefix}/lib/libstdc++.6.dylib ${archdir}/libstdc++.6.dylib
183            }
184        }
185    }
186
187    # http://trac.macports.org/ticket/35770
188    eval delete [glob ${destroot}${prefix}/lib/${name}/libstdc++*]
189
190    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.dylib
191
192    # This symlink is provided as a transition aide and will be removed
193    # with a future revision of this port.
194    ln -s ${prefix}/lib/libstdc++.6.dylib ${destroot}${prefix}/lib/${name}/libstdc++.6.dylib
195}
196
197select.group        gcc
198select.file         ${filespath}/mp-${name}
199
200}
201
202platform powerpc {
203    configure.universal_archs ppc ppc64
204}
205platform i386 {
206    configure.universal_archs i386 x86_64
207}
208variant universal {
209    configure.args-delete --disable-multilib
210}
211# the generated compiler doesn't accept -arch
212configure.env-append CPP="${configure.cc} -E"
213build.env-append CPP="${configure.cc} -E"
214configure.cc-append [get_canonical_archflags]
215configure.cc_archflags
216configure.cxx_archflags
217configure.objc_archflags
218configure.ld_archflags
219configure.universal_cflags
220configure.universal_cxxflags
221configure.universal_ldflags
222configure.universal_args
223
224livecheck.type      regex
225livecheck.url       ftp://gcc.gnu.org/pub/gcc/snapshots/
226livecheck.regex     LATEST-4.8 -> (4.8-\[0-9\]+)
Note: See TracBrowser for help on using the repository browser.