From e6f2d94f950556c15faa949be2ad3732731f1646 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Wed, 30 Jan 2019 00:59:39 +0300 Subject: [PATCH] Conditional usage of clang. Enable it to test building on ABF. --- samba.spec | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/samba.spec b/samba.spec index ba701c2..1f2b45f 100644 --- a/samba.spec +++ b/samba.spec @@ -31,6 +31,7 @@ %define sambaerrorsmajor 1 # Default options +%bcond_without clang %bcond_with doc %bcond_with cifs %bcond_without ads @@ -100,7 +101,7 @@ Summary: Samba SMB server Name: samba Version: 4.9.4 -Release: 5 +Release: 6 Epoch: 1 License: GPLv3+ Group: System/Servers @@ -135,10 +136,13 @@ Patch9: DEBIAN-s3-auth-ignore-create_builtin_guests-failing-without.patch Patch10: ROSA-vendor-version.patch Patch11: ROSA-smb-default-config.patch +%if %{with clang} +BuildRequires: clang lld +%else +BuildRequires: gcc +%endif # Required for ldb docs BuildRequires: docbook-style-xsl -# For -fuse-ld -BuildRequires: gcc BuildRequires: gnupg BuildRequires: perl-Parse-Yapp BuildRequires: python-tdb @@ -1476,6 +1480,12 @@ sed -e 's/@ROSA_VENDOR_PATCH@/%{release}/g' -i VERSION %build install -d -m 0755 %{buildroot}/%{_libdir}/samba +%if %{with clang} +export CC=clang +export CXX=clang++ +export CPP=clang-cpp +%endif + export CFLAGS="-O2 -g" chmod +x ./buildtools/bin/waf