mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
50ceea65cf
into mysql.com:/home/my/mysql-new BitKeeper/etc/ignore: auto-union BUILD/SETUP.sh: Auto merged CMakeLists.txt: Auto merged client/get_password.c: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged cmd-line-utils/readline/bind.c: Auto merged cmd-line-utils/readline/display.c: Auto merged cmd-line-utils/readline/histexpand.c: Auto merged cmd-line-utils/readline/history.c: Auto merged cmd-line-utils/readline/readline.c: Auto merged cmd-line-utils/readline/text.c: Auto merged dbug/user.r: Auto merged extra/yassl/src/handshake.cpp: Auto merged include/config-win.h: Auto merged include/m_string.h: Auto merged include/my_global.h: Auto merged include/my_pthread.h: Auto merged include/mysql/plugin.h: Auto merged include/mysql_com.h: Auto merged include/thr_alarm.h: Auto merged libmysql/CMakeLists.txt: Auto merged libmysql/Makefile.shared: Auto merged libmysql/dll.c: Auto merged libmysql/get_password.c: Auto merged libmysql/libmysql.c: Auto merged libmysqld/Makefile.am: Auto merged mysql-test/lib/mtr_cases.pl: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/alter_table.result: Auto merged mysql-test/r/change_user.result: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/r/merge.result: Auto merged mysql-test/r/mix2_myisam.result: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/valgrind.supp: Auto merged mysql-test/r/view.result: Auto merged mysql-test/suite/rpl/r/rpl_events.result: Auto merged mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/mysqldump.test: Auto merged mysql-test/t/query_cache.test: Auto merged mysql-test/t/subselect.test: Auto merged mysql-test/t/variables.test: Auto merged mysql-test/t/view.test: Auto merged mysys/mf_iocache.c: Auto merged mysys/mf_tempfile.c: Auto merged mysys/my_atomic.c: Auto merged mysys/my_bit.c: Auto merged mysys/my_bitmap.c: Auto merged mysys/my_compress.c: Auto merged mysys/my_create.c: Auto merged mysys/my_delete.c: Auto merged mysys/my_error.c: Auto merged mysys/my_init.c: Auto merged mysys/my_open.c: Auto merged mysys/my_realloc.c: Auto merged mysys/my_rename.c: Auto merged mysys/my_symlink.c: Auto merged mysys/my_sync.c: Auto merged mysys/my_thr_init.c: Auto merged mysys/thr_alarm.c: Auto merged mysys/thr_lock.c: Auto merged scripts/make_binary_distribution.sh: Auto merged server-tools/instance-manager/mysql_connection.cc: Auto merged sql/CMakeLists.txt: Auto merged sql/Makefile.am: Auto merged sql/events.cc: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/filesort.cc: Auto merged sql/gen_lex_hash.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_partition.h: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/lock.cc: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/net_serv.cc: Auto merged sql/opt_range.cc: Auto merged sql/partition_info.cc: Auto merged sql/rpl_injector.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged sql/sp_head.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_plugin.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_test.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/unireg.cc: Auto merged sql/share/errmsg.txt: Auto merged storage/csv/ha_tina.cc: Auto merged storage/csv/ha_tina.h: Auto merged storage/myisam/CMakeLists.txt: Auto merged storage/myisam/ft_boolean_search.c: Auto merged storage/myisam/ft_eval.c: Auto merged storage/myisam/ft_nlq_search.c: Auto merged storage/myisam/ft_parser.c: Auto merged storage/myisam/ft_static.c: Auto merged storage/myisam/ft_stopwords.c: Auto merged storage/myisam/ft_test1.c: Auto merged storage/myisam/ft_update.c: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/mi_check.c: Auto merged storage/myisam/mi_create.c: Auto merged storage/myisam/mi_delete.c: Auto merged storage/myisam/mi_delete_all.c: Auto merged storage/myisam/mi_dynrec.c: Auto merged storage/myisam/mi_key.c: Auto merged storage/myisam/mi_packrec.c: Auto merged storage/myisam/mi_range.c: Auto merged storage/myisam/mi_search.c: Auto merged storage/myisam/mi_test1.c: Auto merged storage/myisam/mi_test2.c: Auto merged storage/myisam/mi_test3.c: Auto merged storage/myisam/mi_unique.c: Auto merged storage/myisam/mi_write.c: Auto merged storage/myisam/myisamchk.c: Auto merged storage/myisam/myisamdef.h: Auto merged storage/myisam/myisampack.c: Auto merged storage/myisam/sort.c: Auto merged storage/myisam/sp_test.c: Auto merged support-files/mysql.spec.sh: Auto merged tests/mysql_client_test.c: Auto merged configure.in: Manual merge dbug/dbug.c: Restore to original state in Maria tree The big diff comes from a wrong pull from 5.0 -> 5.1 after backporting dbug to 5.0 from 5.1 include/Makefile.am: Manual merge include/my_atomic.h: Ignore changes include/my_base.h: Manual merge include/my_dbug.h: Use orginal my_dbug.h from maria tree include/my_handler.h: Manual merge include/my_sys.h: Manual merge include/myisam.h: Manual merge mysql-test/lib/mtr_report.pl: Manual merge mysql-test/r/myisam.result: Manual merge mysql-test/suite/binlog/r/binlog_unsafe.result: Manual merge mysql-test/suite/binlog/t/binlog_unsafe.test: Manual merge mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result: Manual merge mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result: No changes mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test: Manual merge mysql-test/t/change_user.test: Manual merge mysql-test/t/disabled.def: Manual merge mysql-test/t/merge.test: No changes mysql-test/t/myisam.test: Manual merge mysys/Makefile.am: Manual merge mysys/array.c: Manual merge mysys/mf_keycache.c: Manual merge mysys/my_getsystime.c: Manual merge mysys/my_handler.c: Manual merge mysys/my_pread.c: Manual merge mysys/safemalloc.c: Manual merge sql/ha_partition.cc: Manual merge sql/handler.cc: Manual merge sql/lex.h: Manual merge sql/mysql_priv.h: Manual merge sql/mysqld.cc: Manual merge sql/set_var.h: Manual merge sql/sql_class.cc: Manual merge sql/sql_insert.cc: Manual merge sql/sql_parse.cc: Manual merge sql/sql_select.cc: Manual merge sql/sql_show.cc: Manual merge sql/sql_table.cc: Manual merge storage/myisam/mi_checksum.c: No changes storage/myisam/mi_extra.c: Manual merge storage/myisam/mi_open.c: Manual merge storage/myisammrg/ha_myisammrg.cc: Manual merge strings/strmake.c: No changes
237 lines
6.6 KiB
Bash
Executable file
237 lines
6.6 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
########################################################################
|
|
|
|
get_key_value()
|
|
{
|
|
echo "$1" | sed 's/^--[a-zA-Z_-]*=//'
|
|
}
|
|
|
|
usage()
|
|
{
|
|
cat <<EOF
|
|
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]
|
|
Influences the debug flags. Old is default.
|
|
--prefix=path Build with prefix 'path'.
|
|
|
|
Note: this script is intended for internal use by MySQL developers.
|
|
EOF
|
|
}
|
|
|
|
parse_options()
|
|
{
|
|
while test $# -gt 0
|
|
do
|
|
case "$1" in
|
|
--prefix=*)
|
|
prefix=`get_key_value "$1"`;;
|
|
--with-debug=full)
|
|
full_debug="=full";;
|
|
--warning-mode=*)
|
|
warning_mode=`get_key_value "$1"`;;
|
|
-c | --just-configure)
|
|
just_configure=1;;
|
|
-n | --just-print | --print)
|
|
just_print=1;;
|
|
-h | --help)
|
|
usage
|
|
exit 0;;
|
|
*)
|
|
echo "Unknown option '$1'"
|
|
exit 1;;
|
|
esac
|
|
shift
|
|
done
|
|
}
|
|
|
|
########################################################################
|
|
|
|
if test ! -f sql/mysqld.cc
|
|
then
|
|
echo "You must run this script from the MySQL top-level directory"
|
|
exit 1
|
|
fi
|
|
|
|
prefix="/usr/local/mysql"
|
|
just_print=
|
|
just_configure=
|
|
full_debug=
|
|
warning_mode=
|
|
|
|
parse_options "$@"
|
|
|
|
if test -n "$MYSQL_BUILD_PREFIX"
|
|
then
|
|
prefix="$MYSQL_BUILD_PREFIX"
|
|
fi
|
|
|
|
set -e
|
|
|
|
#
|
|
# Check for the CPU and set up CPU specific flags. We may reset them
|
|
# later.
|
|
#
|
|
path=`dirname $0`
|
|
. "$path/check-cpu"
|
|
|
|
export AM_MAKEFLAGS
|
|
AM_MAKEFLAGS="-j 4"
|
|
|
|
# SSL library to use.--with-ssl will select our bundled yaSSL
|
|
# implementation of SSL. To use openSSl you will nee too point out
|
|
# the location of openSSL headers and lbs on your system.
|
|
# Ex --with-ssl=/usr
|
|
SSL_LIBRARY=--with-ssl
|
|
|
|
if [ "x$warning_mode" != "xpedantic" ]; then
|
|
# Both C and C++ warnings
|
|
warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W"
|
|
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
|
|
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
|
|
|
|
# For more warnings, uncomment the following line
|
|
# warnings="$global_warnings -Wshadow"
|
|
|
|
# C warnings
|
|
c_warnings="$warnings -Wunused-parameter"
|
|
# C++ warnings
|
|
cxx_warnings="$warnings"
|
|
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
|
|
cxx_warnings="$cxx_warnings -Wreorder"
|
|
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
|
# Added unless --with-debug=full
|
|
debug_extra_cflags="-O1 -Wuninitialized"
|
|
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.
|
|
# Used in -valgrind builds
|
|
valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify "
|
|
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
|
|
#
|
|
# Used in -debug builds
|
|
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
|
|
debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX"
|
|
error_inject="--with-error-inject "
|
|
#
|
|
# Base C++ flags for all builds
|
|
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
|
|
#
|
|
# Flags for optimizing builds.
|
|
# 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
|
|
|
|
#
|
|
# Configuration options.
|
|
#
|
|
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-plugin-maria --with-maria-tmp-tables"
|
|
|
|
if test -d "$path/../cmd-line-utils/readline"
|
|
then
|
|
base_configs="$base_configs --with-readline"
|
|
elif test -d "$path/../cmd-line-utils/libedit"
|
|
then
|
|
base_configs="$base_configs --with-libedit"
|
|
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
|
|
local_infile_configs="--enable-local-infile"
|
|
|
|
|
|
max_no_embedded_configs="$SSL_LIBRARY --with-plugins=max"
|
|
max_no_ndb_configs="$SSL_LIBRARY --with-plugins=max-no-ndb --with-embedded-server"
|
|
max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server"
|
|
|
|
#
|
|
# CPU and platform specific compilation flags.
|
|
#
|
|
alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag"
|
|
amd64_cflags="$check_cpu_cflags"
|
|
amd64_cxxflags="" # If dropping '--with-big-tables', add here "-DBIG_TABLES"
|
|
pentium_cflags="$check_cpu_cflags"
|
|
pentium64_cflags="$check_cpu_cflags -m64"
|
|
ppc_cflags="$check_cpu_cflags"
|
|
sparc_cflags=""
|
|
|
|
if gmake --version > /dev/null 2>&1
|
|
then
|
|
make=gmake
|
|
else
|
|
make=make
|
|
fi
|
|
|
|
if test -z "$CC" ; then
|
|
CC=gcc
|
|
fi
|
|
|
|
if test -z "$CXX" ; then
|
|
CXX=gcc
|
|
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
|
|
# (returns 0 if finds lines)
|
|
if test "$USING_GCOV" != "1"
|
|
then
|
|
# Not using gcov; Safe to use ccache
|
|
CCACHE_GCOV_VERSION_ENABLED=1
|
|
fi
|
|
|
|
if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1"
|
|
then
|
|
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
|
|
echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX"
|
|
fi
|
|
|
|
# gcov
|
|
|
|
# The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the
|
|
# code with profiling information used by gcov.
|
|
# The -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl.
|
|
# The -DHAVE_gcov enables code to write out coverage info even when crashing.
|
|
|
|
gcov_compile_flags="-fprofile-arcs -ftest-coverage"
|
|
gcov_compile_flags="$gcov_compile_flags -DDISABLE_TAO_ASM"
|
|
gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
|
|
|
|
# GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well
|
|
# as on the compiler command line), and this requires setting LDFLAGS for BDB.
|
|
|
|
gcov_link_flags="-fprofile-arcs -ftest-coverage"
|
|
|
|
gcov_configs="--disable-shared"
|
|
|
|
# gprof
|
|
|
|
gprof_compile_flags="-O2 -pg -g"
|
|
|
|
gprof_link_flags="--disable-shared $static_link"
|
|
|