From ee1d2a43bef5efa6ea1685aa00a0736309b3d2ee Mon Sep 17 00:00:00 2001 From: Chenxi Mao Date: Thu, 13 Apr 2023 21:34:21 +0800 Subject: [PATCH] Support build with clang Signed-off-by: Chenxi Mao --- bzip2.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bzip2.spec b/bzip2.spec index 689ef81..7199f3d 100644 --- a/bzip2.spec +++ b/bzip2.spec @@ -1,6 +1,6 @@ Name: bzip2 Version: 1.0.8 -Release: 5 +Release: 6 Summary: A high-quality data compressor License: BSD @@ -37,12 +37,21 @@ header files for bzip2 %autosetup -n %{name}-%{version} -p1 %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 "CFLAGS=%{optflags} -fpic -fPIC -Winline -D_FILE_OFFSET_BITS=64" +%endif %install 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} +%endif # Default install path is /usr/bin lib man, change dest dirs here. pushd %{buildroot}%{_prefix} @@ -90,6 +99,9 @@ make check %{_mandir}/man1/b*.1.gz %changelog +* Thu Apr 13 2023 Chenxi Mao - 1.0.8-6 +- Support build with clang. + * Tue Sep 20 2022 zhoupengcheng - 1.0.8-5 - Delete redundant .so files