void-packages/srcpkgs/j/patches/crossbuild-libj.patch
2020-01-19 10:21:58 +01:00

25 lines
908 B
Diff

--- make/build_libj.sh 2020-01-19 11:41:50.017038941 +0900
+++ make/build_libj.sh 2020-01-19 11:47:52.455846176 +0900
@@ -10,19 +10,20 @@
# too early to move main linux release package to gcc 5
macmin="-mmacosx-version-min=10.6"
+ccver=$(${CC} --version)
USE_OPENMP="${USE_OPENMP:=0}"
if [ $USE_OPENMP -eq 1 ] ; then
OPENMP=" -fopenmp "
LDOPENMP=" -fopenmp "
-if [ -z "${$CCcc##*gcc*}" ] || [ -z "${CC##*gcc*}" ]; then
+if [ -z "${ccver##*(GCC)*}" ]; then
LDOPENMP32=" -l:libgomp.so.1 " # gcc
else
LDOPENMP32=" -l:libomp.so.5 " # clang
fi
fi
-if [ $CC = "gcc" ] ; then
+if [ -z "${ccver##*(GCC)*}" ]; then
# gcc
common="$OPENMP -Werror -fPIC -O2 -fwrapv -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-type-limits"
GNUC_MAJOR=$(echo __GNUC__ | $CC -E -x c - | tail -n 1)