Don't use %%clang_gcc_wrapper because it fails to deal with complex quotation like -DCPPUNIT_PLUGIN_EXPORT='extern "C" SAL_DLLPUBLIC_EXPORT'

This commit is contained in:
Mikhail Novosyolov 2020-04-04 14:42:04 +03:00
parent 4851e52a41
commit 1312ec35a0

View file

@ -2951,13 +2951,23 @@ export CCACHE_DIR=%{ccachedir}
%setup_compile_flags
%if %{with clang}
# not using %%clang_gcc_wrapper here because it fails
# to deal with complex quotation like
# -DCPPUNIT_PLUGIN_EXPORT='extern "C" SAL_DLLPUBLIC_EXPORT'
for i in %noclang_optflags ; do
export CFLAGS="$(echo "$CFLAGS" | sed -e "s,${i},,g")"
export CXXFLAGS="$(echo "$CXXFLAGS" | sed -e "s,${i},,g")"
done
mkdir -p local_bin
install -m0755 %{SOURCE80} "local_bin/clang++"
export PATH="${PWD}/local_bin:${PATH}"
export CC=clang
export CXX=clang++
export CPP=clang-cpp
# libstdc++ from gcc5 is too old, use newer version of libstdc++
export CPPFLAGS="$CPPFLAGS -I%{_includedir}/libstdc++-gcc10 -I%{_includedir}/libstdc++-gcc10/%{_host}"
export CXXFLAGS="$CXXFLAGS -nostdinc++ $CPPFLAGS -Wno-unused-command-line-argument"
%clang_gcc_wrapper
export LIBCCX_LIBS="-lstdc++-gcc10"
install -m0755 %{SOURCE80} "local_bin/clang++wr"
sed -i -e "s,/usr/bin/clang++,${PWD}/local_bin/clang++wr,g" "local_bin/clang++"
%endif
echo "Configure start at: "`date` >> ooobuildtime.log