This is an automated email from the git hooks/post-receive script.
vashirov pushed a commit to branch master
in repository 389-ds-base.
commit 7eee594fcf61e39cdeb8dd384f215924880574fa
Author: Viktor Ashirov <vashirov(a)redhat.com>
Date: Wed Sep 20 12:20:57 2017 +0200
Issue 49400 - Add clang support to rpm builds
Bug Description:
Server falis to build using clang because we need to explicitly link to
libatomic.
Fix Description:
Explicitly link to libatomic.
Add support for clang in spec file.
https://pagure.io/389-ds-base/issue/49400
Reviewed by: mreynolds (Thanks!)
---
Makefile.am | 2 +-
rpm/389-ds-base.spec.in | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index b71a8f3..8e24957 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -138,7 +138,7 @@ AM_LDFLAGS = -lpthread
else
#AM_LDFLAGS = -Wl,-z,defs
# Provide the tcmalloc links if needed
-AM_LDFLAGS = $(ASAN_DEFINES) $(PROFILING_LINKS) $(TCMALLOC_LINK)
+AM_LDFLAGS = $(ASAN_DEFINES) $(PROFILING_LINKS) $(TCMALLOC_LINK) -latomic
endif #end hpux
#
https://www.gnu.org/software/libtool/manual/html_node/Updating-version-in...
diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in
index b4c863a..52e1095 100644
--- a/rpm/389-ds-base.spec.in
+++ b/rpm/389-ds-base.spec.in
@@ -27,6 +27,9 @@
%endif
%endif
+# Use Clang instead of GCC
+%global use_clang 0
+
# fedora 15 and later uses tmpfiles.d
# otherwise, comment this out
%{!?with_tmpfiles_d: %global with_tmpfiles_d %{_sysconfdir}/tmpfiles.d}
@@ -62,7 +65,12 @@ BuildRequires: cyrus-sasl-devel
BuildRequires: icu
BuildRequires: libicu-devel
BuildRequires: pcre-devel
+BuildRequires: libatomic
+%if %{use_clang}
+BuildRequires: clang
+%else
BuildRequires: gcc-c++
+%endif
# The following are needed to build the snmp ldap-agent
BuildRequires: net-snmp-devel
BuildRequires: bzip2-devel
@@ -246,6 +254,10 @@ The lib389 CI tests that can be run against the Directory Server.
cp %{SOURCE2} README.devel
%build
+%if %{use_clang}
+export CC=clang
+export CXX=clang++
+%endif
%{?with_tmpfiles_d: TMPFILES_FLAG="--with-tmpfiles-d=%{with_tmpfiles_d}"}
# hack hack hack
https://bugzilla.redhat.com/show_bug.cgi?id=833529
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.