2004-11-03 11:39:38 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2001-01-31 02:43:16 +01:00
|
|
|
if ! test -f sql/mysqld.cc
|
|
|
|
then
|
2000-12-18 22:24:19 +01:00
|
|
|
echo "You must run this script from the MySQL top-level directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2005-01-27 12:13:35 +01:00
|
|
|
prefix_configs="--prefix=/usr/local/mysql"
|
2003-10-08 20:50:05 +02:00
|
|
|
just_print=
|
2001-03-04 22:34:26 +01:00
|
|
|
just_configure=
|
2004-10-04 13:43:16 +02:00
|
|
|
full_debug=
|
2001-03-04 22:34:26 +01:00
|
|
|
while test $# -gt 0
|
|
|
|
do
|
|
|
|
case "$1" in
|
2005-01-27 12:13:35 +01:00
|
|
|
--prefix=* ) prefix_configs="$1"; shift ;;
|
|
|
|
--with-debug=full ) full_debug="=full"; shift ;;
|
2001-03-04 22:34:26 +01:00
|
|
|
-c | --just-configure ) just_configure=1; shift ;;
|
2003-10-08 20:50:05 +02:00
|
|
|
-n | --just-print | --print ) just_print=1; shift ;;
|
2001-03-04 22:34:26 +01:00
|
|
|
-h | --help ) cat <<EOF; exit 0 ;;
|
2001-01-31 02:43:16 +01:00
|
|
|
Usage: $0 [-h|-n] [configure-options]
|
|
|
|
-h, --help Show this help message.
|
|
|
|
-n, --just-print Don't actually run any commands; just print them.
|
2001-03-04 22:34:26 +01:00
|
|
|
-c, --just-configure Stop after running configure.
|
2005-01-27 12:13:35 +01:00
|
|
|
--with-debug=full Build with full debug.
|
|
|
|
--prefix=path Build with prefix 'path'.
|
2001-01-31 02:43:16 +01:00
|
|
|
|
|
|
|
Note: this script is intended for internal use by MySQL developers.
|
|
|
|
EOF
|
2005-01-26 15:07:53 +01:00
|
|
|
* )
|
|
|
|
echo "Unknown option '$1'"
|
|
|
|
exit 1
|
|
|
|
break ;;
|
2001-03-04 22:34:26 +01:00
|
|
|
esac
|
|
|
|
done
|
2001-01-31 02:43:16 +01:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
export AM_MAKEFLAGS
|
|
|
|
AM_MAKEFLAGS="-j 4"
|
2000-12-18 22:24:19 +01:00
|
|
|
|
|
|
|
# If you are not using codefusion add "-Wpointer-arith" to WARNINGS
|
|
|
|
# The following warning flag will give too many warnings:
|
|
|
|
# -Wshadow -Wunused -Winline (The later isn't usable in C++ as
|
|
|
|
# __attribute()__ doesn't work with gnu C++)
|
2002-05-21 19:35:58 +02:00
|
|
|
global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings"
|
2001-10-31 17:27:49 +01:00
|
|
|
#debug_extra_warnings="-Wuninitialized"
|
2000-12-18 22:24:19 +01:00
|
|
|
c_warnings="$global_warnings -Wunused"
|
2002-05-21 19:35:58 +02:00
|
|
|
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
2000-12-18 22:24:19 +01:00
|
|
|
|
2005-07-16 02:36:20 +02:00
|
|
|
base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine"
|
2005-07-15 20:15:44 +02:00
|
|
|
max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-openssl --with-embedded-server --with-big-tables"
|
|
|
|
max_configs="$base_max_configs --with-embedded-server"
|
2005-01-13 18:05:23 +01:00
|
|
|
|
2005-04-27 12:50:37 +02:00
|
|
|
path=`dirname $0`
|
|
|
|
. "$path/check-cpu"
|
|
|
|
|
|
|
|
alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag"
|
2005-04-27 12:56:01 +02:00
|
|
|
amd64_cflags="$check_cpu_cflags"
|
2005-04-27 12:50:37 +02:00
|
|
|
pentium_cflags="$check_cpu_cflags"
|
|
|
|
pentium64_cflags="$check_cpu_cflags -m64"
|
|
|
|
ppc_cflags="$check_cpu_cflags"
|
2000-12-18 22:24:19 +01:00
|
|
|
sparc_cflags=""
|
|
|
|
|
2001-05-26 00:26:52 +02:00
|
|
|
# be as fast as we can be without losing our ability to backtrace
|
2001-04-13 21:09:33 +02:00
|
|
|
fast_cflags="-O3 -fno-omit-frame-pointer"
|
2001-05-26 00:26:52 +02:00
|
|
|
# this is one is for someone who thinks 1% speedup is worth not being
|
|
|
|
# able to backtrace
|
|
|
|
reckless_cflags="-O3 -fomit-frame-pointer "
|
2004-10-04 13:43:16 +02:00
|
|
|
|
|
|
|
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX"
|
2005-01-26 15:07:53 +01:00
|
|
|
debug_extra_cflags="-O1 -Wuninitialized"
|
2000-12-18 22:24:19 +01:00
|
|
|
|
|
|
|
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
|
2005-03-30 17:45:03 +02:00
|
|
|
amd64_cxxflags="" # If dropping '--with-big-tables', add here "-DBIG_TABLES"
|
2000-12-18 22:24:19 +01:00
|
|
|
|
2005-03-30 17:45:03 +02:00
|
|
|
base_configs="$prefix_configs --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readline --with-big-tables"
|
2002-01-26 00:19:47 +01:00
|
|
|
static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static"
|
2005-01-13 18:05:23 +01:00
|
|
|
amd64_configs=""
|
2001-01-31 02:43:16 +01:00
|
|
|
alpha_configs="" # Not used yet
|
2000-12-18 22:24:19 +01:00
|
|
|
pentium_configs=""
|
|
|
|
sparc_configs=""
|
2002-03-02 20:45:44 +01:00
|
|
|
# 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"
|
2000-12-18 22:24:19 +01:00
|
|
|
|
2004-10-04 13:43:16 +02:00
|
|
|
debug_configs="--with-debug$full_debug"
|
|
|
|
if [ -z "$full_debug" ]
|
|
|
|
then
|
2005-01-26 15:07:53 +01:00
|
|
|
debug_cflags="$debug_cflags $debug_extra_cflags"
|
2004-10-04 13:43:16 +02:00
|
|
|
fi
|
2000-12-18 22:24:19 +01:00
|
|
|
|
2001-01-31 02:43:16 +01:00
|
|
|
if gmake --version > /dev/null 2>&1
|
|
|
|
then
|
2000-12-18 22:24:19 +01:00
|
|
|
make=gmake
|
|
|
|
else
|
|
|
|
make=make
|
|
|
|
fi
|
2001-10-30 15:31:35 +01:00
|
|
|
|
2003-05-23 18:20:57 +02:00
|
|
|
if test -z "$CXX" ; then
|
2003-04-09 14:53:20 +02:00
|
|
|
CXX=gcc
|
|
|
|
fi
|
2003-05-23 18:20:57 +02:00
|
|
|
|
|
|
|
# If ccache (a compiler cache which reduces build time)
|
|
|
|
# (http://samba.org/ccache) is installed, use it.
|
|
|
|
# We use 'grep' and hope 'grep' will work as expected
|
|
|
|
# (returns 0 if finds lines)
|
|
|
|
if ccache -V > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
if ! (echo "$CC" | grep "ccache" > /dev/null)
|
|
|
|
then
|
|
|
|
CC="ccache $CC"
|
|
|
|
fi
|
|
|
|
if ! (echo "$CXX" | grep "ccache" > /dev/null)
|
|
|
|
then
|
|
|
|
CXX="ccache $CXX"
|
|
|
|
fi
|
|
|
|
fi
|