Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 475294 | Differences between
and this patch

Collapse All | Expand All

(-)a/libcxx-0.0_p20130531-r1.ebuild (-16 / +44 lines)
Lines 8-14 ESVN_REPO_URI="http://llvm.org/svn/llvm-project/libcxx/trunk" Link Here
8
8
9
[ "${PV%9999}" != "${PV}" ] && SCM="subversion" || SCM=""
9
[ "${PV%9999}" != "${PV}" ] && SCM="subversion" || SCM=""
10
10
11
inherit cmake-utils ${SCM} base flag-o-matic toolchain-funcs multilib
11
inherit cmake-utils cmake-multilib ${SCM} base flag-o-matic toolchain-funcs multilib multilib-build
12
12
13
DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
13
DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
14
HOMEPAGE="http://libcxx.llvm.org/"
14
HOMEPAGE="http://libcxx.llvm.org/"
Lines 33-44 DEPEND="${RDEPEND} Link Here
33
	sys-devel/clang
33
	sys-devel/clang
34
	app-arch/xz-utils"
34
	app-arch/xz-utils"
35
35
36
PATCHES=( "${FILESDIR}/multilib.patch" )
36
PATCHES=( "${FILESDIR}/multilib.patch"
37
	"${FILESDIR}/${PN}-0.0_p20130531-minimal-build.patch" )
37
DOCS=( "CREDITS.TXT" )
38
DOCS=( "CREDITS.TXT" )
38
39
40
minimal_build_libcxx(){
41
	cd ${BUILD_DIR}/lib
42
	case ${ABI} in
43
		x86|x86_fbsd)	local append_opt="-m32" ;;
44
	esac
45
	CC="clang -nostdlib ${append_opt}" CXX="clang++ -nostdlib ${append_opt}" ./buildit
46
	append-ldflags "-L${BUILD_DIR}/lib"
47
}
48
39
src_prepare() {
49
src_prepare() {
40
	use libcxxrt && PATCHES+=( "${FILESDIR}/cxxrt.patch" )
50
	use libcxxrt && PATCHES+=( "${FILESDIR}/cxxrt.patch" )
41
	base_src_prepare
51
	base_src_prepare
52
	multilib_copy_sources
53
	multilib_foreach_abi minimal_build_libcxx
42
}
54
}
43
55
44
src_configure() {
56
src_configure() {
Lines 61-90 src_configure() { Link Here
61
	# Needs to be built with clang. gcc-4.6.3 fails at least.
73
	# Needs to be built with clang. gcc-4.6.3 fails at least.
62
	# TODO: cross-compile ?
74
	# TODO: cross-compile ?
63
	export CC="clang"
75
	export CC="clang"
64
	export CXX="clang++"
76
	export CXX="clang++ -stdlib=libc++"
65
77
66
	if use static-libs ; then
78
	if use static-libs ; then
67
		local mycmakeargs=( "${mycmakeargs_base[@]}" "-DLIBCXX_ENABLE_SHARED=OFF" )
79
		local mycmakeargs=( "${mycmakeargs_base[@]}" "-DLIBCXX_ENABLE_SHARED=OFF" )
68
		BUILD_DIR="${S}_static"	cmake-utils_src_configure
80
		BUILD_DIR="${S}_static"	cmake-multilib_src_configure
69
	fi
81
	fi
70
	local mycmakeargs=( "${mycmakeargs_base[@]}" )
82
	local mycmakeargs=( "${mycmakeargs_base[@]}" )
71
	BUILD_DIR="${S}_shared" cmake-utils_src_configure
83
	BUILD_DIR="${S}_shared" cmake-multilib_src_configure
72
}
84
}
73
85
74
src_compile() {
86
src_compile() {
75
	use static-libs && BUILD_DIR="${S}_static" cmake-utils_src_compile
87
	use static-libs && BUILD_DIR="${S}_static" cmake-multilib_src_compile
76
	BUILD_DIR="${S}_shared" cmake-utils_src_compile
88
	BUILD_DIR="${S}_shared" cmake-multilib_src_compile
77
}
89
}
78
90
79
# Tests fail for now, if anybody is able to fix them, help is very welcome.
91
# Tests fail for now, if anybody is able to fix them, help is very welcome.
80
src_test() {
92
src_test() {
81
	cd "${S}/test"
93
	do_libcxx_multilib_test(){
82
	LD_LIBRARY_PATH="${S}_shared/lib:${LD_LIBRARY_PATH}" \
94
		cp -rp "${S}"/test/* "${BUILD_DIR}"/test/
95
		cd "${BUILD_DIR}/test"
96
97
		case ${ABI} in
98
			x86|x86_fbsd)	local append_opt="-m32" ;;
99
		esac
100
101
		if [[ ${ABI} == x86_fbsd ]] ; then
102
			export LD_32_LIBRARY_PATH="${BUILD_DIR}/lib:${LD_LIBRARY_PATH}"
103
		else
104
			export LD_LIBRARY_PATH="${BUILD_DIR}/lib:${LD_LIBRARY_PATH}"
105
		fi
106
83
		CC="clang++" \
107
		CC="clang++" \
84
		HEADER_INCLUDE="-I${S}/include" \
108
			OPTIONS="${append_opt} -std=c++0x -stdlib=libc++" \
85
		SOURCE_LIB="-L${S}_shared/lib" \
109
			HEADER_INCLUDE="-I${BUILD_DIR}/include" \
86
		LIBS="-lm" \
110
			SOURCE_LIB="-L${BUILD_DIR}/lib" \
87
		./testit || die
111
			LIBS="-lm" \
112
			./testit || die
113
	}
114
115
	BUILD_DIR="${S}_shared" multilib_foreach_abi do_libcxx_multilib_test
88
}
116
}
89
117
90
gen_static_ldscript() {
118
gen_static_ldscript() {
Lines 118-127 END_LDSCRIPT Link Here
118
146
119
src_install() {
147
src_install() {
120
	if use static-libs ; then
148
	if use static-libs ; then
121
		BUILD_DIR="${S}_static" cmake-utils_src_install
149
		BUILD_DIR="${S}_static" cmake-multilib_src_install
122
		gen_static_ldscript
150
		multilib_foreach_abi gen_static_ldscript
123
	fi
151
	fi
124
	BUILD_DIR="${S}_shared" cmake-utils_src_install
152
	BUILD_DIR="${S}_shared" cmake-multilib_src_install
125
}
153
}
126
154
127
pkg_postinst() {
155
pkg_postinst() {

Return to bug 475294