/[gentoo-x86]/sys-devel/llvm/llvm-3.1-r2.ebuild
Gentoo

Contents of /sys-devel/llvm/llvm-3.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Thu Jan 3 23:29:51 2013 UTC (23 months, 3 weeks ago) by voyageur
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +3 -4 lines
Update udis86 dep now that pic USE-flag is going away, bump EAPI in old packages when needed for the dep, bug #449812. Also clean ~arch 3.1 packages and update live ebuild EAPI

(Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key C74525F2)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.1-r2.ebuild,v 1.8 2012/12/17 19:53:50 maekke Exp $
4
5 EAPI="4"
6 PYTHON_DEPEND="2"
7 inherit eutils flag-o-matic multilib toolchain-funcs python pax-utils
8
9 DESCRIPTION="Low Level Virtual Machine"
10 HOMEPAGE="http://llvm.org/"
11 SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz"
12
13 LICENSE="UoI-NCSA"
14 SLOT="0"
15 KEYWORDS="amd64 arm ppc x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
16 IUSE="debug gold +libffi multitarget ocaml test udis86 vim-syntax"
17
18 DEPEND="dev-lang/perl
19 >=sys-devel/make-3.79
20 >=sys-devel/flex-2.5.4
21 >=sys-devel/bison-1.875d
22 || ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1 )
23 || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
24 gold? ( >=sys-devel/binutils-2.22[cxx] )
25 libffi? ( virtual/pkgconfig
26 virtual/libffi )
27 ocaml? ( dev-lang/ocaml )
28 udis86? ( dev-libs/udis86[pic(+)] )"
29 RDEPEND="dev-lang/perl
30 libffi? ( virtual/libffi )
31 vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )"
32
33 S=${WORKDIR}/${P}.src
34
35 pkg_setup() {
36 # Required for test and build
37 python_set_active_version 2
38 python_pkg_setup
39
40 # need to check if the active compiler is ok
41
42 broken_gcc=" 3.2.2 3.2.3 3.3.2 4.1.1 "
43 broken_gcc_x86=" 3.4.0 3.4.2 "
44 broken_gcc_amd64=" 3.4.6 "
45
46 gcc_vers=$(gcc-fullversion)
47
48 if [[ ${broken_gcc} == *" ${version} "* ]] ; then
49 elog "Your version of gcc is known to miscompile llvm."
50 elog "Check http://www.llvm.org/docs/GettingStarted.html for"
51 elog "possible solutions."
52 die "Your currently active version of gcc is known to miscompile llvm"
53 fi
54
55 if [[ ${CHOST} == i*86-* && ${broken_gcc_x86} == *" ${version} "* ]] ; then
56 elog "Your version of gcc is known to miscompile llvm on x86"
57 elog "architectures. Check"
58 elog "http://www.llvm.org/docs/GettingStarted.html for possible"
59 elog "solutions."
60 die "Your currently active version of gcc is known to miscompile llvm"
61 fi
62
63 if [[ ${CHOST} == x86_64-* && ${broken_gcc_amd64} == *" ${version} "* ]];
64 then
65 elog "Your version of gcc is known to miscompile llvm in amd64"
66 elog "architectures. Check"
67 elog "http://www.llvm.org/docs/GettingStarted.html for possible"
68 elog "solutions."
69 die "Your currently active version of gcc is known to miscompile llvm"
70 fi
71 }
72
73 src_prepare() {
74 # unfortunately ./configure won't listen to --mandir and the-like, so take
75 # care of this.
76 einfo "Fixing install dirs"
77 sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \
78 -e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \
79 -e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \
80 -i Makefile.config.in || die "Makefile.config sed failed"
81 sed -e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${PN}/" \
82 -i tools/llvm-config/llvm-config.cpp || die "llvm-config sed failed"
83
84 einfo "Fixing rpath and CFLAGS"
85 sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
86 -e '/OmitFramePointer/s/-fomit-frame-pointer//' \
87 -i Makefile.rules || die "rpath sed failed"
88 if use gold; then
89 sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \
90 -i tools/gold/Makefile || die "gold rpath sed failed"
91 fi
92
93 # Specify python version
94 python_convert_shebangs -r 2 test/Scripts
95
96 epatch "${FILESDIR}"/${PN}-2.6-commandguide-nops.patch
97 epatch "${FILESDIR}"/${PN}-2.9-nodoctargz.patch
98 epatch "${FILESDIR}"/${PN}-3.0-PPC_macro.patch
99 epatch "${FILESDIR}"/${P}-ivybridge_support.patch
100 epatch "${FILESDIR}"/${P}-fix_debug_line_info.patch
101 epatch "${FILESDIR}"/${P}-ExecutionEngine_tests_xfail_arm.patch
102
103 # Apply r600 OpenCL-related patches, bug #425688
104 epatch "${FILESDIR}"/cl-patches/*.patch
105
106 # User patches
107 epatch_user
108 }
109
110 src_configure() {
111 local CONF_FLAGS="--enable-shared
112 --with-optimize-option=
113 $(use_enable !debug optimized)
114 $(use_enable debug assertions)
115 $(use_enable debug expensive-checks)"
116
117 if use multitarget; then
118 CONF_FLAGS="${CONF_FLAGS} --enable-targets=all"
119 else
120 CONF_FLAGS="${CONF_FLAGS} --enable-targets=host,cpp"
121 fi
122
123 if use amd64; then
124 CONF_FLAGS="${CONF_FLAGS} --enable-pic"
125 fi
126
127 if use gold; then
128 CONF_FLAGS="${CONF_FLAGS} --with-binutils-include=${EPREFIX}/usr/include/"
129 fi
130 if use ocaml; then
131 CONF_FLAGS="${CONF_FLAGS} --enable-bindings=ocaml"
132 else
133 CONF_FLAGS="${CONF_FLAGS} --enable-bindings=none"
134 fi
135
136 if use udis86; then
137 CONF_FLAGS="${CONF_FLAGS} --with-udis86"
138 fi
139
140 if use libffi; then
141 append-cppflags "$(pkg-config --cflags libffi)"
142 fi
143 CONF_FLAGS="${CONF_FLAGS} $(use_enable libffi)"
144
145 # llvm prefers clang over gcc, so we may need to force that
146 tc-export CC CXX
147 econf ${CONF_FLAGS}
148 }
149
150 src_compile() {
151 emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1
152
153 pax-mark m Release/bin/lli
154 if use test; then
155 pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests
156 fi
157 }
158
159 src_install() {
160 emake KEEP_SYMBOLS=1 DESTDIR="${D}" install
161
162 if use vim-syntax; then
163 insinto /usr/share/vim/vimfiles/syntax
164 doins utils/vim/*.vim
165 fi
166
167 # Fix install_names on Darwin. The build system is too complicated
168 # to just fix this, so we correct it post-install
169 local lib= f= odylib=
170 if [[ ${CHOST} == *-darwin* ]] ; then
171 for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do
172 # libEnhancedDisassembly is Darwin10 only, so non-fatal
173 [[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue
174 ebegin "fixing install_name of $lib"
175 install_name_tool \
176 -id "${EPREFIX}"/usr/lib/${PN}/${lib} \
177 "${ED}"/usr/lib/${PN}/${lib}
178 eend $?
179 done
180 for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do
181 odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib)
182 ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
183 install_name_tool \
184 -change "${odylib}" \
185 "${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \
186 "${f}"
187 eend $?
188 done
189 fi
190 }

  ViewVC Help
Powered by ViewVC 1.1.20