void-packages/srcpkgs/j/patches/crossbuild-libj.patch

62 lines
2.5 KiB
Diff

--- make/build_libj.sh 2019-09-27 16:31:51.711078190 +0900
+++ make/build_libj.sh 2019-09-27 16:35:36.406292466 +0900
@@ -7,36 +7,32 @@
# use -DC_NOMULTINTRINSIC to continue to use more standard c in version 4
# too early to move main linux release package to gcc 5
-compiler=${CC:0:3}
-
USE_OPENMP="${USE_OPENMP:=0}"
-if [ $USE_OPENMP -eq 1 ] ; then
OPENMP=" -fopenmp "
LDOPENMP=" -fopenmp "
-if [ "x$compiler" = x'gcc' ] ; then
-LDOPENMP32=" -l:libgomp.so.1 " # gcc
-else
-LDOPENMP32=" -l:libomp.so.5 " # clang
-fi
-fi
-if [ "x$compiler" = x'gcc' ] ; then
-# gcc
-common="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-clobbered -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-shift-negative-value"
-# alternatively, add comment /* fall through */
-OVER_GCC_VER7=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 7 | bc)
-if [ $OVER_GCC_VER7 -eq 1 ] ; then
-common="$common -Wno-implicit-fallthrough"
-fi
-OVER_GCC_VER8=$(echo `$CC -dumpversion | cut -f1 -d.` \>= 8 | bc)
-if [ $OVER_GCC_VER8 -eq 1 ] ; then
-common="$common -Wno-cast-function-type"
-fi
-else
-# clang 3.5 .. 5.0
-common="$OPENMP -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra -Wno-consumed -Wno-uninitialized -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-unsequenced -Wno-string-plus-int"
-fi
-darwin="$OPENMP -fPIC -O1 -fwrapv -fno-strict-aliasing -Wno-string-plus-int -Wno-empty-body -Wno-unsequenced -Wno-unused-value -Wno-pointer-sign -Wno-parentheses -Wno-return-type -Wno-constant-logical-operand -Wno-comment -Wno-unsequenced"
+common="${OPENMP} -Werror -fPIC -O1 -fwrapv -fno-strict-aliasing -Wextra"
+for wflag in no-maybe-uninitialized \
+ no-unused-parameter \
+ no-sign-compare \
+ no-clobbered \
+ no-empty-body \
+ no-unused-value \
+ no-pointer-sign \
+ no-parentheses \
+ no-shift-negative-value \
+ no-implicit-fallthrough \
+ no-cast-function-type \
+ no-consumed \
+ no-uninitialized \
+ no-unsequenced \
+ no-string-plus-int \
+ no-return-type \
+ no-constant-logical-operand \
+ no-comment; do
+ ${CC} -### -x c -W"${wflag}" /dev/null >/dev/null 2>/dev/null && \
+ common="${common} -W${wflag}"
+done
case $jplatform\_$1 in