!13 llvm平行宇宙计划:支持使用clang构建bzip2

From: @chenxi-mao 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
This commit is contained in:
openeuler-ci-bot 2023-04-18 01:14:05 +00:00 committed by Gitee
commit 69c2fe406f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,6 +1,6 @@
Name: bzip2 Name: bzip2
Version: 1.0.8 Version: 1.0.8
Release: 5 Release: 6
Summary: A high-quality data compressor Summary: A high-quality data compressor
License: BSD License: BSD
@ -37,12 +37,21 @@ header files for bzip2
%autosetup -n %{name}-%{version} -p1 %autosetup -n %{name}-%{version} -p1
%build %build
%if "%toolchain" == "clang"
%make_build -f Makefile-libbz2_so "CFLAGS=%{optflags} -Winline -fpic -fPIC -D_FILE_OFFSET_BITS=64" CC=clang AR=llvm-ar RANLIB=llvm-ranlib
%make_build "CFLAGS=%{optflags} -fpic -fPIC -Winline -D_FILE_OFFSET_BITS=64" CC=clang AR=llvm-ar RANLIB=llvm-ranlib
%else
%make_build -f Makefile-libbz2_so "CFLAGS=%{optflags} -Winline -fpic -fPIC -D_FILE_OFFSET_BITS=64" %make_build -f Makefile-libbz2_so "CFLAGS=%{optflags} -Winline -fpic -fPIC -D_FILE_OFFSET_BITS=64"
%make_build "CFLAGS=%{optflags} -fpic -fPIC -Winline -D_FILE_OFFSET_BITS=64" %make_build "CFLAGS=%{optflags} -fpic -fPIC -Winline -D_FILE_OFFSET_BITS=64"
%endif
%install %install
rm -rf %RPM_BUILD_ROOT rm -rf %RPM_BUILD_ROOT
%if "%toolchain" == "clang"
%make_install PREFIX=%{buildroot}%{_prefix} CC=clang AR=llvm-ar RANLIB=llvm-ranlib
%else
%make_install PREFIX=%{buildroot}%{_prefix} %make_install PREFIX=%{buildroot}%{_prefix}
%endif
# Default install path is /usr/bin lib man, change dest dirs here. # Default install path is /usr/bin lib man, change dest dirs here.
pushd %{buildroot}%{_prefix} pushd %{buildroot}%{_prefix}
@ -90,6 +99,9 @@ make check
%{_mandir}/man1/b*.1.gz %{_mandir}/man1/b*.1.gz
%changelog %changelog
* Thu Apr 13 2023 Chenxi Mao <chenxi.mao@suse.com> - 1.0.8-6
- Support build with clang.
* Tue Sep 20 2022 zhoupengcheng <zhoupengcheng11@huawei.com> - 1.0.8-5 * Tue Sep 20 2022 zhoupengcheng <zhoupengcheng11@huawei.com> - 1.0.8-5
- Delete redundant .so files - Delete redundant .so files