Contents of /trunk/extras/llvm/llvm-3.4.1-r1.smage2
Parent Directory
|
Revision Log
Revision 21399 -
(show annotations)
(download)
Wed Jun 18 12:30:31 2014 UTC (10 years ago) by niro
File size: 4551 byte(s)
Wed Jun 18 12:30:31 2014 UTC (10 years ago) by niro
File size: 4551 byte(s)
-fixed SRCDIR
1 | # $Id$ |
2 | |
3 | PNAME="llvm" |
4 | PVER="3.4.1" |
5 | PBUILD="r1" |
6 | |
7 | PCAT="sys-dev" |
8 | |
9 | DESCRIPTION="The Low Level Virtual Machine." |
10 | HOMEPAGE="http://llvm.org/" |
11 | |
12 | DEPEND_x86_64=">= sys-apps/multiarch-wrapper-1" |
13 | SPECIAL_VARS="DEPEND_x86_64" |
14 | |
15 | DEPEND="$(marchdepend) |
16 | >= dev-lang/perl-5.20 |
17 | >= dev-libs/libffi-3.0.13 |
18 | == sys-libs/libstdc++-4.8.3" |
19 | |
20 | SDEPEND=">= dev-util/pkgconfig-0.25 |
21 | >= sys-dev/bison-2.5 |
22 | >= sys-dev/flex-2.3.35 |
23 | >= sys-dev/make-3.82 |
24 | == sys-dev/gcc-4.8.3 |
25 | >= sys-dev/binutils-2.24 |
26 | >= virtual/sed" |
27 | |
28 | SRCFILE="${PNAME}-${PVER}.src.tar.gz" |
29 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}.src" |
30 | |
31 | #MANPAGES_SRCFILE="${PNAME}-${PVER}-manpages.tar.bz2" |
32 | #MANPAGES_SRCDIR="${BUILDDIR}/${PNAME}-${PVER}-manpages" |
33 | MANPAGES_SRCFILE="${PNAME}-3.4-manpages.tar.bz2" |
34 | MANPAGES_SRCDIR="${BUILDDIR}/${PNAME}-3.4-manpages" |
35 | |
36 | sminclude mtools multilib |
37 | msetfeature "!check" |
38 | |
39 | SRC_URI=( |
40 | http://llvm.org/releases/${PVER}/${SRCFILE} |
41 | mirror://${PNAME}/${SRCFILE} |
42 | mirror://${PNAME}/${MANPAGES_SRCFILE} |
43 | ) |
44 | |
45 | UP2DATE="updatecmd ${HOMEPAGE} | grep 'Download now' | sed 's:.*][lL][lL][vV][mM]\ \(.*\):\1:'" |
46 | |
47 | src_prepare() |
48 | { |
49 | munpack ${SRCFILE} || die |
50 | # pre-generated man-pages |
51 | oldmunpack ${MANPAGES_SRCFILE} || die |
52 | |
53 | # fix symbolic links from OCaml bindings to LLVM libraries |
54 | all-abis 'sed -i "s:\$(PROJ_libdir):/usr/$(mlibdir)/llvm:" bindings/ocaml/Makefile.ocaml || die' |
55 | |
56 | # non-standard configure, fix config pathes and cflags |
57 | all-abis 'sed -i -e "s:\$(PROJ_prefix)/etc/llvm:/etc/llvm:" |
58 | -e "s:\$(PROJ_prefix)/lib:\$(PROJ_prefix)/$(mlibdir)/llvm:" |
59 | -e "s:\$(PROJ_prefix)/docs/llvm:\$(PROJ_prefix)/share/doc/${PNAME}-${PVER}:" |
60 | Makefile.config.in || die' |
61 | all-abis 'sed -i "/ActiveLibDir = ActivePrefix/s:lib:$(mlibdir)/llvm:" tools/llvm-config/llvm-config.cpp || die' |
62 | all-abis 'sed -i "s:LLVM_LIBDIR=\"\${prefix}/lib\":LLVM_LIBDIR=\"\${prefix}/$(mlibdir)/llvm\":" autoconf/configure.ac configure || die' |
63 | |
64 | # remove insecure rpath |
65 | all-abis 'sed -i "s:\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\|ExmplDir\))::g" Makefile.rules || die' |
66 | |
67 | # fix gold |
68 | all-abis 'sed -i "s:\$(SharedLibDir):/usr/$(mlibdir)/llvm:" tools/gold/Makefile || die' |
69 | |
70 | # ugly hack - fix broken path retrieval on magellan - fixme! |
71 | all-abis 'sed -i "s:CurrentPath(GetExecutablePath(argv\[0\]).str()):CurrentPath(\"/usr/bin/llvm-config\"):" tools/llvm-config/llvm-config.cpp || die' |
72 | } |
73 | |
74 | src_compile() |
75 | { |
76 | local myopts |
77 | |
78 | # enable pic on 64bit arches |
79 | [[ ${ARCH} = x86_64 ]] && myopts+="--enable-pic" |
80 | |
81 | # be multilib friendly |
82 | [[ $(mlibdir) != lib ]] && myopts+=" --with-cxx-include-32bit-dir=32" |
83 | |
84 | # include location of libffi headers |
85 | export CPPFLAGS="${CPPFLAGS} $(pkg-config --cflags libffi)" |
86 | |
87 | # force use of gcc instead of clang if already installed |
88 | CC=$(mabi-cc) CXX=$(mabi-cxx) \ |
89 | mconfigure \ |
90 | --libdir=/usr/$(mlibdir)/llvm \ |
91 | --enable-shared \ |
92 | --disable-expensive-checks \ |
93 | --disable-debug-runtime \ |
94 | --disable-assertions \ |
95 | --enable-optimized \ |
96 | --enable-libffi \ |
97 | --enable-targets=all \ |
98 | --enable-bindings=none \ |
99 | --enable-experimental-targets=R600 \ |
100 | ${myopts} \ |
101 | || die |
102 | |
103 | mmake VERBOSE=1 REQUIRES_RTTI=1 || die |
104 | |
105 | # no python sphinx in out src tree, use pre-generated docs atm |
106 | # mmake -C docs -f Makefile.sphinx man html || die |
107 | } |
108 | |
109 | src_install() |
110 | { |
111 | mmake DESTDIR=${BINDIR} install || die |
112 | |
113 | # install pre-generated man-pages |
114 | minstallman ${MANPAGES_SRCDIR}/*.1 || die |
115 | |
116 | # be multilib friendly |
117 | if [[ $(mlibdir) != lib ]] |
118 | then |
119 | if [[ -f ${BINDIR}/usr/bin/llvm-config ]] |
120 | then |
121 | rm ${BINDIR}/usr/bin/llvm-config || die |
122 | fi |
123 | all-abis minstallexec Release/bin/llvm-config /usr/bin/llvm-config-$(mabi) || die |
124 | mlink multiarch-wrapper /usr/bin/llvm-config || die |
125 | |
126 | if [[ -f ${BINDIR}/usr/include/llvm/Config/config.h ]] |
127 | then |
128 | rm ${BINDIR}/usr/include/llvm/Config/config.h || die |
129 | fi |
130 | all-abis minstallfile include/llvm/Config/config.h /usr/include/llvm/Config/config-$(mabi).h || die |
131 | cat > ${BINDIR}/usr/include/llvm/Config/config.h << EOF |
132 | #include <bits/wordsize.h> |
133 | |
134 | #if __WORDSIZE == 32 |
135 | #include "config-m32.h" |
136 | #elif __WORDSIZE == 64 |
137 | #include "config-m64.h" |
138 | #else |
139 | #error "Unknown word size" |
140 | #endif |
141 | EOF |
142 | |
143 | if [[ -f ${BINDIR}/usr/include/llvm/Config/llvm-config.h ]] |
144 | then |
145 | rm ${BINDIR}/usr/include/llvm/Config/llvm-config.h || die |
146 | fi |
147 | all-abis minstallfile include/llvm/Config/llvm-config.h /usr/include/llvm/Config/llvm-config-$(mabi).h || die |
148 | cat > ${BINDIR}/usr/include/llvm/Config/llvm-config.h << EOF |
149 | #include <bits/wordsize.h> |
150 | |
151 | #if __WORDSIZE == 32 |
152 | #include "llvm-config-m32.h" |
153 | #elif __WORDSIZE == 64 |
154 | #include "llvm-config-m64.h" |
155 | #else |
156 | #error "Unknown word size" |
157 | #endif |
158 | EOF |
159 | fi |
160 | } |