diff options
Diffstat (limited to 'BUILD')
58 files changed, 2647 insertions, 0 deletions
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh new file mode 100644 index 00000000..1b730dee --- /dev/null +++ b/BUILD/FINISH.sh @@ -0,0 +1,99 @@ +# Copyright (c) 2000, 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., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1335 USA + +cflags="$c_warnings $extra_flags $EXTRA_FLAGS $EXTRA_CFLAGS" +cxxflags="$cxx_warnings $base_cxxflags $extra_flags $EXTRA_FLAGS $EXTRA_CXXFLAGS" +extra_configs="$extra_configs $local_infile_configs $EXTRA_CONFIGS" + +configure="./configure $base_configs $extra_configs" + +if test "$just_print" = "1" -a "$just_configure" = "1" +then + just_print="" + configure="$configure --print" +fi + +if test "$AM_EXTRA_MAKEFLAGS" = "VERBOSE=1" -o "$verbose_make" = "1" +then + configure="$configure --verbose" +fi + +commands="" +# git clean -fdX removes all ignored (build) files +if test -d .git && test -d libmariadb/CMakeFiles +then + commands="\ +git clean -fdX +cd ./libmariadb +git submodule update +git clean -fdX +cd ../storage/rocksdb/rocksdb +git clean -fdX +git submodule update +git clean -fdX +cd ../../maria/libmarias3 +git submodule update +git clean -fdX +cd ../../.. +cd storage/columnstore/columnstore +git submodule update +git clean -fdX +cd ../../.. +cd wsrep-lib +git submodule update +git clean -fdX +cd .." +fi +commands="$commands +path=`dirname $0` +. \"$path/autorun.sh\"" + +if [ -z "$just_clean"] +then + if test -d .git + then + commands="$commands + git submodule update" + fi + commands="$commands + CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" $configure" +fi + +if [ -z "$just_configure" -a -z "$just_clean" ] +then + commands="$commands + +$make $AM_MAKEFLAGS $AM_EXTRA_MAKEFLAGS +$make tags" + + if [ "x$strip" = "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" + fi +fi + +if test -z "$just_print" +then + eval "set -x; $commands" +else + echo "$commands" +fi diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh new file mode 100755 index 00000000..0defa2d4 --- /dev/null +++ b/BUILD/SETUP.sh @@ -0,0 +1,323 @@ +#!/bin/sh + +# Copyright (c) 2000, 2011, 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., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335 USA + +######################################################################## + +get_key_value() +{ + echo "$1" | sed 's/^--[a-zA-Z_-]*=//' +} + +usage() +{ +cat <<EOF +Usage: $0 [-h|-n] [configure-options] + -h, --help Show this help message. + -n, --just-print Don't actually run any commands; just print them. + -c, --just-configure Stop after running configure. + Combined with --just-print shows configure options. + --just-clean Clean up compilation files and update sub modules + --extra-configs=xxx Add this to configure options + --extra-flags=xxx Add this C and CXX flags + --extra-cflags=xxx Add this to C flags + --extra-cxxflags=xxx Add this to CXX flags + --verbose Print out full compile lines + --with-debug=full Build with full debug(no optimizations, keep call stack). + --warning-mode=[old|pedantic|maintainer] + Influences the debug flags. Old is default. + --prefix=path Build with prefix 'path'. + +Note: this script is intended for internal use by MariaDB developers. +EOF +} + +parse_options() +{ + while test $# -gt 0 + do + case "$1" in + --prefix=*) + prefix=`get_key_value "$1"`;; + --with-debug=full) + full_debug="=full";; + --warning-mode=*) + warning_mode=`get_key_value "$1"`;; + --extra-flags=*) + EXTRA_FLAGS=`get_key_value "$1"`;; + --extra-cflags=*) + EXTRA_CFLAGS=`get_key_value "$1"`;; + --extra-cxxflags=*) + EXTRA_CXXFLAGS=`get_key_value "$1"`;; + --extra-configs=*) + EXTRA_CONFIGS=`get_key_value "$1"`;; + --extra-makeflags=*) + EXTRA_MAKEFLAGS=`get_key_value "$1"`;; + -c | --just-configure) + just_configure=1;; + -n | --just-print | --print) + just_print=1;; + --just-clean) + just_clean=1;; + --verbose) + verbose_make=1;; + -h | --help) + usage + exit 0;; + *) + echo "Unknown option '$1'" + exit 1;; + esac + shift + done +} + +######################################################################## + +if test ! -f sql/mysqld.cc +then + echo "You must run this script from the MySQL top-level directory" + exit 1 +fi + +prefix="/usr/local/mysql" +just_print= +just_clean= +just_configure= +warning_mode= +maintainer_mode= +full_debug= +verbose_make= + +parse_options "$@" + +if test -n "$MYSQL_BUILD_PREFIX" +then + prefix="$MYSQL_BUILD_PREFIX" +fi + +set -e + +# +# Check for the CPU and set up CPU specific flags. We may reset them +# later. +# +path=`dirname $0` +. "$path/check-cpu" +. "$path/util.sh" + +get_make_parallel_flag + +# SSL library to use.--with-ssl will select our bundled yaSSL +# implementation of SSL. --with-ssl=yes will first try system library +# then the bundled one --with-ssl=system will use the system library. +# We normally use bundled by default as this is guaranteed to work with Galera +# However as bundled gives problem on SuSE with tls_version1.test, system +# is used +SSL_LIBRARY=--with-ssl=system + +if [ "x$warning_mode" = "xpedantic" ]; then + warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE" + c_warnings="$warnings" + cxx_warnings="$warnings -std=c++98" +# NOTE: warning mode should not influence optimize/debug mode. +# Please feel free to add a separate option if you don't feel it's an overkill. + debug_extra_cflags="-O0" +# Reset CPU flags (-mtune), they don't work in -pedantic mode + check_cpu_cflags="" +elif [ "x$warning_mode" = "xmaintainer" ]; then + c_warnings="-Wall -Wextra" + cxx_warnings="$c_warnings -Wno-unused-parameter" + maintainer_mode="--enable-mysql-maintainer-mode" + debug_extra_cflags="-g3" +else +# Both C and C++ warnings + warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized -Wno-strict-aliasing -Wformat-security -Wvla" + +# For more warnings, uncomment the following line +# warnings="$warnings -Wshadow" + +# C warnings + c_warnings="$warnings" +# C++ warnings + cxx_warnings="$warnings -Wno-unused-parameter -Wno-invalid-offsetof" +# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo" + cxx_warnings="$cxx_warnings -Wnon-virtual-dtor" + debug_extra_cflags="-O0 -g3 -gdwarf-2" +fi + +# Set flags for various build configurations. +# Used in -valgrind builds +# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro +# UNINIT_VAR(), which is only useful for silencing spurious warnings +# of static analysis tools. We want UNINIT_VAR() to be a no-op in Valgrind. +# TRASH_FREE_MEMORY is enabled so that we can find wrong memory accesses +# even when running a test without valgrind +# +valgrind_flags="-DHAVE_valgrind -USAFEMALLOC -DTRASH_FREE_MEMORY" +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="-DEXTRA_DEBUG -DSAFE_MUTEX -DSAFEMALLOC" +error_inject="--with-error-inject " +# +# Base C++ flags for all builds +base_cxxflags="-felide-constructors -fexceptions" +# +# Flags for optimizing builds. +# Be as fast as we can be without losing our ability to backtrace. +fast_cflags="-O3 -fno-omit-frame-pointer" + +debug_configs="--with-debug" +if [ -z "$full_debug" ] +then + debug_cflags="$debug_cflags $debug_extra_cflags" +fi + +# 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" + +# +# 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 $maintainer_mode" +base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables --with-plugin-s3=STATIC" +base_configs="$base_configs $SSL_LIBRARY" + +if test -d "$path/../cmd-line-utils/readline" +then + base_configs="$base_configs --with-readline" +elif test -d "$path/../cmd-line-utils/libedit" +then + base_configs="$base_configs --with-libedit" +fi + +max_plugins="--with-plugins=max" +max_no_embedded_configs="$max_plugins" +max_no_qc_configs="$max_plugins --without-query-cache" +max_configs="$max_plugins --with-embedded-server --with-libevent --with-plugin-rocksdb=dynamic --with-plugin-test_sql_discovery=DYNAMIC --with-plugin-file_key_management=DYNAMIC --with-plugin-hashicorp_key_management=DYNAMIC --with-plugin-auth_gssapi=DYNAMIC" +all_configs="$max_configs" + +# +# CPU and platform specific compilation flags. +# +alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag" +pentium_cflags="$check_cpu_cflags -m32" +amd64_cflags="$check_cpu_cflags -m64" +pentium64_cflags="$check_cpu_cflags -m64" +ppc_cflags="$check_cpu_cflags" +sparc_cflags="" + +if gmake --version > /dev/null 2>&1 +then + make=gmake +else + make=make +fi + +if test -z "$CC" ; then + CC=gcc +fi + +if test -z "$CXX" ; then + CXX=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 + if (test '(' "$GCCV1" -gt '6' ')') + then + c_warnings="$c_warnings -Wimplicit-fallthrough=2" + cxx_warnings="$cxx_warnings -Wimplicit-fallthrough=2" + 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 +# (returns 0 if finds lines) + +# As cmake doesn't like CC and CXX with a space, use symlinks from +# /usr/lib64/ccache if they exits. + +if ccache -V > /dev/null 2>&1 && test "$CCACHE_DISABLE" != "1" && test "$CC" = "gcc" +then + if test -x /usr/lib64/ccache/gcc + then + CC=/usr/lib64/ccache/gcc + fi + if test -x /usr/lib64/ccache/g++ + then + CXX=/usr/lib64/ccache/g++ + fi +fi + +# gcov + +# The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the +# code with profiling information used by gcov. +# The -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl. +# The -DHAVE_gcov enables code to write out coverage info even when crashing. + +gcov_compile_flags="-fprofile-arcs -ftest-coverage" +gcov_compile_flags="$gcov_compile_flags -DDISABLE_TAO_ASM" +gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov" + +# +# The following plugins doesn't work on 32 bit systems +disable_64_bit_plugins="--without-plugin-rocksdb" + + +# GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well +# as on the compiler command line), and this requires setting LDFLAGS for BDB. + +gcov_link_flags="-fprofile-arcs -ftest-coverage -lgcov" + +gcov_configs="--with-gcov" + +# gprof + +gprof_compile_flags="-O2" + +# Rest of the flags are set in CmakeFile.txt +gprof_link_flags="--disable-shared $static_link" + +disable_gprof_plugins="--with-zlib-dir=bundled --without-plugin-oqgraph --without-plugin-mroonga --with-gprof" + +disable_asan_plugins="--without-plugin-rocksdb" diff --git a/BUILD/autorun.sh b/BUILD/autorun.sh new file mode 100755 index 00000000..a705c726 --- /dev/null +++ b/BUILD/autorun.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Copyright (c) 2005, 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., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1335 USA + +# Create MySQL cmake configure wrapper + +# Use a configure script that will call CMake. +path=`dirname $0` +cp $path/cmake_configure.sh $path/../configure +chmod +x $path/../configure diff --git a/BUILD/check-cpu b/BUILD/check-cpu new file mode 100755 index 00000000..d62e1545 --- /dev/null +++ b/BUILD/check-cpu @@ -0,0 +1,330 @@ +#!/bin/sh +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +# +# Check cpu of current machine and find the +# best compiler optimization flags for gcc +# Will return result in: +# cpu_arg : Type of CPU +# low_cpu_arg : Type of CPU used up until GCC v3.3 +# check_cpu_args : Arguments for GCC compiler settings +# + +check_compiler_cpu_flags () { + # different compiler versions have different option names + # for CPU specific command line options + if test -z "$CC" ; then + cc="gcc"; + else + cc=$CC + fi + + # 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 + if test -z "$cc_minor"; then + cc_minor="0"; + fi + if test -z "$cc_patch"; then + cc_minor="0"; + fi + 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-* | 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_cflags="-mtune=${cpu_arg}" + fi + ;; + ppc-*) + check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}" + ;; + *) + check_cpu_cflags="" + return + ;; + esac + ;; + 2.95.*) + # GCC 2.95 doesn't expose its name in --version output + check_cpu_cflags="-m${cpu_arg}" + ;; + *) + check_cpu_cflags="" + return + ;; + esac + + # now we check whether the compiler really understands the cpu type + touch __test.c + + while [ "$cpu_arg" ] ; do + printf "testing $cpu_arg ... " >&2 + + # compile check + 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="" + break; + done + rm __test.* + return 0 +} + +check_cpu () { + CPUINFO=/proc/cpuinfo + if test -n "$TEST_CPUINFO" ; then + CPUINFO=$TEST_CPUINFO + fi + if test -r "$CPUINFO" -a "$CPUINFO" != " " ; then + # 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` + if test -z "$model_name" ; then + model_name=`$cpuinfo | grep 'cpu model' | cut -d ':' -f 2 | head -1` + fi + + # fallback: get CPU model from uname output + if test -z "$model_name" ; then + model_name=`uname -m` + fi + + # 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 + done + else + # Fallback when there is no /proc/cpuinfo + CPUINFO=" " + case "`uname -s`" in + FreeBSD|OpenBSD) + cpu_family=`uname -m`; + model_name=`sysctl -n hw.model` + ;; + Darwin) + cpu_family=`sysctl -n machdep.cpu.vendor` + model_name=`sysctl -n machdep.cpu.brand_string` + if [ -z "$cpu_family" -o -z "$model_name" ] + then + cpu_family=`uname -p` + model_name=`machine` + fi + ;; + *) + cpu_family=`uname -p`; + model_name=`uname -m`; + ;; + esac + fi + + # detect CPU shortname as used by gcc options + # this list is not complete, feel free to add further entries + cpu_arg="" + low_cpu_arg="" + case "$cpu_vendor--$cpu_family--$model_name--$spu_arch" in + # DEC Alpha + *Alpha*EV6*) + cpu_arg="ev6"; + ;; + #Core 2 Duo + *Intel*Core\(TM\)2*) + cpu_arg="nocona" + core2="yes" + ;; + # Intel ia32 + *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 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" + ;; + *Pentium\(R\)*\ M*) + cpu_arg="pentium-m" + low_cpu_arg="pentium3" + ;; + *Pentium\(R\)*\ D*) + cpu_arg="prescott" + ;; + *Pentium*4*) + cpu_arg="pentium4" + ;; + *Pentium*III*Mobile*) + cpu_arg="pentium3m" + ;; + *Pentium*III*) + cpu_arg="pentium3" + ;; + *Pentium*M*pro*) + cpu_arg="pentium-m" + ;; + *Celeron\(R\)*\ M*) + cpu_arg="pentium-m" + ;; + *Celeron*Coppermine*) + cpu_arg="pentium3" + ;; + *Celeron\(R\)*) + cpu_arg="pentium4" + ;; + *Celeron*) + cpu_arg="pentium2" + ;; + *Atom*) + cpu_arg="prescott" + ;; + *GenuineIntel*) + cpu_arg="pentium" + ;; + *Turion*) + cpu_arg="athlon64" + ;; + *Athlon*64*) + cpu_arg="athlon64" + ;; + *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" + ;; + *Phenom*) + cpu_arg="k8" + ;; + *AuthenticAMD*) + cpu_arg="k6" + ;; + *HygonGenuine*) + cpu_arg="k8" + ;; + *VIA\ *) + cpu_arg="i686" + ;; + # MacOSX / Intel + *i386*i486*) + cpu_arg="pentium-m" + ;; + *i386*) + cpu_arg="i386" + ;; + # Intel ia64 + *Itanium*) + cpu_arg="itanium" + ;; + *IA-64*) + cpu_arg="itanium" + ;; + # Solaris Sparc + *sparc*sun4[uv]*) + cpu_arg="sparc" + ;; + # Power PC + *ppc*) + cpu_arg="powerpc" + ;; + *powerpc*) + cpu_arg="powerpc" + ;; + # unknown + *) + 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 + # fallback to uname if necessary + TEST_CPUINFO=" " + check_cpu_cflags="" + check_cpu + return + fi + echo "BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using." >&2 + check_cpu_cflags="" + return + fi + + if test "x$compiler" = "x" ; then + check_compiler_cpu_flags + fi + + if test "x$core2" = "xyes" ; then + cpu_arg="core2" + fi + + return 0 +} + +check_cpu diff --git a/BUILD/cleanup b/BUILD/cleanup new file mode 100755 index 00000000..3d791296 --- /dev/null +++ b/BUILD/cleanup @@ -0,0 +1,23 @@ +#! /bin/sh + +# Copyright (C) 2003 MySQL AB +# Use is subject to license terms +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +just_clean=1; + +. "$path/FINISH.sh" diff --git a/BUILD/cmake_configure.sh b/BUILD/cmake_configure.sh new file mode 100644 index 00000000..fb0c4320 --- /dev/null +++ b/BUILD/cmake_configure.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +# Copyright (c) 2009, 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., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1335 USA + +# Ensure cmake and perl are there +cmake --help >/dev/null 2>&1 || HAVE_CMAKE=no +perl --version >/dev/null 2>&1 || HAVE_PERL=no +scriptdir=`dirname $0` +if test "$HAVE_CMAKE" = "no" +then + echo "CMake is required to build MySQL." + exit 1 +elif test "$HAVE_PERL" = "no" +then + echo "Perl is required to build MySQL using the configure to CMake translator." + exit 1 +else + perl $scriptdir/cmake/configure.pl "$@" +fi + diff --git a/BUILD/compile-amd64-debug-all b/BUILD/compile-amd64-debug-all new file mode 100755 index 00000000..66f6f330 --- /dev/null +++ b/BUILD/compile-amd64-debug-all @@ -0,0 +1,10 @@ +#! /bin/sh + +path=`dirname $0` +set -- "$@" --with-debug=full +. "$path/SETUP.sh" + +extra_flags="$amd64_cflags $debug_cflags" +extra_configs="$amd64_configs $debug_configs $all_configs" +CC="$CC --pipe" +. "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max new file mode 100755 index 00000000..0af32f5d --- /dev/null +++ b/BUILD/compile-amd64-debug-max @@ -0,0 +1,25 @@ +#! /bin/sh + +# Copyright (c) 2005, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$amd64_cflags $debug_cflags" +extra_configs="$amd64_configs $debug_configs $max_configs" + +CC="$CC --pipe" +. "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-debug-wsrep b/BUILD/compile-amd64-debug-wsrep new file mode 100755 index 00000000..995a8afc --- /dev/null +++ b/BUILD/compile-amd64-debug-wsrep @@ -0,0 +1,11 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$amd64_cflags $debug_cflags -g -O0 $wsrep_cflags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$amd64_configs $debug_configs $wsrep_configs --with-wsrep" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-gcov b/BUILD/compile-amd64-gcov new file mode 100755 index 00000000..83c6b64d --- /dev/null +++ b/BUILD/compile-amd64-gcov @@ -0,0 +1,33 @@ +#! /bin/sh + +# Copyright (C) 2007 MySQL AB +# Use is subject to license terms +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` + +# Need to disable ccache, or we loose the gcov-needed compiler output files. +CCACHE_DISABLE=1 +export CCACHE_DISABLE + +. "$path/SETUP.sh" + +export LDFLAGS="$gcov_link_flags" + +extra_flags="$amd64_cflags $debug_cflags $max_cflags $gcov_compile_flags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$amd64_configs $debug_configs $gcov_configs $max_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-gprof b/BUILD/compile-amd64-gprof new file mode 100755 index 00000000..2be4fdfa --- /dev/null +++ b/BUILD/compile-amd64-gprof @@ -0,0 +1,24 @@ +#! /bin/sh + +# Copyright (C) 2007 MySQL AB +# Use is subject to license terms +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$amd64_cflags $gprof_compile_flags" +extra_configs="$amd64_configs $debug_configs $gprof_link_flags" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-max b/BUILD/compile-amd64-max new file mode 100755 index 00000000..6d3470de --- /dev/null +++ b/BUILD/compile-amd64-max @@ -0,0 +1,24 @@ +#! /bin/sh + +# Copyright (c) 2005, 2006 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" +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 00000000..2d6fa68b --- /dev/null +++ b/BUILD/compile-amd64-valgrind-max @@ -0,0 +1,26 @@ +#! /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., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335 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" diff --git a/BUILD/compile-amd64-wsrep b/BUILD/compile-amd64-wsrep new file mode 100755 index 00000000..57dfbdd6 --- /dev/null +++ b/BUILD/compile-amd64-wsrep @@ -0,0 +1,9 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$amd64_cflags $fast_cflags -g $wsrep_cflags" +extra_configs="$amd64_configs $wsrep_configs --with-wsrep" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-bintar b/BUILD/compile-bintar new file mode 100755 index 00000000..56c3cb72 --- /dev/null +++ b/BUILD/compile-bintar @@ -0,0 +1,79 @@ +#!/bin/bash +# +# MariaDB SQL server. +# Copyright (C) 2010 Kristian Nielsen and Monty Program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA. + + +# This script's purpose is to build the binary tarball packages for MariaDB +# (currently only on Linux systems). +# +# Thus BUILD/compile-bintar from the appropriate source tarball will reproduce +# such a release, provided the build environment (gcc version etc.) matches +# (use scripts/make_binary_distribution after running this script to actually +# create the binary tarball package). +# +# Note that packages are built from source tarballs not bzr checkouts. +# Therefore, this script assumes autotools have already been run. +# +# We link libc dynamically, otherwise we get lots of problems loading +# .so files at runtime (either system stuff like NSS, or server +# plugins). +# +# We link libgcc statically to avoid reduce nasty library version dependencies. + +test -f Makefile && make distclean + +path=`dirname $0` +. $path/util.sh + +SYSTEM_TYPE="$(uname -o)" +MACHINE_TYPE="$(uname -m)" + +# We cannot have a slash '/' in tarfile name. +SYSTEM_TYPE="$(echo ${SYSTEM_TYPE} | sed -e 's/GNU\///')" + +# Get correct options for architecture into CPUOPT. +get_cpuopt +# Get correct -j option into AM_MAKEFLAGS +get_make_parallel_flag + +# Use gcc rather than g++ to avoid linking libstdc++.so (which we don't need). +FLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall $CPUOPT" + +# Don't press on in case of error. +set -e + +CC="gcc -static-libgcc" CXX="g++ -static-libgcc" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \ + ./configure \ + --prefix=/usr/local/mysql \ + --exec-prefix=/usr/local/mysql \ + --libexecdir=/usr/local/mysql/bin \ + --localstatedir=/usr/local/mysql/data \ + \ + --with-comment="(MariaDB - http://mariadb.com/)" \ + --with-system-type="${SYSTEM_TYPE}" \ + --with-machine-type="${MACHINE_TYPE}" \ + \ + --enable-shared --enable-static \ + --with-client-ldflags=-static --with-mysqld-ldflags=-static \ + --enable-thread-safe-client --enable-local-infile --with-big-tables \ + --without-docs --with-extra-charsets=all \ + --with-libwrap --with-ssl --with-readline --with-libevent --with-zlib-dir=bundled \ + --with-partition --with-embedded-server \ + --with-plugins=max \ + --without-plugin-innodb_plugin + +make $AM_MAKEFLAGS diff --git a/BUILD/compile-darwin-mwcc b/BUILD/compile-darwin-mwcc new file mode 100755 index 00000000..811de47e --- /dev/null +++ b/BUILD/compile-darwin-mwcc @@ -0,0 +1,66 @@ +#! /bin/sh + +# Copyright (c) 2005, 2006 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +c_warnings="" +cxx_warnings="" +fast_cflags="-O3" +base_cxxflags="-fno-handle-exceptions" + +# FIXME do we need to link static, not to depend on CodeWarrior libs? + +if [ x$MODE = x ] ; then + echo "You need to give an argument, 'standard', 'max', 'debug' or 'debug-max'" + echo "Like: MODE=standard BUILD/compile-darwin-codewarrior" + exit 1 +else + case $MODE in + standard|pro-gpl) + # FIXME pro/pro-gpl different libedit/readline + extra_flags="$ppc_cflags $fast_cflags" + ;; + pro) + # FIXME pro/pro-gpl different libedit/readline + extra_flags="$ppc_cflags $fast_cflags" + extra_configs="--with-libedit" + ;; + max) + extra_flags="$ppc_cflags $fast_cflags" + extra_configs="$max_configs" + ;; + debug) + extra_flags="$ppc_cflags $debug_cflags" + extra_configs="$debug_configs" + ;; + debug-max) + extra_flags="$ppc_cflags $debug_cflags" + extra_configs="$debug_configs $max_configs" + ;; + *) + echo "You need to give an argument, 'standard', 'max', 'debug' or 'debug-max'" + echo "Like: MODE=standard BUILD/compile-darwin-codewarrior" + exit 1 + ;; + esac +fi + +extra_configs="$extra_configs --with-darwin-mwcc" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-dist b/BUILD/compile-dist new file mode 100755 index 00000000..64147b7a --- /dev/null +++ b/BUILD/compile-dist @@ -0,0 +1,82 @@ +#!/bin/sh +# Copyright (c) 2004-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +# +# This script's purpose is to update the automake/autoconf helper scripts and +# to run a plain "configure" without any special compile flags. Only features +# that affect the content of the source distribution are enabled. The resulting +# 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 maintainer-clean + +path=`dirname $0` +. $path/autorun.sh + +gmake= +for x in gmake gnumake make; do + if $x --version 2>/dev/null | grep GNU > /dev/null; then + gmake=$x + break; + fi +done + +if [ -z "$gmake" ]; then + # Our build may not depend on GNU make, but I wouldn't count on it + echo "Please install GNU make, and ensure it is in your path as gnumake, gmake, or make" >&2 + exit 2 +fi + +# Default to gcc for CC and CXX +if test -z "$CXX" ; then + export CXX + CXX=g++ + # Set some required compile options + if test -z "$CXXFLAGS" ; then + export CXXFLAGS + CXXFLAGS="-felide-constructors -fno-exceptions" + fi +fi + +if test -z "$CC" ; then + export CC + CC=gcc +fi + + +# Use ccache, if available +if ccache -V > /dev/null 2>&1 +then + if echo "$CC" | grep -v ccache > /dev/null + then + export CC + CC="ccache $CC" + fi + if echo "$CXX" | grep -v ccache > /dev/null + then + export CXX + CXX="ccache $CXX" + fi +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-perfschema \ + --with-plugins=max +$gmake -j4 diff --git a/BUILD/compile-hpux11-parisc2-aCC b/BUILD/compile-hpux11-parisc2-aCC new file mode 100755 index 00000000..15e9b964 --- /dev/null +++ b/BUILD/compile-hpux11-parisc2-aCC @@ -0,0 +1,91 @@ +#!/bin/sh + +# Copyright (c) 2004, 2005, 2007 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +if [ ! -f "sql/mysqld.cc" ]; then + echo "You must run this script from the MySQL top-level directory." + exit 1 +fi + +# -fast Expand into a set of compiler options to result in +# improved application run-time. Options include: +O3, +# +Onolooptransform, +Olibcalls, +FPD, +Oentryschedule, +# +Ofastaccess. +# +O4 Perform level 3 as well as doing link time optimizations. +# Also sends +Oprocelim and +Ofastaccess to the linker +# (see ld(1)). + +release_flags="-fast +O3" + +# -z Do not bind anything to address zero. This option +# allows runtime detection of null pointers. See the +# note on pointers below. +cflags="-g -z +O0" +cxxflags="-g0 -z +O0" +debug_configure_options="--with-debug" + +while [ "$#" != 0 ]; do + case "$1" in + --help) + echo "Usage: $0 [options]" + echo "Options:" + echo "--help print this message" + echo "--debug build debug binary [default] " + echo "--release build optimised binary" + echo "-32 build 32 bit binary [default]" + echo "-64 build 64 bit binary" + exit 0 + ;; + --debug) + echo "Building debug binary" + ;; + --release) + echo "Building release binary" + cflags="$release_flags" + cxxflags="$release_flags" + debug_configure_options="" + ;; + -32) + echo "Building 32-bit binary" + ;; + -64) + echo "Building 64-bit binary" + cflags="$cflags +DA2.0W +DD64" + cxxflags="$cxxflags +DA2.0W +DD64" + ;; + *) + echo "$0: invalid option '$1'; use --help to show usage" + exit 1 + ;; + esac + shift +done + + +set -x +make maintainer-clean + +path=`dirname $0` +. "$path/autorun.sh" + +CC=cc CXX=aCC CFLAGS="$cflags" CXXFLAGS="$cxxflags" \ +./configure --prefix=/usr/local/mysql --disable-shared \ + --with-extra-charsets=complex --enable-thread-safe-client \ + --without-extra-tools $debug_configure_options \ + --disable-dependency-tracking + +gmake diff --git a/BUILD/compile-irix-mips64-mipspro b/BUILD/compile-irix-mips64-mipspro new file mode 100755 index 00000000..94d19358 --- /dev/null +++ b/BUILD/compile-irix-mips64-mipspro @@ -0,0 +1,95 @@ +#!/bin/sh + +# Copyright (c) 2004, 2005, 2007 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +if [ ! -f "sql/mysqld.cc" ]; then + echo "You must run this script from the MySQL top-level directory." + exit 1 +fi + +cflags="-64 -mips4" +config_args= +if [ "$#" != 0 ]; then + case "$1" in + --help) + echo "Usage: $0 [options]" + echo "Options:" + echo "--help print this message" + echo "-32 build 32-bit binary" + echo "-64 build 64-bit binary [default]" + exit 0 + ;; + -64) + echo "Building 64-bit binary" + ;; + -32) + echo "Building 32-bit binary" + cflags="" + ;; + *) + config_args="$config_args $1"; shift + ;; + esac +else + echo "Building 64-bit binary" +fi + +set -x +make maintainer-clean + +path=`dirname $0` +. "$path/autorun.sh" + +# C options: +# -apo - auto-parallelize for multiprocessors (implies -mp) +# -mp - generate multiprocessor code +# These two common optimization options apparently use 'sproc' model of +# threading, which is not compatible with PTHREADS: don't add them unless you +# know what you're doing. +# +# -c99 - enable C features standardized in C99, such as long long, +# strtoll, stroull etc. +# This option is vital to compile MySQL. +# -woff - turn off some warnings +# -64 - generate 64 bit object (implies -mips4) +# -mips4 - produce code for MIPS R10000, MIPS R12000 and further 64 bit +# processors +# -OPT:Olimit=0 - no limits exists to size of function for compiler to optimize +# it +nowarn="-woff 1064,1188,1460,1552,1681,1682,3303" +cflags="$cflags $nowarn -O3 -c99 -OPT:Olimit=0" + +# C++ only options: +# -LANG:exceptions=OFF - don't generate exception handling code +# MySQL doesn't use exceptions. +# -LANG:std=OFF - don't link standard C++ library, such as +# <iostream>, <complex>, etc. +# -LANG:libc_in_namespace_std=OFF - libstdc functions can be +# declared in namespace 'std', when included +# into C++ code. Switch this feature off. +# This option is vital to compile MySQL + +cxxflags="$cflags -LANG:exceptions=OFF -LANG:std=OFF" +cxxflags="$cxxflags -LANG:libc_in_namespace_std=OFF" + +CC=cc CXX=CC CFLAGS="$cflags" CXXFLAGS="$cxxflags" \ +./configure --prefix=/usr/local/mysql --disable-shared \ + --with-extra-charsets=complex --enable-thread-safe-client \ + --without-extra-tools --disable-dependency-tracking \ + $config_args + +make diff --git a/BUILD/compile-pentium-icc b/BUILD/compile-pentium-icc new file mode 100755 index 00000000..510cbb1a --- /dev/null +++ b/BUILD/compile-pentium-icc @@ -0,0 +1,40 @@ +#! /bin/sh + +# Copyright (C) 2005 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +# Note that we can't use ccache with icc as the generated .deps file will +# then contain wrong information +CC=icc +CXX=icpc +CXXLD="$CXX -static-libcxa" +export CC CXX CXXLD + +c_warnings="" +cxx_warnings="" +extra_flags="$fast_cflags -unroll2 -ip -mp -restrict" + +# Use -no-ipo if you get this error +# IPO link: can not find "-lstdc++_shared" +# icpc: error: problem during multi-file optimization compilation (code 1) +extra_flags="$extra_flags -no-ipo" +base_cxxflags="-fno-exceptions" +extra_configs="$pentium_configs $static_link $disable_64_bit_plugins" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-icc-yassl b/BUILD/compile-pentium-icc-yassl new file mode 100755 index 00000000..f5cc27c3 --- /dev/null +++ b/BUILD/compile-pentium-icc-yassl @@ -0,0 +1,40 @@ +#! /bin/sh + +# Copyright (C) 2005 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +# Note that we can't use ccache with icc as the generated .deps file will +# then contain wrong information +CC=icc +CXX=icpc +CXXLD="$CXX -static-libcxa" +export CC CXX CXXLD + +c_warnings="" +cxx_warnings="" +extra_flags="$fast_cflags -unroll2 -ip -mp -restrict" + +# Use -no-ipo if you get this error +# IPO link: can not find "-lstdc++_shared" +# icpc: error: problem during multi-file optimization compilation (code 1) +extra_flags="$extra_flags -no-ipo" +base_cxxflags="-fno-exceptions" +extra_configs="$pentium_configs $static_link --with-yassl" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-pgcc b/BUILD/compile-pentium-pgcc new file mode 100755 index 00000000..b6073d74 --- /dev/null +++ b/BUILD/compile-pentium-pgcc @@ -0,0 +1,18 @@ +#! /bin/sh + +AM_MAKEFLAGS="-j 2" +gmake -k maintainer-clean || true +/bin/rm -f */.deps/*.P config.cache + +path=`dirname $0` +. "$path/autorun.sh" + +export PATH=/usr/local/pgcc/bin:$PATH +CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O6 -mpentiumpro -fomit-frame-pointer -mstack-align-double" CXX=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -O6 -fomit-frame-pointer -mpentiumpro -mstack-align-double" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static + +gmake -j 4 + +mkdir -p tmp +nm --numeric-sort sql/mysqld > tmp/mysqld.sym +objdump -d sql/mysqld > tmp/mysqld.S +strip sql/mysqld diff --git a/BUILD/compile-pentium32 b/BUILD/compile-pentium32 new file mode 100755 index 00000000..84dfbcf3 --- /dev/null +++ b/BUILD/compile-pentium32 @@ -0,0 +1,26 @@ +#! /bin/sh + +# Copyright (c) 2000-2002, 2007 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $fast_cflags" +extra_configs="$pentium_configs $disable_64_bit_plugins" +strip=yes + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-cybozu b/BUILD/compile-pentium32-cybozu new file mode 100755 index 00000000..4ff01e73 --- /dev/null +++ b/BUILD/compile-pentium32-cybozu @@ -0,0 +1,24 @@ +#! /bin/sh + +# Copyright (C) 2005 MySQL AB +# Use is subject to license terms +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $fast_cflags -g" +extra_configs="$pentium_configs --with-charset=utf8 --with-collation=utf8_general_cs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-debug b/BUILD/compile-pentium32-debug new file mode 100755 index 00000000..3f5e7b50 --- /dev/null +++ b/BUILD/compile-pentium32-debug @@ -0,0 +1,24 @@ +#! /bin/sh + +# Copyright (c) 2000, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $debug_cflags" +extra_configs="$pentium_configs $debug_configs $disable_64_bit_plugins" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-debug-max b/BUILD/compile-pentium32-debug-max new file mode 100755 index 00000000..2938aaaa --- /dev/null +++ b/BUILD/compile-pentium32-debug-max @@ -0,0 +1,24 @@ +#! /bin/sh + +# Copyright (c) 2001, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $debug_cflags" +extra_configs="$pentium_configs $debug_configs $max_configs $error_inject --with-experimental-collations $disable_64_bit_plugins" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-debug-openssl b/BUILD/compile-pentium32-debug-openssl new file mode 100755 index 00000000..469495b1 --- /dev/null +++ b/BUILD/compile-pentium32-debug-openssl @@ -0,0 +1,26 @@ +#! /bin/sh + +# Copyright (c) 2001, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $debug_cflags" +extra_configs="$pentium_configs $debug_configs $disable_64_bit_plugins" + +extra_configs="$extra_configs --with-debug --with-ssl=/usr" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-gcov b/BUILD/compile-pentium32-gcov new file mode 100755 index 00000000..44b672b2 --- /dev/null +++ b/BUILD/compile-pentium32-gcov @@ -0,0 +1,45 @@ +#! /bin/sh + +# Copyright (C) 2000, 2007 MySQL AB +# Use is subject to license terms +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 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" + +export LDFLAGS="$gcov_link_flags" + +extra_flags="$pentium_cflags $debug_cflags $max_cflags $gcov_compile_flags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs $disable_64_bit_plugins" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-gprof b/BUILD/compile-pentium32-gprof new file mode 100755 index 00000000..878a358e --- /dev/null +++ b/BUILD/compile-pentium32-gprof @@ -0,0 +1,24 @@ +#! /bin/sh + +# Copyright (C) 2001, 2007 MySQL AB +# Use is subject to license terms +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $gprof_compile_flags" +extra_configs="$pentium_configs $debug_configs $gprof_link_flags $disable_64_bit_plugins $disable_gprof_plugins" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-icc-valgrind-max b/BUILD/compile-pentium32-icc-valgrind-max new file mode 100755 index 00000000..7d7a1a19 --- /dev/null +++ b/BUILD/compile-pentium32-icc-valgrind-max @@ -0,0 +1,63 @@ +#! /bin/sh +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +# Copyright (c) 2005, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +# Note that we can't use ccache with icc as the generated .deps file will +# then contain wrong information +CC=icc +CXX=icpc +export CC CXX + +extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" + +# Disable following warnings as these are generated by header files: +# 161 unrecognized pragma +# 444 destructor for base class xxx is not virtual +# 279 controlling expression is constant +# 810 conversion from ulonglong to ulong with cast +# 981 operands are evaluated in unspecified order +# 1292 warning for unknown 'attribute' options +# 1469 "xxx" clobber ignored +# 1572 floating-point equality and inequality comparisons are unreliable + +# In C++ +# 869 parameter "xxx" was never referenced +# (Problem with virtual functions) +# 874 support for placement delete is disabled + +c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572" +cxx_warnings="$c_warnings -wd869,874" +base_cxxflags="-fno-exceptions" +extra_configs="$pentium_configs $debug_configs $valgrind_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-max b/BUILD/compile-pentium32-max new file mode 100755 index 00000000..f2766ab0 --- /dev/null +++ b/BUILD/compile-pentium32-max @@ -0,0 +1,25 @@ +#! /bin/sh + +# Copyright (c) 2001-2006 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $fast_cflags -g" +extra_configs="$pentium_configs $max_configs $disable_64_bit_plugins" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-valgrind-max b/BUILD/compile-pentium32-valgrind-max new file mode 100755 index 00000000..6784d202 --- /dev/null +++ b/BUILD/compile-pentium32-valgrind-max @@ -0,0 +1,38 @@ +#! /bin/sh +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +# Copyright (c) 2002, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $debug_cflags $valgrind_flags" +extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs $disable_64_bit_plugins" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium32-wsrep b/BUILD/compile-pentium32-wsrep new file mode 100755 index 00000000..b0b8e408 --- /dev/null +++ b/BUILD/compile-pentium32-wsrep @@ -0,0 +1,11 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $fast_cflags $wsrep_cflags" +extra_configs="$pentium_configs $wsrep_configs --with-wsrep $disable_64_bit_plugins" + +#strip=yes + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64 b/BUILD/compile-pentium64 new file mode 100755 index 00000000..01eb2adf --- /dev/null +++ b/BUILD/compile-pentium64 @@ -0,0 +1,14 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $fast_cflags" +# On CentOS/Fedora Core 10 amd64, there is system libz.so but not +# libz.a, so need to use bundled zlib when building static +# binary. Hence we use --with-zlib-dir=bundled +extra_configs="$pentium_configs $static_link --with-zlib-dir=bundled" +CC="$CC --pipe" +strip=yes + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-asan-max b/BUILD/compile-pentium64-asan-max new file mode 100755 index 00000000..cedf5254 --- /dev/null +++ b/BUILD/compile-pentium64-asan-max @@ -0,0 +1,29 @@ +#! /bin/sh +# Copyright (c) 2018, MariaDB Corporation. +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +# +# Enable AddressSanitzer, a fast memory error detector. +# Detects "Out of bounds" and "use-after-free" memory errors +# + +extra_flags="$pentium64_cflags $debug_cflags -lasan -O -g -fsanitize=address -USAFEMALLOC -UFORCE_INIT_OF_VARS -Wno-uninitialized -Wno-maybe-uninitialized -DMYSQL_SERVER_SUFFIX=-asan-max" +extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs $disable_asan_plugins" +export LDFLAGS="-ldl" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug new file mode 100755 index 00000000..f30c6634 --- /dev/null +++ b/BUILD/compile-pentium64-debug @@ -0,0 +1,26 @@ +#! /bin/sh + +# Copyright (c) 2005, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $debug_cflags" +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-all b/BUILD/compile-pentium64-debug-all new file mode 100755 index 00000000..8733ad00 --- /dev/null +++ b/BUILD/compile-pentium64-debug-all @@ -0,0 +1,10 @@ +#! /bin/sh + +path=`dirname $0` +set -- "$@" --with-debug=full +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $debug_cflags" +extra_configs="$pentium_configs $debug_configs $all_configs" +CC="$CC --pipe" +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max new file mode 100755 index 00000000..c68a6326 --- /dev/null +++ b/BUILD/compile-pentium64-debug-max @@ -0,0 +1,25 @@ +#! /bin/sh + +# Copyright (c) 2005, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $debug_cflags" +extra_configs="$pentium_configs $debug_configs $max_configs" + +CC="$CC --pipe" +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-gcov b/BUILD/compile-pentium64-gcov new file mode 100755 index 00000000..f66499cb --- /dev/null +++ b/BUILD/compile-pentium64-gcov @@ -0,0 +1,35 @@ +#! /bin/sh + +# Copyright (C) 2007 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +set -x -v +path=`dirname $0` + +# Need to disable ccache, or we loose the gcov-needed compiler output files. +CCACHE_DISABLE=1 +export CCACHE_DISABLE + +. "$path/SETUP.sh" + +export LDFLAGS="$gcov_link_flags" + +extra_flags="$pentium64_cflags $max_cflags $gcov_compile_flags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs --without-oqgraph" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-gprof b/BUILD/compile-pentium64-gprof new file mode 100755 index 00000000..2baba1c4 --- /dev/null +++ b/BUILD/compile-pentium64-gprof @@ -0,0 +1,25 @@ +#! /bin/sh + +# Copyright (C) 2007 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $gprof_compile_flags" +extra_configs="$pentium_configs $max_configs $gprof_link_flags $disable_gprof_plugins" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-max b/BUILD/compile-pentium64-max new file mode 100755 index 00000000..a7bf969d --- /dev/null +++ b/BUILD/compile-pentium64-max @@ -0,0 +1,32 @@ +#! /bin/sh + +# Copyright (C) 2007 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $fast_cflags" +# On CentOS/Fedora Core 10 amd64, there is system libz.so but not +# libz.a, so need to use bundled zlib when building static +# binary. Hence we use --with-zlib-dir=bundled +extra_configs="$pentium_configs $max_configs $static_link --with-zlib-dir=bundled" +CC="$CC --pipe" +strip=yes + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-ubsan b/BUILD/compile-pentium64-ubsan new file mode 100755 index 00000000..538b5e88 --- /dev/null +++ b/BUILD/compile-pentium64-ubsan @@ -0,0 +1,37 @@ +#! /bin/sh +# Copyright (c) 2018, MariaDB Corporation. +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +# Compilation with UBSAN, The Undefined Behavior Sanitizer +# We have to use -Wno-uninitialized and -Wno-unitialized we get a lot of false +# positive warnings for this when compiling with -fsanitize=undefined. +# We also have to compile without Spider as linking with Spider library does +# not work. (errno: 11, undefined symbol: _ZTI12ha_partition) + +path=`dirname $0` +. "$path/SETUP.sh" + +# +# Enable UBSAN, UndefinedBehaviorSanitizer. Detects undefined behavior like: +# - Using misaligned or null pointer +# - Signed integer overflow +# - Conversion to, from, or between floating-point types which would overflow +# the destination +# + +extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized" +extra_configs="$pentium_configs $debug_configs -DWITH_UBSAN=ON -DMYSQL_MAINTAINER_MODE=NO --without-spider" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-valgrind-max b/BUILD/compile-pentium64-valgrind-max new file mode 100755 index 00000000..0653fb7f --- /dev/null +++ b/BUILD/compile-pentium64-valgrind-max @@ -0,0 +1,38 @@ +#! /bin/sh +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +# Copyright (c) 2005, 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 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +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-pentium64-wsrep b/BUILD/compile-pentium64-wsrep new file mode 100755 index 00000000..285cdaca --- /dev/null +++ b/BUILD/compile-pentium64-wsrep @@ -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., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $fast_cflags -g $wsrep_cflags" +extra_configs="$pentium_configs $static_link $wsrep_configs --with-wsrep" +CC="$CC --pipe" +strip=yes + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc b/BUILD/compile-ppc new file mode 100755 index 00000000..18c8842d --- /dev/null +++ b/BUILD/compile-ppc @@ -0,0 +1,26 @@ +#! /bin/sh + +# Copyright (C) 2004 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $fast_cflags" +extra_configs="$static_link" +strip=yes + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-debug b/BUILD/compile-ppc-debug new file mode 100755 index 00000000..504ffcf8 --- /dev/null +++ b/BUILD/compile-ppc-debug @@ -0,0 +1,27 @@ +#! /bin/sh + +# Copyright (c) 2004, 2006 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $debug_cflags" +extra_configs="$debug_configs " + +extra_configs="$extra_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max new file mode 100755 index 00000000..ef8d7984 --- /dev/null +++ b/BUILD/compile-ppc-debug-max @@ -0,0 +1,25 @@ +#! /bin/sh + +# Copyright (c) 2004-2006 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $debug_cflags" +extra_configs="$debug_configs $max_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max new file mode 100755 index 00000000..10ffdfc5 --- /dev/null +++ b/BUILD/compile-ppc-max @@ -0,0 +1,25 @@ +#! /bin/sh + +# Copyright (c) 2004-2006 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $fast_cflags -g" +extra_configs="$extra_configs $max_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-solaris-amd64 b/BUILD/compile-solaris-amd64 new file mode 100755 index 00000000..b24c1460 --- /dev/null +++ b/BUILD/compile-solaris-amd64 @@ -0,0 +1,8 @@ +#!/bin/sh +# used for sol10-64 builder in buildbot, don't use it elsewhere +export LDFLAGS='-m64 -lmtmalloc -R/usr/sfw/lib/64' +export CFLAGS='-mtune=i386 -D__sun -m64 -mtune=athlon64' +export CXXFLAGS='-mtune=i386 -D__sun -m64 -mtune=athlon64' +cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EXTRA_CHARSETS=complex -DWITH_READLINE=ON -DWITH_SSL=bundled -DWITH_MAX=ON -DWITH_EMBEDDED_SERVER=ON -DWITH_ZLIB=bundled -DPLUGIN_INNOBASE=NO +gmake -j6 VERBOSE=1 + diff --git a/BUILD/compile-solaris-amd64-debug b/BUILD/compile-solaris-amd64-debug new file mode 100755 index 00000000..78d66495 --- /dev/null +++ b/BUILD/compile-solaris-amd64-debug @@ -0,0 +1,27 @@ +#!/bin/sh + +# Copyright (C) 2007 MySQL AB +# Use is subject to license terms +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +path=`dirname $0` +. "$path/SETUP.sh" +extra_flags="$amd64_cflags -D__sun -m64 -mtune=athlon64 $debug_cflags" +extra_configs="$amd64_configs $debug_configs $max_configs --with-libevent" + +LDFLAGS="-m64 -lmtmalloc -R/usr/sfw/lib/64" +export LDFLAGS + +. "$path/FINISH.sh" diff --git a/BUILD/compile-solaris-amd64-debug-forte b/BUILD/compile-solaris-amd64-debug-forte new file mode 100755 index 00000000..7ccf0f3a --- /dev/null +++ b/BUILD/compile-solaris-amd64-debug-forte @@ -0,0 +1,27 @@ +#!/bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +# Take only #define options - the others are gcc specific. +# (real fix is for SETUP.sh not to put gcc specific options in $debug_cflags) +DEFS="" +for F in $debug_cflags ; do + expr "$F" : "^-D" && DEFS="$DEFS $F" +done +debug_cflags="-O0 -g $DEFS" + +extra_flags="-m64 -mt -D_FORTEC_ -xlibmopt -fns=no $debug_cflags" +extra_configs="$max_configs --with-libevent $debug_configs" + +warnings="" +c_warnings="" +cxx_warnings="" +base_cxxflags="-noex" + +CC=cc +CFLAGS="-xstrconst" +CXX=CC +LDFLAGS="-lmtmalloc" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-solaris-amd64-forte b/BUILD/compile-solaris-amd64-forte new file mode 100755 index 00000000..4dee546b --- /dev/null +++ b/BUILD/compile-solaris-amd64-forte @@ -0,0 +1,46 @@ +#!/bin/sh +# Copyright (c) 2007 MySQL AB, 2008 Sun Microsystems, Inc. +# Use is subject to license terms. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +# 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=`dirname $0` +. "$path/SETUP.sh" + +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="" +c_warnings="" +cxx_warnings="" +base_cxxflags="-noex" + +CC=cc +CFLAGS="-xstrconst" +CXX=CC +LDFLAGS="-lmtmalloc" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-solaris-amd64-forte-debug b/BUILD/compile-solaris-amd64-forte-debug new file mode 100755 index 00000000..08a095b0 --- /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" diff --git a/BUILD/compile-solaris-sparc b/BUILD/compile-solaris-sparc new file mode 100755 index 00000000..27c611ec --- /dev/null +++ b/BUILD/compile-solaris-sparc @@ -0,0 +1,29 @@ +#! /bin/sh +# Copyright (c) 2000-2002, 2005-2007 MySQL AB, 2008 Sun Microsystems, Inc. +# Use is subject to license terms. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +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 $EXTRA_FLAGS $EXTRA_CFLAGS" CXX=g++ 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 -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g $EXTRA_FLAGS $EXTRA_CXXFLAGS" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client + +make -j 4 diff --git a/BUILD/compile-solaris-sparc-debug b/BUILD/compile-solaris-sparc-debug new file mode 100755 index 00000000..194b4b94 --- /dev/null +++ b/BUILD/compile-solaris-sparc-debug @@ -0,0 +1,11 @@ +#!/bin/sh + +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" CXX=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 -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug + +make -j 4 diff --git a/BUILD/compile-solaris-sparc-forte b/BUILD/compile-solaris-sparc-forte new file mode 100755 index 00000000..5e513ebc --- /dev/null +++ b/BUILD/compile-solaris-sparc-forte @@ -0,0 +1,70 @@ +#! /bin/sh +# Copyright (c) 2001, 2002, 2005, 2007 MySQL AB, 2008 Sun Microsystems, Inc. +# Use is subject to license terms. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +# Copyright (c) 2001, 2002, 2005, 2007 MySQL AB, 2008 Sun Microsystems, Inc. +# Use is subject to license terms. +# +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA + +# 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" + +# For "optimal" code for this computer add -fast to EXTRA +# To compile 32/64 bit, uncomment/comment EXTRA_64_BIT + +EXTRA_64_BIT="-m64" +EXTRA="-fast" # Remove comment to target current machine + +# +# The following should not need to be touched +# + +STD="-mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT" +CC=cc-5.0 CFLAGS="-Xa -xstrconst $STD" \ +CXX=CC CXXFLAGS="-noex $STD" LIBS="-lmtmalloc" \ +./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --prefix=$PREFIX + +make -j 4 +if [ $? = 0 ] +then + make test +fi diff --git a/BUILD/compile-solaris-sparc-purify b/BUILD/compile-solaris-sparc-purify new file mode 100755 index 00000000..a4b7ec63 --- /dev/null +++ b/BUILD/compile-solaris-sparc-purify @@ -0,0 +1,110 @@ +#! /bin/sh + +mode="" +cxxfilt="" + +# For g++ 3.X, the PurifyPlus tools needs a program named "cxxfilt", +# "c++file" or similar. It is part of libtool. If not found, you can +# specify the path to it. + +while test $# -gt 0 +do + case "$1" in + --debug) EXTRA_CONFIG_FLAGS=--with-debug ;; + --purify) mode=purify ;; + --purecov*) mode=purecov ;; + --quantify) mode=quantify ;; + --cxxfilt) shift ; cxxfilt=$1 ;; + -h | --help ) + echo "Usage: $0 [ options ]" + echo "Where the 'options' are" + echo " --help | -h Display this help" + echo " --debug Compile with DBUG enabled" + echo " --purify Only prepare for Purify" + echo " --purecov Only prepare for PureCover" + echo " --quantify Only prepare for Quantify" + echo " --cxxfilt <cxxfilt> Path to cxxfilt/c++filt program" + echo " This program is needed for gcc 3.X" + exit 0 ;; + *) echo "No such option '$1'" ; exit 1 ;; + esac + shift +done + +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_valgrind -DEXTRA_DEBUG -O2" CXX=g++ 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 -DHAVE_valgrind -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 + +make -j 4 + +# ---------------------------------------------------------------------- + +#set -x + +purifying_binaries () +{ + while test $1 + do + dir=$1 + shift + target=$1 + shift + binary=$1 + shift + + opts="" + if [ -n "$cxxfilt" ] ; then + opts="$opts -demangle-program=$cxxfilt" + fi + opts="$opts -best-effort" + + back=`pwd` + cd $dir + + # Because of libtool magic, the target and binary + # created might not be the same. To trigger rebuild, + # we need to move them both. + + mv $binary $binary-old + if [ -f $target ] ; then + mv $target $target-old + fi + + if [ -n "$mode" -a $mode = purify ] ; then + make CCLD="purify $opts gcc" CXXLD="purify $opts g++" $target + mv $binary $binary-purify + fi + + if [ -n "$mode" -a $mode = quantify ] ; then + make CCLD="quantify $opts gcc" CXXLD="quantify $opts g++" $target + mv $binary $binary-quantify + fi + + if [ -n "$mode" -a $mode = purecov ] ; then + make CCLD="purecov $opts gcc" CXXLD="purecov $opts g++" $target + mv $binary $binary-purecov + fi + + mv $binary-old $binary + if [ -f $target-old ] ; then + mv $target-old $target + fi + + cd $back + done +} + + +purifying_binaries \ + sql mysqld mysqld \ + client mysqltest .libs/mysqltest \ + tests mysql_client_test mysql_client_test \ + libmysqld/examples mysqltest_embedded mysqltest_embedded \ + libmysqld/examples mysql_client_test_embedded mysql_client_test_embedded + +# ---------------------------------------------------------------------- + diff --git a/BUILD/util.sh b/BUILD/util.sh new file mode 100644 index 00000000..d1f4722b --- /dev/null +++ b/BUILD/util.sh @@ -0,0 +1,48 @@ +# MariaDB SQL server. +# Copyright (C) 2010 Kristian Nielsen and Monty Program 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA. + +# Setting cpu options. +get_cpuopt () { + case "$(uname -o)" in + *Linux*) + case "$(gcc -dumpmachine)" in + x86_64-*) + # gcc barfs on -march=... on x64 + CPUOPT="-m64 -mtune=generic" + ;; + *) + # we'd use i586 to not trip up mobile/lowpower devices + CPUOPT="-m32 -march=i586 -mtune=generic" + ;; + esac + ;; + *Solaris*) + # ToDo: handle 32-bit build? For now default to 64-bit. + CPUOPT="-D__sun -m64 -mtune=athlon64" + ;; + esac + return 0 +} + +# Default to a parallel build, but only if AM_MAKEFLAGS is not set. +# (So buildbots can easily disable this behaviour if required.) +get_make_parallel_flag () { + if test -z "$AM_MAKEFLAGS" + then + AM_MAKEFLAGS="-j 6" + fi + return 0 +} |