source: trunk/dports/lang/llvm-3.2/Portfile @ 96925

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

{clang,dragonegg,llvm}-3.2: Bump to current svn

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.8 KB
Line 
1# $Id: Portfile 96925 2012-08-21 22:54:20Z jeremyhu@macports.org $
2
3PortSystem              1.0
4PortGroup select        1.0
5
6set llvm_version        3.2
7revision                0
8name                    llvm-${llvm_version}
9set suffix              mp-${llvm_version}
10set sub_prefix          ${prefix}/libexec/${name}
11dist_subdir             llvm
12categories              lang
13platforms               darwin
14license                 NCSA
15maintainers             jeremyhu openmaintainer
16description             llvm is a next generation compiler infrastructure (svn trunk version)
17long_description        The LLVM Core libraries provide a modern source- and \
18                        target-independent optimizer, along with code \
19                        generation support for many popular CPUs (as well as \
20                        some less common ones!) These libraries are built \
21                        around a well specified code representation known as \
22                        the LLVM intermediate representation ("LLVM IR").
23
24homepage                http://llvm.org/
25
26depends_lib             port:libffi
27depends_run             bin:perl:perl5 port:llvm_select
28
29fetch.type              svn
30svn.revision            162304
31version                 ${llvm_version}-r${svn.revision}
32worksrcdir              trunk
33svn.url                 http://llvm.org/svn/llvm-project/llvm/trunk
34#worksrcdir              release_32
35#svn.url                 http://llvm.org/svn/llvm-project/llvm/branches/release_32
36default_variants-append +assertions
37
38#version                 ${llvm_version}
39#epoch                   1
40#master_sites            ${homepage}releases/${version}/
41#extract.suffix          .tar.gz
42#distname                llvm-${version}.src
43
44patchfiles      tiger.patch \
45                tiger-shlib.patch
46patch.pre_args  -p1
47
48build.env-append        VERBOSE=1 REQUIRE_RTTI=1
49destroot.env-append     VERBOSE=1 REQUIRE_RTTI=1
50configure.cppflags
51configure.ldflags
52configure.pre_args-delete --prefix=${prefix}
53configure.args          --enable-bindings=none --enable-libffi --enable-shared --enable-jit \
54                        --enable-optimized --disable-profiling \
55                        --enable-debug-symbols --disable-debug-runtime \
56                        --prefix="${sub_prefix}"
57
58select.group    llvm
59select.file     ${filespath}/mp-${name}
60
61# g++-4.0 fails to build some of the newer C++ for ppc
62# Intel looks ok, but I prefer using gcc-4.2 for consistency
63if {${configure.compiler} == "gcc-4.0"} {
64    configure.compiler gcc-4.2
65    if {![file exists ${configure.cc}]} {
66        depends_build-append port:apple-gcc42 port:ld64 port:cctools
67        depends_skip_archcheck-append apple-gcc42 ld64 cctools
68
69        configure.compiler apple-gcc-4.2
70    }
71}
72
73variant universal {
74    build.env-append \
75        UNIVERSAL=1 \
76        UNIVERSAL_ARCH="[get_canonical_archs]"
77    destroot.env-append \
78        UNIVERSAL=1 \
79        UNIVERSAL_ARCH="[get_canonical_archs]"
80
81    post-extract {
82        # workaround a bug in Apple's shipped gcc driver-driver, patched in
83        # ours with driverdriver-num_infiles.patch
84        if {${configure.compiler} == "gcc-4.0" ||
85            ${configure.compiler} == "gcc-4.2"} {
86            system "echo \"static int ___ignoreme;\" > ${worksrcpath}/tools/llvm-shlib/ignore.c"
87        }
88    }
89}
90
91variant assertions description "Enable assertions for error detection (has performance impacts, especially on JIT)" {
92    configure.args-append --enable-assertions
93}
94
95platform darwin {
96    if {${build_arch} == "i386" } {
97        configure.pre_args-append --build=i686-apple-darwin${os.major}
98    } elseif {${build_arch} == "ppc" } {
99        configure.pre_args-append --build=powerpc-apple-darwin${os.major}
100    } elseif {${build_arch} == "ppc64" } {
101        configure.pre_args-append --build=powerpc64-apple-darwin${os.major}
102    } else {
103        configure.pre_args-append --build=${build_arch}-apple-darwin${os.major}
104    }
105
106    if {[string match "*ppc*" [get_canonical_archs]]} {
107        # http://trac.macports.org/ticket/33987
108        configure.args-append --with-optimize-option=-Os
109    }
110
111    post-destroot {
112        foreach liba [glob ${destroot}${sub_prefix}/lib/*dylib] {
113            set liba_nodr [string map "${destroot} {}" ${liba}]
114            system "install_name_tool -id ${liba_nodr} ${liba}"
115
116            foreach libb [glob ${destroot}${sub_prefix}/lib/*dylib] {
117                set libb_base [string map "${destroot}${sub_prefix}/lib/ {}" ${libb}]
118                set libb_nodr [string map "${destroot} {}" ${libb}]
119
120                system "install_name_tool -change @executable_path/../lib/${libb_base} ${libb_nodr} ${liba}"
121            }
122        }
123    }
124}
125
126platform darwin 8 {
127    post-configure {
128        reinplace "/^RPATH/s/=.*/=/" ${worksrcpath}/Makefile.config
129    }
130}
131
132variant ocaml description {Enable generation of OCaml binding} {
133    depends_lib-append   port:ocaml
134
135    configure.args-delete --enable-bindings=none
136    configure.args-append --enable-bindings=ocaml
137
138    destroot.args-append  OVERRIDE_libdir=${sub_prefix}/lib
139}
140
141post-destroot {
142    file mkdir ${destroot}${prefix}/share/doc
143    file rename ${destroot}${sub_prefix}/docs/llvm ${destroot}${prefix}/share/doc/${name}
144
145    # r156389 (a5d2435409858728970202226d0bbbee508fe408) temporarilary removed llvm man pages
146    #foreach man [glob ${destroot}${sub_prefix}/share/man/man1/*.1] {
147    #    set basename [string map "${destroot}${sub_prefix}/share/man/man1/ {}" ${man}]
148    #    file rename ${man} ${destroot}${prefix}/share/man/man1/[string map ".1 -${suffix}.1" ${basename}]
149    #}
150
151    foreach bin [glob ${destroot}${sub_prefix}/bin/*] {
152        set bin_filename [string map "${sub_prefix} ${prefix}" ${bin}]-${suffix}
153        set exec_path [string map "${destroot}${sub_prefix} ${sub_prefix}" ${bin}]
154
155        xinstall -m 755 "${filespath}/llvm-bin" "${bin_filename}"
156        reinplace "s:EXEC_PATH:${exec_path}:" "${bin_filename}"
157    }
158}
Note: See TracBrowser for help on using the repository browser.