Ticket #24046: Portfile

File Portfile, 4.2 KB (added by macports@…, 15 years ago)
Line 
1# $Id: Portfile 60440 2009-11-12 16:20:19Z erickt@macports.org $
2
3PortSystem 1.0
4
5name                    llvm-gcc42
6version                 2.6
7revision                1
8platforms               darwin
9categories              lang
10maintainers             feiri.de:macports erickt openmaintainer
11license                 GPLv2
12description             llvm-gcc is a gcc compiler frontend for llvm
13long_description        llvm-gcc is a gcc compiler frontend for llvm \
14                        offering C, C++, Objective-C, Objective-C++ and Fortran.
15
16homepage                http://llvm.org/
17master_sites            http://llvm.org/releases/${version}/
18
19set major               4.2
20distname                llvm-gcc-${major}-${version}.source
21
22checksums               md5     4e8c5a1035701c231dbfc7e2af2d7571 \
23                        sha1    60670d550be09a57d315efa259d2b19955f6fa79 \
24                        rmd160  08d7ffadb88e3abdcc971372f737e4ddf8f991c6
25
26# gmp and mpfr are not universal
27universal_variant       no
28
29depends_lib             port:llvm port:gmp port:mpfr port:libiconv
30
31worksrcdir              build
32
33post-extract {
34    file mkdir ${worksrcpath}
35}
36
37# the generated compiler doesn't accept -arch
38if {[info exists build_arch] && ${os.platform} == "darwin"} {
39    configure.cc_archflags
40    configure.cxx_archflags
41    configure.objc_archflags
42    if {${build_arch} == "i386" } {
43        configure.pre_args-append --host=$i686-apple-darwin${os.major}
44    } else {
45        configure.pre_args-append --host=${build_arch}-apple-darwin${os.major}
46    }
47}
48
49configure.cmd           ../llvm-gcc${major}-${version}.source/configure
50configure.args          --enable-llvm=${prefix}/lib/llvm/obj \
51                        --enable-languages=c,c++,objc,obj-c++,fortran \
52                        --libdir=${prefix}/lib/${name} \
53                        --includedir=${prefix}/include/${name} \
54                        --infodir=${prefix}/share/info \
55                        --mandir=${prefix}/share/man \
56                        --with-local-prefix=${prefix} \
57                        --with-system-zlib \
58                        --disable-nls \
59                        --program-prefix=llvm- \
60                        --program-suffix=-${major} \
61                        --with-gxx-include-dir=/usr/include/c++/4.2.1 \
62                        --with-gmp=${prefix} \
63                        --with-mpfr=${prefix} \
64                        --with-slibdir=/usr/lib \
65                        --with-build-time-tools=/usr/bin
66
67build.target            bootstrap
68use_parallel_build      yes
69
70destroot.target         install install-info-host
71
72post-destroot {
73        # mimic the setup provided by apple in /Developer
74        system "cd ${destroot}${prefix}/bin/ && ln -s llvm-gcc-4.2 llvm-gcc"
75        # dont actually install slibs in directories outside of ${prefix}
76        file delete -force ${destroot}/usr/lib
77        # generic docs conflict with other ports
78        file delete -force ${destroot}${prefix}/share/man/man7 \
79            ${destroot}${prefix}/share/info
80        # install/copy ffitarget.h only if we have it
81        if {![catch {set ffitarget.h [glob ${destroot}${prefix}/lib/${name}/gcc/*/${version}/include/ffitarget.h]} result]} {
82            file copy ${ffitarget.h} ${destroot}${prefix}/include/${name}/
83        }
84        # install select file for gcc_select
85        xinstall -m 755 -d ${destroot}${prefix}/etc/select/gcc
86        xinstall -m 444 ${filespath}/mp-llvm-gcc42 ${destroot}${prefix}/etc/select/gcc/
87}
88
89platform darwin 9 {
90        configure.args-delete --with-gxx-include-dir=/usr/include/c++/4.2.1
91        configure.args-append --with-gxx-include-dir=/usr/include/c++/4.0.0
92}
93
94### Update the odcctools to provide a custom ld64 with support for LTO
95#variant odcctools \
96#        description "The presence of the odcctools package enables -flto and -O4" {
97#        depends_lib-append port:odcctools
98#}
99
100variant libgcc_s \
101        description "Install and use the libgcc_s libraries provided by gcc instead of the ones provided by the system. \
102        This introduces a linker dependency in all binaries built for 10.4 and 10.5 targets using this compiler." {
103        configure.args-delete --with-slibdir=/usr/lib
104}
105
106livecheck.type  regex
107livecheck.url   ${homepage}releases/
108livecheck.regex {'(\d+\.\d+)'}