Annotation of /branches/magellan-next/core/llvm/llvm-2.9-r1.smage2
Parent Directory | Revision Log
Revision 9161 -
(hide annotations)
(download)
Tue Nov 8 12:16:45 2011 UTC (12 years, 6 months ago) by niro
File size: 3510 byte(s)
Tue Nov 8 12:16:45 2011 UTC (12 years, 6 months ago) by niro
File size: 3510 byte(s)
-fixed sed lines and added missing up2date
1 | niro | 9160 | # $Id$ |
2 | |||
3 | PNAME="llvm" | ||
4 | PVER="2.9" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | PCATEGORIE="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="\$(eval echo \\\$DEPEND_\${ARCH/i*86/x86} | tr ';' '\n') | ||
16 | >= dev-lang/perl-5.14 | ||
17 | >= dev-libs/libffi-3" | ||
18 | |||
19 | SDEPEND=">= dev-util/pkgconfig-0.25 | ||
20 | >= sys-dev/bison-2.5 | ||
21 | >= sys-dev/flex-2.3.35 | ||
22 | >= sys-dev/make-3.82 | ||
23 | >= sys-dev/gcc-4.6 | ||
24 | >= sys-dev/binutils-2.21" | ||
25 | |||
26 | SRCFILE="${PNAME}-${PVER}.tgz" | ||
27 | SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" | ||
28 | |||
29 | sminclude mtools multilib | ||
30 | |||
31 | SRC_URI=( | ||
32 | http://llvm.org/releases/${PVER}/${SRCFILE} | ||
33 | mirror://${PNAME}/${SRCFILE} | ||
34 | mirror://${PNAME}/${PNAME}-${PVER}-no-docs.patch | ||
35 | mirror://${PNAME}/${PNAME}-${PVER}-PR9869-operator-destructor.patch | ||
36 | ) | ||
37 | |||
38 | niro | 9161 | UP2DATE="updatecmd ${HOMEPAGE} | grep 'Download now' | sed 's:.*][lL][lL][vV][mM]\ \(.*\):\1:'" |
39 | niro | 9160 | |
40 | src_prepare() | ||
41 | { | ||
42 | munpack ${SRCFILE} || die | ||
43 | |||
44 | # non-standard configure, fix config pathes, rpath and cflags | ||
45 | niro | 9161 | all-abis 'sed -e "s,^PROJ_docsdir.*,PROJ_docsdir := \$(PROJ_prefix)/share/doc/${PNAME}-${PVER}," -e "s,^PROJ_etcdir.*,PROJ_etcdir := ''/etc/llvm," -e "s,^PROJ_libdir.*,PROJ_libdir := \$(PROJ_prefix)/$(mlibdir)/${PNAME}," -i Makefile.config.in || die' |
46 | all-abis 'sed -e "s,\$ABS_RUN_DIR/lib,/usr/$(mlibdir)/${PNAME}," -i tools/llvm-config/llvm-config.in.in || die' | ||
47 | all-abis 'sed -e "s,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),\$(RPATH) -Wl\,/usr/$(mlibdir)/${PNAME}," -e "/OmitFramePointer/s/-fomit-frame-pointer//" -i Makefile.rules || die' | ||
48 | niro | 9160 | |
49 | # do not generate docs, which are just the man pages | ||
50 | mpatch ${PNAME}-${PVER}-no-docs.patch || die | ||
51 | |||
52 | # operator.h incompatibility with gcc-4.6 in c++0x mode | ||
53 | # see http://llvm.org/bugs/show_bug.cgi?id=9869 | ||
54 | mpatch ${PNAME}-${PVER}-PR9869-operator-destructor.patch || die | ||
55 | } | ||
56 | |||
57 | src_compile() | ||
58 | { | ||
59 | cd ${SRCDIR} | ||
60 | |||
61 | local myopts | ||
62 | |||
63 | # enable pic on 64bit arches | ||
64 | [[ ${ARCH} = x86_64 ]] && myopts+="--enable-pic" | ||
65 | |||
66 | # be mutlilib friendly | ||
67 | [[ $(mlibdir) != lib ]] && myopts+=" --with-cxx-include-32bit-dir=32" | ||
68 | |||
69 | mconfigure \ | ||
70 | --enable-shared \ | ||
71 | --with-optimize-option= \ | ||
72 | --enable-optimized \ | ||
73 | --enable-libffi \ | ||
74 | --enable-bindings=none \ | ||
75 | ${myopts} \ | ||
76 | || die | ||
77 | |||
78 | mmake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 || die | ||
79 | } | ||
80 | |||
81 | src_install() | ||
82 | { | ||
83 | cd ${SRCDIR} | ||
84 | mmake DESTDIR=${BINDIR} KEEP_SYMBOLS=1 install || die | ||
85 | |||
86 | # be multilib friendly | ||
87 | if [[ $(mlibdir) != lib ]] | ||
88 | then | ||
89 | if [[ -f ${BINDIR}/usr/bin/llvm-config ]] | ||
90 | then | ||
91 | rm ${BINDIR}/usr/bin/llvm-config || die | ||
92 | fi | ||
93 | all-abis minstallexec llvm-config /usr/bin/llvm-config-$(mabi) || die | ||
94 | mlink multiarch-wrapper /usr/bin/llvm-config || die | ||
95 | |||
96 | if [[ -f ${BINDIR}/usr/include/llvm/Config/config.h ]] | ||
97 | then | ||
98 | rm ${BINDIR}/usr/include/llvm/Config/config.h || die | ||
99 | fi | ||
100 | all-abis minstallfile config.h /usr/include/llvm/Config/config-$(mabi) || die | ||
101 | cat > ${BINDIR}/usr/include/llvm/Config/config.h << EOF | ||
102 | #include <bits/wordsize.h> | ||
103 | |||
104 | #if __WORDSIZE == 32 | ||
105 | #include "config-32.h" | ||
106 | #elif __WORDSIZE == 64 | ||
107 | #include "config-64.h" | ||
108 | #else | ||
109 | #error "Unknown word size" | ||
110 | #endif | ||
111 | EOF | ||
112 | |||
113 | if [[ -f ${BINDIR}/usr/include/llvm/Config/llvm-config.h ]] | ||
114 | then | ||
115 | rm ${BINDIR}/usr/include/llvm/Config/llvm-config.h || die | ||
116 | fi | ||
117 | all-abis minstallfile config.h /usr/include/llvm/Config/llvm-config-$(mabi) || die | ||
118 | cat > ${BINDIR}/usr/include/llvm/Config/llvm-config.h << EOF | ||
119 | #include <bits/wordsize.h> | ||
120 | |||
121 | #if __WORDSIZE == 32 | ||
122 | #include "llvm-config-32.h" | ||
123 | #elif __WORDSIZE == 64 | ||
124 | #include "llvm-config-64.h" | ||
125 | #else | ||
126 | #error "Unknown word size" | ||
127 | #endif | ||
128 | EOF | ||
129 | fi | ||
130 | } |