summaryrefslogtreecommitdiff
path: root/BUILD
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-03-01 15:51:35 +0200
committerMichael Widenius <monty@askmonty.org>2011-03-01 15:51:35 +0200
commitb432ceda3df313f47181b5496379c19944f7eaba (patch)
tree566e8d8373df70a93371fa22f558947912d00887 /BUILD
parent9f2194090c7436ed0fea6220c4c4c8727dc41771 (diff)
parent97d46a0cd341dfce56c0a94a669e1832f51116f2 (diff)
downloadmariadb-git-b432ceda3df313f47181b5496379c19944f7eaba.tar.gz
Merge with 5.1
Diffstat (limited to 'BUILD')
-rwxr-xr-xBUILD/SETUP.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 27d26843ac7..7a05d80f531 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=g++
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