Ticket #22299: Portfile

File Portfile, 3.0 KB (added by shawjef3@…, 15 years ago)

llvm 2.6 portfile

Line 
1# $Id: Portfile 58531 2009-09-30 11:48:05Z nox@macports.org $
2
3PortSystem 1.0
4
5name                    llvm
6version                 2.6
7revision                0
8categories              lang
9platforms               darwin
10use_parallel_build      yes
11maintainers             erickt openmaintainer
12description             llvm is a next generation compiler infrastructure
13long_description        llvm brings tools to work on the llvm intermediate \
14                        language incl. a C and C++ frontend.
15
16homepage                http://llvm.org/
17master_sites            ${homepage}releases/${version}/
18
19checksums               md5     34a11e807add0f4555f691944e1a404a \
20                        sha1    547471147cbf6d3e49539e01196ffada2c79c250 \
21                        rmd160  24d58cb052ab5879aae59eaf4885ec41186ee22a
22
23universal_variant       no
24
25depends_build           bin:flex:flex \
26                        bin:bison:bison
27
28configure.dir           ${workpath}/build
29build.dir               ${configure.dir}
30destroot.dir            ${configure.dir}
31
32post-extract {
33    file mkdir ${configure.dir}
34}
35
36patchfiles              patch-Makefile.config.in.diff \
37                        patch-Makefile.ocaml.diff
38
39configure.cppflags
40configure.ldflags
41configure.cmd           ${worksrcpath}/configure
42configure.args          --enable-optimized --enable-jit \
43                        --enable-bindings=none \
44                        --disable-assertions \
45                        --disable-expensive-checks \
46                        --disable-pic
47                        #pic is enabled by default in 2.6
48
49post-destroot {
50    file mkdir ${destroot}${prefix}/lib/llvm
51    file mkdir ${destroot}${prefix}/lib/llvm/src
52    file mkdir ${destroot}${prefix}/lib/llvm/obj
53
54    file copy ${worksrcpath}/include ${destroot}${prefix}/lib/llvm/src
55    file copy ${configure.dir}/include ${destroot}${prefix}/lib/llvm/obj
56    file copy ${configure.dir}/Release-Asserts ${destroot}${prefix}/lib/llvm/obj
57
58    reinplace "s|${worksrcpath}|${prefix}/lib/llvm/src|g"       ${destroot}${prefix}/bin/llvm-config \
59                                                                ${destroot}${prefix}/lib/llvm/obj/Release-Asserts/bin/llvm-config
60    reinplace "s|${configure.dir}|${prefix}/lib/llvm/obj|g"     ${destroot}${prefix}/bin/llvm-config \
61                                                                ${destroot}${prefix}/lib/llvm/obj/Release-Asserts/bin/llvm-config
62
63    fs-traverse item ${destroot} {
64        if {[file isfile ${item}] && ".dir" == [file tail ${item}]} {
65            delete ${item}
66        }
67    }
68}
69
70variant ocaml description {Enable generation of OCaml binding} {
71    depends_build-append port:ocaml
72    depends_lib-append   port:ocaml
73
74    configure.args-delete --enable-bindings=none
75    configure.args-append --enable-bindings=ocaml
76
77    destroot.args-append  OVERRIDE_libdir=${prefix}/lib
78}
79
80variant pic description {Enable generation of position independent code} {
81    configure.args-delete --disable-pic
82}
83
84variant host_only description {Disables non-host targets} {
85    configure.args-append --enable-targets=host-only
86}