diff options
Diffstat (limited to 'BUILD/SETUP.sh')
-rwxr-xr-x | BUILD/SETUP.sh | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index e5a8255c428..6c45c23587f 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -16,7 +16,6 @@ # License along with this library; if not, write to the Free # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA - ######################################################################## get_key_value() @@ -130,7 +129,7 @@ elif [ "x$warning_mode" = "xmaintainer" ]; then debug_extra_cflags="-g3" else # Both C and C++ warnings - warnings="-Wall -Wextra -Wunused -Wwrite-strings" + warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized" # For more warnings, uncomment the following line # warnings="$warnings -Wshadow" @@ -149,13 +148,14 @@ fi # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro # LINT_INIT(), which is only useful for silencing spurious warnings # of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind. -valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify -DHAVE_valgrind " +valgrind_flags="-DHAVE_valgrind -DHAVE_purify -USAFEMALLOC" +valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized" valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" valgrind_configs="--with-valgrind" # # Used in -debug builds -debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS " -debug_cflags="$debug_cflags -DSAFE_MUTEX" +debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG" +debug_cflags="$debug_cflags -DSAFE_MUTEX -DSAFEMALLOC" error_inject="--with-error-inject " # # Base C++ flags for all builds @@ -171,9 +171,6 @@ then debug_cflags="$debug_cflags $debug_extra_cflags" fi - -static_link="--with-mysqld-ldflags=-all-static " -static_link="$static_link --with-client-ldflags=-all-static" # we need local-infile in all binaries for rpl000001 # if you need to disable local-infile in the client, write a build script # and unset local_infile_configs @@ -187,8 +184,6 @@ base_configs="$base_configs --with-extra-charsets=complex " base_configs="$base_configs --enable-thread-safe-client " base_configs="$base_configs --with-big-tables $maintainer_mode" base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables" -# Compile our client programs with static libraries to allow them to be moved -base_configs="$base_configs --with-mysqld-ldflags=-static --with-client-ldflags=-static" if test -d "$path/../cmd-line-utils/readline" then @@ -230,6 +225,24 @@ 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/^[a-zA-Z][a-zA-Z]* [a-zA-Z][a-zA-Z]* //' | 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 |