1 | # $Id: Portfile 58531 2009-09-30 11:48:05Z nox@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name llvm |
---|
6 | version 2.6 |
---|
7 | revision 0 |
---|
8 | categories lang |
---|
9 | platforms darwin |
---|
10 | use_parallel_build yes |
---|
11 | maintainers erickt openmaintainer |
---|
12 | description llvm is a next generation compiler infrastructure |
---|
13 | long_description llvm brings tools to work on the llvm intermediate \ |
---|
14 | language incl. a C and C++ frontend. |
---|
15 | |
---|
16 | homepage http://llvm.org/ |
---|
17 | master_sites ${homepage}releases/${version}/ |
---|
18 | |
---|
19 | checksums md5 34a11e807add0f4555f691944e1a404a \ |
---|
20 | sha1 547471147cbf6d3e49539e01196ffada2c79c250 \ |
---|
21 | rmd160 24d58cb052ab5879aae59eaf4885ec41186ee22a |
---|
22 | |
---|
23 | universal_variant no |
---|
24 | |
---|
25 | depends_build bin:flex:flex \ |
---|
26 | bin:bison:bison |
---|
27 | |
---|
28 | configure.dir ${workpath}/build |
---|
29 | build.dir ${configure.dir} |
---|
30 | destroot.dir ${configure.dir} |
---|
31 | |
---|
32 | post-extract { |
---|
33 | file mkdir ${configure.dir} |
---|
34 | } |
---|
35 | |
---|
36 | patchfiles patch-Makefile.config.in.diff \ |
---|
37 | patch-Makefile.ocaml.diff |
---|
38 | |
---|
39 | configure.cppflags |
---|
40 | configure.ldflags |
---|
41 | configure.cmd ${worksrcpath}/configure |
---|
42 | configure.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 | |
---|
49 | post-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 | |
---|
70 | variant 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 | |
---|
80 | variant pic description {Enable generation of position independent code} { |
---|
81 | configure.args-delete --disable-pic |
---|
82 | } |
---|
83 | |
---|
84 | variant host_only description {Disables non-host targets} { |
---|
85 | configure.args-append --enable-targets=host-only |
---|
86 | } |
---|