Ticket #17489: Portfile

File Portfile, 2.6 KB (added by hircus@…, 16 years ago)

llvm Portfile with ocaml variant

Line 
1# $Id$
2
3PortSystem 1.0
4
5name                    llvm
6version                 2.4
7revision                2
8categories              lang
9platforms               darwin
10use_parallel_build      yes
11maintainers             erickt@macports.org 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     bf43eee98c364fd79c7d2b72e645a15e \
20                        sha1    8496fe06de1e622bfcfc84eac3c649b5333a241b \
21                        rmd160  a1f23490f4c110133afbcf7e96fe0aa9d29d1de2
22
23depends_build           bin:flex:flex \
24                        bin:bison:bison
25
26configure.dir           ${workpath}/build
27build.dir               ${configure.dir}
28destroot.dir            ${configure.dir}
29
30post-extract {
31    file mkdir ${configure.dir}
32}
33
34patchfiles              patch-Makefile.config.in.diff \
35                        patch-Makefile.ocaml.diff
36
37configure.cppflags
38configure.ldflags
39configure.cmd           ${worksrcpath}/configure
40configure.args          --enable-optimized --enable-jit
41
42post-destroot {
43    file mkdir ${destroot}${prefix}/lib/llvm
44    file mkdir ${destroot}${prefix}/lib/llvm/src
45    file mkdir ${destroot}${prefix}/lib/llvm/obj
46
47    file copy ${worksrcpath}/include ${destroot}${prefix}/lib/llvm/src
48    file copy ${configure.dir}/include ${destroot}${prefix}/lib/llvm/obj
49    file copy ${configure.dir}/Release ${destroot}${prefix}/lib/llvm/obj
50
51    reinplace "s|${worksrcpath}|${prefix}/lib/llvm/src|g"       ${destroot}${prefix}/bin/llvm-config \
52                                                                ${destroot}${prefix}/lib/llvm/obj/Release/bin/llvm-config
53    reinplace "s|${configure.dir}|${prefix}/lib/llvm/obj|g"     ${destroot}${prefix}/bin/llvm-config \
54                                                                ${destroot}${prefix}/lib/llvm/obj/Release/bin/llvm-config
55
56    fs-traverse item ${destroot} {
57        if {[file isfile ${item}] && ".dir" == [file tail ${item}]} {
58            delete ${item}
59        }
60    }
61}
62
63variant ocaml description {Enable generation of OCaml binding} {
64    depends_build-append port:ocaml
65    depends_lib-append   port:ocaml
66
67    configure.args-delete --enable-bindings=none
68    configure.args-append --enable-bindings=ocaml
69
70    destroot.args-append  OVERRIDE_libdir=${prefix}/lib
71}
72
73variant pic description {Enable generation of position independent code} {
74    configure.args-append --enable-pic
75}