From 12d09539064e0624a8ac48fa6d1f2f6703329ad7 Mon Sep 17 00:00:00 2001 From: Suyun114 Date: Thu, 9 Jan 2025 15:05:44 +0800 Subject: [PATCH] Support for building with Clang --- linuxptp.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/linuxptp.spec b/linuxptp.spec index 24606d0..1bedd2d 100644 --- a/linuxptp.spec +++ b/linuxptp.spec @@ -1,6 +1,6 @@ Name: linuxptp Version: 4.2 -Release: 1 +Release: 2 Summary: Linuxptp is an implementation of the Precision Time Protocol (PTP) Group: System Environment/Base License: GPLv2+ @@ -34,7 +34,11 @@ Help files for %{name} %autosetup -n %{name}-%{version} %build -%make_build EXTRA_CFLAGS="$RPM_OPT_FLAGS" \ +%if "%{?toolchain}" == "clang" + %global make_opts CC=clang CXX=clang++ +%endif + +%make_build %{?make_opts} EXTRA_CFLAGS="$RPM_OPT_FLAGS" \ EXTRA_LDFLAGS="$RPM_LD_FLAGS" @@ -81,6 +85,9 @@ echo 'OPTIONS="-a -r"' > %{buildroot}%{_sysconfdir}/sysconfig/phc2sys %{_mandir}/man8/*.8* %changelog +* Thu Jan 09 2025 Suyun - 4.2-2 +- Support for building with Clang + * Mon Aug 05 2024 Ge Wang - 4.2-1 - Update to 4.2 version -- Gitee