| 1 | # $Id: Portfile 60440 2009-11-12 16:20:19Z erickt@macports.org $ |
|---|
| 2 | |
|---|
| 3 | PortSystem 1.0 |
|---|
| 4 | |
|---|
| 5 | name llvm-gcc42 |
|---|
| 6 | version 2.6 |
|---|
| 7 | revision 1 |
|---|
| 8 | platforms darwin |
|---|
| 9 | categories lang |
|---|
| 10 | maintainers feiri.de:macports erickt openmaintainer |
|---|
| 11 | license GPLv2 |
|---|
| 12 | description llvm-gcc is a gcc compiler frontend for llvm |
|---|
| 13 | long_description llvm-gcc is a gcc compiler frontend for llvm \ |
|---|
| 14 | offering C, C++, Objective-C, Objective-C++ and Fortran. |
|---|
| 15 | |
|---|
| 16 | homepage http://llvm.org/ |
|---|
| 17 | master_sites http://llvm.org/releases/${version}/ |
|---|
| 18 | |
|---|
| 19 | set major 4.2 |
|---|
| 20 | distname llvm-gcc-${major}-${version}.source |
|---|
| 21 | |
|---|
| 22 | checksums md5 4e8c5a1035701c231dbfc7e2af2d7571 \ |
|---|
| 23 | sha1 60670d550be09a57d315efa259d2b19955f6fa79 \ |
|---|
| 24 | rmd160 08d7ffadb88e3abdcc971372f737e4ddf8f991c6 |
|---|
| 25 | |
|---|
| 26 | # gmp and mpfr are not universal |
|---|
| 27 | universal_variant no |
|---|
| 28 | |
|---|
| 29 | depends_lib port:llvm port:gmp port:mpfr port:libiconv |
|---|
| 30 | |
|---|
| 31 | worksrcdir build |
|---|
| 32 | |
|---|
| 33 | post-extract { |
|---|
| 34 | file mkdir ${worksrcpath} |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | # the generated compiler doesn't accept -arch |
|---|
| 38 | if {[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 | |
|---|
| 49 | configure.cmd ../llvm-gcc${major}-${version}.source/configure |
|---|
| 50 | configure.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 | |
|---|
| 67 | build.target bootstrap |
|---|
| 68 | use_parallel_build yes |
|---|
| 69 | |
|---|
| 70 | destroot.target install install-info-host |
|---|
| 71 | |
|---|
| 72 | post-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 | |
|---|
| 89 | platform 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 | |
|---|
| 100 | variant 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 | |
|---|
| 106 | livecheck.type regex |
|---|
| 107 | livecheck.url ${homepage}releases/ |
|---|
| 108 | livecheck.regex {'(\d+\.\d+)'} |
|---|