Ticket #23629: Portfile

File Portfile, 5.1 KB (added by mathew.oakes@…, 15 years ago)

Portfile modified

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 57794 2009-09-16 18:09:03Z jmr@macports.org $
3
4PortSystem 1.0
5
6name            gcc43
7version         4.3.4
8platforms       darwin
9categories      lang
10maintainers     mww
11license         GPLv3
12description     The GNU compiler collection
13long_description The GNU compiler collection, including front ends for \
14                C, C++, Objective-C, Objective-C++, Java and Fortran95.
15
16homepage        http://gcc.gnu.org/
17master_sites    ftp://ftp.funet.fi/pub/mirrors/sources.redhat.com/pub/gcc/releases/gcc-${version}/ \
18                ftp://ftp.gwdg.de/pub/linux/gcc/releases/gcc-${version}/ \
19                ftp://gcc.ftp.nluug.nl/mirror/languages/gcc/releases/gcc-${version}/ \
20                ftp://gcc.gnu.org/pub/gcc/releases/gcc-${version}/ \
21                gnu:/gcc/gcc-${version}
22
23set dcore       gcc-core-${version}.tar.gz
24set dfort       gcc-fortran-${version}.tar.gz
25set dcxx        gcc-g++-${version}.tar.gz
26set djava       gcc-java-${version}.tar.gz
27set dobjc       gcc-objc-${version}.tar.gz
28distfiles       ${dcore} ${dfort} ${dcxx} ${djava} ${dobjc}
29
30checksums       ${dcore} sha1 49d0aa2cc468a5d8bfbd70b6827b6c6f5715cb18 \
31                ${dfort} sha1 b5b1f498b174bcfdf64e1b1f8a90a4febdd0db51 \
32                ${dcxx} sha1 1fd5a0876becfdee9d7ab6ca52172be6590a81b6 \
33                ${djava} sha1 55d3dfd4076017ea354a18acc9a4c1a416a72e66 \
34                ${dobjc} sha1 7b7753659c4720d08f5c982e6d479cd632b413c7
35
36use_bzip2       no
37
38# gmp and mpfr are not universal
39universal_variant       no
40
41depends_lib     port:gmp port:mpfr port:libiconv
42
43patchfiles      Make-lang.in.diff
44patch.dir       ${workpath}/gcc-${version}
45
46set major       4.3
47
48worksrcdir      build
49
50post-extract {
51    file mkdir ${worksrcpath}
52}
53
54# the generated compiler doesn't accept -arch
55if {[info exists build_arch] && ${os.platform} == "darwin"} {
56    configure.cc_archflags
57    configure.cxx_archflags
58    configure.objc_archflags
59    configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
60}
61
62configure.cmd   ../gcc-${version}/configure
63configure.args  --enable-languages=c,c++,objc,obj-c++,java,fortran \
64        --libdir=${prefix}/lib/${name} \
65        --includedir=${prefix}/include/${name} \
66        --infodir=${prefix}/share/info \
67        --mandir=${prefix}/share/man \
68        --with-local-prefix=${prefix} \
69        --with-system-zlib \
70        --disable-nls \
71        --program-suffix=-mp-${major} \
72        --with-gxx-include-dir=${prefix}/include/${name}/c++/ \
73        --with-gmp=${prefix} \
74        --with-mpfr=${prefix}
75# do NOT use MacPorts binutils -- they do not work
76configure.env-append    AR_FOR_TARGET=/usr/bin/ar \
77            AS_FOR_TARGET=/usr/bin/as \
78            LD_FOR_TARGET=/usr/bin/ld \
79            NM_FOR_TARGET=/usr/bin/nm \
80            OBJDUMP_FOR_TARGET=/usr/bin/objdump \
81            RANLIB_FOR_TARGET=/usr/bin/ranlib \
82            STRIP_FOR_TARGET=/usr/bin/strip
83
84use_parallel_build  yes
85
86destroot.target install install-info-host
87# install-info # errors on objc-info files
88
89post-destroot {
90    # move manuals to gcc43-specific directory
91    xinstall -m 755 -d ${destroot}${prefix}/share/gcc43/man/man7
92    xinstall -m 755 -d ${destroot}${prefix}/share/gcc43/info
93    eval xinstall -m 0644 [glob ${destroot}${prefix}/share/man/man7/*]  ${destroot}${prefix}/share/gcc43/man/man7
94    eval xinstall -m 0644 [glob ${destroot}${prefix}/share/info/*] ${destroot}${prefix}/share/gcc43/info
95    # install/copy ffitarget.h only if we have it
96    if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
97        file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
98    }
99    # install select file for gcc_select
100    xinstall -m 755 -d ${destroot}${prefix}/etc/select/gcc
101    xinstall -m 444 ${filespath}/mp-gcc43 ${destroot}${prefix}/etc/select/gcc/
102}
103
104platform darwin 7 {
105    depends_build-append    port:gmake
106    build.cmd               gmake
107#   configure.cflags-append -force_cpusubtype_ALL
108#   configure.env           BOOT_CFLAGS="-g -O2 -force_cpusubtype_ALL"
109#   build.args-append   XCFLAGS=-force_cpusubtype_ALL
110}
111
112platform powerpc {
113    configure.args-append --disable-multilib
114}
115
116# Java support does not compile on 10.4/x86
117platform darwin 8 i386 {
118        configure.args-delete   --enable-languages=c,c++,objc,obj-c++,java,fortran
119        configure.args-append   --enable-languages=c,c++,objc,obj-c++,fortran
120}
121
122# odcctools currently do not compile for x64 - move to variant for the time being
123#variant odcctools \
124#   description "Use the odcctools instead of the system provided ones - does not work for x64 currently!" {
125#   depends_lib-append  port:odcctools
126#   patch {
127#       reinplace "s|/usr/bin/libtool|${prefix}/bin/odlibtool|g" \
128#           ${workpath}/gcc-${version}/gcc/config/darwin.h
129#   }
130#   configure.args-append   --with-as=${prefix}/bin/odas \
131#               --with-ld=${prefix}/bin/odld \
132#               --with-ar=${prefix}/bin/odar
133#}
134
135livecheck.type  regex
136livecheck.url   http://gcc.gnu.org/gcc-4.3/
137livecheck.regex GCC (4\\.3\\.\[0-9\])
138