summaryrefslogtreecommitdiff
path: root/BUILD/SETUP.sh
diff options
context:
space:
mode:
Diffstat (limited to 'BUILD/SETUP.sh')
-rwxr-xr-xBUILD/SETUP.sh46
1 files changed, 22 insertions, 24 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index 2028db94eed..44e5ed74ab7 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -14,8 +14,7 @@ Usage: $0 [-h|-n] [configure-options]
-h, --help Show this help message.
-n, --just-print Don't actually run any commands; just print them.
-c, --just-configure Stop after running configure.
- --with-debug=full Build with full debug.
- --warning-mode=[old|pedantic]
+ --warning-mode=[old|pedantic|maintainer]
Influences the debug flags. Old is default.
--prefix=path Build with prefix 'path'.
@@ -30,8 +29,6 @@ parse_options()
case "$1" in
--prefix=*)
prefix=`get_key_value "$1"`;;
- --with-debug=full)
- full_debug="=full";;
--warning-mode=*)
warning_mode=`get_key_value "$1"`;;
--extra-flags=*)
@@ -68,8 +65,8 @@ fi
prefix="/usr/local/mysql"
just_print=
just_configure=
-full_debug=
warning_mode=
+maintainer_mode=
parse_options "$@"
@@ -96,7 +93,21 @@ get_make_parallel_flag
# Ex --with-ssl=/usr
SSL_LIBRARY=--with-ssl
-if [ "x$warning_mode" != "xpedantic" ]; then
+if [ "x$warning_mode" = "xpedantic" ]; then
+ warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
+ c_warnings="$warnings"
+ cxx_warnings="$warnings -std=c++98"
+# NOTE: warning mode should not influence optimize/debug mode.
+# Please feel free to add a separate option if you don't feel it's an overkill.
+ debug_extra_cflags="-O0"
+# Reset CPU flags (-mtune), they don't work in -pedantic mode
+ check_cpu_cflags=""
+elif [ "x$warning_mode" = "xmaintainer" ]; then
+ c_warnings="-Wall -Wextra"
+ cxx_warnings="$c_warnings -Wno-unused-parameter"
+ maintainer_mode="--enable-mysql-maintainer-mode"
+ debug_extra_cflags="-g3"
+else
# Both C and C++ warnings
warnings="-Wall -Wextra -Wunused -Wwrite-strings"
@@ -109,17 +120,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then
cxx_warnings="$warnings -Wno-unused-parameter"
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
-# Added unless --with-debug=full
debug_extra_cflags="-O0 -g3 -gdwarf-2"
-else
- warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
- c_warnings="$warnings"
- cxx_warnings="$warnings -std=c++98"
-# NOTE: warning mode should not influence optimize/debug mode.
-# Please feel free to add a separate option if you don't feel it's an overkill.
- debug_extra_cflags="-O0"
-# Reset CPU flags (-mtune), they don't work in -pedantic mode
- check_cpu_cflags=""
fi
# Set flags for various build configurations.
@@ -127,13 +128,13 @@ 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="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_valgrind "
+valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify "
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 -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
+debug_cflags="$debug_cflags -DSAFE_MUTEX"
error_inject="--with-error-inject "
#
# Base C++ flags for all builds
@@ -143,11 +144,8 @@ base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
# Be as fast as we can be without losing our ability to backtrace.
fast_cflags="-O3 -fno-omit-frame-pointer"
-debug_configs="--with-debug$full_debug"
-if [ -z "$full_debug" ]
-then
- debug_cflags="$debug_cflags $debug_extra_cflags"
-fi
+debug_configs="--with-debug"
+debug_cflags="$debug_cflags $debug_extra_cflags"
static_link="--with-mysqld-ldflags=-all-static "
static_link="$static_link --with-client-ldflags=-all-static"
@@ -162,7 +160,7 @@ local_infile_configs="--enable-local-infile"
base_configs="--prefix=$prefix --enable-assembler "
base_configs="$base_configs --with-extra-charsets=complex "
base_configs="$base_configs --enable-thread-safe-client "
-base_configs="$base_configs --with-big-tables"
+base_configs="$base_configs --with-big-tables $maintainer_mode"
base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables --without-plugin-innodb_plugin"
# 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"