summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Chauvet <kwizart@gmail.com>2015-07-21 13:59:00 +0200
committerNicolas Chauvet <kwizart@gmail.com>2015-07-27 11:26:05 +0200
commitb8f8d47c1d4bebab6c4b0d077937bce56293ec4a (patch)
tree1fb3ae16b7e4c43450d0ef0d487c58311cea1c09
parent3e520d73d93d41744149380df412799128ad0650 (diff)
downloadmesa-b8f8d47c1d4bebab6c4b0d077937bce56293ec4a.tar.gz
mesa-b8f8d47c1d4bebab6c4b0d077937bce56293ec4a.tar.xz
mesa-b8f8d47c1d4bebab6c4b0d077937bce56293ec4a.zip
Add with_clang to compile with clang/llvm
-rw-r--r--mesa.spec14
1 files changed, 14 insertions, 0 deletions
diff --git a/mesa.spec b/mesa.spec
index 6147b9c..d12a5a7 100644
--- a/mesa.spec
+++ b/mesa.spec
@@ -34,7 +34,9 @@
%define with_ilo 1
%define with_vmware 1
%define with_xa 1
+%{!?with_clang:
%define with_opencl 1
+}
%define with_omx 1
%endif
%ifarch %{arm} aarch64
@@ -105,6 +107,9 @@ BuildRequires: gettext
BuildRequires: mesa-private-llvm-devel
%else
BuildRequires: llvm-devel >= 3.4-7
+%if 0%{?with_clang}
+BuildRequires: clang >= 3.4-7
+%endif
%if 0%{?with_opencl}
BuildRequires: clang-devel >= 3.0
%endif
@@ -366,6 +371,12 @@ cp %{SOURCE4} docs/
autoreconf --install
+%if 0%{?with_clang}
+export CFLAGS="-O2 -g"
+export CXXFLAGS="-O2 -g -fno-rtti -fno-exceptions"
+export CC=clang
+export CXX=clang++
+%else
export CFLAGS="$RPM_OPT_FLAGS"
# C++ note: we never say "catch" in the source. we do say "typeid" once,
# in an assert, which is patched out above. LLVM doesn't use RTTI or throw.
@@ -373,6 +384,7 @@ export CFLAGS="$RPM_OPT_FLAGS"
# We do say 'catch' in the clover and d3d1x state trackers, but we're not
# building those yet.
export CXXFLAGS="$RPM_OPT_FLAGS %{?with_opencl:-frtti -fexceptions} %{!?with_opencl:-fno-rtti -fno-exceptions}"
+%endif
%ifarch %{ix86}
# i do not have words for how much the assembly dispatch code infuriates me
%define asm_flags --disable-asm
@@ -542,10 +554,12 @@ rm -rf $RPM_BUILD_ROOT
%endif
%endif
%if 0%{?with_llvm}
+%if 0%{?!with_clang}
%ifarch %{ix86} x86_64
%dir %{_libdir}/gallium-pipe
%{_libdir}/gallium-pipe/*.so
%endif
+%endif
%{_libdir}/dri/kms_swrast_dri.so
%endif
%{_libdir}/dri/swrast_dri.so