blob: 2a42a0d280b299dc3e2aaf09e36450e3eb100ae4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxxrt/libcxxrt-9999.ebuild,v 1.7 2013/06/01 12:58:41 aballier Exp $
EAPI=5
EGIT_REPO_URI="git://github.com/pathscale/libcxxrt.git"
[ "${PV%9999}" != "${PV}" ] && SCM="git-2" || SCM=""
inherit base flag-o-matic toolchain-funcs portability ${SCM}
DESCRIPTION="C++ Runtime from PathScale, FreeBSD and NetBSD."
HOMEPAGE="https://github.com/pathscale/libcxxrt http://www.pathscale.com/node/265"
if [ "${PV%9999}" = "${PV}" ] ; then
SRC_URI="mirror://gentoo/${P}.tar.xz"
DEPEND="app-arch/xz-utils"
else
SRC_URI=""
fi
LICENSE="BSD-2"
SLOT="0"
if [ "${PV%9999}" = "${PV}" ] ; then
KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
else
KEYWORDS=""
fi
IUSE="libunwind static-libs"
RDEPEND="libunwind? ( >=sys-libs/libunwind-1.0.1-r1[static-libs?] )"
DEPEND="${RDEPEND}
${DEPEND}"
src_prepare() {
base_src_prepare
cp "${FILESDIR}/Makefile" src/ || die
cp "${FILESDIR}/Makefile.test" test/Makefile || die
}
src_compile() {
# Notes: we build -nodefaultlibs to avoid linking to gcc libs.
# libcxxrt needs: dladdr (dlopen_lib), libunwind or libgcc_s and the libc.
tc-export CC CXX AR
append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
cd "${S}/src"
LIBS="$(dlopen_lib) -l$(usex libunwind unwind gcc_s) -lc" emake shared
use static-libs && emake static
}
src_test() {
cd "${S}/test"
LD_LIBRARY_PATH="${S}/src:${LD_LIBRARY_PATH}" LIBS="-L${S}/src -lcxxrt -lc" emake check
}
src_install() {
# TODO: See README. Maybe hide it in a subdir and let only libcxx know about
# it. FreeBSD head installs it in /lib
dolib.so src/${PN}.so*
use static-libs && dolib.a src/${PN}.a
insinto /usr/include/libcxxrt/
doins src/cxxabi.h src/unwind*.h
dodoc AUTHORS COPYRIGHT README
}
|