lld/lld.spec
2020-08-14 14:04:33 +03:00

104 lines
2.1 KiB
RPMSpec

%define major 10
%define libname %mklibname %{name} %{major}
%define devname %mklibname %{name} -d
%if %{mdvver} <= 201610
%bcond_without clang
%else
%bcond_with clang
%endif
%if %{with clang}
%define debug_package %{nil}
%endif
%bcond_without git
Summary: The LLVM Linker
Name: lld
Version: 10.0.1
Release: 2
Group: Development/Other
License: NCSA
Url: http://llvm.org
%if %{with git}
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{name}-%{version}.src.tar.xz
%else
Source0: http://releases.llvm.org/%{version}/%{name}-%{version}.src.tar.xz
%endif
BuildRequires: cmake
%if %{with clang}
BuildRequires: clang
BuildRequires: libcxx-devel
%endif
BuildRequires: llvm-devel = %{version}
BuildRequires: ncurses-devel
BuildRequires: zlib-devel
Requires: clang
Requires: llvm
Requires: llvm-plugins
%description
The LLVM project linker.
%files
%doc LICENSE.TXT
%{_bindir}/lld*
%{_bindir}/ld.lld
%{_bindir}/ld64.lld
%{_bindir}/wasm-ld
#-------------------------------------------------------------------------
%package -n %{libname}
Summary: LLD shared libraries
Group: System/Libraries
%description -n %{libname}
Shared libraries for LLD.
%files -n %{libname}
%doc LICENSE.TXT
%{_libdir}/lib%{name}*.so.%{major}*
#-------------------------------------------------------------------------
%package -n %{devname}
Summary: Libraries and header files for LLD
Group: Development/Other
Requires: %{libname} = %{EVRD}
Provides: %{name}-devel = %{EVRD}
%description -n %{devname}
This package contains library and header files needed to develop new native
programs that use the LLD infrastructure.
%files -n %{devname}
%doc LICENSE.TXT
%{_includedir}/lld
%{_libdir}/liblld*.so
#-------------------------------------------------------------------------
%prep
%setup -qn %{name}-%{version}.src
%build
%if %{with clang}
%clang_gcc_wrapper
export CC=clang
export CXX=clang++
%endif
%cmake \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DLLVM_DYLIB_COMPONENTS="all" \
%ifarch x86_64
-DLLVM_LIBDIR_SUFFIX=64
%else
-DLLVM_LIBDIR_SUFFIX=
%endif
%make -s
%install
%makeinstall_std -C build