diff options
author | Michael Widenius <monty@askmonty.org> | 2011-03-09 15:47:59 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-03-09 15:47:59 +0200 |
commit | 139a2b64bf8ec2e248656835e23a5c98ffc667a8 (patch) | |
tree | 7d77d6f1073f8090f275b30cb3f10254497da243 /BUILD | |
parent | b3f7eac5301529c2d069ebe4d0558980412af3a2 (diff) | |
parent | ce675406ca8dbc1532a908803a1371de8432d466 (diff) | |
download | mariadb-git-139a2b64bf8ec2e248656835e23a5c98ffc667a8.tar.gz |
Merge with 5.2
Diffstat (limited to 'BUILD')
-rw-r--r-- | BUILD/Makefile.am | 5 | ||||
-rwxr-xr-x | BUILD/SETUP.sh | 27 | ||||
-rwxr-xr-x | BUILD/build_mccge.sh | 238 | ||||
-rwxr-xr-x | BUILD/compile-pentium-mysqlfs-debug | 11 | ||||
-rwxr-xr-x | BUILD/compile-solaris-amd64-forte | 2 | ||||
-rwxr-xr-x | BUILD/compile-solaris-amd64-forte-debug | 31 |
6 files changed, 127 insertions, 187 deletions
diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am index 3d9986ab548..cf19291c9eb 100644 --- a/BUILD/Makefile.am +++ b/BUILD/Makefile.am @@ -1,11 +1,11 @@ # Copyright (C) 2002, 2004-2005 MySQL AB # -# This library is free software; you can redistribute it and/or +# 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 library is distributed in the hope that it will be useful, +# 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. @@ -54,7 +54,6 @@ EXTRA_DIST = FINISH.sh \ compile-pentium-icc-yassl \ compile-pentium-max \ compile-pentium-myodbc \ - compile-pentium-mysqlfs-debug \ compile-pentium-pgcc \ compile-pentium-valgrind-max \ compile-pentium64 \ diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 3f1933ac4ef..303766f3a78 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -98,7 +98,7 @@ SSL_LIBRARY=--with-ssl if [ "x$warning_mode" != "xpedantic" ]; then # Both C and C++ warnings - warnings="-Wall -Wextra -Wunused -Wwrite-strings" + warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized" # For more warnings, uncomment the following line # warnings="$warnings -Wshadow" @@ -112,7 +112,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then # 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" + warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -Wno-uninitialized -D_POSIX_SOURCE" c_warnings="$warnings" cxx_warnings="$warnings -std=c++98" # NOTE: warning mode should not influence optimize/debug mode. @@ -127,12 +127,13 @@ fi # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro # LINT_INIT(), which is only useful for silencing spurious warnings # of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind. -valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_valgrind " +valgrind_flags="-DHAVE_valgrind -USAFEMALLOC" +valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized" valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" valgrind_configs="--with-valgrind" # # Used in -debug builds -debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS " +debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG" debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC" error_inject="--with-error-inject " # @@ -207,6 +208,24 @@ if test -z "$CXX" ; then CXX=g++ fi + +# +# Set -Wuninitialized to debug flags for gcc 4.4 and above +# because it is allowed there without -O +# +if test `$CC -v 2>&1 | tail -1 | sed 's/ .*$//'` = 'gcc' ; then + GCCVERSION=`$CC -v 2>&1 | tail -1 | \ + sed 's/^[a-zA-Z][a-zA-Z]* [a-zA-Z][a-zA-Z]* //' | sed 's/ .*$//'` + GCCV1=`echo $GCCVERSION | sed 's/\..*$//'` + GCCV2=`echo $GCCVERSION | sed 's/[0-9][0-9]*\.//'|sed 's/\..*$//'` + if test '(' "$GCCV1" -gt '4' ')' -o \ + '(' '(' "$GCCV1" -eq '4' ')' -a '(' "$GCCV2" -ge '4' ')' ')' + then + debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized" + fi +fi + + # If ccache (a compiler cache which reduces build time) # (http://samba.org/ccache) is installed, use it. # We use 'grep' and hope 'grep' will work as expected diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh index 81dbebff32d..8f44699505f 100755 --- a/BUILD/build_mccge.sh +++ b/BUILD/build_mccge.sh @@ -1,5 +1,23 @@ #!/bin/sh +# Copyright (c) 2008, 2010, Oracle. +# Copyright (c) 2009-2011 Monty Program 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 + die() { echo "ERROR: $@"; exit 1; @@ -13,23 +31,18 @@ get_key_value() 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 + This script can be used by developers of MariaDB wanting to try out + early versions 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 build process. + + This help text is targeted towards those that want to debug and test + 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: + Three environment variables can be used to define the default behaviour: MYSQL_DEVELOPER Defining this variable is similar to setting the --developer flag @@ -40,11 +53,6 @@ cat <<EOF 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. @@ -62,17 +70,12 @@ 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. + same type as that on which you intend to run the program. 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): + MariaDB source directory): shell> BUILD/build_mccge.sh @@ -84,21 +87,15 @@ cat <<EOF 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. + 4) Builds a set of of 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 + be run. If you have downloaded a launchpad 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 @@ -117,20 +114,16 @@ cat <<EOF 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 + done when starting the 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 + able to send gdb core dumps to 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 } @@ -141,9 +134,8 @@ 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 + to build MariaDB + --developer-help Show help for developers trying to build MariaDB --with-help Show extended help on --with-xxx options to configure --extended-help Show extended help message @@ -166,11 +158,9 @@ Usage: $0 [options] 'path' --debug Build normal version, but add debug information to binary - --developer Use extensions that most MySQL developers use + --developer Use extensions that most MariaDB developers use --no-developer Do not use extensions that most developers of - MySQL use - --commercial Use commercial libraries - --gpl Use gpl libraries + MariaDB use --compiler=[gcc|icc|forte|SunStudio] Select compiler --cpu=[x86|x86_64|sparc|itanium] Select CPU type x86 => x86 and 32-bit binary @@ -180,10 +170,10 @@ Usage: $0 [options] --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 + --package=[pro|classic] Select package to build --parallelism=number Define parallelism in make --strip Strip binaries - --error-inject Enable error injection into MySQL Server and + --error-inject Enable error injection into MariaDB Server and data nodes --valgrind Build with valgrind --fast Optimise for CPU architecture built on @@ -201,12 +191,12 @@ 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 + ----------------------------------- + + This script is intended to make it easier to build + performance-optimised MariaDB versions 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 @@ -214,49 +204,28 @@ extended_usage() 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. + the specific platform you are using. 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 + version of MariaDB having only the MyISAM storage engine, a "Pro" + package including all storage engines and other features except MariaDB + Cluster, and an "extended" package including these features plus MariaDB Cluster (this is the default if the --developer option is used). - Different MySQL storage engines are included in the build, depending + Different MariaDB 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 + comment: Pro versions version string suffix: [none] --package=classic storage engines: CSV, MYISAM - comment: MySQL Classic GPL/Commercial version built - from source + comment: Version without InnoDB and Maria version string suffix: [none] All packages except Classic include support for user-defined @@ -265,10 +234,6 @@ extended_usage() 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. @@ -357,8 +322,7 @@ extended_usage() Package-specific options: ------------------------- --with-innodb - Specifically included in the "pro" and "extended" packages, and not - in any of the others. + Specifically included in the "pro" package. --with-comment Sets the comment for the MySQL version, by package, as described @@ -371,12 +335,10 @@ extended_usage() Other options used: ------------------- --with-readline - Use the GPL readline library for command editing functions; not - available with commercial packages. + Use the GPL readline library for command editing functions. --with-libedit - Use the BSD licensed library for command editing functions; used for - commercial packages. + Use the BSD licensed library for command editing functions. --with-zlib-dir=bundled Use the zlib package bundled with MySQL. @@ -579,9 +541,6 @@ parse_package() extended ) package="extended" ;; - cge ) - package="cge" - ;; *) echo "Unknown package '$package'" exit 1 @@ -712,12 +671,6 @@ parse_options() --developer) developer_flag="yes" ;; - --commercial) - gpl="no" - ;; - --gpl) - gpl="yes" - ;; --compiler=*) compiler=`get_key_value "$1"` parse_compiler @@ -765,7 +718,7 @@ parse_options() --configure-only) just_configure="yes" ;; - --print-only) + --print-only|--just-print) just_print="yes" ;; --static-linking) @@ -1063,7 +1016,7 @@ set_warning_flags() 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" + warnings="$warnings -Wunused-value -Wunused-variable -Wno-uninitialized" if test "x$warning_mode" = "extra" ; then warnings="$warnings -Wshadow" @@ -1094,7 +1047,8 @@ 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="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG" + loc_debug_flags="$loc_debug_flags -Wuninitialized -DFORCE_INIT_OF_VARS" loc_debug_flags="$loc_debug_flags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC" compiler_flags="$compiler_flags $loc_debug_flags" fi @@ -1167,28 +1121,19 @@ set_base_configs() base_configs="$base_configs --with-pic" base_configs="$base_configs --with-csv-storage-engine" base_configs="$base_configs --with-perfschema" + base_configs="$base_configs --with-libevent" } # -# 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. +# Add all standard engines and partitioning # -set_base_engines() +set_max_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" + engine_configs="--with-plugins=max --with-plugin-maria --with-maria-tmp-tables" + engine_configs="$engine_configs --without-plugin-innodb_plugin" base_configs="$base_configs $engine_configs" } -set_innodb_engine() -{ - base_configs="$base_configs --with-innodb" -} - set_ndb_engine() { base_configs="$base_configs --with-ndbcluster" @@ -1198,41 +1143,17 @@ set_ndb_engine() set_pro_package() { if test "x$without_comment" != "xyes" ; then - base_configs="$base_configs --with-comment=\"MySQL Enterprise Pro $version_text built from source\"" + base_configs="$base_configs --with-comment=\"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\"" + base_configs="$base_configs --with-comment=\"Classic $version_text built from source\"" fi if test "x$with_debug_flag" = "xyes" ; then base_configs="$base_configs --with-server-suffix=\"-debug\"" @@ -1618,11 +1539,7 @@ set_error_inject_configs() set_default_package() { if test "x$package" = "x" ; then - if test "x$developer_flag" = "xyes" ; then package="extended" - else - package="cge" - fi fi } @@ -1749,28 +1666,13 @@ 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. +# build a source variant including all storage engines except InnoDB. # 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_max_engines 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 diff --git a/BUILD/compile-pentium-mysqlfs-debug b/BUILD/compile-pentium-mysqlfs-debug deleted file mode 100755 index c871200604e..00000000000 --- a/BUILD/compile-pentium-mysqlfs-debug +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh - -path=`dirname $0` -. "$path/SETUP.sh" - -extra_flags="$pentium_cflags $debug_cflags" -extra_configs="$pentium_configs $debug_configs $static_link" - -extra_configs="$extra_configs --with-debug=full --with-mysqlfs --without-server --without-pstack" - -. "$path/FINISH.sh" diff --git a/BUILD/compile-solaris-amd64-forte b/BUILD/compile-solaris-amd64-forte index c89b3129a1b..870fa91a5af 100755 --- a/BUILD/compile-solaris-amd64-forte +++ b/BUILD/compile-solaris-amd64-forte @@ -13,7 +13,7 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="-m64 -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3" +extra_flags="-m64 -fast -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3" extra_configs="$max_configs --with-libevent" warnings="" diff --git a/BUILD/compile-solaris-amd64-forte-debug b/BUILD/compile-solaris-amd64-forte-debug new file mode 100755 index 00000000000..08a095b05c8 --- /dev/null +++ b/BUILD/compile-solaris-amd64-forte-debug @@ -0,0 +1,31 @@ +#!/bin/sh + +# See file compile-solaris-amd64 for basic pre-requisites. + +# This build uses the Sun Studio compilers (cc, CC), available from: +# http://developers.sun.com/sunstudio/downloads/index.jsp +# Note that you may want to apply current patches, as the downloaded version +# is typically out of date. Download the PKG version if you intend to patch! + +# After installing, add /opt/SUNWspro/bin to your $PATH + + +gmake -k clean || true +/bin/rm -f */.deps/*.P config.cache + +. "$path/SETUP.sh" + +extra_flags="-g -m64 -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3" +extra_configs="$max_configs --with-libevent" + +warnings="" +c_warnings="" +cxx_warnings="" +base_cxxflags="-noex" + +CC=cc +CFLAGS="-xstrconst" +CXX=CC +LDFLAGS="-lmtmalloc" + +. "$path/FINISH.sh" |