tstellar / rpms / llvm

Forked from rpms/llvm 5 years ago
Clone
ca904f1
# Components enabled if supported by target architecture:
be655c4
%ifarch %ix86 x86_64
be655c4
  %bcond_without gold
434321d
%else
be655c4
  %bcond_with gold
434321d
%endif
23fedaf
ca904f1
Name:		llvm
ca904f1
Version:	3.7.1
8b72be4
Release:	7%{?dist}
ca904f1
Summary:	The Low Level Virtual Machine
97e156a
ca904f1
License:	NCSA
ca904f1
URL:		http://llvm.org
ca904f1
Source0:	http://llvm.org/releases/%{version}/%{name}-%{version}.src.tar.xz
cb91f5f
ca904f1
Source100:	llvm-config.h
3f23b32
8b72be4
# recognize s390 as SystemZ when configuring build
8b72be4
Patch0:		llvm-3.7.1-cmake-s390.patch
8b72be4
ca904f1
BuildRequires:	cmake
ca904f1
BuildRequires:	zlib-devel
a5a420c
BuildRequires:  libffi-devel
ca904f1
BuildRequires:	python3-sphinx
0b697ba
%if %{with gold}
0b697ba
BuildRequires:  binutils-devel
0b697ba
%endif
ca904f1
BuildRequires:  libstdc++-static
Bryan O'Sullivan d291b49
ca904f1
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
Bryan O'Sullivan d291b49
ca904f1
%description
ca904f1
LLVM is a compiler infrastructure designed for compile-time, link-time,
ca904f1
runtime, and idle-time optimization of programs from arbitrary programming
ca904f1
languages. The compiler infrastructure includes mirror sets of programming
ca904f1
tools as well as libraries with equivalent functionality.
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%package devel
ca904f1
Summary:	Libraries and header files for LLVM
ca904f1
Requires:	%{name}%{?_isa} = %{version}-%{release}
ca904f1
Requires(posttrans): %{_sbindir}/alternatives
ca904f1
Requires(posttrans): %{_sbindir}/alternatives
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%description devel
ca904f1
This package contains library and header files needed to develop new native
ca904f1
programs that use the LLVM infrastructure.
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%package doc
ca904f1
Summary:	Documentation for LLVM
ca904f1
BuildArch:	noarch
ca904f1
Requires:	%{name} = %{version}-%{release}
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%description doc
Bryan O'Sullivan d291b49
Documentation for the LLVM compiler infrastructure.
Bryan O'Sullivan d291b49
a8c599f
%package libs
ca904f1
Summary:	LLVM shared libraries
a8c599f
a8c599f
%description libs
a8c599f
Shared libraries for the LLVM compiler infrastructure.
a8c599f
7a85177
%package static
7a85177
Summary:	LLVM static libraries
7a85177
7a85177
%description static
7a85177
Static libraries for the LLVM compiler infrastructure.
7a85177
Bryan O'Sullivan d291b49
%prep
ca904f1
%setup -q -n %{name}-%{version}.src
8b72be4
%patch0 -p1 -b .s390
09ee2ab
Bryan O'Sullivan d291b49
%build
ca904f1
mkdir -p _build
ca904f1
cd _build
ca904f1
933aa47
# force off shared libs as cmake macros turns it on.
ca904f1
%cmake .. \
933aa47
	-DBUILD_SHARED_LIBS:BOOL=OFF \
ca904f1
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
ca904f1
	-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic -static-libstdc++" \
a95cfcf
%if 0%{?__isa_bits} == 64
ca904f1
	-DLLVM_LIBDIR_SUFFIX=64 \
be655c4
%else
ca904f1
	-DLLVM_LIBDIR_SUFFIX= \
98be43e
%endif
ca904f1
	\
1c8a6cd
	-DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;BPF;CppBackend" \
ca904f1
	-DLLVM_ENABLE_LIBCXX:BOOL=OFF \
ca904f1
	-DLLVM_ENABLE_ZLIB:BOOL=ON \
ca904f1
	-DLLVM_ENABLE_FFI:BOOL=ON \
ca904f1
	-DLLVM_ENABLE_RTTI:BOOL=ON \
be655c4
%if %{with gold}
ca904f1
	-DLLVM_BINUTILS_INCDIR=%{_includedir} \
ca904f1
%endif
ca904f1
	\
ca904f1
	-DLLVM_BUILD_RUNTIME:BOOL=ON \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_TOOLS:BOOL=ON \
ca904f1
	-DLLVM_BUILD_TOOLS:BOOL=ON \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_TESTS:BOOL=ON \
ca904f1
	-DLLVM_BUILD_TESTS:BOOL=ON \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_EXAMPLES:BOOL=ON \
ca904f1
	-DLLVM_BUILD_EXAMPLES:BOOL=OFF \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_UTILS:BOOL=ON \
ca904f1
	-DLLVM_INSTALL_UTILS:BOOL=OFF \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_DOCS:BOOL=ON \
ca904f1
	-DLLVM_BUILD_DOCS:BOOL=ON \
ca904f1
	-DLLVM_ENABLE_SPHINX:BOOL=ON \
ca904f1
	-DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
ca904f1
	\
933aa47
	-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
10a1975
	-DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
ca904f1
	-DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \
ca904f1
	-DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
ca904f1
	\
ca904f1
	-DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3
ca904f1
ca904f1
make %{?_smp_mflags}
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%install
ca904f1
cd _build
ca904f1
make install DESTDIR=%{buildroot}
9dd4cd3
ca904f1
# fix multi-lib
ca904f1
mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
ca904f1
mv -v %{buildroot}%{_includedir}/llvm/Config/llvm-config{,-%{__isa_bits}}.h
ca904f1
install -m 0644 %{SOURCE100} %{buildroot}%{_includedir}/llvm/Config/llvm-config.h
Bryan O'Sullivan 03bad00
a5a420c
%check
ca904f1
cd _build
ca904f1
make check-all || :
a5a420c
999f905
%post libs -p /sbin/ldconfig
999f905
%postun libs -p /sbin/ldconfig
194b08b
ca904f1
%post devel
ca904f1
%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config llvm-config %{_bindir}/llvm-config-%{__isa_bits} %{__isa_bits}
a5a420c
a5a420c
%postun devel
ca904f1
[ $1 -eq 0 ] && %{_sbindir}/update-alternatives --remove llvm-config %{_bindir}/llvm-config-%{__isa_bits}
a5a420c
Bryan O'Sullivan d291b49
%files
ca904f1
%{_bindir}/*
ca904f1
%{_mandir}/man1/*.1.*
a5a420c
%exclude %{_bindir}/llvm-config-%{__isa_bits}
ca904f1
%exclude %{_mandir}/man1/llvm-config.1.*
ca904f1
ca904f1
%files libs
ca904f1
%{_libdir}/*.so.*
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%files devel
a5a420c
%{_bindir}/llvm-config-%{__isa_bits}
ca904f1
%{_mandir}/man1/llvm-config.1.*
ca904f1
%{_includedir}/llvm
ca904f1
%{_includedir}/llvm-c
ca904f1
%{_libdir}/*.so
0242d4d
%{_datadir}/llvm/cmake
c6833e1
c6833e1
%files doc
ca904f1
%doc %{_pkgdocdir}/html
Bryan O'Sullivan d291b49
7a85177
%files static
7a85177
%{_libdir}/*.a
7a85177
Bryan O'Sullivan d291b49
%changelog
8b72be4
* Tue Feb 16 2016 Dan HorĂ¡k <dan[at][danny.cz> 3.7.1-7
8b72be4
- recognize s390 as SystemZ when configuring build
8b72be4
10a1975
* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-6
10a1975
- export C++ API for mesa.
10a1975
7a85177
* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-5
7a85177
- reintroduce llvm-static, clang needs it currently.
7a85177
933aa47
* Fri Feb 12 2016 Dave Airlie <airlied@redhat.com> 3.7.1-4
933aa47
- jump back to single llvm library, the split libs aren't working very well.
933aa47
d0a77df
* Fri Feb 05 2016 Dave Airlie <airlied@redhat.com> 3.7.1-3
d0a77df
- add missing obsoletes (#1303497)
d0a77df
4fb79db
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-2
4fb79db
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
4fb79db
ca904f1
* Thu Jan 07 2016 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.1-1
ca904f1
- new upstream release
ca904f1
- enable gold linker
7889508
ca904f1
* Wed Nov 04 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
ca904f1
- fix Requires for subpackages on the main package
Bryan O'Sullivan d291b49
ca904f1
* Tue Oct 06 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
ca904f1
- initial version using cmake build system