summaryrefslogtreecommitdiff
path: root/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'BUILD')
-rw-r--r--BUILD/FINISH.sh5
-rw-r--r--BUILD/Makefile.am6
-rwxr-xr-xBUILD/SETUP.sh224
-rwxr-xr-xBUILD/autorun.sh28
-rwxr-xr-xBUILD/build_mccge.sh1845
-rwxr-xr-xBUILD/check-cpu224
-rwxr-xr-xBUILD/compile-alpha-ccc4
-rwxr-xr-xBUILD/compile-alpha-cxx6
-rwxr-xr-xBUILD/compile-alpha-debug6
-rwxr-xr-xBUILD/compile-amd64-debug-max4
-rwxr-xr-xBUILD/compile-amd64-debug-max-no-ndb25
-rwxr-xr-xBUILD/compile-amd64-max2
-rwxr-xr-xBUILD/compile-amd64-valgrind-max41
-rwxr-xr-xBUILD/compile-darwin-mwcc6
-rwxr-xr-xBUILD/compile-dist19
-rwxr-xr-xBUILD/compile-hpux11-parisc2-aCC2
-rwxr-xr-xBUILD/compile-ia64-debug-max6
-rwxr-xr-xBUILD/compile-irix-mips64-mipspro2
-rwxr-xr-xBUILD/compile-pentium-debug6
-rwxr-xr-xBUILD/compile-pentium-debug-max6
-rwxr-xr-xBUILD/compile-pentium-debug-max-no-embedded6
-rwxr-xr-xBUILD/compile-pentium-debug-max-no-ndb4
-rwxr-xr-xBUILD/compile-pentium-debug-no-bdb24
-rwxr-xr-xBUILD/compile-pentium-debug-openssl4
-rwxr-xr-xBUILD/compile-pentium-debug-yassl4
-rwxr-xr-xBUILD/compile-pentium-gcov21
-rwxr-xr-xBUILD/compile-pentium-icc-valgrind-max4
-rwxr-xr-xBUILD/compile-pentium-max2
-rwxr-xr-xBUILD/compile-pentium-mysqlfs-debug4
-rwxr-xr-xBUILD/compile-pentium-pgcc5
-rwxr-xr-xBUILD/compile-pentium-valgrind-max9
-rwxr-xr-xBUILD/compile-pentium-valgrind-max-no-ndb41
-rwxr-xr-xBUILD/compile-pentium6428
-rwxr-xr-xBUILD/compile-pentium64-debug4
-rwxr-xr-xBUILD/compile-pentium64-debug-max6
-rwxr-xr-xBUILD/compile-pentium64-max28
-rwxr-xr-xBUILD/compile-pentium64-valgrind-max9
-rwxr-xr-xBUILD/compile-ppc-debug2
-rwxr-xr-xBUILD/compile-ppc-debug-max4
-rwxr-xr-xBUILD/compile-ppc-debug-max-no-ndb4
-rwxr-xr-xBUILD/compile-ppc-max2
-rwxr-xr-xBUILD/compile-sap24
-rwxr-xr-xBUILD/compile-sap-debug24
-rwxr-xr-xBUILD/compile-solaris-amd6484
-rwxr-xr-x[-rw-r--r--]BUILD/compile-solaris-amd64-forte7
-rw-r--r--BUILD/compile-solaris-amd64-forte-debug4
-rwxr-xr-xBUILD/compile-solaris-sparc9
-rwxr-xr-xBUILD/compile-solaris-sparc-debug8
-rwxr-xr-xBUILD/compile-solaris-sparc-forte29
-rwxr-xr-xBUILD/compile-solaris-sparc-purify12
-rwxr-xr-xBUILD/test-alpha-ccc26
51 files changed, 2481 insertions, 428 deletions
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh
index 7c73d8e0723..2bb3a0d9a0b 100644
--- a/BUILD/FINISH.sh
+++ b/BUILD/FINISH.sh
@@ -21,9 +21,8 @@ extra_configs="$extra_configs $local_infile_configs"
configure="./configure $base_configs $extra_configs"
commands="\
-$make -k distclean || true
-/bin/rm -rf */.deps/*.P config.cache innobase/config.cache bdb/build_unix/config.cache bdb/dist/autom4te.cache autom4te.cache innobase/autom4te.cache;
-
+$make -k maintainer-clean || true
+/bin/rm -rf */.deps/*.P configure config.cache storage/*/configure storage/*/config.cache autom4te.cache storage/*/autom4te.cache;
path=`dirname $0`
. \"$path/autorun.sh\""
diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am
index 43ffc78e82e..72b586a72de 100644
--- a/BUILD/Makefile.am
+++ b/BUILD/Makefile.am
@@ -20,6 +20,7 @@
EXTRA_DIST = FINISH.sh \
SETUP.sh \
autorun.sh \
+ build_mccge.sh \
check-cpu \
cleanup \
compile-alpha \
@@ -27,10 +28,12 @@ EXTRA_DIST = FINISH.sh \
compile-alpha-cxx \
compile-alpha-debug \
compile-amd64-debug-max \
+ compile-amd64-debug-max-no-ndb \
compile-amd64-gcov \
compile-amd64-gprof \
compile-amd64-max \
compile-amd64-max-sci \
+ compile-amd64-valgrind-max \
compile-darwin-mwcc \
compile-dist \
compile-hpux11-parisc2-aCC \
@@ -41,7 +44,6 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-debug-max \
compile-pentium-debug-max-no-embedded \
compile-pentium-debug-max-no-ndb \
- compile-pentium-debug-no-bdb \
compile-pentium-debug-openssl \
compile-pentium-debug-yassl \
compile-pentium-gcov \
@@ -54,10 +56,12 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-mysqlfs-debug \
compile-pentium-pgcc \
compile-pentium-valgrind-max \
+ compile-pentium64 \
compile-pentium64-debug \
compile-pentium64-debug-max \
compile-pentium64-gcov \
compile-pentium64-gprof \
+ compile-pentium64-max \
compile-pentium64-max-sci \
compile-pentium64-valgrind-max \
compile-ppc \
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index a4ec8be1018..0c8c42efab8 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -17,95 +17,154 @@
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
-if test ! -f sql/mysqld.cc
-then
- echo "You must run this script from the MySQL top-level directory"
- exit 1
-fi
+########################################################################
-prefix_configs="--prefix=/usr/local/mysql"
-just_print=
-just_configure=
-full_debug=
-if test -n "$MYSQL_BUILD_PREFIX"
-then
- prefix_configs="--prefix=$MYSQL_BUILD_PREFIX"
-fi
+get_key_value()
+{
+ echo "$1" | sed 's/^--[a-zA-Z_-]*=//'
+}
-while test $# -gt 0
-do
- case "$1" in
- --prefix=* ) prefix_configs="$1"; shift ;;
- --with-debug=full ) full_debug="=full"; shift ;;
- -c | --just-configure ) just_configure=1; shift ;;
- -n | --just-print | --print ) just_print=1; shift ;;
- -h | --help ) cat <<EOF; exit 0 ;;
+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.
+Note: this script is intended for internal use by MySQL developers.
EOF
- * )
- echo "Unknown option '$1'"
- echo "Use -h or --help for usage"
- exit 1
- break ;;
- esac
-done
+}
+
+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
+}
+
+########################################################################
-set -e
-
-export AM_MAKEFLAGS
-AM_MAKEFLAGS="-j 4"
+if test ! -f sql/mysqld.cc
+then
+ echo "You must run this script from the MySQL top-level directory"
+ exit 1
+fi
-# SSL library to use.
-SSL_LIBRARY=--with-yassl
+prefix="/usr/local/mysql"
+just_print=
+just_configure=
+full_debug=
+warning_mode=
-# If you are not using codefusion add "-Wpointer-arith" to WARNINGS
-# The following warning flag will give too many warnings:
-# -Wunused -Winline (The later isn't usable in C++ as
-# __attribute()__ doesn't work with gnu C++)
+parse_options "$@"
-global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
-#
-# For more warnings, uncomment the following line
-# global_warnings="$global_warnings -Wshadow"
+if test -n "$MYSQL_BUILD_PREFIX"
+then
+ prefix="$MYSQL_BUILD_PREFIX"
+fi
-c_warnings="$global_warnings -Wunused"
-cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
-base_max_configs="--with-innodb --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY"
-base_max_no_ndb_configs="--with-innodb --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY"
-max_leave_isam_configs="--with-innodb --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine $SSL_LIBRARY --with-embedded-server --with-big-tables"
-max_configs="$base_max_configs --with-embedded-server"
-max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server"
+set -e
+#
+# Check for the CPU and set up CPU specific flags. We may reset them
+# later.
+#
path=`dirname $0`
. "$path/check-cpu"
-alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag"
-amd64_cflags="$check_cpu_cflags"
-pentium_cflags="$check_cpu_cflags"
-pentium64_cflags="$check_cpu_cflags -m64"
-ppc_cflags="$check_cpu_cflags"
-sparc_cflags=""
+export AM_MAKEFLAGS
+AM_MAKEFLAGS="-j 6"
-# be as fast as we can be without losing our ability to backtrace
-fast_cflags="-O3 -fno-omit-frame-pointer"
-# this is one is for someone who thinks 1% speedup is worth not being
-# able to backtrace
-reckless_cflags="-O3 -fomit-frame-pointer "
+# 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="-Wall -Wextra -Wunused -Wwrite-strings"
-debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX"
-debug_extra_cflags="-O1 -Wuninitialized"
+# For more warnings, uncomment the following line
+# warnings="$warnings -Wshadow"
+
+# C warnings
+ c_warnings="$warnings"
+# C++ warnings
+ cxx_warnings="$warnings -Wno-unused-parameter"
+# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
+ cxx_warnings="$cxx_warnings -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.
+# Used in -valgrind builds
+# 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_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 -DSAFE_MUTEX"
+error_inject="--with-error-inject "
+#
+# Base C++ flags for all builds
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
-amd64_cxxflags="" # If dropping '--with-big-tables', add here "-DBIG_TABLES"
+#
+# Flags for optimizing builds.
+# Be as fast as we can be without losing our ability to backtrace.
+fast_cflags="-O3 -fno-omit-frame-pointer"
-base_configs="$prefix_configs --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables"
+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"
if test -d "$path/../cmd-line-utils/readline"
then
@@ -115,21 +174,28 @@ then
base_configs="$base_configs --with-libedit"
fi
-static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static"
-amd64_configs=""
-alpha_configs="" # Not used yet
-pentium_configs=""
-sparc_configs=""
+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"
-debug_configs="--with-debug$full_debug"
-if [ -z "$full_debug" ]
-then
- debug_cflags="$debug_cflags $debug_extra_cflags"
-fi
+
+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
@@ -150,7 +216,13 @@ fi
# (http://samba.org/ccache) is installed, use it.
# We use 'grep' and hope 'grep' will work as expected
# (returns 0 if finds lines)
-if ccache -V > /dev/null 2>&1
+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"
diff --git a/BUILD/autorun.sh b/BUILD/autorun.sh
index 53668e2f24d..ef298b54eec 100755
--- a/BUILD/autorun.sh
+++ b/BUILD/autorun.sh
@@ -21,19 +21,29 @@
die() { echo "$@"; exit 1; }
+# Handle "glibtoolize" (e.g., for native OS X autotools) as another
+# name for "libtoolize". Use the first one, either name, found in PATH.
+LIBTOOLIZE=libtoolize # Default
+IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
+for dir in $PATH
+do
+ if test -x $dir/glibtoolize
+ then
+ LIBTOOLIZE=glibtoolize
+ break
+ elif test -x $dir/libtoolize
+ then
+ break
+ fi
+done
+IFS="$save_ifs"
+
aclocal || die "Can't execute aclocal"
autoheader || die "Can't execute autoheader"
# --force means overwrite ltmain.sh script if it already exists
-# Added glibtoolize reference to make native OSX autotools work
-if test -f /usr/bin/glibtoolize ; then
- glibtoolize --automake --force || die "Can't execute glibtoolize"
-else
- libtoolize --automake --force || die "Can't execute libtoolize"
-fi
+$LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
# --add-missing instructs automake to install missing auxiliary files
# and --force to overwrite them if they already exist
-automake --add-missing --force || die "Can't execute automake"
+automake --add-missing --force --copy || die "Can't execute automake"
autoconf || die "Can't execute autoconf"
-(cd bdb/dist && sh s_all)
-(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh
new file mode 100755
index 00000000000..70ef792b041
--- /dev/null
+++ b/BUILD/build_mccge.sh
@@ -0,0 +1,1845 @@
+#!/bin/sh
+
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
+die()
+{
+ echo "ERROR: $@"; exit 1;
+}
+
+get_key_value()
+{
+ echo "$1" | sed 's/^--[a-zA-Z_-]*=//'
+}
+
+developer_usage()
+{
+cat <<EOF
+
+ This script can be used by developers of MySQL, early adopters wanting
+ to try out early versions of MySQL before binary versions are
+ available, anyone needing a version with a special patch included that
+ needs to be built from source code, or anyone else wanting to exercise
+ full control over the MySQL build process.
+
+ This help text is targeted towards those that want to debug and test
+ MySQL using source code releases. If you have downloaded a source code
+ release and simply want to build a usable binary, you should read the
+ --sysadmin-help instead.
+
+ The script is also designed to be used by anyone receiving a source
+ code release of MySQL Cluster Carrier Grade Edition. The default
+ behaviour is to build the standard MySQL Cluster Carrier Grade Edition
+ package. Three environment variables can be used to change the
+ default behaviour:
+
+ MYSQL_DEVELOPER
+ Defining this variable is similar to setting the --developer flag
+ MYSQL_DEVELOPER_PACKAGE=package
+ Defining this variable is similar to setting the --package=*
+ variable
+ MYSQL_DEVELOPER_DEBUG
+ Defining this variable sets the --with-debug flag
+
+ Options used with this script always override any default behaviour.
+ The default package is MySQL Cluster Carrier Grade (standard) Edition.
+ For developers, the default package is MySQL Cluster Carrier Grade
+ Extended Edition, and the default build behaviour is to build with
+ autotools. If you want to skip autotools and start from a source code
+ release you can use the --no-autotools flag.
+
+ More information for developers can be found in --help,
+ --sysadmin-help, and --extended-help.
+
+ The most common usage for developers is to set the three variables
+ mentioned previously and then simply to run the script without any
+ additional parameters, using them only when needing to change some
+ things like not requiring debug build. If some of these environment
+ variables have already been set, you can use the corresponding options
+ to unset them and reverse their effects.
+EOF
+}
+
+sysadmin_usage()
+{
+cat <<EOF
+
+ This script can be used to build MySQL Cluster Carrier Grade Edition
+ based on a source code release you received from MySQL. It can also
+ be used to build many variants other variants of MySQL, in particular
+ various performance-optimised versions of MySQL.
+
+ It is assumed that you are building on a computer which is of the
+ same type as that on which you intend to run MySQL/MySQL Cluster.
+
+ The simplest possible way to run this script is to allow it to use the
+ built-in defaults everywhere, invoking it simply as (from top-level
+ MySQL directory):
+
+ shell> BUILD/build_mccge.sh
+
+ This performs the following operations:
+ 1) Detects the operating system. Currently, Linux, FreeBSD, Solaris
+ 8/9/10/11, and Mac OS X are supported by this script.
+ 2) Detect the type of CPU being used. Currently supported processors
+ are: x86 for all supported operating systems, Itanium for Linux
+ with GCC, and x86 + SPARC for Solaris using the Forte compiler and
+ finally x86 on Linux using the Intel compiler.
+ 3) Invokes the GCC compiler.
+ 4) Builds a set of MySQL/MySQL Cluster binaries; for
+ more information about these, see --extended-help.
+ 5) Default compiler is always gcc.
+
+ The default version assumes that you have a source code tarball from
+ which you are building, and thus autoconf and automake do not need to
+ be run. If you have downloaded a BitKeeper tree then you should read
+ --developer-help.
+
+ If you are building MySQL/MySQL Cluster for commercial
+ use then you need to set the --commercial flag to ensure that the
+ commercial libraries are compiled in, rather than the GPL-only
+ libraries. The default is to build a GPL version of MySQL Cluster
+ Carrier Grade Edition.
+
+ If your building on a Solaris SPARC machine and you want to compile
+ using SunStudio you must set
+ --compiler=forte; if you want to build using the Intel compiler on
+ Linux, you need to set --compiler=icc.
+
+ A synonym for forte is SunStudio, so one can also use
+ --compiler=SunStudio.
+
+ If you want to make sure that a 64-bit version is built then you
+ should add the flag --64. This is always set on Solaris machines and
+ when check-cpu is able to discover that a 64-bit CPU is being used. If
+ you want to ensure that a 32-bit binary is produced, use --32 instead.
+
+ If you need the binaries to be installed in a different location from
+ /usr/local/mysql, then you should set --prefix to point to where you
+ want the binaries installed.
+
+ Using a data directory other than the default (PREFIX/data) can be
+ done when starting the MySQL Server, or by invoking this script with
+ the --datadir option.
+
+ If you want your binaries stripped of surplus debug or other
+ information, use the --strip option.
+
+ If you want debug information in the binary (for example, to be
+ able to send gdb core dumps to MySQL Support), then you should add the
+ flag --with-debug; if you want a production build with only debugging
+ information in the binary then use --debug.
+
+ If your aim is not to build MySQL Cluster Carrier Grade Edition, you
+ can also use this script to build MySQL Classic and MySQL Enterprise Pro
+ versions; see the --extended-help for descriptions of these packages.
+EOF
+}
+
+usage()
+{
+cat <<EOF
+
+Usage: $0 [options]
+ --help Show this help message.
+ --sysadmin-help Show help for system administrators wishing
+ to build MySQL Cluster Carrier Grade Edition
+ or other MySQL versions.
+ --developer-help Show help for developers trying to build MySQL
+ --with-help Show extended help on --with-xxx options to
+ configure
+ --extended-help Show extended help message
+ --without-debug Build non-debug version
+ --use-comment Set the comment in the build
+ --with-fast-mutexes Use try/retry method of acquiring mutex
+ --with-debug Build debug version
+ --with-debug=full Build with full debug.
+ --with-link-time-optimizer
+ Link time optimizations enabled (Requires GCC 4.5
+ if GCC used), available for icc as well. This flag
+ is only considered if also fast is set.
+ --configure-only Stop after running configure.
+ --use-autotools Start by running autoconf, automake,.. tools
+ --no-autotools Start from configure
+ --print-only Print commands that the script will execute,
+ but do not actually execute
+ --prefix=path Build with prefix 'path'
+ --datadir=path Build with data directory set to non-standard
+ 'path'
+ --debug Build normal version, but add debug
+ information to binary
+ --developer Use extensions that most MySQL developers use
+ --no-developer Do not use extensions that most developers of
+ MySQL use
+ --commercial Use commercial libraries
+ --gpl Use gpl libraries
+ --compiler=[gcc|icc|forte|SunStudio] Select compiler
+ --cpu=[x86|x86_64|sparc|itanium] Select CPU type
+ x86 => x86 and 32-bit binary
+ x86_64 => x86 and 64 bit binary
+ --warning-mode=[extra|pedantic|normal|no] Set warning mode level
+ --warnings Set warning mode to normal
+ --32 Build a 32-bit binary even if CPU is 64-bit
+ --64 Build a 64-bit binary even if not sure a
+ 64-bit CPU is being used
+ --package=[cge|extended|pro|classic] Select package to build
+ --parallelism=number Define parallelism in make
+ --strip Strip binaries
+ --error-inject Enable error injection into MySQL Server and
+ data nodes
+ --valgrind Build with valgrind
+ --fast Optimise for CPU architecture built on
+ --static-linking Statically link system libraries into binaries
+ --use-tcmalloc Link with tcmalloc instead of standard malloc (Linux only)
+ --with-flags * Pass extra --with-xxx options to configure
+EOF
+ if test "x$1" != "x" ; then
+ echo "Failure Message: $1"
+ fi
+}
+
+extended_usage()
+{
+ cat <<EOF
+
+ Extended help text for this script:
+ -----------------------------------
+ This script is intended to make it easier for customers using MySQL
+ Cluster Carrier Grade Edition, customers using performance-optimised
+ MySQL versions and developers to build the product from source on
+ these platforms/compilers: Linux/x86 (32-bit and 64-bit) (either using
+ gcc or icc), Linux Itanium, Solaris 8,9,10 and 11 x86 and SPARC using
+ gcc or SunStudio and MacOSX/x86/gcc.
+
+ The script automatically detects CPU type and operating system; The
+ default compiler is always gcc.
+
+ To build on other platforms you can use the --print-only option on a
+ supported platform and edit the output for a proper set of commands on
+ the specific platform you are using. MySQL also provides custom builds
+ for any type of platform that is officially supported for MySQL
+ Cluster. For a list of supported platforms, see
+ http://www.mysql.com/support/supportedplatforms/cluster.html.
+
+ Using the --package option, it is also possible to build a "classic"
+ version of MySQL having only the MyISAM storage engine, a "Pro"
+ package including all storage engines and other features except MySQL
+ Cluster, and an "extended" package including these features plus MySQL
+ Cluster (this is the default if the --developer option is used).
+
+ Different MySQL storage engines are included in the build, depending
+ on which --package option is used. The comment and version strong
+ suffix are also set according to the package selected.
+
+ --package=cge
+ storage engines:
+ ARCHIVE, BLACKHOLE, CSV, FEDERATED, MYISAM, NDB
+ (All storage engines except InnoDB)
+ comment: MySQL Cluster Carrier Grade Edition GPL/Commercial version
+ built from source
+ version string suffix: -cge
+
+ --package=extended
+ storage engines:
+ ARCHIVE, BLACKHOLE, CSV, FEDERATED, MYISAM, INNODB, NDB
+ (All storage engines)
+ comment: MySQL Cluster Carrier Grade Extended Edition GPL/Commercial
+ version built from source
+ version string suffix: -cge-extended
+
+ --package=pro
+ storage engines:
+ ARCHIVE, BLACKHOLE, CSV, FEDERATED, INNODB, MYISAM
+ (All storage engines except NDB)
+ comment: MySQL Pro GPL/Commercial version built from
+ source
+ version string suffix: [none]
+
+ --package=classic
+ storage engines: CSV, MYISAM
+ comment: MySQL Classic GPL/Commercial version built
+ from source
+ version string suffix: [none]
+
+ All packages except Classic include support for user-defined
+ partitioning.
+
+ If --with-debug is used, an additional "-debug" is appended to the
+ version string.
+
+ --commercial
+ This flag prevents the use of GPL libraries which cannot be used
+ under a commercial license, such as the readline library.
+
+ --with-debug[=full]
+ This option will ensure that the version is built with debug
+ information enabled; the optimisation level is decreased to -O.
+
+ --developer
+ This option changes a number of things to make the version built
+ more appropriate to the debugging and testing needs of developers.
+ It changes the default package to "extended". It also changes the
+ default warning mode from "none" to "normal", which allows an
+ extensive list of warnings to be generated.
+
+ --error-inject
+ This flag is used only when the --developer option is also used, and
+ enables error injection in both the MySQL Server and in MySQL
+ Cluster data nodes.
+
+ The following is a list of the default configure options used for all
+ packages:
+
+ --prefix: /usr/local/mysql (can be overridden)
+
+ --libexecdir: <prefix>/bin (can be overridden)
+
+ --localstatedir: <prefix>/data, unless --datadir is used, in which
+ case it defaults to <datadir>/data (can be overridden by setting
+ --localstatedir explicitly).
+
+ --enable-local-infile: Enable use of the LOAD DATA FROM LOCAL INFILE
+ command (cannot be overridden).
+
+ --enable-thread-safe-client: Enable the multi-threaded mysql client
+ library (cannot be overridden).
+
+ --with-big-tables: Enable use of tables with more than 4G rows (cannot
+ be overridden).
+
+ --with-extra-charsets=all: Enable use of all character sets supported
+ by MySQL (cannot be overridden).
+
+ --with-ssl: Enable use of yaSSL library included in the MySQL source
+ if possible (GCC and same CC and CXX).
+ (cannot be overridden).
+
+ --with-pic: Build all binaries using position independent assembler
+ to avoid problems with dynamic linkers (cannot be overridden).
+
+ --without-example-engine: Ensure that the example engine isn't built,
+ it cannot do any useful things, it's merely intended as documentation.
+ (cannot be overridden)
+
+ --with-csv-storage-engine: Ensure that the CSV storage engine is
+ included in all builds. Since CSV is required for log tables in
+ MySQL 5.1, this option cannot be overridden.
+
+ (Note that MyISAM support is always built into the MySQL Server; the
+ server *cannot* be built without MyISAM.)
+
+ --with-mysqld-ldflags=-static
+ --with-client-ldflags=-static
+ Ensures that binaries for, respectively, the MySQL server and client
+ are built with static libraries except for the system libraries,
+ which use dynamically loaded libraries provided by the operating
+ system. Building with --developer sets these to all-static instead,
+ to build everything statically.
+
+ In addition there are some configure options that are specific to
+ Linux operating systems:
+
+ --enable-assembler
+ Include assembler code optimisations for a number of mostly string
+ methods. Used for x86 processors only.
+
+ Neither of the preceding options can be disabled.
+
+ MySQL Cluster Carrier Grade edition also adds the following options
+ (also used by the extended package):
+
+ --with-ndbcluster
+ Include the NDB Cluster storage engine, its kernel, management
+ server, and client, as well as support for the NDB and MGM APIs.
+
+ --without-ndb-debug
+ Do not include specific NDB debug code, not even in debug versions
+ (cannot be overridden).
+
+ Package-specific options:
+ -------------------------
+ --with-innodb
+ Specifically included in the "pro" and "extended" packages, and not
+ in any of the others.
+
+ --with-comment
+ Sets the comment for the MySQL version, by package, as described
+ above.
+
+ --with-server-suffix
+ Sets the server suffix on the MySQL version, by package, as
+ described above.
+
+ Other options used:
+ -------------------
+ --with-readline
+ Use the GPL readline library for command editing functions; not
+ available with commercial packages.
+
+ --with-libedit
+ Use the BSD licensed library for command editing functions; used for
+ commercial packages.
+
+ --with-zlib-dir=bundled
+ Use the zlib package bundled with MySQL.
+
+ --with-mysqld-libs=-lmtmalloc
+ Used on Solaris to ensure that the proper malloc library is used.
+ Investigations have shown mtmalloc to be the best choice on Solaris,
+ also umem has good performance on Solaris but better debugging
+ capabilities.
+
+ Compiler options:
+ -----------------
+
+ This section describes the compiler options for each of the different
+ platforms supported by this script.
+
+ The --fast option adds -mtune=cpu_arg to the C/C++ flags (provides
+ support for Nocona, K8, and other processors).
+
+ Use of the --debug option adds -g to the C/C++ flags.
+
+ In all cases it is possible to override the definition of CC and CXX
+ by calling the script as follows:
+ CC="/usr/local/bin/gcc" CXX="/usr/local/bin/gcc" BUILD/build_mccge.sh
+
+ FreeBSD/x86/gcc
+ ---------------
+ No flags are used. Instead, configure determines the proper flags to
+ use.
+
+ Linux/x86+Itanium/gcc
+ -------------
+ For debug builds -O is used and otherwise -O3 is used.Discovery of a
+ Nocona or Core 2 Duo CPU causes a 64-bit binary to be built;
+ otherwise, the binary is 32-bit. To build a 64-bit binary, -m64 is
+ added to the C/C++ flags. (To build a 32-bit binary on a 64-bit CPU,
+ use the --32 option as described previously.)
+
+ Linux/x86+Itanium/icc
+ -------------
+ Flags used:
+ CC = icc -static-libgcc -static-intel
+ C++ = icpc -static-libgcc -static-intel
+ C/C++ flags = -mp -restrict
+
+ On Itanium we also add -no-ftz and to CC and C++ flags.
+
+ Note that if the user of this script sets CC or CXX explicitly then
+ also -static-libgcc and -static-intel needs to be set in the CC and
+ CXX.
+
+ The non-debug versions also add the following:
+ C/C++ flags += -O3 unroll2 -ip
+
+ The fast version adds (if --with-link-time-optimizer is used):
+ C/C++ flags += -ipo
+
+ On discovery of a Core 2 Duo architecture while using icc, -xT is also
+ added to the C/C++ flags; this provides optimisations specific to Core
+ 2 Duo. This is added only when the --fast flag is set.
+
+ Solaris/x86/gcc
+ ---------------
+ All builds on Solaris are by default 64-bit, so -m64 is always used in
+ the C/C++ flags. LDFLAGS is set to -m64 -O/-O2/-O3. If for
+ some reason a 32-bit Solaris is used it is necessary to add the flag
+ --32 to the script invocation. Due to bugs in compiling with -O3 on
+ Solaris only -O2 is used by default, when --fast flag is used -O3 will
+ be used instead.
+
+ Sets -m64 (default) or -m32 (if specifically set) in LDFLAGS and
+ C/C++ flags.
+
+ Solaris/Sparc/Forte
+ -------------------
+ Uses cc as CC and CC as CXX
+ Note that SunStudio uses different binaries for C and C++ compilers.
+
+ Set -m64 (default) or -m32 (if specifically set) in ASFLAGS,
+ LDFLAGS and C/C++ flags.
+
+ Sets ASFLAGS=LDFLAGS=compiler flags=xarch=sparc, so that we compile
+ Sparc v9 binaries, also -mt is set in all those since we're always
+ building a multithreaded program.
+
+ C flags = -xstrconst This flag is set only on SPARC
+ C++ flags = -noex
+
+ Set the following C/C++ flags:
+ -fsimple=1
+ -ftrap=%none
+ -nofstore This flag is set only on x86
+ -xbuiltin=%all
+ -xlibmil
+ -xlibmopt
+
+ Set the C++ flag:
+ -noex
+ -features=no%except This flag is set only on x86
+
+ When compiling with fast we set (-ipo only used if we have
+ set --with-link-time-optimizer):
+ C/C++ flags: -xtarget=native -xunroll=3 -xipo
+ LDFLAGS: -xipo
+
+ When not compiling with fast we always set -xtarget=generic
+
+ When compiling with fast on SPARC we also set:
+ C/C++ flags: -xbinopt=prepare
+ LDFLAGS: -xbinopt=prepare
+
+ When compiling with fast on x86 we also set:
+ C/C++ flags: -xregs=frameptr
+ When not compiling with fast we set on x86
+ C/C++ flags: -xregs=no%frameptr
+
+ On SPARC we set
+ ASFLAGS = LDFLAGS = C/C++ flags = -xarch=sparc
+
+ The optimisation level is
+ -xO Debug builds
+ -xO2 Production build on SPARC
+ -xO3 Production build on x86
+ -xO4 Fast builds on SPARC/x86
+
+ MacOSX/x86/gcc
+ --------------
+ C/C++ flags include -fno-common -arch i386.
+ When 64-bits builds then i386 is replaced by x86_64.
+
+ Non-debug versions also add -Os -felide-constructors, where "-Os"
+ means the build is space-optimised as long as the space optimisations
+ do not negatively affect performance. Debug versions use -O.
+
+ Mac OS X builds will always be 32-bit by default, when --64 is added
+ the build will be 64 bit instead. Thus the flag --m64 is added only
+ when specifically given as an option.
+EOF
+}
+
+with_usage()
+{
+ cat <<EOF
+
+ To obtain extended help on the --with-* options available, run this
+ script with --configure-only to create a configuration file. Then
+ issue the command ./configure --help to get an extensive list of
+ possible configure options.
+
+ The remainder of this text focuses on those options which are useful
+ in building binaries for MySQL Cluster Carrier Grade Edition.
+
+ --with-ndb-sci=/opt/DIS
+ Used to build a MySQL Cluster Carrier Grade Edition that can use the
+ SCI Transporter. The Dolphin SCI installation must be completed
+ first (see
+ http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-interconnects.html
+ for more information).
+
+ --with-ndb-test
+ Compile the MySQL Cluster test programs.
+
+ --with-ndb-port=PORT
+ Change the default port for the MySQL Cluster management server.
+
+ --with-ndb-port-base=PORT
+ Change the default port base for MySQL Cluster data nodes.
+
+ --without-query-cache
+ Build the MySQL Server without the query cache, which is often not
+ of value in MySQL Cluster applications.
+
+ --with-atomic-ops=rwlocks|smp|up
+ Implement atomic operations using pthread
+ rwlocks or atomic CPU instructions for
+ multi-processor (default) or single-processor
+ configurations.
+
+ --without-geometry Do not build geometry-related portions of the
+ MySQL Server. Seldom used in MySQL Cluster
+ applications.
+
+ --with-ndb-cc-flags=FLAGS
+ This option can be used to build MySQL Cluster with error injection
+ on the data nodes. It can be used to pass special options to
+ programs in the NDB kernel for special test builds.
+ The option for enabling data node error injection is -DERROR_INSERT.
+EOF
+}
+
+parse_package()
+{
+ case "$package" in
+ classic )
+ package="classic"
+ ;;
+ pro )
+ package="pro"
+ ;;
+ extended )
+ package="extended"
+ ;;
+ cge )
+ package="cge"
+ ;;
+ *)
+ echo "Unknown package '$package'"
+ exit 1
+ ;;
+ esac
+}
+
+parse_warning_mode()
+{
+ case "$warning_mode" in
+ pedantic )
+ warning_mode="pedantic"
+ ;;
+ extra_warnings | extra-warnings | extra )
+ warning_mode="extra"
+ ;;
+ no )
+ warning_mode=
+ ;;
+ normal )
+ warning_mode="normal"
+ ;;
+ *)
+ echo "Unknown warning mode '$warning_mode'"
+ exit 1
+ ;;
+ esac
+}
+
+#
+# We currently only support x86, Itanium and UltraSparc processors.
+#
+parse_cpu_type()
+{
+ case "$cpu_type" in
+ x86 )
+ cpu_type="x86"
+ if test "x$m64" = "x" ; then
+ m64="no"
+ fi
+ ;;
+ x86_64 )
+ cpu_type="x86"
+ if test "x$m64" = "x" ; then
+ m64="yes"
+ fi
+ ;;
+ itanium )
+ cpu_type="itanium"
+ ;;
+ sparc )
+ cpu_type="sparc"
+ ;;
+ * )
+ echo "Unknown CPU type $cpu_type"
+ exit 1
+ ;;
+ esac
+ return
+}
+
+#
+# We currently only support gcc, icc and Forte.
+#
+parse_compiler()
+{
+ case "$compiler" in
+ gcc )
+ compiler="gcc"
+ ;;
+ icc )
+ compiler="icc"
+ ;;
+ forte | SunStudio | sunstudio )
+ compiler="forte"
+ ;;
+ *)
+ echo "Unknown compiler '$compiler'"
+ exit 1
+ ;;
+ esac
+}
+
+parse_options()
+{
+ while test $# -gt 0
+ do
+ case "$1" in
+ --prefix=*)
+ prefix=`get_key_value "$1"`
+ ;;
+ --datadir=*)
+ datadir=`get_key_value "$1"`
+ ;;
+ --with-link-time-optimizer)
+ with_link_time_optimizer="yes"
+ ;;
+ --with-debug=full)
+ full_debug="=full"
+ with_debug_flag="yes"
+ fast_flag="no"
+ ;;
+ --without-debug)
+ with_debug_flag="no"
+ if test "x$fast_flag" != "xyes" ; then
+ fast_flag="generic"
+ fi
+ ;;
+ --use-comment)
+ without_comment="no"
+ ;;
+ --with-fast-mutexes)
+ with_fast_mutexes="yes"
+ ;;
+ --use-tcmalloc)
+ use_tcmalloc="yes"
+ ;;
+ --with-debug)
+ with_debug_flag="yes"
+ fast_flag="no"
+ ;;
+ --debug)
+ compile_debug_flag="yes"
+ ;;
+ --no-developer)
+ developer_flag="no"
+ ;;
+ --developer)
+ developer_flag="yes"
+ ;;
+ --commercial)
+ gpl="no"
+ ;;
+ --gpl)
+ gpl="yes"
+ ;;
+ --compiler=*)
+ compiler=`get_key_value "$1"`
+ parse_compiler
+ ;;
+ --cpu=*)
+ cpu_type=`get_key_value "$1"`
+ parse_cpu_type
+ ;;
+ --warning-mode=*)
+ warning_mode=`get_key_value "$1"`
+ parse_warning_mode
+ ;;
+ --warnings)
+ warning_mode="normal"
+ ;;
+ --32)
+ if test "x$explicit_size_set" != "x" ; then
+ echo "Cannot set both --32 and --64"
+ exit 1
+ fi
+ explicit_size_set="yes"
+ m64="no"
+ ;;
+ --64)
+ if test "x$explicit_size_set" != "x" ; then
+ echo "Cannot set both --32 and --64"
+ exit 1
+ fi
+ explicit_size_set="yes"
+ m64="yes"
+ ;;
+ --package=*)
+ package=`get_key_value "$1"`
+ parse_package
+ ;;
+ --parallelism=*)
+ parallelism=`get_key_value "$1"`
+ ;;
+ --use-autotools)
+ use_autotools="yes"
+ ;;
+ --no-autotools)
+ use_autotools="no"
+ ;;
+ --configure-only)
+ just_configure="yes"
+ ;;
+ --print-only)
+ just_print="yes"
+ ;;
+ --static-linking)
+ static_linking_flag="yes"
+ ;;
+ --strip)
+ strip_flag="yes"
+ ;;
+ --error-inject)
+ error_inject_flag="yes"
+ ;;
+ --valgrind)
+ valgrind="yes"
+ ;;
+ --fast)
+ fast_flag="yes"
+ ;;
+ --with-flags)
+ shift
+ break
+ ;;
+ --with-help)
+ with_usage
+ exit 0
+ ;;
+ --sysadmin-help)
+ sysadmin_usage
+ exit 0
+ ;;
+ --developer-help)
+ developer_usage
+ exit 0
+ ;;
+ --extended-help)
+ extended_usage
+ exit 0
+ ;;
+ --help)
+ usage
+ exit 0
+ ;;
+ *)
+ echo "Unknown option '$1'"
+ exit 1
+ ;;
+ esac
+ shift
+ done
+ for flag in $@
+ do
+ with_flags="$with_flags $flag"
+ done
+}
+
+#
+# We currently only support Linux, FreeBSD/OpenBSD, Mac OS X and Solaris
+#
+check_os()
+{
+ case "`uname -s`" in
+ Linux)
+ os="linux"
+ ;;
+ FreeBSD|OpenBSD)
+ os="bsd"
+ ;;
+ Darwin)
+ os="MacOSX"
+ ;;
+ SunOS)
+ os="Solaris"
+ ;;
+ *)
+ os="Unknown"
+ ;;
+ esac
+
+}
+
+set_cpu_base()
+{
+ if test "x$cpu_type" = "x" ; then
+ if test "x$cpu_arg" = "x" ; then
+ usage "CPU type not discovered, cannot proceed"
+ exit 1
+ fi
+ case "$cpu_arg" in
+ core2 | nocona | prescott | pentium* | i*86 )
+ # Intel CPU
+ cpu_base_type="x86"
+ ;;
+ athlon* | opteron* | k6 | k8 )
+ # AMD CPU
+ cpu_base_type="x86"
+ ;;
+ sparc )
+ cpu_base_type="sparc"
+ ;;
+ itanium )
+ cpu_base_type="itanium"
+ ;;
+ * )
+ usage "CPU type $cpu_arg not handled by this script"
+ exit 1
+ ;;
+ esac
+ else
+ cpu_base_type="$cpu_type"
+ check_cpu_cflags=""
+ fi
+ if test "x$os" = "xMacOSX" ; then
+ if test "x$m64" = "x" ; then
+ m64="no"
+ fi
+ elif test "x$os" = "xSolaris" ; then
+ if test "x$m64" = "x" ; then
+ m64="yes"
+ fi
+ elif test "x$m64" = "x" ; then
+ if test "x$cpu_arg" = "xnocona" || test "x$cpu_arg" = "xcore2" || \
+ test "x$cpu_arg" = "xathlon64" || test "x$cpu_arg" = "xopteron" ; then
+ m64="yes"
+ else
+ m64="no"
+ fi
+ fi
+ echo "Discovered CPU of type $cpu_base_type ($cpu_arg) on $os"
+ if test "x$m64" = "xyes" ; then
+ echo "Will compile 64-bit binaries"
+ else
+ echo "Will compile 32-bit binaries"
+ fi
+ return 0
+}
+
+#
+# Add to the variable commands with the configure command
+#
+init_configure_commands()
+{
+ cflags="$c_warnings $base_cflags $compiler_flags"
+ cxxflags="$cxx_warnings $base_cxxflags $compiler_flags"
+ configure="./configure $base_configs $with_flags"
+
+ env_flags="CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\""
+ if test "x$LDFLAGS" != "x" ; then
+ env_flags="$env_flags LDFLAGS=\"$LDFLAGS\""
+ fi
+ if test "x$ASFLAGS" != "x" ; then
+ env_flags="$env_flags ASFLAGS=\"$ASFLAGS\""
+ fi
+ commands="$commands
+ $env_flags $configure"
+}
+
+#
+# Initialise the variable commands with the commands needed to generate
+# the configure script.
+#
+init_auto_commands()
+{
+ set_libtoolize_version
+ commands="\
+ $make -k maintainer-clean || true
+ /bin/rm -rf */.deps/*.P configure config.cache
+ /bin/rm -rf storage/*/configure storage/*/config.cache autom4te.cache
+ /bin/rm -rf storage/*/autom4te.cache;"
+#
+# --add-missing instructs automake to install missing auxiliary files
+# and --force to overwrite them if they already exist
+#
+ commands="$commands
+ aclocal || die \"Can't execute aclocal\"
+ autoheader || die \"Can't execute autoheader\"
+ $LIBTOOLIZE --automake --copy --force || die \"Can't execute libtoolize\"
+ automake --add-missing --copy --force || die \"Can't execute automake\"
+ autoconf || die \"Can't execute autoconf\""
+}
+
+#
+# Add to the variable commands the make command and possibly also
+# strip commands
+#
+add_make_commands()
+{
+ AM_MAKEFLAGS="-j $parallelism"
+ commands="$commands
+ $make $AM_MAKEFLAGS"
+
+ if test "x$strip_flag" = "xyes" ; then
+ commands="$commands
+ mkdir -p tmp
+ nm --numeric-sort sql/mysqld > tmp/mysqld.sym
+ objdump -d sql/mysqld > tmp/mysqld.S
+ strip sql/mysqld
+ strip storage/ndb/src/kernel/ndbd
+ strip storage/ndb/src/mgmsrv/ndb_mgmd
+ strip storage/ndb/src/mgmclient/ndb_mgm"
+ fi
+}
+
+#
+# Set make version, but only gmake is supported :)
+#
+set_make_version()
+{
+ if gmake --version > /dev/null 2>&1
+ then
+ make=gmake
+ else
+ make=make
+ fi
+ if test "x`$make --version | grep GNU`" = "x" ; then
+ die "Only gmake is supported"
+ fi
+}
+
+#
+# Find a libtoolize binary, both libtoolize and glibtoolize are
+# ok, use first found.
+#
+set_libtoolize_version()
+{
+ LIBTOOLIZE=not_found
+ save_ifs="$IFS"; IFS=':'
+ for dir in $PATH
+ do
+ if test -x $dir/libtoolize
+ then
+ LIBTOOLIZE=libtoolize
+ echo "Found libtoolize in $dir"
+ break
+ fi
+ if test -x $dir/glibtoolize
+ then
+ LIBTOOLIZE=glibtoolize
+ echo "Found glibtoolize in $dir"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test "x$LIBTOOLIZE" = "xnot_found" ; then
+ die "Found no libtoolize version, quitting here"
+ fi
+ return
+}
+
+#
+# If ccache (a compiler cache which reduces build time)
+# (http://samba.org/ccache) is installed, use it.
+# We use 'grep' and hope that 'grep' works as expected
+# (returns 0 if finds lines)
+# We do not use ccache when gcov is used. Also only when
+# gcc is used.
+#
+set_ccache_usage()
+{
+ if test "x$compiler" = "xgcc" ; then
+ if ccache -V > /dev/null 2>&1 && test "$USING_GCOV" != "1"
+ then
+ echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
+ echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX"
+ fi
+ fi
+}
+
+#
+# Set flags for various build configurations.
+# Used in -valgrind builds
+#
+set_valgrind_flags()
+{
+ if test "x$valgrind_flag" = "xyes" ; then
+ loc_valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify "
+ loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
+ compiler_flags="$compiler_flags $loc_valgrind_flags"
+ with_flags="$with_flags --with-valgrind"
+ fi
+}
+
+#
+# Set up warnings; default is to use no warnings, but if warning_mode
+# is used a lot of warning flags are set up. These flags are valid only
+# for gcc, so for other compilers we ignore the warning_mode.
+#
+set_warning_flags()
+{
+ if test "x$developer_flag" = "xyes" && test "x$warning_mode" = "x" ; then
+ warning_mode="normal"
+ fi
+ if test "x$compiler" = "xgcc" ; then
+ if test "x$warning_mode" = "normal" || test "x$warning_mode" = "extra" ; then
+# Both C and C++ warnings
+ warnings="$warnings -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs"
+ warnings="$warnings -Wcomment -W"
+ warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
+ warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label"
+ warnings="$warnings -Wunused-value -Wunused-variable"
+
+ if test "x$warning_mode" = "extra" ; then
+ warnings="$warnings -Wshadow"
+ fi
+# C warnings
+ c_warnings="$warnings -Wunused-parameter"
+# C++ warnings
+ cxx_warnings="$warnings -Woverloaded-virtual -Wsign-promo -Wreorder"
+ cxx_warnings="$warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
+# Added unless --with-debug=full
+ if test "x$full_debug" = "x" ; then
+ compiler_flags="$compiler_flags -Wuninitialized"
+ fi
+ elif test "x$warning_mode" = "xpedantic" ; then
+ warnings="-W -Wall -ansi -pedantic -Wno-long-long -D_POSIX_SOURCE"
+ c_warnings="$warnings"
+ cxx_warnings="$warnings -std=c++98"
+# Reset CPU flags (-mtune), they don't work in -pedantic mode
+ check_cpu_cflags=""
+ fi
+ fi
+}
+
+#
+# Used in -debug builds
+#
+set_with_debug_flags()
+{
+ if test "x$with_debug_flag" = "xyes" ; then
+ if test "x$developer_flag" = "xyes" ; then
+ loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
+ loc_debug_flags="$loc_debug_flags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
+ compiler_flags="$compiler_flags $loc_debug_flags"
+ fi
+ fi
+}
+
+#
+# Flag for optimizing builds for developers.
+#
+set_no_omit_frame_pointer_for_developers()
+{
+ if test "x$fast_flag" != "xno" ; then
+ if test "x$developer_flag" = "xyes" && test "x$compiler" = "xgcc" ; then
+# Be as fast as we can be without losing our ability to backtrace.
+ compiler_flags="$compiler_flags -fno-omit-frame-pointer"
+ fi
+ fi
+}
+
+#
+# Add -g to all builds that requested debug information in build
+#
+set_debug_flag()
+{
+ if test "x$compile_debug_flags" = "xyes" ; then
+ compiler_flags="$compiler_flags -g"
+ fi
+}
+
+#
+# We compile in SSL support if we can, this isn't possible if CXX
+# and CC aren't the same and we're not using GCC.
+#
+set_ssl()
+{
+ if test "x$compiler" = "xgcc" && \
+ test "x$CC" = "x$CXX" ; then
+ base_configs="$base_configs --with-ssl"
+ fi
+}
+
+#
+# Base options used by all packages
+#
+# SSL library to use. --with-ssl selects the bundled yaSSL
+# implementation of SSL. To use openSSL, you must point out the location
+# of the openSSL headers and libs on your system.
+# For example: --with-ssl=/usr
+#
+set_base_configs()
+{
+ base_configs="$base_configs --prefix=$prefix"
+ base_configs="$base_configs --libexecdir=$prefix/bin"
+ base_configs="$base_configs --with-zlib-dir=bundled"
+ if test "x$datadir" = "x" ; then
+ base_configs="$base_configs --localstatedir=$prefix/data"
+ else
+ base_configs="$base_configs --localstatedir=$datadir"
+ fi
+ if test "x$with_debug_flag" = "xyes" ; then
+ base_configs="$base_configs --with-debug$full_debug"
+ fi
+ base_configs="$base_configs --enable-local-infile"
+ base_configs="$base_configs --enable-thread-safe-client"
+ base_configs="$base_configs --with-big-tables"
+ base_configs="$base_configs --with-extra-charsets=all"
+ if test "x$with_fast_mutexes" = "xyes" ; then
+ base_configs="$base_configs --with-fast-mutexes"
+ fi
+ base_configs="$base_configs --with-pic"
+ base_configs="$base_configs --with-csv-storage-engine"
+ base_configs="$base_configs --with-perfschema"
+}
+
+#
+# Add all standard engines and partitioning (included as part of MySQL
+# Cluster storage engine as well) as part of MySQL Server. These are
+# added in all packages except the classic package.
+#
+set_base_engines()
+{
+ engine_configs="--with-archive-storage-engine"
+ engine_configs="$engine_configs --with-blackhole-storage-engine"
+ engine_configs="$engine_configs --without-example-storage-engine"
+ engine_configs="$engine_configs --with-federated-storage-engine"
+ engine_configs="$engine_configs --with-partition"
+ base_configs="$base_configs $engine_configs"
+}
+
+set_innodb_engine()
+{
+ base_configs="$base_configs --with-innodb"
+}
+
+set_ndb_engine()
+{
+ base_configs="$base_configs --with-ndbcluster"
+ base_configs="$base_configs --without-ndb-debug"
+}
+
+set_pro_package()
+{
+ if test "x$without_comment" != "xyes" ; then
+ base_configs="$base_configs --with-comment=\"MySQL Enterprise Pro $version_text built from source\""
+ fi
+ if test "x$with_debug_flag" = "xyes" ; then
+ base_configs="$base_configs --with-server-suffix=\"-debug\""
+ fi
+}
+
+set_cge_extended_package()
+{
+ if test "x$without_comment" != "xyes" ; then
+ base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Extended Edition $version_text built from source\""
+ fi
+ if test "x$with_debug_flag" = "xyes" ; then
+ base_configs="$base_configs --with-server-suffix=\"-cge-extended-debug\""
+ else
+ base_configs="$base_configs --with-server-suffix=\"-cge-extended\""
+ fi
+}
+
+set_cge_package()
+{
+ if test "x$without_comment" != "xyes" ; then
+ base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Edition $version_text built from source\""
+ fi
+ if test "x$with_debug_flag" = "xyes" ; then
+ base_configs="$base_configs --with-server-suffix=\"-cge-debug\""
+ else
+ base_configs="$base_configs --with-server-suffix=\"-cge\""
+ fi
+}
+
+set_classic_package()
+{
+ if test "x$without_comment" != "xyes" ; then
+ base_configs="$base_configs --with-comment=\"MySQL Classic $version_text built from source\""
+ fi
+ if test "x$with_debug_flag" = "xyes" ; then
+ base_configs="$base_configs --with-server-suffix=\"-debug\""
+ fi
+ base_configs="$base_configs --without-example-storage-engine"
+}
+
+#
+# Special handling of readline; use readline from the MySQL
+# distribution if building a GPL version, otherwise use libedit.
+#
+set_readline_package()
+{
+ if test -d "$path/../cmd-line-utils/readline" && test "x$gpl" = "xyes" ; then
+ base_configs="$base_configs --with-readline"
+ elif test -d "$path/../cmd-line-utils/libedit" ; then
+ base_configs="$base_configs --with-libedit"
+ fi
+}
+
+#
+# If fast flag set by user we also add architecture as discovered to
+# compiler flags to make binary optimised for architecture at hand.
+# We use this feature on gcc compilers.
+#
+set_gcc_special_options()
+{
+ if test "x$fast_flag" = "xyes" && test "x$compiler" = "xgcc" ; then
+ compiler_flags="$compiler_flags $check_cpu_cflags"
+ fi
+}
+
+set_cc_and_cxx_for_gcc()
+{
+ if test "x$CC" = "x" ; then
+ CC="gcc -static-libgcc -fno-exceptions"
+ fi
+ if test "x$CXX" = "x" ; then
+ CXX="gcc -static-libgcc -fno-exceptions"
+ fi
+}
+
+set_cc_and_cxx_for_icc()
+{
+ if test "x$CC" = "x" ; then
+ CC="icc -static-intel -static-libgcc"
+ fi
+ if test "x$CXX" = "x" ; then
+ CXX="icpc -static-intel -static-libgcc"
+ fi
+}
+
+set_cc_and_cxx_for_forte()
+{
+ if test "x$CC" = "x" ; then
+ CC="cc"
+ fi
+ if test "x$CXX" = "x" ; then
+ CXX="CC"
+ fi
+}
+
+#
+# If we discover a Core 2 Duo architecture and we have enabled the fast
+# flag, we enable a compile especially optimised for Core 2 Duo. This
+# feature is currently available on Intel's icc compiler only.
+#
+set_icc_special_options()
+{
+ if test "x$fast_flag" = "xyes" && test "x$cpu_arg" = "xcore2" && \
+ test "x$compiler" = "xicc" ; then
+ compiler_flags="$compiler_flags -xT"
+ fi
+}
+
+#
+# FreeBSD Section
+#
+set_bsd_configs()
+{
+ if test "x$cpu_base_type" != "xx86" ; then
+ usage "Only x86 CPUs supported for FreeBSD"
+ exit 1
+ fi
+ if test "x$compiler" != "xgcc" ; then
+ usage "Only gcc supported for FreeBSD"
+ exit 1
+ fi
+ base_configs="$base_configs --enable-assembler"
+ if test "x$fast_flag" != "xno" ; then
+ compiler_flags="$compiler_flags -O3"
+ else
+ compiler_flags="$compiler_flags -O0"
+ fi
+ set_cc_and_cxx_for_gcc
+}
+
+check_64_bits()
+{
+ echo "Checking for 32/64-bits compilation"
+ echo "int main() { return 0; }" > temp_test.c
+ if test "x$m64" = "xyes" ; then
+ cmd="$CC $compile_flags -m64 temp_test.c"
+ if ! $cmd 2>1 ; then
+ m64="no"
+ echo "Changing to 32-bits since 64-bits didn't work"
+ else
+ echo "Will use 64-bits"
+ fi
+ else
+ cmd="$CC $compile_flags -m32 temp_test.c"
+ if ! $cmd 2>1 ; then
+ m64="yes"
+ echo "Changing to 64-bits since 32-bits didn't work"
+ else
+ echo "Will use 32-bits"
+ fi
+ fi
+ rm temp_test.c
+}
+
+#
+# Get GCC version
+#
+get_gcc_version()
+{
+ # check if compiler is gcc and dump its version
+ cc_verno=`$cc -dumpversion 2>/dev/null`
+ if test "x$?" = "x0" ; then
+ set -- `echo $cc_verno | tr '.' ' '`
+ cc_ver="GCC"
+ cc_major=$1
+ cc_minor=$2
+ cc_patch=$3
+ gcc_version=`expr $cc_major '*' 100 '+' $cc_minor`
+ fi
+}
+
+#
+# Link Time Optimizer in GCC (LTO) uses a parameter -flto
+# which was added to GCC 4.5, if --with-link-time-optimizer
+# is set then use this feature
+#
+check_for_link_time_optimizer()
+{
+ get_gcc_version
+ if test "$gcc_version" -ge 405 && \
+ test "x$with_link_time_optimizer" = "xyes" ; then
+ compiler_flags="$compiler_flags -flto"
+ LDFLAGS="$LDFLAGS -flto"
+ fi
+}
+#
+# Linux Section
+#
+set_linux_configs()
+{
+ if test "x$cpu_base_type" != "xx86" && \
+ test "x$cpu_base_type" != "xitanium" ; then
+ usage "Only x86 and Itanium CPUs supported for Linux"
+ exit 1
+ fi
+ if test "x$use_tcmalloc" = "xyes" ; then
+ base_configs="$base_configs --with-mysqld-libs=-ltcmalloc_minimal"
+ fi
+ if test "x$cpu_base_type" = "xx86" ; then
+ base_configs="$base_configs --enable-assembler"
+ fi
+ if test "x$compiler" = "xgcc" ; then
+ set_cc_and_cxx_for_gcc
+ if test "x$fast_flag" != "xno" ; then
+ if test "x$fast_flag" = "xyes" ; then
+ compiler_flags="$compiler_flags -O3"
+ check_for_link_time_optimizer
+ else
+ compiler_flags="$compiler_flags -O2"
+ fi
+ else
+ compiler_flags="$compiler_flags -O0"
+ fi
+ check_64_bits
+ if test "x$m64" = "xyes" ; then
+ compiler_flags="$compiler_flags -m64"
+ else
+ compiler_flags="$compiler_flags -m32"
+ fi
+# configure will set proper compiler flags for gcc on Linux
+ elif test "x$compiler" = "xicc" ; then
+ compiler_flags="$compiler_flags -mp -restrict"
+ set_cc_and_cxx_for_icc
+ if test "x$cpu_base_type" = "xitanium" ; then
+ compiler_flags="$compiler_flags -no-ftz"
+ fi
+ if test "x$fast_flag" != "xno" ; then
+ compiler_flags="$compiler_flags -O3 -unroll2 -ip"
+ if test "x$fast_flag" = "xyes" && \
+ test "x$with_link_time_optimizer" = "xyes" ; then
+ compiler_flags="$compiler_flags -ipo"
+ LDFLAGS="$LDFLAGS -ipo"
+ fi
+ fi
+ else
+ usage "Only gcc and icc compilers supported for Linux"
+ exit 1
+ fi
+}
+
+#
+# Solaris Section
+#
+set_solaris_configs()
+{
+# Use mtmalloc as malloc, see Tim Cook blog
+# For information on optimal compiler settings, see article at
+# http://developers.sun.com/solaris/articles/mysql_perf_tune.html
+# by Luojia Chen at Sun.
+ base_configs="$base_configs --with-named-curses=-lcurses"
+ case "`uname -a`" in
+ *5.8* | *5.9* )
+ ;;
+
+ *5.10* | *5.11*)
+ base_configs="$base_configs --with-mysqld-libs=-lmtmalloc"
+ ;;
+ *)
+ usage "Only versions 8,9, 10 and 11 supported for Solaris"
+ exit 1
+ esac
+ if test "x$cpu_base_type" != "xx86" && \
+ test "x$cpu_base_type" != "xsparc" ; then
+ usage "Only x86 and Sparc CPUs supported for Solaris"
+ exit 1
+ fi
+ if test "x$compiler" != "xgcc" && \
+ test "x$compiler" != "xforte" ; then
+ usage "Only gcc and Forte compilers supported for Solaris"
+ exit 1
+ fi
+ if test "x$m64" = "xyes" ; then
+ compiler_flags="$compiler_flags -m64"
+ LDFLAGS="-m64"
+ ASFLAGS="$ASFLAGS -m64"
+ else
+ compiler_flags="$compiler_flags -m32"
+ LDFLAGS="-m32"
+ ASFLAGS="$ASFLAGS -m32"
+ fi
+ if test "x$compiler" = "xgcc" ; then
+ set_cc_and_cxx_for_gcc
+ if test "x$cpu_base_type" != "xx86" ; then
+ usage "gcc currently not supported for Solaris on SPARC"
+ exit 1
+ fi
+ if test "x$fast_flag" = "xyes" ; then
+ LDFLAGS="$LDFLAGS -O3"
+ compiler_flags="$compiler_flags -O3"
+ check_for_link_time_optimizer
+ else
+ if test "x$fast_flag" = "xgeneric" ; then
+ LDFLAGS="$LDFLAGS -O2"
+ compiler_flags="$compiler_flags -O2"
+ else
+ LDFLAGS="$LDFLAGS -O0"
+ compiler_flags="$compiler_flags -O0"
+ fi
+ fi
+ else
+#Using Forte compiler (SunStudio)
+ set_cc_and_cxx_for_forte
+ compiler_flags="$compiler_flags -mt"
+ LDFLAGS="$LDFLAGS -mt"
+ compiler_flags="$compiler_flags -fsimple=1"
+ compiler_flags="$compiler_flags -ftrap=%none"
+ compiler_flags="$compiler_flags -xbuiltin=%all"
+ compiler_flags="$compiler_flags -xlibmil"
+ compiler_flags="$compiler_flags -xlibmopt"
+ if test "x$fast_flag" = "xyes" ; then
+ compiler_flags="$compiler_flags -xtarget=native"
+ compiler_flags="$compiler_flags -xunroll=3"
+ if test "x$with_link_time_optimizer" = "xyes" ; then
+ compiler_flags="$compiler_flags -xipo"
+ LDFLAGS="$LDFLAGS -xipo"
+ fi
+ else
+ compiler_flags="$compiler_flags -xtarget=generic"
+ fi
+ if test "x$cpu_base_type" = "xx86" ; then
+ compiler_flags="$compiler_flags -nofstore"
+ base_cxx_flags="$base_cxx_flags -features=no%except"
+ if test "x$fast_flag" = "xyes" ; then
+ compiler_flags="$compiler_flags -xregs=frameptr"
+ compiler_flags="$compiler_flags -xO4"
+ else
+ compiler_flags="$compiler_flags -xregs=no%frameptr"
+ if test "x$fast_flag" = "xgeneric" ; then
+ compiler_flags="$compiler_flags -xO2"
+ else
+ compiler_flags="$compiler_flags -xO0"
+ fi
+ fi
+ else
+#Using SPARC cpu with SunStudio (Forte) compiler
+ ASFLAGS="$ASFLAGS -xarch=sparc"
+ LDFLAGS="$LDFLAGS -xarch=sparc"
+ base_cxxflags="$base_cxxflags -noex"
+ base_cflags="$base_cflags -xstrconst"
+ compiler_flags="$compiler_flags -xarch=sparc"
+ if test "x$fast_flag" = "xyes" ; then
+ compiler_flags="$compiler_flags -xbinopt=prepare"
+ LDFLAGS="$LDFLAGS -xbinopt=prepare"
+ compiler_flags="$compiler_flags -xO4"
+ elif test "x$fast_flag" = "xgeneric" ; then
+ compiler_flags="$compiler_flags -xO3"
+ else
+ compiler_flags="$compiler_flags -xO0"
+ fi
+ fi
+ fi
+}
+
+#
+# Mac OS X Section
+#
+set_macosx_configs()
+{
+ if test "x$cpu_base_type" != "xx86" || test "x$compiler" != "xgcc" ; then
+ usage "Only gcc/x86 supported for Mac OS X"
+ exit 1
+ fi
+#
+# Optimize for space as long as it doesn't affect performance, use some
+# optimisations also when not in fast mode.
+#
+ base_cxxflags="$base_cxxflags -felide-constructors"
+ compiler_flags="$compiler_flags -fno-common"
+ if test "x$m64" = "xyes" ; then
+ compiler_flags="$compiler_flags -m64"
+ compiler_flags="$compiler_flags -arch x86_64"
+ else
+ compiler_flags="$compiler_flags -m32"
+ compiler_flags="$compiler_flags -arch i386"
+ fi
+ if test "x$fast_flag" != "xno" ; then
+ compiler_flags="$compiler_flags -Os"
+ else
+ compiler_flags="$compiler_flags -O0"
+ fi
+ set_cc_and_cxx_for_gcc
+}
+
+#
+# Use static linking for own modules and dynamic linking for system
+# modules unless specifically requested to do everything statically.
+# Should normally not be used; static_linking_flag kept in case someone
+# really needs it. Available only if developer flag is also set.
+#
+set_static_link_configs()
+{
+ if test "x$static_linking_flag" = "xyes" && test "x$developer_flag" = "xyes" ; then
+ loc_static_link="--with-mysqld-ldflags=\"-all-static\""
+ loc_static_link="$loc_static_link --with-client-ldflags=\"-all-static\""
+ else
+ loc_static_link="--with-mysqld-ldflags=\"-static\""
+ loc_static_link="$loc_static_link --with-client-ldflags=\"-static\""
+ fi
+ base_configs="$base_configs $loc_static_link"
+}
+
+#
+# Enable error injection in MySQL Server (for developer build only -
+# extra check for developer flag required).
+#
+set_error_inject_configs()
+{
+ if test "x$error_inject_flag" = "xyes" && test "x$developer_flag" = "xyes" ; then
+ base_configs="$base_configs --with-error-inject"
+ if test "x$package" = "xndb" || test "x$package" = "xextended" ; then
+ base_configs="$base_configs --with-ndb-ccflags='-DERROR_INSERT'"
+ fi
+ fi
+}
+
+set_default_package()
+{
+ if test "x$package" = "x" ; then
+ if test "x$developer_flag" = "xyes" ; then
+ package="extended"
+ else
+ package="cge"
+ fi
+ fi
+}
+
+set_autotool_flags()
+{
+ if test "x$use_autotools" = "x" ; then
+ if test "x$developer_flag" = "xno" ; then
+ use_autotools="no"
+ else
+ use_autotools="yes"
+ fi
+ fi
+}
+
+set_defaults_based_on_environment()
+{
+ if test ! -z "$MYSQL_DEVELOPER" ; then
+ developer_flag="yes"
+ fi
+ if test ! -z "$MYSQL_DEVELOPER_DEBUG" ; then
+ with_debug_flag="yes"
+ fast_flag="no"
+ fi
+ if test ! -z "$MYSQL_DEVELOPER_PACKAGE" ; then
+ package="$MYSQL_DEVELOPER_PACKAGE"
+ parse_package
+ fi
+}
+
+########################################################################
+
+if test ! -f sql/mysqld.cc ; then
+ die "You must run this script from the MySQL top-level directory"
+fi
+
+cpu_type=
+package=
+prefix="/usr/local/mysql"
+parallelism="8"
+fast_flag="generic"
+compiler="gcc"
+gpl="yes"
+version_text=
+developer_flag="no"
+just_configure=
+full_debug=
+warning_mode=
+with_flags=
+error_inject_flag=
+with_debug_flag=
+compile_debug_flag=
+strip_flag=
+valgrind_flag=
+static_linking_flag=
+compiler_flags=
+os=
+cpu_base_type=
+warnings=
+c_warnings=
+cflags=
+base_cflags=
+cxx_warnings=
+base_cxxflags=
+base_configs=
+debug_flags=
+cxxflags=
+m64=
+explicit_size_set=
+datadir=
+commands=
+use_autotools=
+engine_configs=
+ASFLAGS=
+LDFLAGS=
+use_tcmalloc=
+without_comment="yes"
+with_fast_mutexes=
+with_link_time_optimizer=
+gcc_version="0"
+
+set_defaults_based_on_environment
+
+parse_options "$@"
+
+set_autotool_flags
+set_default_package
+
+set -e
+
+#
+# Check for the CPU and set up CPU specific flags. We may reset them
+# later.
+# This call sets the cpu_arg and check_cpu_args parameters
+#
+path=`dirname $0`
+if test "x$compiler" = "xgcc" ; then
+ compiler=
+fi
+. "$path/check-cpu"
+if test "x$compiler" = "x" ; then
+ compiler="gcc"
+fi
+check_os
+set_cpu_base
+if test "x$?" = "x1" ; then
+ exit 1
+fi
+
+#
+# Set up c_warnings and cxx_warnings; add to compiler_flags.
+# Possibly reset check_cpu_flags.
+#
+set_warning_flags
+
+#
+# Add to compiler_flags.
+#
+set_valgrind_flags
+set_with_debug_flags
+set_no_omit_frame_pointer_for_developers
+set_debug_flag
+set_gcc_special_options
+set_icc_special_options
+
+#
+# Definitions of various packages possible to compile. The default is to
+# build a source variant of MySQL Cluster Carrier Grade Edition
+# including all storage engines except InnoDB, and to use GPL libraries.
+#
+set_base_configs
+if test "x$gpl" = "xyes" ; then
+ version_text="GPL version"
+else
+ version_text="Commercial version"
+fi
+if test "x$package" = "xpro" ; then
+ set_base_engines
+ set_innodb_engine
+ set_pro_package
+elif test "x$package" = "xextended" ; then
+ set_base_engines
+ set_ndb_engine
+ set_innodb_engine
+ set_cge_extended_package
+elif test "x$package" = "xcge" ; then
+ set_base_engines
+ set_ndb_engine
+ set_cge_package
+elif test "x$package" = "xclassic" ; then
+ set_classic_package
+else
+ die "No supported package was used, internal error"
+fi
+set_readline_package
+set_static_link_configs
+set_error_inject_configs
+
+#
+# This section handles flags for specific combinations of compilers,
+# operating systems, and processors.
+#
+
+if test "x$os" = "xlinux" ; then
+ set_linux_configs
+elif test "x$os" = "xSolaris" ; then
+ set_solaris_configs
+elif test "x$os" = "xMacOSX" ; then
+ set_macosx_configs
+elif test "x$os" = "xbsd" ; then
+ set_bsd_configs
+else
+ die "Operating system not supported by this script"
+fi
+set_ssl
+#
+# Final step before setting up commands is to set up proper make and
+# proper libtoolize versions, and to determine whether to use ccache.
+#
+set_make_version
+set_ccache_usage
+
+#
+# Set up commands variable from variables prepared for base
+# configurations, compiler flags, and warnings flags.
+#
+if test "x$use_autotools" = "xyes" ; then
+ init_auto_commands
+fi
+init_configure_commands
+
+if test "x$just_configure" != "xyes" ; then
+ add_make_commands
+fi
+
+#
+# The commands variable now contains the entire command to be run for
+# the build; we either execute it, or merely print it out.
+#
+if test "x$just_print" = "xyes" ; then
+ echo "$commands"
+else
+ eval "set -x; $commands"
+fi
diff --git a/BUILD/check-cpu b/BUILD/check-cpu
index ce14afcc57a..40ddea073b1 100755
--- a/BUILD/check-cpu
+++ b/BUILD/check-cpu
@@ -18,6 +18,9 @@
#
# Check cpu of current machine and find the
# best compiler optimization flags for gcc
+# Will return result in:
+# cpu_arg : Type of CPU
+# check_cpu_args : Arguments for GCC compiler settings
#
check_cpu () {
@@ -29,12 +32,14 @@ check_cpu () {
# on Linux (and others?) we can get detailed CPU information out of /proc
cpuinfo="cat $CPUINFO"
+ # detect CPU architecture
+ cpu_arch=`$cpuinfo | grep 'arch' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
+
# detect CPU family
cpu_family=`$cpuinfo | grep 'family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
if test -z "$cpu_family" ; then
cpu_family=`$cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
fi
-
# detect CPU vendor and model
cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
model_name=`$cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1`
@@ -49,7 +54,7 @@ check_cpu () {
# parse CPU flags
for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //' -e 's/[^a-zA-Z0-9_ ]/_/g'`; do
- eval cpu_flag_$flag=yes
+ eval cpu_flag_$flag=yes
done
else
# Fallback when there is no /proc/cpuinfo
@@ -69,8 +74,8 @@ check_cpu () {
fi
;;
*)
- cpu_family=`uname -m`;
- model_name=`uname -p`;
+ cpu_family=`uname -p`;
+ model_name=`uname -m`;
;;
esac
fi
@@ -78,95 +83,142 @@ check_cpu () {
# detect CPU shortname as used by gcc options
# this list is not complete, feel free to add further entries
cpu_arg=""
- case "$cpu_family--$model_name" in
+ low_cpu_arg=""
+ case "$cpu_vendor--$cpu_family--$model_name--$cpu_arch" in
# DEC Alpha
- Alpha*EV6*)
+ *Alpha*EV6*)
cpu_arg="ev6";
;;
-
+ #Core 2 Duo
+ *Intel*Core\(TM\)2*)
+ cpu_arg="nocona"
+ core2="yes"
+ ;;
# Intel ia32
- *Xeon*)
+ *Intel*Core*|*X[eE][oO][nN]*)
# a Xeon is just another pentium4 ...
# ... unless it has the "lm" (long-mode) flag set,
- # in that case it's a Xeon with EM64T support
- if [ -z "$cpu_flag_lm" ]; then
- cpu_arg="pentium4";
- else
- cpu_arg="nocona";
+ # in that case it's a Xeon with EM64T support
+ # If SSE3 support exists it is a Core2 Duo or newer
+ # So is Intel Core.
+ if [ -z "$cpu_flag_lm" ]; then
+ cpu_arg="pentium4"
+ else
+ cpu_arg="nocona"
+ fi
+ if test -z "$cpu_flag_ssse3" ; then
+ core2="no"
+ else
+ core2="yes"
fi
;;
*Pentium*4*Mobile*)
- cpu_arg="pentium4m";
- ;;
+ cpu_arg="pentium4m"
+ ;;
+ *Pentium\(R\)*\ M*)
+ cpu_arg="pentium-m"
+ low_cpu_arg="pentium3"
+ ;;
+ *Pentium\(R\)*\ D*)
+ cpu_arg="prescott"
+ ;;
*Pentium*4*)
- cpu_arg="pentium4";
+ cpu_arg="pentium4"
;;
*Pentium*III*Mobile*)
- cpu_arg="pentium3m";
- ;;
+ cpu_arg="pentium3m"
+ ;;
*Pentium*III*)
- cpu_arg="pentium3";
- ;;
+ cpu_arg="pentium3"
+ ;;
*Pentium*M*pro*)
- cpu_arg="pentium-m";
+ cpu_arg="pentium-m"
;;
*Celeron\(R\)*\ M*)
- cpu_arg="pentium-m";
- ;;
+ cpu_arg="pentium-m"
+ ;;
*Celeron*Coppermine*)
cpu_arg="pentium3"
- ;;
+ ;;
*Celeron\(R\)*)
cpu_arg="pentium4"
- ;;
+ ;;
*Celeron*)
- cpu_arg="pentium2";
- ;;
- *Athlon*64*)
- cpu_arg="athlon64";
+ cpu_arg="pentium2"
+ ;;
+ *Atom*)
+ cpu_arg="prescott"
+ ;;
+ *GenuineIntel*)
+ cpu_arg="pentium"
;;
*Turion*)
- cpu_arg="athlon64";
+ cpu_arg="athlon64"
;;
- *Opteron*)
- cpu_arg="athlon64";
+ *Athlon*64*)
+ cpu_arg="athlon64"
;;
*Athlon*)
- cpu_arg="athlon";
+ cpu_arg="athlon"
+ ;;
+ *AMD-K7*)
+ cpu_arg="athlon"
+ ;;
+ *Athlon*XP\ *)
+ cpu_arg="athlon-xp"
+ ;;
+ *AMD*Sempron\(tm\)*)
+ cpu_arg="athlon-mp"
+ ;;
+ *AMD*Athlon\(tm\)\ 64*)
+ cpu_arg="k8"
;;
*Opteron*)
- cpu_arg="opteron";
+ cpu_arg="opteron"
+ ;;
+ *Phenom*)
+ cpu_arg="k8"
+ ;;
+ *AuthenticAMD*)
+ cpu_arg="k6"
+ ;;
+ *VIA\ *)
+ cpu_arg="i686"
;;
# MacOSX / Intel
*i386*i486*)
- cpu_arg="pentium-m";
+ cpu_arg="pentium-m"
;;
- #Core 2 Duo
- *Intel*Core\(TM\)2*)
- cpu_arg="nocona";
+ *i386*)
+ cpu_arg="i386"
;;
-
# Intel ia64
*Itanium*)
- # Don't need to set any flags for itanium(at the moment)
- cpu_arg="";
+ cpu_arg="itanium"
;;
-
- #
+ *IA-64*)
+ cpu_arg="itanium"
+ ;;
+ # Solaris Sparc
+ *sparc*sun4[uv]*)
+ cpu_arg="sparc"
+ ;;
+ # Power PC
*ppc*)
- cpu_arg='powerpc'
+ cpu_arg="powerpc"
;;
-
*powerpc*)
- cpu_arg='powerpc'
+ cpu_arg="powerpc"
;;
-
# unknown
*)
- cpu_arg="";
+ cpu_arg=""
;;
esac
+ if test "x$low_cpu_arg" = "x" ; then
+ low_cpu_arg="$cpu_arg"
+ fi
if test -z "$cpu_arg" ; then
if test "$CPUINFO" != " " ; then
@@ -189,36 +241,32 @@ check_cpu () {
cc=$CC
fi
- cc_ver=`$cc --version | sed 1q`
- cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
- set -- `echo $cc_verno | tr '.' ' '`
- cc_major=$1
- cc_minor=$2
- cc_patch=$3
- cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
+ # check if compiler is gcc and dump its version
+ cc_verno=`$cc -dumpversion 2>/dev/null`
+ if test "x$?" = "x0" ; then
+ set -- `echo $cc_verno | tr '.' ' '`
+ cc_ver="GCC"
+ cc_major=$1
+ cc_minor=$2
+ cc_patch=$3
+ cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
+ fi
case "$cc_ver--$cc_verno" in
*GCC*)
# different gcc backends (and versions) have different CPU flags
case `gcc -dumpmachine` in
- i?86-*)
- if test "$cc_comp" -lt 304
- then
- check_cpu_args='-mcpu=$cpu_arg'
+ i?86-* | x86_64-*)
+ if test "$cc_comp" -lt 304 ; then
+ check_cpu_cflags="-mcpu=${low_cpu_arg}"
+ elif test "$cc_comp" -ge 402 ; then
+ check_cpu_cflags="-mtune=native"
else
- check_cpu_args='-mtune=$cpu_arg'
+ check_cpu_cflags="-mtune=${cpu_arg}"
fi
;;
ppc-*)
- check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg'
- ;;
- x86_64-*)
- if test "$cc_comp" -lt 304
- then
- check_cpu_args='-mcpu=$cpu_arg'
- else
- check_cpu_args='-mtune=$cpu_arg'
- fi
+ check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}"
;;
*)
check_cpu_cflags=""
@@ -228,7 +276,7 @@ check_cpu () {
;;
2.95.*)
# GCC 2.95 doesn't expose its name in --version output
- check_cpu_args='-m$cpu_arg'
+ check_cpu_cflags="-m${cpu_arg}"
;;
*)
check_cpu_cflags=""
@@ -239,41 +287,23 @@ check_cpu () {
# now we check whether the compiler really understands the cpu type
touch __test.c
+ if test "x$core2" = "xyes" ; then
+ cpu_arg="core2"
+ fi
while [ "$cpu_arg" ] ; do
printf "testing $cpu_arg ... " >&2
-
+
# compile check
- check_cpu_cflags=`eval echo $check_cpu_args`
- if $cc -c $check_cpu_cflags __test.c 2>/dev/null; then
- echo ok >&2
- break;
+ eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
+ if test "x$?" = "x0" ; then
+ echo ok >&2
+ break;
fi
echo failed >&2
check_cpu_cflags=""
-
- # if compile failed: check whether it supports a predecessor of this CPU
- # this list is not complete, feel free to add further entries
- case "$cpu_arg" in
- # Intel ia32
- nocona) cpu_arg=pentium4 ;;
- prescott) cpu_arg=pentium4 ;;
- pentium4m) cpu_arg=pentium4 ;;
- pentium4) cpu_arg=pentium3 ;;
- pentium3m) cpu_arg=pentium3 ;;
- pentium3) cpu_arg=pentium2 ;;
- pentium2) cpu_arg=pentiumpro ;;
- pentiumpro) cpu_arg=pentium ;;
- pentium) cpu_arg=i486 ;;
- i486) cpu_arg=i386 ;;
-
- # power / powerPC
- 7450) cpu_arg=7400 ;;
-
- *) cpu_arg="" ;;
- esac
+ break;
done
-
rm __test.*
}
diff --git a/BUILD/compile-alpha-ccc b/BUILD/compile-alpha-ccc
index 1146a8bc53c..01bfaa9af68 100755
--- a/BUILD/compile-alpha-ccc
+++ b/BUILD/compile-alpha-ccc
@@ -1,3 +1,5 @@
+#! /bin/sh
+
# Copyright (C) 2000, 2005 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
@@ -14,7 +16,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
/bin/rm -f */.deps/*.P */*.o
-make -k clean
+make -k maintainer-clean
/bin/rm -f */.deps/*.P */*.o
/bin/rm -f config.cache mysql-*.tar.gz
diff --git a/BUILD/compile-alpha-cxx b/BUILD/compile-alpha-cxx
index 386778fb045..ec35be1ba68 100755
--- a/BUILD/compile-alpha-cxx
+++ b/BUILD/compile-alpha-cxx
@@ -1,3 +1,5 @@
+#! /bin/sh
+
# Copyright (C) 2000, 2005 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
@@ -14,9 +16,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
/bin/rm -f */.deps/*.P */*.o
-make -k clean
+make -k maintainer-clean
/bin/rm -f */.deps/*.P */*.o
-/bin/rm -f */.deps/*.P config.cache innobase/config.cache bdb/build_unix/config.cache mysql-*.tar.gz
+/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache mysql-*.tar.gz
path=`dirname $0`
. "$path/autorun.sh"
diff --git a/BUILD/compile-alpha-debug b/BUILD/compile-alpha-debug
index ccaec6aa17a..51895d3c230 100755
--- a/BUILD/compile-alpha-debug
+++ b/BUILD/compile-alpha-debug
@@ -1,3 +1,5 @@
+#! /bin/sh
+
# Copyright (C) 2000, 2005 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
@@ -14,9 +16,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
/bin/rm -f */.deps/*.P */*.o
-make -k clean
+make -k maintainer-clean
/bin/rm -f */.deps/*.P */*.o
-/bin/rm -f */.deps/*.P config.cache innobase/config.cache bdb/build_unix/config.cache mysql-*.tar.gz
+/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache mysql-*.tar.gz
path=`dirname $0`
. "$path/autorun.sh"
diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max
index a394d3e2101..273942df5f8 100755
--- a/BUILD/compile-amd64-debug-max
+++ b/BUILD/compile-amd64-debug-max
@@ -17,9 +17,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$amd64_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$amd64_cflags $debug_cflags"
extra_configs="$amd64_configs $debug_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-amd64-debug-max-no-ndb b/BUILD/compile-amd64-debug-max-no-ndb
new file mode 100755
index 00000000000..0eaabe99108
--- /dev/null
+++ b/BUILD/compile-amd64-debug-max-no-ndb
@@ -0,0 +1,25 @@
+#! /bin/sh
+
+# Copyright (C) 2005, 2006 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+extra_flags="$amd64_cflags $debug_cflags"
+extra_configs="$amd64_configs $debug_configs $max_no_ndb_configs"
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-amd64-max b/BUILD/compile-amd64-max
index 3bd8d6cd8ba..c14f0d7104c 100755
--- a/BUILD/compile-amd64-max
+++ b/BUILD/compile-amd64-max
@@ -17,7 +17,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$amd64_cflags $fast_cflags $max_cflags -g"
+extra_flags="$amd64_cflags $fast_cflags -g"
extra_configs="$amd64_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-amd64-valgrind-max b/BUILD/compile-amd64-valgrind-max
new file mode 100755
index 00000000000..1515b6374ff
--- /dev/null
+++ b/BUILD/compile-amd64-valgrind-max
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$amd64_cflags $debug_cflags $valgrind_flags"
+extra_configs="$amd64_configs $debug_configs $valgrind_configs $max_configs"
+
+. "$path/FINISH.sh"
+
+if test -z "$just_print"
+then
+ set +v +x
+ echo "\
+******************************************************************************
+Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
+--enable-assembler. When Valgrind detects an error involving an assembly
+function (for example an uninitialized value used as an argument of an
+assembly function), Valgrind will not print the stacktrace and 'valgrind
+--gdb-attach=yes' will not work either. If you need a stacktrace in those
+cases, you have to run BUILD/compile-pentium-valgrind-max with the
+--disable-assembler argument.
+******************************************************************************"
+fi
diff --git a/BUILD/compile-darwin-mwcc b/BUILD/compile-darwin-mwcc
index 2fb96b32f80..88747de77af 100755
--- a/BUILD/compile-darwin-mwcc
+++ b/BUILD/compile-darwin-mwcc
@@ -46,14 +46,10 @@ else
;;
debug)
extra_flags="$ppc_cflags $debug_cflags"
- c_warnings="$c_warnings $debug_extra_warnings"
- cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$debug_configs"
;;
debug-max)
- extra_flags="$ppc_cflags $debug_cflags $max_cflags"
- c_warnings="$c_warnings $debug_extra_warnings"
- cxx_warnings="$cxx_warnings $debug_extra_warnings"
+ extra_flags="$ppc_cflags $debug_cflags"
extra_configs="$debug_configs $max_configs"
;;
*)
diff --git a/BUILD/compile-dist b/BUILD/compile-dist
index 66c3754381e..26f09c0edf8 100755
--- a/BUILD/compile-dist
+++ b/BUILD/compile-dist
@@ -22,14 +22,10 @@
# tree can then be picked up by "make dist" to create the "pristine source
# package" that is used as the basis for all other binary builds.
#
-test -f Makefile && make distclean
-aclocal
-autoheader
-libtoolize --automake --force --copy
-automake --force --add-missing --copy
-autoconf
-(cd bdb/dist && sh s_all)
-(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
+test -f Makefile && make maintainer-clean
+
+path=`dirname $0`
+. $path/autorun.sh
gmake=
for x in gmake gnumake make; do
@@ -78,12 +74,9 @@ then
fi
# Make sure to enable all features that affect "make dist"
+# Remember that configure restricts the man pages to the configured features !
./configure \
--with-embedded-server \
- --with-berkeley-db \
- --with-innodb \
- --enable-thread-safe-client \
- --with-extra-charsets=complex \
--with-ndbcluster
-
$gmake
+
diff --git a/BUILD/compile-hpux11-parisc2-aCC b/BUILD/compile-hpux11-parisc2-aCC
index ca2ae93e69f..5d0df465bc9 100755
--- a/BUILD/compile-hpux11-parisc2-aCC
+++ b/BUILD/compile-hpux11-parisc2-aCC
@@ -76,7 +76,7 @@ done
set -x
-make distclean
+make maintainer-clean
path=`dirname $0`
. "$path/autorun.sh"
diff --git a/BUILD/compile-ia64-debug-max b/BUILD/compile-ia64-debug-max
index ecbd750bff5..6686ae983c4 100755
--- a/BUILD/compile-ia64-debug-max
+++ b/BUILD/compile-ia64-debug-max
@@ -1,3 +1,5 @@
+#! /bin/sh
+
# Copyright (C) 2001, 2005 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
@@ -13,8 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-gmake -k clean || true
-/bin/rm -f */.deps/*.P config.cache innobase/config.cache bdb/build_unix/config.cache
+gmake -k maintainer-clean || true
+/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache
path=`dirname $0`
. "$path/autorun.sh"
diff --git a/BUILD/compile-irix-mips64-mipspro b/BUILD/compile-irix-mips64-mipspro
index 0c54309e822..a8433c715ab 100755
--- a/BUILD/compile-irix-mips64-mipspro
+++ b/BUILD/compile-irix-mips64-mipspro
@@ -48,7 +48,7 @@ else
fi
set -x
-make distclean
+make maintainer-clean
path=`dirname $0`
. "$path/autorun.sh"
diff --git a/BUILD/compile-pentium-debug b/BUILD/compile-pentium-debug
index af7c0fa978c..ab44af0712f 100755
--- a/BUILD/compile-pentium-debug
+++ b/BUILD/compile-pentium-debug
@@ -20,10 +20,6 @@ set -- "$@" --with-debug=full
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
-extra_configs="$pentium_configs $debug_configs "
-
-extra_configs="$extra_configs"
+extra_configs="$pentium_configs $debug_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max
index 66db0d31e87..69074fa47c2 100755
--- a/BUILD/compile-pentium-debug-max
+++ b/BUILD/compile-pentium-debug-max
@@ -19,9 +19,7 @@ path=`dirname $0`
set -- "$@" --with-debug=full
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
-extra_configs="$pentium_configs $debug_configs $max_configs --with-experimental-collations"
+extra_flags="$pentium_cflags $debug_cflags"
+extra_configs="$pentium_configs $debug_configs $max_configs $error_inject --with-experimental-collations"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-max-no-embedded b/BUILD/compile-pentium-debug-max-no-embedded
index ae43eada2b3..55aede7536f 100755
--- a/BUILD/compile-pentium-debug-max-no-embedded
+++ b/BUILD/compile-pentium-debug-max-no-embedded
@@ -18,9 +18,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
-extra_configs="$pentium_configs $debug_configs $base_max_configs"
+extra_flags="$pentium_cflags $debug_cflags"
+extra_configs="$pentium_configs $debug_configs $max_no_embedded_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-max-no-ndb b/BUILD/compile-pentium-debug-max-no-ndb
index cbcd954b8c2..fda8e4ac5c0 100755
--- a/BUILD/compile-pentium-debug-max-no-ndb
+++ b/BUILD/compile-pentium-debug-max-no-ndb
@@ -19,9 +19,7 @@ path=`dirname $0`
set -- "$@" --with-debug=full
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$pentium_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-no-bdb b/BUILD/compile-pentium-debug-no-bdb
deleted file mode 100755
index c28b7d0132a..00000000000
--- a/BUILD/compile-pentium-debug-no-bdb
+++ /dev/null
@@ -1,24 +0,0 @@
-#! /bin/sh
-
-# Copyright (C) 2000, 2002 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-path=`dirname $0`
-. "$path/SETUP.sh"
-
-extra_flags="$pentium_cflags $debug_cflags"
-extra_configs="$pentium_configs $debug_configs --without-berkeley-db $static_link"
-
-. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-openssl b/BUILD/compile-pentium-debug-openssl
index b8b014c512b..505cfe9b234 100755
--- a/BUILD/compile-pentium-debug-openssl
+++ b/BUILD/compile-pentium-debug-openssl
@@ -19,10 +19,8 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
-extra_configs="$extra_configs --with-debug=full --with-openssl"
+extra_configs="$extra_configs --with-debug=full --with-ssl=/usr"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-debug-yassl b/BUILD/compile-pentium-debug-yassl
index 16786151d4d..57ae409eafd 100755
--- a/BUILD/compile-pentium-debug-yassl
+++ b/BUILD/compile-pentium-debug-yassl
@@ -19,10 +19,8 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
-extra_configs="$extra_configs --with-debug=full --with-yassl"
+extra_configs="$extra_configs --with-debug=full --with-ssl"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov
index 7d355b90fba..26dc85382bf 100755
--- a/BUILD/compile-pentium-gcov
+++ b/BUILD/compile-pentium-gcov
@@ -15,13 +15,26 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Need to disable ccache, or we loose the gcov-needed compiler output files.
+
+USING_GCOV=1
+CCACHE_GCOV_VERSION_ENABLED=0
+if ccache -V > /dev/null 2>&1
+then
+ CCACHE_VER=`ccache -V | head -1 | sed s/"ccache version "//`
+ if test "$CCACHE_VER" == "2.4-gcov"
+ then
+ CCACHE_GCOV_VERSION_ENABLED=1
+ else
+ CCACHE_DISABLE=1
+ export CCACHE_DISABLE
+ fi
+fi
+export CCACHE_GCOV_VERSION_ENABLED
+
path=`dirname $0`
. "$path/SETUP.sh"
-# Need to disable ccache, or we loose the gcov-needed compiler output files.
-CCACHE_DISABLE=1
-export CCACHE_DISABLE
-
export LDFLAGS="$gcov_link_flags"
extra_flags="$pentium_cflags $debug_cflags $max_cflags $gcov_compile_flags"
diff --git a/BUILD/compile-pentium-icc-valgrind-max b/BUILD/compile-pentium-icc-valgrind-max
index 0e32efdc9a6..ebefb1b3fd0 100755
--- a/BUILD/compile-pentium-icc-valgrind-max
+++ b/BUILD/compile-pentium-icc-valgrind-max
@@ -24,7 +24,7 @@ CC=icc
CXX=icpc
export CC CXX
-extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
+extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
# Disable following warnings as these are generated by header files:
# 161 unrecognized pragma
@@ -44,6 +44,6 @@ extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT
c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572"
cxx_warnings="$c_warnings -wd869,874"
base_cxxflags="-fno-exceptions -fno-rtti"
-extra_configs="$pentium_configs $debug_configs"
+extra_configs="$pentium_configs $debug_configs $valgrind_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max
index 91e8d967302..7bd063cd24a 100755
--- a/BUILD/compile-pentium-max
+++ b/BUILD/compile-pentium-max
@@ -18,7 +18,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $fast_cflags $max_cflags -g"
+extra_flags="$pentium_cflags $fast_cflags -g"
extra_configs="$pentium_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-mysqlfs-debug b/BUILD/compile-pentium-mysqlfs-debug
index 6ef61177980..d09d2e23cfa 100755
--- a/BUILD/compile-pentium-mysqlfs-debug
+++ b/BUILD/compile-pentium-mysqlfs-debug
@@ -19,10 +19,8 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs $static_link"
-extra_configs="$extra_configs --with-debug=full --with-mysqlfs --without-server --without-pstack"
+extra_configs="$extra_configs --with-debug=full --with-mysqlfs --without-server"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-pgcc b/BUILD/compile-pentium-pgcc
index c91def7faa5..383cd288bf1 100755
--- a/BUILD/compile-pentium-pgcc
+++ b/BUILD/compile-pentium-pgcc
@@ -1,3 +1,5 @@
+#! /bin/sh
+
# Copyright (C) 2000, 2005 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
@@ -14,10 +16,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
AM_MAKEFLAGS="-j 2"
-gmake -k clean || true
+gmake -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache
-
path=`dirname $0`
. "$path/autorun.sh"
diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max
index 5aa6654bf6f..7c81e335c36 100755
--- a/BUILD/compile-pentium-valgrind-max
+++ b/BUILD/compile-pentium-valgrind-max
@@ -18,13 +18,8 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
-extra_configs="$pentium_configs $debug_configs"
-
-# We want to test isam when building with valgrind
-extra_configs="$extra_configs $max_leave_isam_configs --with-isam"
+extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
+extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-valgrind-max-no-ndb b/BUILD/compile-pentium-valgrind-max-no-ndb
new file mode 100755
index 00000000000..f869e8956b8
--- /dev/null
+++ b/BUILD/compile-pentium-valgrind-max-no-ndb
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
+extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_no_ndb_configs"
+
+. "$path/FINISH.sh"
+
+if test -z "$just_print"
+then
+ set +v +x
+ echo "\
+******************************************************************************
+Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
+--enable-assembler. When Valgrind detects an error involving an assembly
+function (for example an uninitialized value used as an argument of an
+assembly function), Valgrind will not print the stacktrace and 'valgrind
+--gdb-attach=yes' will not work either. If you need a stacktrace in those
+cases, you have to run BUILD/compile-pentium-valgrind-max with the
+--disable-assembler argument.
+******************************************************************************"
+fi
diff --git a/BUILD/compile-pentium64 b/BUILD/compile-pentium64
new file mode 100755
index 00000000000..6d24f681d73
--- /dev/null
+++ b/BUILD/compile-pentium64
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+# Copyright (C) 2006, 2007 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$pentium64_cflags $fast_cflags"
+extra_configs="$pentium_configs $static_link"
+CC="$CC --pipe"
+strip=yes
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug
index 8a768b65bc4..d33cd82adb0 100755
--- a/BUILD/compile-pentium64-debug
+++ b/BUILD/compile-pentium64-debug
@@ -20,10 +20,8 @@ set -- "$@" --with-debug=full
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs $static_link"
extra_configs="$extra_configs "
-
+CC="$CC --pipe"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max
index 5cf89c75017..747de21ad7d 100755
--- a/BUILD/compile-pentium64-debug-max
+++ b/BUILD/compile-pentium64-debug-max
@@ -19,11 +19,9 @@ path=`dirname $0`
set -- "$@" --with-debug=full
. "$path/SETUP.sh"
-extra_flags="$pentium64_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$pentium64_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $max_configs"
extra_configs="$extra_configs "
-
+CC="$CC --pipe"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-max b/BUILD/compile-pentium64-max
new file mode 100755
index 00000000000..39dcd86ef89
--- /dev/null
+++ b/BUILD/compile-pentium64-max
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+# Copyright (C) 2007 MySQL AB
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+
+path=`dirname $0`
+. "$path/SETUP.sh"
+
+extra_flags="$pentium64_cflags $fast_cflags"
+extra_configs="$pentium_configs $max_configs $static_link"
+CC="$CC --pipe"
+strip=yes
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-valgrind-max b/BUILD/compile-pentium64-valgrind-max
index 4a78977b847..db9f3f7f9f9 100755
--- a/BUILD/compile-pentium64-valgrind-max
+++ b/BUILD/compile-pentium64-valgrind-max
@@ -18,13 +18,8 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$pentium64_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
-extra_configs="$pentium_configs $debug_configs"
-
-# We want to test isam when building with valgrind
-extra_configs="$extra_configs $max_leave_isam_configs --with-isam"
+extra_flags="$pentium64_cflags $debug_cflags $valgrind_flags"
+extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-ppc-debug b/BUILD/compile-ppc-debug
index c8279de6439..76b6bf65ce4 100755
--- a/BUILD/compile-ppc-debug
+++ b/BUILD/compile-ppc-debug
@@ -19,8 +19,6 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$ppc_cflags $debug_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$debug_configs "
extra_configs="$extra_configs"
diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max
index c5718bbab21..b2c7ec18b3e 100755
--- a/BUILD/compile-ppc-debug-max
+++ b/BUILD/compile-ppc-debug-max
@@ -18,9 +18,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$ppc_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$ppc_cflags $debug_cflags"
extra_configs="$debug_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-ppc-debug-max-no-ndb b/BUILD/compile-ppc-debug-max-no-ndb
index 85d786d35ee..e77c517b302 100755
--- a/BUILD/compile-ppc-debug-max-no-ndb
+++ b/BUILD/compile-ppc-debug-max-no-ndb
@@ -18,9 +18,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$ppc_cflags $debug_cflags $max_cflags"
-c_warnings="$c_warnings $debug_extra_warnings"
-cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_flags="$ppc_cflags $debug_cflags"
extra_configs="$debug_configs $max_no_ndb_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max
index 91db8699017..cd2ada87dd8 100755
--- a/BUILD/compile-ppc-max
+++ b/BUILD/compile-ppc-max
@@ -18,7 +18,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
-extra_flags="$ppc_cflags $fast_cflags $max_cflags -g"
+extra_flags="$ppc_cflags $fast_cflags -g"
extra_configs="$extra_configs $max_configs"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-sap b/BUILD/compile-sap
deleted file mode 100755
index bdde866c49d..00000000000
--- a/BUILD/compile-sap
+++ /dev/null
@@ -1,24 +0,0 @@
-#! /bin/sh
-
-# Copyright (C) 2005 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-path=`dirname $0`
-. "$path/SETUP.sh"
-
-extra_flags="$pentium_cflags"
-extra_configs="$pentium_configs --without-berkeley-db"
-
-. "$path/FINISH.sh"
diff --git a/BUILD/compile-sap-debug b/BUILD/compile-sap-debug
deleted file mode 100755
index 1691fe26120..00000000000
--- a/BUILD/compile-sap-debug
+++ /dev/null
@@ -1,24 +0,0 @@
-#! /bin/sh
-
-# Copyright (C) 2005 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-path=`dirname $0`
-. "$path/SETUP.sh"
-
-extra_flags="$pentium_cflags $debug_cflags"
-extra_configs="$pentium_configs $debug_configs --without-berkeley-db $static_link"
-
-. "$path/FINISH.sh"
diff --git a/BUILD/compile-solaris-amd64 b/BUILD/compile-solaris-amd64
index bcd62e6de24..af44d4f3aa8 100755
--- a/BUILD/compile-solaris-amd64
+++ b/BUILD/compile-solaris-amd64
@@ -1,26 +1,72 @@
-#! /bin/sh
+#!/usr/bin/bash
# Copyright (C) 2007 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; version 2
+# of the License.
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with this library; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA
+function _find_mysql_root () (
+ while [ "x$PWD" != "x/" ]; do
+ # Check if some directories are present
+ if [ -d BUILD -a -d sql -a -d mysys ]; then
+ echo "$PWD"
+ return 0
+ fi
+ cd ..
+ done
+ return 1
+)
+
+make -k clean || true
+/bin/rm -f */.deps/*.P config.cache
+
path=`dirname $0`
-. "$path/SETUP.sh"
-amd64_cflags="-m64 -mtune=athlon64"
-extra_flags="$amd64_cflags $max_cflags"
-c_warnings="$c_warnings"
-cxx_warnings="$cxx_warnings"
-extra_configs="$amd64_configs $debug_configs $max_configs --enable-thread-safe-client"
+. "$path/autorun.sh"
+
+warning_flags="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused"
+compiler_flags="-g -O3 -fno-omit-frame-pointer"
+
+export CC CXX CFLAGS CXXFLAGS LDFLAGS LIBS
+CC="gcc"
+CXX="gcc"
+CFLAGS="$warning_flags $compiler_flags"
+CXXFLAGS=""
+LDFLAGS="-O3 -g -static-libgcc"
+LIBS=-lmtmalloc
+root=$(_find_mysql_root)
-. "$path/FINISH.sh"
+$root/configure \
+ --prefix=/usr/local/mysql \
+ --localstatedir=/usr/local/mysql/data \
+ --libexecdir=/usr/local/mysql/bin \
+ --with-extra-charsets=complex \
+ --enable-thread-safe-client \
+ --enable-local-infile \
+ --with-zlib-dir=bundled \
+ --with-big-tables \
+ --with-readline \
+ --with-archive-storage-engine \
+ --with-named-curses=-lcurses \
+ --with-big-tables \
+ --with-innodb \
+ --with-berkeley-db \
+ --with-example-storage-engine \
+ --with-blackhole-storage-engine \
+ --with-ndbcluster \
+ --with-federated-storage-engine \
+ --with-csv-storage-engine \
+ --with-ssl \
+ --with-embedded-server \
+ --disable-shared
diff --git a/BUILD/compile-solaris-amd64-forte b/BUILD/compile-solaris-amd64-forte
index 0f13bdddb16..ebdc0c9a6fc 100644..100755
--- a/BUILD/compile-solaris-amd64-forte
+++ b/BUILD/compile-solaris-amd64-forte
@@ -22,22 +22,23 @@ path=`dirname $0`
. "$path/autorun.sh"
# For "optimal" code for this computer add -fast to EXTRA
-# To compile 64 bit, add -xarch=v9 to EXTRA_64_BIT
+# To compile 64 bit, add -m64 to EXTRA_64_BIT
-EXTRA_64_BIT="-xarch=amd64"
+EXTRA_64_BIT="-m64"
EXTRA="-fast"
#
# The following should not need to be touched
#
-export CC CXX CFLAGS CXXFLAGS
+export CC CXX CFLAGS CXXFLAGS LIBS
STD="-g -mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT"
ASFLAGS="$EXTRA_64_BIT"
CC=cc-5.0
CFLAGS="-Xa -xstrconst $STD"
CXX=CC
CXXFLAGS="-noex $STD"
+LIBS=-lmtmalloc
./configure \
--prefix=/usr/local/mysql \
--localstatedir=/usr/local/mysql/data \
diff --git a/BUILD/compile-solaris-amd64-forte-debug b/BUILD/compile-solaris-amd64-forte-debug
index 9c1e892e9f4..749b6216399 100644
--- a/BUILD/compile-solaris-amd64-forte-debug
+++ b/BUILD/compile-solaris-amd64-forte-debug
@@ -21,8 +21,8 @@ gmake -k clean || true
path=`dirname $0`
. "$path/autorun.sh"
-# To compile 64 bit, add -xarch=amd64 to EXTRA_64_BIT
-EXTRA_64_BIT="-xarch=amd64"
+# To compile 64 bit, add -m64 to EXTRA_64_BIT
+EXTRA_64_BIT="-m64"
# For "optimal" code for this computer add -fast to EXTRA. Note that
# this causes problem with debugging the program since -fast implies
diff --git a/BUILD/compile-solaris-sparc b/BUILD/compile-solaris-sparc
index c3546111789..ce76f39d9a8 100755
--- a/BUILD/compile-solaris-sparc
+++ b/BUILD/compile-solaris-sparc
@@ -15,12 +15,15 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-gmake -k clean || true
+make -k clean || true
/bin/rm -f */.deps/*.P config.cache
+# gcc is often in /usr/ccs/bin or /usr/local/bin
+PATH=$PATH:/usr/ccs/bin:/usr/local/bin
+
path=`dirname $0`
. "$path/autorun.sh"
-CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
+CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
-gmake -j 4
+make -j 4
diff --git a/BUILD/compile-solaris-sparc-debug b/BUILD/compile-solaris-sparc-debug
index dfc0d9ed354..8e4a4672f2e 100755
--- a/BUILD/compile-solaris-sparc-debug
+++ b/BUILD/compile-solaris-sparc-debug
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
# Copyright (C) 2001, 2005 MySQL AB
#
@@ -15,12 +15,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-gmake -k clean || true
+make -k clean || true
/bin/rm -f */.deps/*.P config.cache
path=`dirname $0`
. "$path/autorun.sh"
-CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug
+CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug
-gmake -j 4
+make -j 4
diff --git a/BUILD/compile-solaris-sparc-forte b/BUILD/compile-solaris-sparc-forte
index cd101ace310..087fe22a591 100755
--- a/BUILD/compile-solaris-sparc-forte
+++ b/BUILD/compile-solaris-sparc-forte
@@ -15,21 +15,27 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-gmake -k clean || true
+# Assume Forte is installed in /opt/SUNWSpro and ld is installed in
+# /usr/ccs/bin
+
+PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin:$PATH
+
+prefix="/usr/local/mysql"
+if test -n "$MYSQL_BUILD_PREFIX"
+then
+ prefix="$MYSQL_BUILD_PREFIX"
+fi
+
+make -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache
path=`dirname $0`
. "$path/autorun.sh"
-
-# Assume Forte is installed in /opt/SUNWSpro
-
-PATH=/opt/SUNWspro/bin/:$PATH
-
# For "optimal" code for this computer add -fast to EXTRA
-# To compile 64 bit, add -xarch=v9 to EXTRA_64_BIT
+# To compile 32/64 bit, uncomment/comment EXTRA_64_BIT
-EXTRA_64_BIT="-xarch=v9" # Remove comment to get 64 bit binaries
+EXTRA_64_BIT="-m64"
EXTRA="-fast" # Remove comment to target current machine
#
@@ -37,12 +43,11 @@ EXTRA="-fast" # Remove comment to target current machine
#
STD="-mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT"
-ASFLAGS="$EXTRA_64_BIT" \
CC=cc-5.0 CFLAGS="-Xa -xstrconst $STD" \
-CXX=CC CXXFLAGS="-noex $STD" \
-./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
+CXX=CC CXXFLAGS="-noex $STD" LIBS="-lmtmalloc" \
+./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --prefix=$PREFIX
-gmake -j 4
+make -j 4
if [ $? = 0 ]
then
make test
diff --git a/BUILD/compile-solaris-sparc-purify b/BUILD/compile-solaris-sparc-purify
index 952137a42a2..1083835ba43 100755
--- a/BUILD/compile-solaris-sparc-purify
+++ b/BUILD/compile-solaris-sparc-purify
@@ -46,15 +46,15 @@ do
shift
done
-gmake -k clean || true
+make -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache
path=`dirname $0`
. "$path/autorun.sh"
-CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-berkeley-db --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS
+CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS
-gmake -j 4
+make -j 4
# ----------------------------------------------------------------------
@@ -90,17 +90,17 @@ purifying_binaries ()
fi
if [ -n "$mode" -a $mode = purify ] ; then
- gmake CCLD="purify $opts gcc" CXXLD="purify $opts g++" $target
+ make CCLD="purify $opts gcc" CXXLD="purify $opts g++" $target
mv $binary $binary-purify
fi
if [ -n "$mode" -a $mode = quantify ] ; then
- gmake CCLD="quantify $opts gcc" CXXLD="quantify $opts g++" $target
+ make CCLD="quantify $opts gcc" CXXLD="quantify $opts g++" $target
mv $binary $binary-quantify
fi
if [ -n "$mode" -a $mode = purecov ] ; then
- gmake CCLD="purecov $opts gcc" CXXLD="purecov $opts g++" $target
+ make CCLD="purecov $opts gcc" CXXLD="purecov $opts g++" $target
mv $binary $binary-purecov
fi
diff --git a/BUILD/test-alpha-ccc b/BUILD/test-alpha-ccc
deleted file mode 100755
index 92da165ceed..00000000000
--- a/BUILD/test-alpha-ccc
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2000 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-cd /usr/local/mysql
-bin/mysqladmin shutdown
-libexec/mysqld --basedir . &
-cd sql-bench
-rm output/*
-perl run-all-tests --comment "Alpha DS20 2x500 MHz, 2G memory, key_buffer=16M; egcs 1.1.2 + ccc" --user=monty --password="ds20-gryta"
-perl run-all-tests --comment "Alpha DS20 2x500 MHz, 2G memory, key_buffer=16M; egcs 1.1.2 + ccc" --user=monty --password="ds20-gryta" --log --use-old
-mv output/* output-ccc
-perl run-all-tests --comment "Alpha DS20 2x500 MHz, 2G memory, key_buffer=16M; egcs 1.1.2 + ccc" --user=monty --password="ds20-gryta" --fast
-perl run-all-tests --comment "Alpha DS20 2x500 MHz, 2G memory, key_buffer=16M; egcs 1.1.2 + ccc" --user=monty --password="ds20-gryta" --log --use-old --fast
-mv output/* output-ccc