f56b59e
# If you need to bootstrap this, turn this on.
f56b59e
# Otherwise, you have a loop with libcxxabi
5ac45bb
%global bootstrap 0
f56b59e
f56b59e
Name:		libcxx
d0d0df8
Version:	4.0.0
d8ba11b
Release:	1%{?dist}
f56b59e
Summary:	C++ standard library targeting C++11
f56b59e
License:	MIT or NCSA
f56b59e
URL:		http://libcxx.llvm.org/
f56b59e
Source0:	http://llvm.org/releases/%{version}/libcxx-%{version}.src.tar.xz
f56b59e
BuildRequires:	clang llvm-devel cmake
f56b59e
%if %{bootstrap} < 1
f56b59e
BuildRequires:	libcxxabi-devel
947aaa0
BuildRequires:	python3
f56b59e
%endif
f56b59e
# PPC64 (on EL7) doesn't like this code.
f56b59e
# /builddir/build/BUILD/libcxx-3.8.0.src/include/thread:431:73: error: '(9.223372036854775807e+18 / 1.0e+9)' is not a constant expression
f56b59e
# _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
311df88
%if 0%{?rhel}
f56b59e
ExcludeArch:	ppc64 ppc64le
311df88
%endif
f56b59e
f56b59e
%description
f56b59e
libc++ is a new implementation of the C++ standard library, targeting C++11.
f56b59e
f56b59e
%package devel
f56b59e
Summary:	Headers and libraries for libcxx devel
f56b59e
Requires:	%{name}%{?_isa} = %{version}-%{release}
f56b59e
%if %{bootstrap} < 1
f56b59e
Requires:	libcxxabi-devel
f56b59e
%endif
f56b59e
f56b59e
f56b59e
%description devel
f56b59e
%{summary}.
f56b59e
f56b59e
%prep
f56b59e
%setup -q -n %{name}-%{version}.src
f56b59e
f56b59e
%build
f56b59e
mkdir _build
f56b59e
cd _build
311df88
%ifarch s390 s390x
f0aa13e
%if 0%{?fedora} < 26
311df88
# clang requires z10 at minimum
311df88
# workaround until we change the defaults for Fedora
311df88
%global optflags %(echo %{optflags} | sed 's/-march=z9-109 /-march=z10 /')
311df88
%endif
f0aa13e
%endif
f190f97
export LDFLAGS="-Wl,--build-id"
f56b59e
# Clang in older releases than f24 can't build this code without crashing.
f56b59e
# So, we use gcc there. But the really old version in RHEL 6 works. Huh.
f56b59e
%cmake .. \
f56b59e
%if 0%{?rhel} == 6
f56b59e
	-DCMAKE_C_COMPILER=/usr/bin/clang \
f56b59e
	-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
f56b59e
%else
f56b59e
%if 0%{?fedora} >= 24
f56b59e
	-DCMAKE_C_COMPILER=/usr/bin/clang \
f56b59e
	-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
f56b59e
%else
f56b59e
	-DCMAKE_C_COMPILER=/usr/bin/gcc \
f56b59e
	-DCMAKE_CXX_COMPILER=/usr/bin/g++ \
f56b59e
%endif
f56b59e
%endif
f56b59e
	-DLLVM_CONFIG=%{_bindir}/llvm-config \
f56b59e
%if %{bootstrap} < 1
f56b59e
	-DLIBCXX_CXX_ABI=libcxxabi \
f56b59e
	-DLIBCXX_CXX_ABI_INCLUDE_PATHS=%{_includedir} \
947aaa0
	-DPYTHONINTERP_FOUND=ON \
947aaa0
	-DPYTHON_EXECUTABLE=%{_bindir}/python3 \
947aaa0
	-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \
f56b59e
%endif
e39e1ea
%if 0%{?__isa_bits} == 64
f56b59e
	-DLIBCXX_LIBDIR_SUFFIX:STRING=64 \
f56b59e
%endif
f56b59e
	-DCMAKE_BUILD_TYPE=RelWithDebInfo
f56b59e
f56b59e
f56b59e
make %{?_smp_mflags}
f56b59e
f56b59e
%install
f56b59e
cd _build
f56b59e
make install DESTDIR=%{buildroot}
f56b59e
f56b59e
%post -p /sbin/ldconfig
f56b59e
f56b59e
%postun -p /sbin/ldconfig
f56b59e
f56b59e
%files
f56b59e
%license LICENSE.TXT
f56b59e
%doc CREDITS.TXT TODO.TXT
f56b59e
%{_libdir}/libc++.so.*
f56b59e
f56b59e
%files devel
f56b59e
%{_includedir}/c++/
f56b59e
%{_libdir}/libc++.so
f56b59e
f56b59e
%changelog
d0d0df8
* Sat Apr 22 2017 Tom Callaway <spot@fedoraproject.org> - 4.0.0-1
d0d0df8
- update to 4.0.0
d0d0df8
d8ba11b
* Wed Mar  8 2017 Tom Callaway <spot@fedoraproject.org> - 3.9.1-1
d8ba11b
- update to 3.9.1
d8ba11b
947aaa0
* Fri Mar  3 2017 Tom Callaway <spot@fedoraproject.org> - 3.9.0-4
947aaa0
- LIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON
947aaa0
5ac45bb
* Wed Mar  1 2017 Tom Callaway <spot@fedoraproject.org> - 3.9.0-3
5ac45bb
- disable bootstrap
5ac45bb
f0aa13e
* Tue Feb 21 2017 Dan Horák <dan[at]danny.cz> - 3.9.0-2
f0aa13e
- apply s390(x) workaround only in Fedora < 26
f0aa13e
f190f97
* Mon Feb 20 2017 Tom Callaway <spot@fedoraproject.org> - 3.9.0-1
f190f97
- update to 3.9.0 (match clang)
f190f97
71d7381
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.1-2
71d7381
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
71d7381
39f1942
* Fri Aug 26 2016 Tom Callaway <spot@fedoraproject.org> - 3.8.1-1
39f1942
- update to 3.8.1
39f1942
311df88
* Thu Jun 09 2016 Dan Horák <dan[at]danny.cz> - 3.8.0-4
311df88
- exclude Power only in EPEL
311df88
- default to z10 on s390(x)
311df88
f56b59e
* Thu May 19 2016 Tom Callaway <spot@fedoraproject.org> - 3.8.0-3
f56b59e
- use gcc on el7, fedora < 24. use clang on el6 and f24+
f56b59e
  MAGIC.
f56b59e
- bootstrap on
f56b59e
f56b59e
* Tue May 3 2016 Tom Callaway <spot@fedoraproject.org> - 3.8.0-2
f56b59e
- bootstrap off
f56b59e
f56b59e
* Tue May 3 2016 Tom Callaway <spot@fedoraproject.org> - 3.8.0-1
f56b59e
- initial package
f56b59e
- bootstrap on