diff --git a/java-11-openjdk.spec b/java-11-openjdk.spec index 387d089..66cc569 100644 --- a/java-11-openjdk.spec +++ b/java-11-openjdk.spec @@ -30,6 +30,7 @@ %bcond_with timezonejava %bcond_with binary +%bcond_without clang # 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. @@ -1162,7 +1163,9 @@ Patch10: clang_stack.patch # JDK 9+ only patches # ############################################# +%if %{with clang} BuildRequires: clang +%endif BuildRequires: autoconf BuildRequires: automake BuildRequires: binutils @@ -1483,8 +1486,10 @@ sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg %build +%if %{with clang} export CC="clang" export CXX="clang++" +%endif # How many CPU's do we have? export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :) export NUM_PROC=${NUM_PROC:-1} @@ -1570,7 +1575,10 @@ bash ../configure \ --with-jvm-features=zgc \ %endif --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 # build speed-up