summaryrefslogtreecommitdiff
path: root/BUILD/SETUP.sh
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2011-03-01 15:19:25 +0200
committerunknown <sanja@askmonty.org>2011-03-01 15:19:25 +0200
commit845afae61e8edad52b9d985109852c914337efd1 (patch)
treeffffb8d549e70d02eb0fe85163438a354b7011b8 /BUILD/SETUP.sh
parent8fa14ba6e6c6e7360d0799d703a5af26e2c2c61f (diff)
downloadmariadb-git-845afae61e8edad52b9d985109852c914337efd1.tar.gz
Allow -Wuninitialized without -O only for gcc 4.4 and upper
Diffstat (limited to 'BUILD/SETUP.sh')
-rwxr-xr-xBUILD/SETUP.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 0f97f265a52..c65955dd466 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -134,7 +134,6 @@ valgrind_configs="--with-valgrind"
#
# Used in -debug builds
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
-debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized"
debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
error_inject="--with-error-inject "
#
@@ -209,6 +208,23 @@ if test -z "$CXX" ; then
CXX=gcc
fi
+
+#
+# Set -Wuninitialized to debug flags for gcc 4.4 and above
+# because it is allowed there without -O
+#
+if test `$CC -v 2>&1 | tail -1 | sed 's/ .*$//'` = 'gcc' ; then
+ GCCVERSION=`cc -v 2>&1 | tail -1 | sed 's/^\w\w* \w\w* //' | sed 's/ .*$//'`
+ GCCV1=`echo $GCCVERSION | sed 's/\..*$//'`
+ GCCV2=`echo $GCCVERSION | sed 's/[0-9][0-9]*\.//'|sed 's/\..*$//'`
+ if test '(' "$GCCV1" -gt '4' ')' -o \
+ '(' '(' "$GCCV1" -eq '4' ')' -a '(' "$GCCV2" -ge '4' ')' ')'
+ then
+ debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized"
+ fi
+fi
+
+
# If ccache (a compiler cache which reduces build time)
# (http://samba.org/ccache) is installed, use it.
# We use 'grep' and hope 'grep' will work as expected