conditionalize clang

This commit is contained in:
Mikhail Novosyolov 2020-07-13 12:37:11 +03:00
parent 4961ba1e1a
commit 26f9b59d6c

View file

@ -30,6 +30,7 @@
%bcond_with timezonejava %bcond_with timezonejava
%bcond_with binary %bcond_with binary
%bcond_without clang
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs. # The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
# This fixes detailed NMT and other tools which need minimal debug info. # This fixes detailed NMT and other tools which need minimal debug info.
@ -1162,7 +1163,9 @@ Patch10: clang_stack.patch
# JDK 9+ only patches # JDK 9+ only patches
# #
############################################# #############################################
%if %{with clang}
BuildRequires: clang BuildRequires: clang
%endif
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: binutils BuildRequires: binutils
@ -1483,8 +1486,10 @@ sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg
%build %build
%if %{with clang}
export CC="clang" export CC="clang"
export CXX="clang++" export CXX="clang++"
%endif
# How many CPU's do we have? # How many CPU's do we have?
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
export NUM_PROC=${NUM_PROC:-1} export NUM_PROC=${NUM_PROC:-1}
@ -1570,7 +1575,10 @@ bash ../configure \
--with-jvm-features=zgc \ --with-jvm-features=zgc \
%endif %endif
--disable-warnings-as-errors \ --disable-warnings-as-errors \
--with-toolchain-type="clang" %if %{with clang}
--with-toolchain-type="clang" \
%endif
--
# Debug builds don't need same targets as release for # Debug builds don't need same targets as release for
# build speed-up # build speed-up