SHA256
1
0
forked from pool/ipmiutil
ipmiutil/warnings.patch

53 lines
1.8 KiB
Diff

--- ipmiutil-3.0.7/configure.ac 2017-09-20 11:08:20.000000000 -0400
+++ ipmiutil-new/configure.ac 2017-12-05 14:10:10.773545568 -0500
@@ -342,6 +342,17 @@
echo "ok, suppress excess warnings"
fi
rm -f $tmpc $tmpo >/dev/null 2>&1
+ echo $ECHO_N "checking strict aliasing warning flags ... $ECHO_C"
+ cfalias="-fno-strict-aliasing"
+ echo "int main() { return(1); }" >$tmpc
+ $CC -o $tmpo -c $cfalias $tmpc >/dev/null 2>&1
+ if test $? -ne 0 ; then
+ cfalias=
+ echo "skip"
+ else
+ echo "ok, suppress aliasing warnings"
+ fi
+ rm -f $tmpc $tmpo >/dev/null 2>&1
echo $ECHO_N "checking compile fortify flags ... $ECHO_C"
cfhard="-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
echo "int main() { alloca(100); return(1); }" >$tmpc
@@ -405,16 +416,19 @@
sed -i 's/# Default-Stop:/# Default-Stop: 0 1 2 6/' $init_scripts
fi
# The openssl rpm might not be installed
+ sslver=""
which rpm >/dev/null 2>&1
if test $? -eq 0 ; then
sslver=`rpm -q openssl-devel |cut -f3 -d'-' |cut -f1-2 -d'.'`
- else
- sslver=`openssl version |awk '{ print $2 }'|cut -f1-2 -d'.'`
- fi
+ fi
+ if test "$sslver" = ""; then
+ sslver=`openssl version |awk '{ print $2 }'|cut -f1-2 -d'.'`
+ fi
if test "$sslver" = "1.1"; then
echo "Detected openssl-$sslver"
MD2_CFLAGS="-DSKIP_MD2 -DSSL11"
else
+ echo "Detected openssl-$sslver"
if test -f "$LIB_DIR/libcrypto.so"; then
strings $LIB_DIR/libcrypto.so | grep EVP_md2 >/dev/null 2>&1
if test $? -ne 0; then
@@ -426,7 +440,7 @@
MD2_CFLAGS="-DSKIP_MD2"
fi
fi
- OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfgnu $cfhard"
+ OS_CFLAGS="-DLINUX $MD2_CFLAGS -fPIC $cfwarn $cfgnu $cfalias $cfhard"
else
macos=1 # =1 means not mac
# usually "x$sysname" = "xFreeBSD", but allow NetBSD