diff options
author | Nicolas Chauvet <kwizart@gmail.com> | 2015-07-21 13:59:00 +0200 |
---|---|---|
committer | Nicolas Chauvet <kwizart@gmail.com> | 2015-07-27 11:26:05 +0200 |
commit | b8f8d47c1d4bebab6c4b0d077937bce56293ec4a (patch) | |
tree | 1fb3ae16b7e4c43450d0ef0d487c58311cea1c09 | |
parent | 3e520d73d93d41744149380df412799128ad0650 (diff) | |
download | mesa-b8f8d47c1d4bebab6c4b0d077937bce56293ec4a.tar.gz mesa-b8f8d47c1d4bebab6c4b0d077937bce56293ec4a.tar.xz mesa-b8f8d47c1d4bebab6c4b0d077937bce56293ec4a.zip |
Add with_clang to compile with clang/llvm
-rw-r--r-- | mesa.spec | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 |