Skip to content

Commit d4c5988

Browse files
committed
copy src from mysql-5.7.20
1 parent 410f597 commit d4c5988

File tree

26,826 files changed

+10178898
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

26,826 files changed

+10178898
-0
lines changed

BUILD/README

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
This directory used to contain lots of build scripts for building
2+
MySQL on various platforms. They are mostly gone, use cmake instead.
3+
4+
Some scripts have been kept for backward compatibility (other scripts
5+
depend on them). Others have been kept to illustrate how to enable
6+
gcov or gprof, or explicitly selecting 64bit architecture. If you
7+
want to use these scripts for building, you may want to speed things
8+
up a bit by setting environment variable MAKEFLAGS="-j8"
9+
(or some other number/flag depending on your environment)
10+
11+
The recommended way to build MySQL for developers:
12+
13+
cd <some build directory>
14+
cmake <path to source directory>
15+
make
16+
17+
This will give you a release build, with compiler options taken from
18+
../cmake/build_configurations/compiler_options.cmake
19+
and "feature set" taken from
20+
../cmake/build_configurations/feature_set.cmake
21+
22+
Adding -DWITH_DEBUG=1 to the cmake command line gives you a debug build.
23+
24+
25+
Building on Windows is slightly different:
26+
cd <some build directory>
27+
cmake <path to source directory>
28+
29+
cmake --build . --config Debug
30+
or
31+
cmake --build . --config RelWithDebInfo
32+
33+
34+
If you have special needs, you can disable the defaults by setting
35+
these cmake variables off:
36+
37+
WITH_DEFAULT_COMPILER_OPTIONS
38+
WITH_DEFAULT_FEATURE_SET
39+
40+
Note: For building with unit tests, you need to tell cmake where to find
41+
the sources, see ../unittest/gunit/CMakeLists.txt
42+
You should *not* 'make install' googletest/googlemock on your system,
43+
the libraries must be built from source, with the unit tests.
44+
45+
Note: You need to tell cmake where to find boost, see ../cmake/boost.cmake

BUILD/SETUP.sh

+254
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
#!/bin/sh
2+
3+
# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
4+
#
5+
# This program is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Library General Public
7+
# License as published by the Free Software Foundation; version 2
8+
# of the License.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
# Library General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Library General Public
16+
# License along with this library; if not, write to the Free
17+
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18+
# MA 02110-1301, USA
19+
20+
########################################################################
21+
22+
get_key_value()
23+
{
24+
echo "$1" | sed 's/^--[a-zA-Z_-]*=//'
25+
}
26+
27+
usage()
28+
{
29+
cat <<EOF
30+
Usage: $0 [-h|-n] [configure-options]
31+
-h, --help Show this help message.
32+
-n, --just-print Don't actually run any commands; just print them.
33+
-c, --just-configure Stop after running configure.
34+
--with-debug=full Build with full debug(no optimizations, keep call stack).
35+
--warning-mode=[old|pedantic|maintainer]
36+
Influences the debug flags. Old is default.
37+
--prefix=path Build with prefix 'path'.
38+
39+
Note: this script is intended for internal use by MySQL developers.
40+
EOF
41+
}
42+
43+
parse_options()
44+
{
45+
while test $# -gt 0
46+
do
47+
case "$1" in
48+
--prefix=*)
49+
prefix=`get_key_value "$1"`;;
50+
--with-debug=full)
51+
full_debug="=full";;
52+
--warning-mode=*)
53+
warning_mode=`get_key_value "$1"`;;
54+
-c | --just-configure)
55+
just_configure=1;;
56+
-n | --just-print | --print)
57+
just_print=1;;
58+
-h | --help)
59+
usage
60+
exit 0;;
61+
*)
62+
echo "Unknown option '$1'"
63+
exit 1;;
64+
esac
65+
shift
66+
done
67+
}
68+
69+
########################################################################
70+
71+
if test ! -f sql/mysqld.cc
72+
then
73+
echo "You must run this script from the MySQL top-level directory"
74+
exit 1
75+
fi
76+
77+
prefix="/usr/local/mysql"
78+
just_print=
79+
just_configure=
80+
warning_mode=
81+
maintainer_mode=
82+
full_debug=
83+
84+
parse_options "$@"
85+
86+
if test -n "$MYSQL_BUILD_PREFIX"
87+
then
88+
prefix="$MYSQL_BUILD_PREFIX"
89+
fi
90+
91+
set -e
92+
93+
#
94+
# Check for the CPU and set up CPU specific flags. We may reset them
95+
# later.
96+
#
97+
path=`dirname $0`
98+
. "$path/check-cpu"
99+
100+
export AM_MAKEFLAGS
101+
AM_MAKEFLAGS="-j 6"
102+
103+
# SSL library to use.--with-ssl will select our bundled yaSSL
104+
# implementation of SSL. To use openSSl you will nee too point out
105+
# the location of openSSL headers and lbs on your system.
106+
# Ex --with-ssl=/usr
107+
SSL_LIBRARY=--with-ssl
108+
109+
if [ "x$warning_mode" = "xpedantic" ]; then
110+
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
111+
c_warnings="$warnings"
112+
cxx_warnings="$warnings -std=c++98"
113+
# NOTE: warning mode should not influence optimize/debug mode.
114+
# Please feel free to add a separate option if you don't feel it's an overkill.
115+
debug_extra_cflags="-O0"
116+
# Reset CPU flags (-mtune), they don't work in -pedantic mode
117+
check_cpu_cflags=""
118+
elif [ "x$warning_mode" = "xmaintainer" ]; then
119+
c_warnings="-Wall -Wextra"
120+
cxx_warnings="$c_warnings -Wno-unused-parameter"
121+
maintainer_mode="--enable-mysql-maintainer-mode"
122+
debug_extra_cflags="-g3"
123+
else
124+
# Both C and C++ warnings
125+
warnings="-Wall -Wextra -Wunused -Wwrite-strings"
126+
127+
# For more warnings, uncomment the following line
128+
# warnings="$warnings -Wshadow"
129+
130+
# C warnings
131+
c_warnings="$warnings"
132+
# C++ warnings
133+
cxx_warnings="$warnings -Wno-unused-parameter"
134+
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
135+
cxx_warnings="$cxx_warnings -Wnon-virtual-dtor"
136+
debug_extra_cflags="-O0 -g3 -gdwarf-2"
137+
fi
138+
139+
# Set flags for various build configurations.
140+
# Used in -valgrind builds
141+
valgrind_flags="-DMYSQL_SERVER_SUFFIX=-valgrind-max"
142+
valgrind_configs="--with-valgrind"
143+
#
144+
# Used in -debug builds
145+
debug_cflags="-DEXTRA_DEBUG "
146+
debug_cflags="$debug_cflags -DSAFE_MUTEX"
147+
error_inject="--with-error-inject "
148+
#
149+
# Base C++ flags for all builds
150+
base_cxxflags="-felide-constructors"
151+
#
152+
# Flags for optimizing builds.
153+
# Be as fast as we can be without losing our ability to backtrace.
154+
fast_cflags="-O3 -fno-omit-frame-pointer"
155+
156+
debug_configs="--with-debug"
157+
if [ -z "$full_debug" ]
158+
then
159+
debug_cflags="$debug_cflags $debug_extra_cflags"
160+
fi
161+
162+
163+
#
164+
# Configuration options.
165+
#
166+
base_configs="--prefix=$prefix --enable-assembler "
167+
base_configs="$base_configs --with-extra-charsets=complex "
168+
base_configs="$base_configs --enable-thread-safe-client "
169+
base_configs="$base_configs --with-big-tables $maintainer_mode"
170+
171+
172+
if test -d "$path/../cmd-line-utils/libedit"
173+
then
174+
base_configs="$base_configs --with-libedit"
175+
fi
176+
177+
static_link="--with-mysqld-ldflags=-all-static "
178+
static_link="$static_link --with-client-ldflags=-all-static"
179+
# we need local-infile in all binaries for rpl000001
180+
# if you need to disable local-infile in the client, write a build script
181+
# and unset local_infile_configs
182+
local_infile_configs="--enable-local-infile"
183+
184+
185+
max_no_embedded_configs="$SSL_LIBRARY --with-plugins=max"
186+
max_no_ndb_configs="$SSL_LIBRARY --with-plugins=max-no-ndb --with-embedded-server"
187+
max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server"
188+
189+
#
190+
# CPU and platform specific compilation flags.
191+
#
192+
alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag"
193+
amd64_cflags="$check_cpu_cflags"
194+
amd64_cxxflags="" # If dropping '--with-big-tables', add here "-DBIG_TABLES"
195+
pentium_cflags="$check_cpu_cflags"
196+
pentium64_cflags="$check_cpu_cflags -m64"
197+
ppc_cflags="$check_cpu_cflags"
198+
sparc_cflags=""
199+
200+
if gmake --version > /dev/null 2>&1
201+
then
202+
make=gmake
203+
else
204+
make=make
205+
fi
206+
207+
if test -z "$CC" ; then
208+
CC=gcc
209+
fi
210+
211+
if test -z "$CXX" ; then
212+
CXX=g++
213+
fi
214+
215+
# If ccache (a compiler cache which reduces build time)
216+
# (http://samba.org/ccache) is installed, use it.
217+
# We use 'grep' and hope 'grep' will work as expected
218+
# (returns 0 if finds lines)
219+
if test "$USING_GCOV" != "1"
220+
then
221+
# Not using gcov; Safe to use ccache
222+
CCACHE_GCOV_VERSION_ENABLED=1
223+
fi
224+
225+
if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1"
226+
then
227+
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
228+
echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX"
229+
fi
230+
231+
# gcov
232+
233+
# The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the
234+
# code with profiling information used by gcov.
235+
# The -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl.
236+
# The -DHAVE_gcov enables code to write out coverage info even when crashing.
237+
238+
gcov_compile_flags="-fprofile-arcs -ftest-coverage"
239+
gcov_compile_flags="$gcov_compile_flags -DDISABLE_TAO_ASM"
240+
gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
241+
242+
# GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well
243+
# as on the compiler command line), and this requires setting LDFLAGS for BDB.
244+
245+
gcov_link_flags="-fprofile-arcs -ftest-coverage"
246+
247+
gcov_configs="--with-gcov"
248+
249+
# gprof
250+
251+
gprof_compile_flags="-O2 -pg -g"
252+
253+
gprof_link_flags="--disable-shared $static_link"
254+

BUILD/autorun.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
3+
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
4+
#
5+
# This program is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Library General Public
7+
# License as published by the Free Software Foundation; version 2
8+
# of the License.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
# Library General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Library General Public
16+
# License along with this library; if not, write to the Free
17+
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
18+
# MA 02110-1301, USA
19+
20+
# Create MySQL cmake configure wrapper
21+
22+
die() { echo "$@"; exit 1; }
23+
24+
# Use a configure script that will call CMake.
25+
path=`dirname $0`
26+
cp $path/cmake_configure.sh $path/../configure
27+
chmod +x $path/../configure

BUILD/cmake_configure.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/sh
2+
3+
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
4+
#
5+
# This program is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Library General Public
7+
# License as published by the Free Software Foundation; version 2
8+
# of the License.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
# Library General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Library General Public
16+
# License along with this library; if not, write to the Free
17+
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
18+
# MA 02110-1301, USA
19+
20+
# Ensure cmake and perl are there
21+
cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no
22+
perl --version >/dev/null 2>&1 || HAVE_PERL=no
23+
scriptdir=`dirname $0`
24+
if test "$HAVE_CMAKE" = "no"
25+
then
26+
echo "CMake is required to build MySQL."
27+
exit 1
28+
elif test "$HAVE_PERL" = "no"
29+
then
30+
echo "Perl is required to build MySQL using the configure to CMake translator."
31+
exit 1
32+
else
33+
perl $scriptdir/cmake/configure.pl "$@"
34+
fi
35+

BUILD/compile-dist

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
# Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
4+
#
5+
# This program is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; version 2 of the License.
8+
#
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program; if not, write to the Free Software
16+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
18+
#
19+
# This script's purpose is to prepare for a subsequent 'make dist';
20+
# We don't actually have to compile anything,
21+
# as the 'dist' target in our .cmake files is self-contained
22+
# i.e. it generates source dependencies.
23+
#
24+
25+
path=`dirname $0`
26+
. $path/autorun.sh
27+
28+
# By default we get the "community" feature set from
29+
# cmake/build_configurations/feature_set.cmake
30+
#
31+
./configure

0 commit comments

Comments
 (0)