Fix support for GCC being build as C++.

This commit is contained in:
Chris Johns 2013-02-20 16:39:41 +11:00
parent 4f8fb656c4
commit 4f5321fa65
2 changed files with 4 additions and 0 deletions

View File

@ -143,10 +143,13 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
%endif
%if "%{_build}" != "%{_host}"
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
CXXFLAGS_FOR_BUILD="-g -O2 -Wall" \
CC="%{_host}-gcc ${SB_OPT_FLAGS}" \
CXX="%{_host}-g++ ${SB_OPT_FLAGS}" \
%else
# gcc is not ready to be compiled with -std=gnu99
CC=$(echo "%{__cc} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
CXX=$(echo "%{__cxx} ${SB_OPT_FLAGS}" | sed -e 's,-std=gnu99 ,,') \
%endif
../gcc-%{gcc_version}/configure \
--prefix=%{_prefix} \

View File

@ -176,6 +176,7 @@ export SB_BUILD_ROOT
%{?_targetcflags:CFLAGS_FOR_TARGET="%{_targetcflags}"}
%{?_targetcxxflags:CXXFLAGS_FOR_TARGET="%{_targetcxxflags}"}
export CFLAGS_FOR_TARGET
export CXXFLAGS_FOR_TARGET
# Default environment set up.
LANG=C
export LANG