/[gentoo-x86]/sys-devel/clang/clang-2.6-r1.ebuild
Gentoo

Contents of /sys-devel/clang/clang-2.6-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Thu Mar 18 21:33:10 2010 UTC (4 years, 5 months ago) by voyageur
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
Remove forced -O3 -fomit-frame-pointer CFLAGS, bug #308145
(Portage version: 2.2_rc67/cvs/Linux x86_64)

1 # Copyright 1999-2010 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.6-r1.ebuild,v 1.5 2010/01/28 00:32:05 voyageur Exp $
4
5 EAPI=2
6 inherit eutils python
7
8 DESCRIPTION="C language family frontend for LLVM"
9 HOMEPAGE="http://clang.llvm.org/"
10 # Fetching LLVM as well: see http://llvm.org/bugs/show_bug.cgi?id=4840
11 SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.tar.gz
12 http://llvm.org/releases/${PV}/${P}.tar.gz"
13
14 LICENSE="UoI-NCSA"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="debug +static-analyzer test"
18
19 # Note: for LTO support, clang will depend on binutils with gold plugins, and LLVM built after that - http://llvm.org/docs/GoldPlugin.html
20 DEPEND="static-analyzer? ( dev-lang/perl )
21 test? ( dev-util/dejagnu )"
22 RDEPEND="~sys-devel/llvm-${PV}"
23
24 S="${WORKDIR}/llvm-2.6"
25
26 src_prepare() {
27 mv "${WORKDIR}"/clang-2.6 "${S}"/tools/clang || die "clang source directory not found"
28
29 # Same as llvm doc patches
30 epatch "${FILESDIR}"/${PN}-2.6-fixdoc.patch
31
32 # multilib-strict
33 sed -e "/PROJ_headers/s#lib/clang/1.0#$(get_libdir)/clang/1.0#" \
34 -i tools/clang/lib/Headers/Makefile \
35 || die "clang Makefile failed"
36 # fix the static analyzer for in-tree install
37 sed -e 's/import ScanView/from clang \0/' \
38 -i tools/clang/tools/scan-view/scan-view \
39 || die "scan-view sed failed"
40 sed -e "/scanview.css\|sorttable.js/s#\$RealBin#/usr/share/${PN}#" \
41 -i tools/clang/utils/scan-build \
42 || die "scan-build sed failed"
43 # Broken test in 2.6, http://llvm.org/bugs/show_bug.cgi?id=5111
44 rm tools/clang/test/Analysis/retain-release.m
45
46 # From llvm src_prepare
47 einfo "Fixing install dirs"
48 sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(DESTDIR)$(PROJ_prefix)/share/doc/'${PF}, \
49 -e 's,^PROJ_etcdir.*,PROJ_etcdir := $(DESTDIR)/etc/llvm,' \
50 -e 's,^PROJ_libdir.*,PROJ_libdir := $(DESTDIR)/usr/'$(get_libdir), \
51 -i Makefile.config.in || die "Makefile.config sed failed"
52
53 einfo "Fixing rpath"
54 sed -e 's/\$(RPATH) -Wl,\$(\(ToolDir\|LibDir\))//g' -i Makefile.rules \
55 || die "rpath sed failed"
56 }
57
58 src_configure() {
59 local CONF_FLAGS=""
60
61 if use debug; then
62 CONF_FLAGS="${CONF_FLAGS} --disable-optimized"
63 einfo "Note: Compiling LLVM in debug mode will create huge and slow binaries"
64 # ...and you probably shouldn't use tmpfs, unless it can hold 900MB
65 else
66 CONF_FLAGS="${CONF_FLAGS} \
67 --enable-optimized \
68 --disable-assertions \
69 --disable-expensive-checks"
70 fi
71
72 if use amd64; then
73 CONF_FLAGS="${CONF_FLAGS} --enable-pic"
74 fi
75
76 # Skip llvm-gcc parts even if installed
77 CONF_FLAGS="${CONF_FLAGS} --with-llvmgccdir=/dev/null"
78
79 econf ${CONF_FLAGS} || die "econf failed"
80 }
81
82 src_compile() {
83 emake VERBOSE=1 KEEP_SYMBOLS=1 clang-only || die "emake failed"
84 }
85
86 src_test() {
87 cd "${S}"/tools/clang || die "cd clang failed"
88
89 echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
90 if ! emake -j1 VERBOSE=1 test; then
91 hasq test $FEATURES && die "Make test failed. See above for details."
92 hasq test $FEATURES || eerror "Make test failed. See above for details."
93 fi
94 }
95
96 src_install() {
97 cd "${S}"/tools/clang || die "cd clang failed"
98 emake KEEP_SYMBOLS=1 DESTDIR="${D}" install || die "install failed"
99
100 if use static-analyzer ; then
101 dobin utils/ccc-analyzer
102 dobin utils/scan-build
103
104 insinto /usr/share/${PN}
105 doins utils/scanview.css
106 doins utils/sorttable.js
107
108 cd tools/scan-view || die "cd scan-view failed"
109 dobin scan-view
110 python_version
111 insinto /usr/$(get_libdir)/python${PYVER}/site-packages/clang
112 doins Reporter.py Resources ScanView.py startfile.py
113 touch "${D}"/usr/$(get_libdir)/python${PYVER}/site-packages/clang/__init__.py
114 fi
115 }
116
117 pkg_postinst() {
118 python_version
119 python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/clang
120 }
121
122 pkg_postrm() {
123 python_mod_cleanup
124 }

  ViewVC Help
Powered by ViewVC 1.1.20