summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2013-07-03 21:17:16 +0000
committerAlexis Ballier <aballier@gentoo.org>2013-07-03 21:17:16 +0000
commitcf44f4840c4a4e7bc4d82d622b96bdca4f16b5b6 (patch)
tree0cdbd16d45e36ce293f68379e579f9d86633c720 /sys-libs/libcxx
parentFix indenting (diff)
downloadgentoo-2-cf44f4840c4a4e7bc4d82d622b96bdca4f16b5b6.tar.gz
gentoo-2-cf44f4840c4a4e7bc4d82d622b96bdca4f16b5b6.tar.bz2
gentoo-2-cf44f4840c4a4e7bc4d82d622b96bdca4f16b5b6.zip
Use a simple Makefile instead of cmake for building it and drop our patches. It no longer needs to be built with clang.
(Portage version: 2.2.0_alpha186/cvs/Linux x86_64, signed Manifest commit with key 160F534A)
Diffstat (limited to 'sys-libs/libcxx')
-rw-r--r--sys-libs/libcxx/ChangeLog7
-rw-r--r--sys-libs/libcxx/files/Makefile38
-rw-r--r--sys-libs/libcxx/libcxx-9999.ebuild66
3 files changed, 72 insertions, 39 deletions
diff --git a/sys-libs/libcxx/ChangeLog b/sys-libs/libcxx/ChangeLog
index def2890458e7..cd8612ec5d53 100644
--- a/sys-libs/libcxx/ChangeLog
+++ b/sys-libs/libcxx/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-libs/libcxx
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/ChangeLog,v 1.22 2013/07/03 18:38:26 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/ChangeLog,v 1.23 2013/07/03 21:17:16 aballier Exp $
+
+ 03 Jul 2013; Alexis Ballier <aballier@gentoo.org> libcxx-9999.ebuild,
+ +files/Makefile:
+ Use a simple Makefile instead of cmake for building it and drop our patches.
+ It no longer needs to be built with clang.
03 Jul 2013; Alexis Ballier <aballier@gentoo.org> libcxx-9999.ebuild:
inherit base before subversion to get a correct src_unpack, bug #475598 by
diff --git a/sys-libs/libcxx/files/Makefile b/sys-libs/libcxx/files/Makefile
new file mode 100644
index 000000000000..029e7295b889
--- /dev/null
+++ b/sys-libs/libcxx/files/Makefile
@@ -0,0 +1,38 @@
+CXXFLAGS+=-std=c++11 -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
+ -Wpadded -Wstrict-aliasing=2 -Wstrict-overflow=4
+
+SRCDIR=..
+LIB=libc++
+STATIC=libc++.a
+MAJOR=1
+MINOR=0
+SHEXT?=.so
+SHLIB=$(LIB)$(SHEXT).$(MAJOR).$(MINOR)
+SONAME=$(LIB)$(SHEXT).$(MAJOR)
+
+SRC=$(wildcard $(SRCDIR)/src/*.cpp)
+OBJ=$(SRC:$(SRCDIR)/src/%.cpp=%.o)
+SOBJ=$(SRC:$(SRCDIR)/src/%.cpp=%.So)
+
+
+%.So: $(SRCDIR)/src/%.cpp
+ $(CXX) -I$(SRCDIR)/include $(CPPFLAGS) $(CXXFLAGS) -fPIC -nostdinc++ -c $< -o $@
+
+%.o: $(SRCDIR)/src/%.cpp
+ $(CXX) -I$(SRCDIR)/include $(CPPFLAGS) $(CXXFLAGS) -nostdinc++ -c $< -o $@
+
+$(STATIC): $(OBJ)
+ $(AR) cr $@ $^
+
+static: $(STATIC)
+
+$(SHLIB): $(SOBJ)
+ $(CXX) -fPIC -nodefaultlibs $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ $(LIBS)
+
+$(SONAME): $(SHLIB)
+ ln -s $< $@
+
+$(LIB)$(SHEXT): $(SONAME)
+ ln -s $< $@
+
+shared: $(SHLIB) $(SONAME) $(LIB)$(SHEXT)
diff --git a/sys-libs/libcxx/libcxx-9999.ebuild b/sys-libs/libcxx/libcxx-9999.ebuild
index 853b7863c625..2b448f475f12 100644
--- a/sys-libs/libcxx/libcxx-9999.ebuild
+++ b/sys-libs/libcxx/libcxx-9999.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/libcxx-9999.ebuild,v 1.14 2013/07/03 18:38:26 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/libcxx-9999.ebuild,v 1.15 2013/07/03 21:17:16 aballier Exp $
EAPI=5
@@ -8,7 +8,7 @@ ESVN_REPO_URI="http://llvm.org/svn/llvm-project/libcxx/trunk"
[ "${PV%9999}" != "${PV}" ] && SCM="subversion" || SCM=""
-inherit cmake-utils base ${SCM} flag-o-matic toolchain-funcs multilib
+inherit ${SCM} flag-o-matic toolchain-funcs multilib
DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
HOMEPAGE="http://libcxx.llvm.org/"
@@ -25,64 +25,47 @@ if [ "${PV%9999}" = "${PV}" ] ; then
else
KEYWORDS=""
fi
-IUSE="elibc_glibc +libcxxrt static-libs"
+IUSE="elibc_glibc +libcxxrt static-libs test"
RDEPEND="libcxxrt? ( >=sys-libs/libcxxrt-0.0_p20130530[static-libs?] )
!libcxxrt? ( sys-devel/gcc[cxx] )"
DEPEND="${RDEPEND}
- sys-devel/clang
+ test? ( sys-devel/clang )
app-arch/xz-utils"
-PATCHES=( "${FILESDIR}/multilib.patch" )
-DOCS=( "CREDITS.TXT" )
-
src_prepare() {
- use libcxxrt && PATCHES+=( "${FILESDIR}/cxxrt.patch" )
- base_src_prepare
+ cp -f "${FILESDIR}/Makefile" lib/ || die
}
-src_configure() {
- local mycmakeargs_base=( )
+src_compile() {
+ export LIBS="-lpthread -lrt -lc -lgcc_s"
if use libcxxrt ; then
- mycmakeargs_base=(
- -DLIBCXX_CXX_ABI=libcxxrt
- -DLIBCXX_LIBCXXRT_INCLUDE_PATHS="/usr/include/libcxxrt/"
- )
+ append-cppflags -DLIBCXXRT "-I${EPREFIX}/usr/include/libcxxrt/"
+ LIBS="-lcxxrt ${LIBS}"
else
# Very hackish, see $HOMEPAGE
# If someone has a clever idea, please share it!
- local includes="$(echo | "$(tc-getCXX)" -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | tr '\n' ';' | tr -d ' ')"
- mycmakeargs_base=(
- -DLIBCXX_CXX_ABI=libsupc++
- -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="${includes}"
- )
+ local includes="$(echo | "$(tc-getCXX)" -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | sed -e 's/^ /-I/' | tr '\n' ' ')"
+ append-cppflags -D__GLIBCXX__ ${includes}
+ LIBS="-lsupc++ ${LIBS}"
fi
- # Needs to be built with clang. gcc-4.6.3 fails at least.
- # TODO: cross-compile ?
- export CC="clang"
- export CXX="clang++"
+ tc-export AR CC CXX
- if use static-libs ; then
- local mycmakeargs=( "${mycmakeargs_base[@]}" "-DLIBCXX_ENABLE_SHARED=OFF" )
- BUILD_DIR="${S}_static" cmake-utils_src_configure
- fi
- local mycmakeargs=( "${mycmakeargs_base[@]}" )
- BUILD_DIR="${S}_shared" cmake-utils_src_configure
-}
+ append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
-src_compile() {
- use static-libs && BUILD_DIR="${S}_static" cmake-utils_src_compile
- BUILD_DIR="${S}_shared" cmake-utils_src_compile
+ cd "${S}/lib" || die
+ emake shared
+ use static-libs && emake static
}
# Tests fail for now, if anybody is able to fix them, help is very welcome.
src_test() {
cd "${S}/test"
- LD_LIBRARY_PATH="${S}_shared/lib:${LD_LIBRARY_PATH}" \
+ LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" \
CC="clang++" \
HEADER_INCLUDE="-I${S}/include" \
- SOURCE_LIB="-L${S}_shared/lib" \
+ SOURCE_LIB="-L${S}/lib" \
LIBS="-lm" \
./testit || die
}
@@ -117,11 +100,18 @@ END_LDSCRIPT
}
src_install() {
+ cd "${S}/lib"
if use static-libs ; then
- BUILD_DIR="${S}_static" cmake-utils_src_install
+ dolib.a libc++.a
gen_static_ldscript
fi
- BUILD_DIR="${S}_shared" cmake-utils_src_install
+ dolib.so libc++.so*
+
+ cd "${S}"
+ insinto /usr/include/c++/v1
+ doins -r include/*
+
+ dodoc CREDITS.TXT
}
pkg_postinst() {