mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Mergine from mysql-next-me
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
[MYSQL]
|
[MYSQL]
|
||||||
post_commit_to = "commits@lists.mysql.com"
|
post_commit_to = "commits@lists.mysql.com"
|
||||||
post_push_to = "commits@lists.mysql.com"
|
post_push_to = "commits@lists.mysql.com"
|
||||||
tree_name = "mysql-5.5-next-mr"
|
tree_name = "mysql-next-mr"
|
||||||
|
@ -3072,6 +3072,9 @@ libmysqld/rpl_handler.cc
|
|||||||
libmysqld/debug_sync.cc
|
libmysqld/debug_sync.cc
|
||||||
libmysqld/rpl_handler.cc
|
libmysqld/rpl_handler.cc
|
||||||
dbug/tests
|
dbug/tests
|
||||||
|
libmysqld/mdl.cc
|
||||||
|
client/transaction.h
|
||||||
|
libmysqld/transaction.cc
|
||||||
libmysqld/sys_vars.cc
|
libmysqld/sys_vars.cc
|
||||||
libmysqld/keycaches.cc
|
libmysqld/keycaches.cc
|
||||||
client/dtoa.c
|
client/dtoa.c
|
||||||
|
243
BUILD-CMAKE
Normal file
243
BUILD-CMAKE
Normal file
@ -0,0 +1,243 @@
|
|||||||
|
How to Build MySQL server with CMake
|
||||||
|
|
||||||
|
WHAT YOU NEED
|
||||||
|
---------------------------------------------------------------
|
||||||
|
CMake version 2.6 or later installed on your system.
|
||||||
|
|
||||||
|
HOW TO INSTALL:
|
||||||
|
|
||||||
|
Linux distributions:
|
||||||
|
shell> sudo apt-get install cmake
|
||||||
|
|
||||||
|
The above works on do Debian/Ubuntu based distributions.On others, command
|
||||||
|
line needs to be modified to e.g "yum install" on Fedora or "zypper install"
|
||||||
|
on OpenSUSE.
|
||||||
|
|
||||||
|
OpenSolaris:
|
||||||
|
shell> pfexec pkgadd install SUNWcmake
|
||||||
|
|
||||||
|
Windows and Mac OSX:
|
||||||
|
Download and install the latest distribution from
|
||||||
|
http://www.cmake.org/cmake/resources/software.html.On Windows, download
|
||||||
|
installer exe file and run it. On Mac, download the .dmg image and open it.
|
||||||
|
|
||||||
|
Other Unixes:
|
||||||
|
Precompiled packages for other Unix flavors (HPUX, AIX) are available from
|
||||||
|
http://www.cmake.org/cmake/resources/software.html
|
||||||
|
|
||||||
|
Alternatively, you can build from source, source package is also available on
|
||||||
|
CMake download page.
|
||||||
|
|
||||||
|
|
||||||
|
Compiler Tools
|
||||||
|
--------------
|
||||||
|
You will need a working compiler and make utility on your OS.
|
||||||
|
On Windows, install Visual Studio (Express editions will work too).
|
||||||
|
On Mac OSX, install Xcode tools.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BUILD
|
||||||
|
---------------------------------------------------------------
|
||||||
|
Ensure that compiler and cmake are in PATH.
|
||||||
|
The following description assumes that current working directory
|
||||||
|
is the source directory.
|
||||||
|
|
||||||
|
|
||||||
|
- Generic build on Unix, using "Unix Makefiles" generator
|
||||||
|
|
||||||
|
shell>cmake .
|
||||||
|
shell>make
|
||||||
|
|
||||||
|
Note: by default, cmake build is less verbose than automake build. Use
|
||||||
|
"make VERBOSE=1" if you want to see add command lines for each compiled source.
|
||||||
|
|
||||||
|
- Windows, using "Visual Studio 9 2008" generator
|
||||||
|
shell>cmake . -G "Visual Studio 9 2008"
|
||||||
|
shell>devenv MySQL.sln /build /relwithdebinfo
|
||||||
|
(alternatively, open MySQL.sln and build using the IDE)
|
||||||
|
|
||||||
|
- Windows, using "NMake Makefiles" generator
|
||||||
|
shell>cmake . -G "NMake Makefiles"
|
||||||
|
shell>nmake
|
||||||
|
|
||||||
|
- Mac OSX build with Xcode
|
||||||
|
shell>cmake . -G Xcode
|
||||||
|
shell>xcodebuild -configuration Relwithdebinfo
|
||||||
|
(alternatively, open MySQL.xcodeproj and build using the IDE)
|
||||||
|
|
||||||
|
Command line build with CMake 2.8
|
||||||
|
After creating project with cmake -G as above, issue
|
||||||
|
cmake . --build
|
||||||
|
this works with any CMake generator.
|
||||||
|
|
||||||
|
For Visual Studio and Xcode you might want to add an extra
|
||||||
|
configuration parameter, to avoid building all configurations.
|
||||||
|
|
||||||
|
cmake . --build --config Relwithdebinfo
|
||||||
|
|
||||||
|
|
||||||
|
Building "out-of-source"
|
||||||
|
---------------------------------------------------------------
|
||||||
|
Building out-of-source provides additional benefits. For example it allows to
|
||||||
|
build both Release and Debug configurations using the single source tree.Or
|
||||||
|
build the same source with different version of the same compiler or with
|
||||||
|
different compilers. Also you will prevent polluting the source tree with the
|
||||||
|
objects and binaries produced during the make.
|
||||||
|
|
||||||
|
Here is an example on how to do it (generic Unix), assuming the source tree is
|
||||||
|
in directory named src and the current working directory is source root.
|
||||||
|
|
||||||
|
shell>mkdir ../build # build directory is called build
|
||||||
|
shell>cd ../build
|
||||||
|
shell>cmake ../src
|
||||||
|
|
||||||
|
Note: if a directory was used for in-source build, out-of-source will
|
||||||
|
not work. To reenable out-of-source build, remove <source-root>/CMakeCache.txt
|
||||||
|
file.
|
||||||
|
|
||||||
|
|
||||||
|
CONFIGURATION PARAMETERS
|
||||||
|
---------------------------------------------------------------
|
||||||
|
The procedure above will build with default configuration.
|
||||||
|
|
||||||
|
Let's you want to change the configuration parameters and have archive
|
||||||
|
storage engine compiled into the server instead of building it as pluggable
|
||||||
|
module.
|
||||||
|
|
||||||
|
1)You can provide parameters on the command line, like
|
||||||
|
|
||||||
|
shell> cmake . -DWITH_ARCHIVE_STORAGE_ENGINE=1
|
||||||
|
|
||||||
|
This can be done during the initial configuration or any time later.
|
||||||
|
|
||||||
|
Note, that parameters are "sticky", that is they are remebered in the CMake
|
||||||
|
cache (CMakeCache.txt file in the build directory)
|
||||||
|
|
||||||
|
2) Configuration using cmake-gui (Windows, OSX, or Linux with cmake-gui
|
||||||
|
installed)
|
||||||
|
|
||||||
|
From the build directory, issue
|
||||||
|
shell> cmake-gui .
|
||||||
|
|
||||||
|
- Check the WITH_INNOBASE_STORAGE_ENGINE checkbox
|
||||||
|
- Click on "Configure" button
|
||||||
|
- Click on "Generate" button
|
||||||
|
- Close cmake-gui
|
||||||
|
shell> make
|
||||||
|
|
||||||
|
3)Using ccmake (Unix)
|
||||||
|
ccmake is curses-based GUI application that provides the same functionality
|
||||||
|
as cmake-gui. It is less user-friendly compared to cmake-gui but works also
|
||||||
|
on exotic Unixes like HPUX, AIX or Solaris.
|
||||||
|
|
||||||
|
Besides storage engines, probably the most important parameter from a
|
||||||
|
developer's point of view is WITH_DEBUG (this allows to build server with
|
||||||
|
dbug tracing library and with debug compile flags).
|
||||||
|
|
||||||
|
After changing the configuration, recompile using
|
||||||
|
shell> make
|
||||||
|
|
||||||
|
|
||||||
|
Listing configuration parameters
|
||||||
|
---------------------------------------------------------------
|
||||||
|
shell> cmake -L
|
||||||
|
|
||||||
|
Gives a brief overview of important configuration parameters (dump to stdout)
|
||||||
|
|
||||||
|
shell> cmake -LH
|
||||||
|
|
||||||
|
Does the same but also provides a short help text for each parameter.
|
||||||
|
|
||||||
|
shell> cmake -LAH
|
||||||
|
|
||||||
|
Dumps all config parameters (including advanced) to the stdout.
|
||||||
|
|
||||||
|
PACKAGING
|
||||||
|
---------------------------------------------------------------
|
||||||
|
-- Binary distribution --
|
||||||
|
Packaging in form of tar.gz archives (or .zip on Windows) is also supported
|
||||||
|
To create a tar.gz package,
|
||||||
|
|
||||||
|
1)If you're using "generic" Unix build with makefiles
|
||||||
|
|
||||||
|
shell> make package
|
||||||
|
this will create a tar.gz file in the top level build directory.
|
||||||
|
|
||||||
|
2)On Windows, using "NMake Makefiles" generator
|
||||||
|
|
||||||
|
shell> nmake package
|
||||||
|
|
||||||
|
3)On Windows, using "Visual Studio" generator
|
||||||
|
|
||||||
|
shell> devenv mysql.sln /build relwithdebinfo /project package
|
||||||
|
|
||||||
|
Note On Windows, 7Zip or Winzip must be installed and 7z.exe rsp winzip.exe
|
||||||
|
need to be in the PATH.
|
||||||
|
|
||||||
|
|
||||||
|
Another way to build packages is calling cpack executable directly like
|
||||||
|
shell> cpack -G TGZ --config CPackConfig.cmake
|
||||||
|
(-G TGZ is for tar.gz generator, there is also -GZIP)
|
||||||
|
|
||||||
|
-- Source distribution --
|
||||||
|
"make dist" target is provided.
|
||||||
|
|
||||||
|
ADDITIONAL MAKE TARGETS: "make install" AND "make test"
|
||||||
|
----------------------------------------------------------------
|
||||||
|
install target also provided for Makefile based generators. Installation
|
||||||
|
directory can be controlled using configure-time parameter
|
||||||
|
CMAKE_INSTALL_PREFIX (default is /usr/local. It is also possible to install to
|
||||||
|
non-configured directory, using
|
||||||
|
|
||||||
|
shell> make install DESTDIR="/some/absolute/path"
|
||||||
|
|
||||||
|
"make test" runs unit tests (uses CTest for it)
|
||||||
|
"make test-force" runs mysql-test-run.pl tests with --test-force parameter
|
||||||
|
|
||||||
|
FOR PROGRAMMERS: WRITING PLATFORM CHECKS
|
||||||
|
--------------------------------------------------------------
|
||||||
|
If you modify MySQL source and want to add a new platform check,please read
|
||||||
|
http://www.vtk.org/Wiki/CMake_HowToDoPlatformChecks first. In MySQL, most of
|
||||||
|
the platform tests are implemented in configure.cmake and the template header
|
||||||
|
file is config.h.cmake
|
||||||
|
|
||||||
|
Bigger chunks of functionality, for example non-trivial macros are implemented
|
||||||
|
in files <src-root>/cmake subdirectory.
|
||||||
|
|
||||||
|
For people with autotools background, it is important to remember CMake does
|
||||||
|
not provide autoheader functionality. That is, when you add a check
|
||||||
|
|
||||||
|
CHECK_FUNCTION_EXISTS(foo HAVE_FOO)
|
||||||
|
to config.cmake, then you will also need to add
|
||||||
|
#cmakedefine HAVE_FOO 1
|
||||||
|
to config.h.cmake
|
||||||
|
|
||||||
|
Troubleshooting platform checks
|
||||||
|
--------------------------------
|
||||||
|
If you suspect that a platform check returned wrong result, examine
|
||||||
|
<build-root>/CMakeFiles/CMakeError.log and
|
||||||
|
<build-root>/CMakeFiles/CMakeOutput.log
|
||||||
|
These files they contain compiler command line, and exact error messages.
|
||||||
|
|
||||||
|
Troubleshooting CMake code
|
||||||
|
----------------------------------
|
||||||
|
While there are advanced flags for cmake like -debug-trycompile and --trace,
|
||||||
|
a simple and efficient way to debug to add
|
||||||
|
MESSAGE("interesting variable=${some_invariable}")
|
||||||
|
to the interesting places in CMakeLists.txt
|
||||||
|
|
||||||
|
|
||||||
|
Tips:
|
||||||
|
- When using Makefile generator it is easy to examine which compiler flags are
|
||||||
|
used to build. For example, compiler flags for mysqld are in
|
||||||
|
<build-root>/sql/CMakeFiles/mysqld.dir/flags.make and the linker command line
|
||||||
|
is in <build-root>/sql/CMakeFiles/mysqld.dir/link.txt
|
||||||
|
|
||||||
|
- CMake caches results of platform checks in CMakeCache.txt. It is a nice
|
||||||
|
feature because tests do not rerun when reconfiguring (e.g when a new test was
|
||||||
|
added).The downside of caching is that when a platform test was wrong and was
|
||||||
|
later corrected, the cached result is still used. If you encounter this
|
||||||
|
situation, which should be a rare occation, you need either to remove the
|
||||||
|
offending entry from CMakeCache.txt (if test was for HAVE_FOO, remove lines
|
||||||
|
containing HAVE_FOO from CMakeCache.txt) or just remove the cache file.
|
@ -20,6 +20,7 @@
|
|||||||
EXTRA_DIST = FINISH.sh \
|
EXTRA_DIST = FINISH.sh \
|
||||||
SETUP.sh \
|
SETUP.sh \
|
||||||
autorun.sh \
|
autorun.sh \
|
||||||
|
choose_configure.sh \
|
||||||
build_mccge.sh \
|
build_mccge.sh \
|
||||||
check-cpu \
|
check-cpu \
|
||||||
cleanup \
|
cleanup \
|
||||||
|
@ -20,6 +20,7 @@ do
|
|||||||
done
|
done
|
||||||
IFS="$save_ifs"
|
IFS="$save_ifs"
|
||||||
|
|
||||||
|
rm -rf configure
|
||||||
aclocal || die "Can't execute aclocal"
|
aclocal || die "Can't execute aclocal"
|
||||||
autoheader || die "Can't execute autoheader"
|
autoheader || die "Can't execute autoheader"
|
||||||
# --force means overwrite ltmain.sh script if it already exists
|
# --force means overwrite ltmain.sh script if it already exists
|
||||||
@ -29,3 +30,9 @@ $LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
|
|||||||
# and --force to overwrite them if they already exist
|
# and --force to overwrite them if they already exist
|
||||||
automake --add-missing --force --copy || die "Can't execute automake"
|
automake --add-missing --force --copy || die "Can't execute automake"
|
||||||
autoconf || die "Can't execute autoconf"
|
autoconf || die "Can't execute autoconf"
|
||||||
|
# Do not use autotools generated configure directly. Instead, use a script
|
||||||
|
# that will either call CMake or original configure shell script at build
|
||||||
|
# time (CMake is preferred if installed).
|
||||||
|
mv configure configure.am
|
||||||
|
cp BUILD/choose_configure.sh configure
|
||||||
|
chmod a+x configure
|
||||||
|
14
BUILD/choose_configure.sh
Normal file
14
BUILD/choose_configure.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Choose whether to use autoconf created configure
|
||||||
|
# of perl script that calls cmake.
|
||||||
|
|
||||||
|
# Ensure cmake and perl are there
|
||||||
|
cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no
|
||||||
|
perl --version >/dev/null 2>&1 || HAVE_CMAKE=no
|
||||||
|
if test "$HAVE_CMAKE" = "no"
|
||||||
|
then
|
||||||
|
sh ./configure.am "$@"
|
||||||
|
else
|
||||||
|
perl ./cmake/configure.pl "$@"
|
||||||
|
fi
|
||||||
|
|
525
CMakeLists.txt
525
CMakeLists.txt
@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2006 MySQL AB, 2009 Sun Microsystems, Inc
|
# Copyright (C) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -13,332 +13,275 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||||
IF(COMMAND cmake_policy)
|
# Avoid warnings in higher versions
|
||||||
cmake_policy(SET CMP0005 NEW)
|
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6)
|
||||||
ENDIF(COMMAND cmake_policy)
|
CMAKE_POLICY(VERSION 2.8)
|
||||||
|
endif()
|
||||||
|
|
||||||
PROJECT(MySql)
|
|
||||||
|
|
||||||
# This reads user configuration, generated by configure.js.
|
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
|
||||||
INCLUDE(win/configure.data)
|
|
||||||
|
|
||||||
# Hardcode support for CSV storage engine
|
# First, decide about build type (debug or release)
|
||||||
SET(WITH_CSV_STORAGE_ENGINE TRUE)
|
# If custom compiler flags are set or cmake is invoked with -DCMAKE_BUILD_TYPE,
|
||||||
|
# respect user wishes and do not (re)define CMAKE_BUILD_TYPE. If WITH_DEBUG{_FULL}
|
||||||
|
# is given, set CMAKE_BUILD_TYPE = Debug. Otherwise, use Relwithdebinfo.
|
||||||
|
|
||||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
|
|
||||||
${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY)
|
|
||||||
|
|
||||||
# Set standard options
|
IF(DEFINED CMAKE_BUILD_TYPE)
|
||||||
ADD_DEFINITIONS(-DHAVE_YASSL)
|
SET(HAVE_CMAKE_BUILD_TYPE TRUE)
|
||||||
ADD_DEFINITIONS(-DCMAKE_CONFIGD)
|
ENDIF()
|
||||||
ADD_DEFINITIONS(-DDEFAULT_MYSQL_HOME="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/")
|
SET(CUSTOM_C_FLAGS $ENV{CFLAGS})
|
||||||
ADD_DEFINITIONS(-DDEFAULT_BASEDIR="c:/Program Files/MySQL/")
|
IF(NOT CUSTOM_C_FLAGS)
|
||||||
ADD_DEFINITIONS(-DMYSQL_DATADIR="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/data")
|
SET(CUSTOM_C_FLAGS ${CMAKE_C_FLAGS})
|
||||||
ADD_DEFINITIONS(-DDEFAULT_CHARSET_HOME="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/")
|
ENDIF()
|
||||||
ADD_DEFINITIONS(-DPACKAGE=mysql)
|
|
||||||
ADD_DEFINITIONS(-DSHAREDIR="share")
|
|
||||||
|
|
||||||
# Enable IPv6 handling code
|
OPTION(WITH_DEBUG "Use dbug" OFF)
|
||||||
ADD_DEFINITIONS(-DHAVE_IPV6)
|
OPTION(WITH_DEBUG_FULL "Use dbug and safemalloc/safemutex. Slow" OFF)
|
||||||
|
|
||||||
# Set debug options
|
IF(NOT HAVE_CMAKE_BUILD_TYPE)
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
|
IF(BUILD_CONFIG OR NOT CUSTOM_C_FLAGS)
|
||||||
|
IF(WITH_DEBUG)
|
||||||
|
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Debug build" FORCE)
|
||||||
|
ELSE()
|
||||||
|
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
|
||||||
|
"RelWithDebInfo build" FORCE)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# Do not use SAFEMALLOC for Windows builds, as Debug CRT has the same functionality
|
IF(WITH_DEBUG_FULL)
|
||||||
# Neither SAFE_MUTEX works on Windows and it has been explicitely undefined in
|
SET(WITH_DEBUG ON CACHE BOOL "Use DBUG")
|
||||||
# my_pthread.h
|
ENDIF()
|
||||||
IF(NOT WIN32)
|
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
|
||||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
|
||||||
ENDIF(NOT WIN32)
|
|
||||||
|
|
||||||
SET(localstatedir "C:\\mysql\\data")
|
IF(BUILD_CONFIG)
|
||||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-huge.cnf.sh
|
SET(CMAKE_USER_MAKE_RULES_OVERRIDE
|
||||||
${CMAKE_SOURCE_DIR}/support-files/my-huge.ini @ONLY)
|
${CMAKE_SOURCE_DIR}/cmake/build_configurations/${BUILD_CONFIG}.cmake)
|
||||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-innodb-heavy-4G.cnf.sh
|
ENDIF()
|
||||||
${CMAKE_SOURCE_DIR}/support-files/my-innodb-heavy-4G.ini @ONLY)
|
|
||||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-large.cnf.sh
|
|
||||||
${CMAKE_SOURCE_DIR}/support-files/my-large.ini @ONLY)
|
|
||||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-medium.cnf.sh
|
|
||||||
${CMAKE_SOURCE_DIR}/support-files/my-medium.ini @ONLY)
|
|
||||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh
|
|
||||||
${CMAKE_SOURCE_DIR}/support-files/my-small.ini @ONLY)
|
|
||||||
|
|
||||||
IF(CYBOZU)
|
PROJECT(MySQL)
|
||||||
ADD_DEFINITIONS(-DCYBOZU)
|
|
||||||
ENDIF(CYBOZU)
|
|
||||||
|
|
||||||
IF(EXTRA_DEBUG)
|
# Include the platform-specific file. To allow exceptions, this code
|
||||||
ADD_DEFINITIONS(-D EXTRA_DEBUG)
|
# looks for files in order of how specific they are. If there is, for
|
||||||
ENDIF(EXTRA_DEBUG)
|
# example, a generic Linux.cmake and a version-specific
|
||||||
|
# Linux-2.6.28-11-generic, it will pick Linux-2.6.28-11-generic and
|
||||||
|
# include it. It is then up to the file writer to include the generic
|
||||||
|
# version if necessary.
|
||||||
|
FOREACH(_base
|
||||||
|
${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}-${CMAKE_SYSTEM_PROCESSOR}
|
||||||
|
${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}
|
||||||
|
${CMAKE_SYSTEM_NAME})
|
||||||
|
SET(_file ${CMAKE_SOURCE_DIR}/cmake/os/${_base}.cmake)
|
||||||
|
IF(EXISTS ${_file})
|
||||||
|
INCLUDE(${_file})
|
||||||
|
BREAK()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
IF(ENABLED_DEBUG_SYNC)
|
|
||||||
ADD_DEFINITIONS(-D ENABLED_DEBUG_SYNC)
|
|
||||||
ENDIF(ENABLED_DEBUG_SYNC)
|
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
|
|
||||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
|
|
||||||
|
|
||||||
# in some places we use DBUG_OFF
|
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
|
|
||||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
|
|
||||||
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDBUG_OFF")
|
|
||||||
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
|
|
||||||
|
|
||||||
#TODO: update the code and remove the disabled warnings
|
# Following autotools tradition, add preprocessor definitions
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805")
|
# specified in environment variable CPPFLAGS
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805")
|
IF(DEFINED ENV{CPPFLAGS})
|
||||||
|
ADD_DEFINITIONS($ENV{CPPFLAGS})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# Disable warnings in Visual Studio 8 and above
|
# Add macros
|
||||||
IF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
INCLUDE(character_sets)
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
|
INCLUDE(zlib)
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996")
|
INCLUDE(ssl)
|
||||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996")
|
INCLUDE(readline)
|
||||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996")
|
INCLUDE(mysql_version)
|
||||||
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996")
|
INCLUDE(libutils)
|
||||||
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996")
|
INCLUDE(dtrace)
|
||||||
ENDIF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
INCLUDE(plugin)
|
||||||
|
INCLUDE(install_macros)
|
||||||
|
INCLUDE(install_layout)
|
||||||
|
INCLUDE(mysql_add_executable)
|
||||||
|
|
||||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
# Handle options
|
||||||
# VS2003 has a bug that prevents linking mysqld with module definition file
|
OPTION(DISABLE_SHARED
|
||||||
# (/DEF option for linker). Linker would incorrectly complain about multiply
|
"Don't build shared libraries, compile code as position-dependent" OFF)
|
||||||
# defined symbols. Workaround is to disable dynamic plugins, so /DEF is not
|
IF(DISABLE_SHARED)
|
||||||
# used.
|
SET(WITHOUT_DYNAMIC_PLUGINS 1)
|
||||||
MESSAGE("Warning: Building MySQL with Visual Studio 2003.NET is no more supported.")
|
ENDIF()
|
||||||
MESSAGE("Please use a newer version of Visual Studio.")
|
OPTION(ENABLED_PROFILING "Enable profiling" ON)
|
||||||
SET(WITHOUT_DYNAMIC_PLUGINS TRUE)
|
OPTION(CYBOZU "" OFF)
|
||||||
|
OPTION(BACKUP_TEST "" OFF)
|
||||||
|
OPTION(WITHOUT_SERVER OFF)
|
||||||
|
OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
|
||||||
|
MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)
|
||||||
|
|
||||||
# VS2003 needs the /Op compiler option to disable floating point optimizations
|
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Op")
|
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Op")
|
|
||||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Op")
|
|
||||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Op")
|
|
||||||
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Op")
|
|
||||||
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /Op")
|
|
||||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
|
||||||
|
|
||||||
# Settings for Visual Studio 7 and above.
|
OPTION(ENABLE_DEBUG_SYNC "Enable debug sync (debug builds only)" ON)
|
||||||
IF(MSVC)
|
IF(ENABLE_DEBUG_SYNC)
|
||||||
# replace /MDd with /MTd
|
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
|
||||||
STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
|
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
|
||||||
STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
|
ENDIF()
|
||||||
STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
|
|
||||||
STRING(REPLACE "/MDd" "/MTd" CMAKE_C_FLAGS_DEBUG_INIT ${CMAKE_C_FLAGS_DEBUG_INIT})
|
|
||||||
|
|
||||||
STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
|
OPTION(WITH_ERROR_INJECT
|
||||||
STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
|
"Enable error injection in MySQL Server (debug builds only)" OFF)
|
||||||
STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
|
IF(WITH_ERROR_INJECT)
|
||||||
STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
|
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DERROR_INJECT_SUPPORT")
|
||||||
|
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DERROR_INJECT_SUPPORT")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# generate map files, set stack size (see bug#20815)
|
OPTION(ENABLE_LOCAL_INFILE
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS")
|
"If we should should enable LOAD DATA LOCAL by default" ${IF_WIN})
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1048576")
|
MARK_AS_ADVANCED(ENABLE_LOCAL_INFILE)
|
||||||
|
|
||||||
# remove support for Exception handling
|
OPTION(WITH_FAST_MUTEXES "Compile with fast mutexes" OFF)
|
||||||
STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
|
||||||
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
|
||||||
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT})
|
|
||||||
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
|
|
||||||
|
|
||||||
# Mark 32 bit executables large address aware so they can
|
# Set DBUG_OFF and other optional release-only flags for non-debug project types
|
||||||
# use > 2GB address space
|
FOREACH(BUILD_TYPE RELEASE RELWITHDEBINFO MINSIZEREL)
|
||||||
IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
FOREACH(LANG C CXX)
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
SET(CMAKE_${LANG}_FLAGS_${BUILD_TYPE}
|
||||||
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
"${CMAKE_${LANG}_FLAGS_${BUILD_TYPE}} -DDBUG_OFF")
|
||||||
|
IF(WITH_FAST_MUTEXES)
|
||||||
|
SET(CMAKE_${LANG}_FLAGS_${BUILD_TYPE}
|
||||||
|
"${CMAKE_${LANG}_FLAGS_${BUILD_TYPE}} -DMY_PTHREAD_FASTMUTEX=1")
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
# Disable automatic manifest generation.
|
IF(NOT CMAKE_BUILD_TYPE
|
||||||
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
|
AND NOT CMAKE_GENERATOR MATCHES "Visual Studio"
|
||||||
${CMAKE_EXE_LINKER_FLAGS})
|
AND NOT CMAKE_GENERATOR MATCHES "Xcode")
|
||||||
# Explicitly disable it since it is the default for newer versions of VS
|
# This is the case of no CMAKE_BUILD_TYPE choosen, typical for VS and Xcode
|
||||||
STRING(REGEX MATCH "MANIFEST:NO" tmp_manifest ${CMAKE_EXE_LINKER_FLAGS})
|
# or if custom C flags are set. In VS and Xcode for non-Debug configurations
|
||||||
IF(NOT tmp_manifest)
|
# DBUG_OFF is already correctly set. Use DBUG_OFF for Makefile based projects
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
|
# without build type too, unless user specifically requests DBUG.
|
||||||
ENDIF(NOT tmp_manifest)
|
IF(NOT CMAKE_C_FLAGS MATCHES "-DDBUG_ON")
|
||||||
ENDIF(MSVC)
|
ADD_DEFINITIONS(-DDBUG_OFF)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Add safemalloc and safemutex for debug condifurations, except on Windows
|
||||||
|
# (C runtime library provides safemalloc functionality and safemutex has never
|
||||||
|
# worked there)
|
||||||
|
IF(WITH_DEBUG OR WITH_DEBUG_FULL AND NOT WIN32)
|
||||||
|
FOREACH(LANG C CXX)
|
||||||
|
IF(WITH_DEBUG_FULL)
|
||||||
|
SET(CMAKE_${LANG}_FLAGS_DEBUG
|
||||||
|
"${CMAKE_${LANG}_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||||
|
ELSE()
|
||||||
|
SET(CMAKE_${LANG}_FLAGS_DEBUG
|
||||||
|
"${CMAKE_${LANG}_FLAGS_DEBUG} -DSAFE_MUTEX")
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
# Set commonly used variables
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
|
SET(DEFAULT_MYSQL_HOME "C:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}" )
|
||||||
ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501")
|
SET(SHAREDIR share)
|
||||||
ENDIF(WIN32)
|
ELSE()
|
||||||
|
SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX})
|
||||||
|
SET(SHAREDIR ${DEFAULT_MYSQL_HOME}/${INSTALL_MYSQLSHAREDIR})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# default to x86 platform. We'll check for X64 in a bit
|
SET(DEFAULT_BASEDIR "${DEFAULT_MYSQL_HOME}")
|
||||||
SET (PLATFORM X86)
|
SET(MYSQL_DATADIR "${DEFAULT_MYSQL_HOME}/${INSTALL_MYSQLDATADIR}" CACHE PATH
|
||||||
|
"default MySQL data directory")
|
||||||
|
SET(DEFAULT_CHARSET_HOME "${DEFAULT_MYSQL_HOME}")
|
||||||
|
SET(PLUGINDIR "${DEFAULT_MYSQL_HOME}/${INSTALL_PLUGINDIR}")
|
||||||
|
IF(SYSCONFDIR)
|
||||||
|
SET(DEFAULT_SYSCONFDIR "${SYSCONFDIR}")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
# This definition is necessary to work around a bug with Intellisense described
|
|
||||||
# here: http://tinyurl.com/2cb428. Syntax highlighting is important for proper
|
|
||||||
# debugger functionality.
|
|
||||||
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
|
||||||
MESSAGE(STATUS "Detected 64-bit platform.")
|
|
||||||
ADD_DEFINITIONS("-D_WIN64")
|
|
||||||
SET (PLATFORM X64)
|
|
||||||
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
|
||||||
|
|
||||||
IF(EMBED_MANIFESTS)
|
# Run platform tests
|
||||||
# Search for the tools (mt, makecat, signtool) necessary for embedding
|
INCLUDE(configure.cmake)
|
||||||
# manifests and signing executables with the MySQL AB authenticode cert.
|
|
||||||
#
|
|
||||||
# CMake will first search it's defaults (CMAKE_FRAMEWORK_PATH,
|
|
||||||
# CMAKE_APPBUNDLE_PATH, CMAKE_PROGRAM_PATH and the system PATH) followed
|
|
||||||
# by the listed paths which are the current possible defaults and should be
|
|
||||||
# updated when necessary.
|
|
||||||
#
|
|
||||||
# The custom manifests are designed to be compatible with all mt versions.
|
|
||||||
# The MySQL AB Authenticode certificate is available only internally.
|
|
||||||
# Others should store a single signing certificate in a local cryptographic
|
|
||||||
# service provider and alter the signtool command as necessary.
|
|
||||||
FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
|
|
||||||
PATHS
|
|
||||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
|
|
||||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
|
|
||||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
|
|
||||||
FIND_PROGRAM(HAVE_CATALOG_TOOL NAMES makecat
|
|
||||||
PATHS
|
|
||||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin")
|
|
||||||
FIND_PROGRAM(HAVE_SIGN_TOOL NAMES signtool
|
|
||||||
PATHS
|
|
||||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
|
|
||||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
|
|
||||||
|
|
||||||
IF(HAVE_MANIFEST_TOOL)
|
# Common defines and includes
|
||||||
MESSAGE(STATUS "Found Mainfest Tool.")
|
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
|
||||||
ELSE(HAVE_MANIFEST_TOOL)
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||||
MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
|
|
||||||
ENDIF(HAVE_MANIFEST_TOOL)
|
|
||||||
IF(HAVE_CATALOG_TOOL)
|
|
||||||
MESSAGE(STATUS "Found Catalog Tool.")
|
|
||||||
ELSE(HAVE_CATALOG_TOOL)
|
|
||||||
MESSAGE(FATAL_ERROR "Catalog tool, makecat.exe, can't be found.")
|
|
||||||
ENDIF(HAVE_CATALOG_TOOL)
|
|
||||||
IF(HAVE_SIGN_TOOL)
|
|
||||||
MESSAGE(STATUS "Found Sign Tool. Embedding custom manifests and signing executables.")
|
|
||||||
ELSE(HAVE_SIGN_TOOL)
|
|
||||||
MESSAGE(FATAL_ERROR "Sign tool, signtool.exe, can't be found.")
|
|
||||||
ENDIF(HAVE_SIGN_TOOL)
|
|
||||||
|
|
||||||
# Set the processor architecture.
|
# Add bundled or system zlib.
|
||||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
|
MYSQL_CHECK_ZLIB_WITH_COMPRESS()
|
||||||
SET(PROCESSOR_ARCH "amd64")
|
# Optionally add bundled yassl/taocrypt or system openssl.
|
||||||
ELSE(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
|
MYSQL_CHECK_SSL()
|
||||||
SET(PROCESSOR_ARCH "X86")
|
# Add readline or libedit.
|
||||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
|
MYSQL_CHECK_READLINE()
|
||||||
ENDIF(EMBED_MANIFESTS)
|
|
||||||
|
|
||||||
# Figure out what engines to build and how (statically or dynamically),
|
IF(NOT WITHOUT_SERVER)
|
||||||
# add preprocessor defines for storage engines.
|
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
|
||||||
IF(WITHOUT_DYNAMIC_PLUGINS)
|
# Add storage engines and plugins.
|
||||||
MESSAGE("Dynamic plugins are disabled.")
|
CONFIGURE_PLUGINS()
|
||||||
ENDIF(WITHOUT_DYNAMIC_PLUGINS)
|
ENDIF()
|
||||||
|
|
||||||
FILE(GLOB STORAGE_SUBDIRS storage/*)
|
ADD_SUBDIRECTORY(include)
|
||||||
FOREACH(SUBDIR ${STORAGE_SUBDIRS})
|
|
||||||
FILE(RELATIVE_PATH DIRNAME ${PROJECT_SOURCE_DIR}/storage ${SUBDIR})
|
|
||||||
IF (EXISTS ${SUBDIR}/CMakeLists.txt)
|
|
||||||
# Check MYSQL_STORAGE_ENGINE macro is present
|
|
||||||
FILE(STRINGS ${SUBDIR}/CMakeLists.txt HAVE_STORAGE_ENGINE REGEX MYSQL_STORAGE_ENGINE)
|
|
||||||
IF(HAVE_STORAGE_ENGINE)
|
|
||||||
# Extract name of engine from HAVE_STORAGE_ENGINE
|
|
||||||
STRING(REGEX REPLACE ".*MYSQL_STORAGE_ENGINE\\((.*\)\\).*"
|
|
||||||
"\\1" ENGINE_NAME ${HAVE_STORAGE_ENGINE})
|
|
||||||
STRING(TOUPPER ${ENGINE_NAME} ENGINE)
|
|
||||||
STRING(TOLOWER ${ENGINE_NAME} ENGINE_LOWER)
|
|
||||||
|
|
||||||
SET(ENGINE_BUILD_TYPE "DYNAMIC")
|
|
||||||
# Read plug.in to find out if a plugin is mandatory and whether it supports
|
|
||||||
# build as shared library (dynamic).
|
|
||||||
IF(EXISTS ${SUBDIR}/plug.in)
|
|
||||||
FILE(READ ${SUBDIR}/plug.in PLUGIN_FILE_CONTENT)
|
|
||||||
STRING (REGEX MATCH "MYSQL_PLUGIN_DYNAMIC" MYSQL_PLUGIN_DYNAMIC ${PLUGIN_FILE_CONTENT})
|
|
||||||
STRING (REGEX MATCH "MYSQL_PLUGIN_MANDATORY" MYSQL_PLUGIN_MANDATORY ${PLUGIN_FILE_CONTENT})
|
|
||||||
STRING (REGEX MATCH "MYSQL_PLUGIN_STATIC" MYSQL_PLUGIN_STATIC ${PLUGIN_FILE_CONTENT})
|
|
||||||
|
|
||||||
IF(MYSQL_PLUGIN_MANDATORY)
|
|
||||||
SET(WITH_${ENGINE}_STORAGE_ENGINE TRUE)
|
|
||||||
ENDIF(MYSQL_PLUGIN_MANDATORY)
|
|
||||||
|
|
||||||
IF (WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
|
|
||||||
SET(ENGINE_BUILD_TYPE "STATIC")
|
|
||||||
ELSEIF(NOT WITHOUT_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_DYNAMIC AND NOT WITHOUT_DYNAMIC_PLUGINS)
|
|
||||||
SET(ENGINE_BUILD_TYPE "DYNAMIC")
|
|
||||||
ELSE(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
|
|
||||||
SET(ENGINE_BUILD_TYPE "NONE")
|
|
||||||
ENDIF(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
|
|
||||||
IF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
|
|
||||||
IF(MYSQL_PLUGIN_MANDATORY)
|
|
||||||
SET (mysql_mandatory_plugins "${mysql_mandatory_plugins}builtin_${ENGINE_LOWER}_plugin,")
|
|
||||||
ELSE(MYSQL_PLUGIN_MANDATORY)
|
|
||||||
SET (mysql_optional_plugins "${mysql_optional_plugins}builtin_${ENGINE_LOWER}_plugin,")
|
|
||||||
ENDIF(MYSQL_PLUGIN_MANDATORY)
|
|
||||||
SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${ENGINE_LOWER})
|
|
||||||
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE")
|
|
||||||
SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE)
|
|
||||||
SET (${ENGINE}_DIR ${DIRNAME})
|
|
||||||
ENDIF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
|
|
||||||
ENDIF(EXISTS ${SUBDIR}/plug.in)
|
|
||||||
|
|
||||||
IF(NOT ENGINE_BUILD_TYPE STREQUAL "NONE")
|
|
||||||
LIST(APPEND ${ENGINE_BUILD_TYPE}_ENGINE_DIRECTORIES ${SUBDIR})
|
|
||||||
ENDIF(NOT ENGINE_BUILD_TYPE STREQUAL "NONE")
|
|
||||||
|
|
||||||
ENDIF(HAVE_STORAGE_ENGINE)
|
|
||||||
ENDIF(EXISTS ${SUBDIR}/CMakeLists.txt)
|
|
||||||
ENDFOREACH(SUBDIR ${STORAGE_SUBDIRS})
|
|
||||||
|
|
||||||
# Special handling for partition(not really pluggable)
|
|
||||||
IF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
|
|
||||||
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_PARTITION_STORAGE_ENGINE")
|
|
||||||
SET (mysql_optional_plugins "${mysql_optional_plugins}builtin_partition_plugin,")
|
|
||||||
ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
|
|
||||||
|
|
||||||
ADD_DEFINITIONS(${STORAGE_ENGINE_DEFS})
|
|
||||||
|
|
||||||
# Now write out our mysql_mandatory_plugins/mysql_optional_plugins structs
|
|
||||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
|
|
||||||
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc @ONLY)
|
|
||||||
|
|
||||||
# Add subdirectories for storage engines
|
|
||||||
SET (ENGINE_BUILD_TYPE "STATIC")
|
|
||||||
FOREACH(DIR ${STATIC_ENGINE_DIRECTORIES})
|
|
||||||
ADD_SUBDIRECTORY(${DIR})
|
|
||||||
IF(EXISTS ${DIR}/unittest)
|
|
||||||
ADD_SUBDIRECTORY(${DIR}/unittest)
|
|
||||||
ENDIF(EXISTS ${DIR}/unittest)
|
|
||||||
ENDFOREACH(DIR ${STATIC_ENGINE_DIRECTORIES})
|
|
||||||
|
|
||||||
SET (ENGINE_BUILD_TYPE "DYNAMIC")
|
|
||||||
FOREACH(DIR ${DYNAMIC_ENGINE_DIRECTORIES})
|
|
||||||
IF(EXISTS ${DIR}/unittest)
|
|
||||||
ADD_SUBDIRECTORY(${DIR}/unittest)
|
|
||||||
ENDIF(EXISTS ${DIR}/unittest)
|
|
||||||
ADD_SUBDIRECTORY(${DIR})
|
|
||||||
ENDFOREACH(DIR ${DYNAMIC_ENGINE_DIRECTORIES})
|
|
||||||
|
|
||||||
# Add subdirectories for semisync plugin
|
|
||||||
IF(NOT WITHOUT_DYNAMIC_PLUGINS)
|
|
||||||
ADD_SUBDIRECTORY(plugin/semisync)
|
|
||||||
ENDIF(NOT WITHOUT_DYNAMIC_PLUGINS)
|
|
||||||
|
|
||||||
# FIXME "debug" only needed if build type is "Debug", but
|
|
||||||
# CMAKE_BUILD_TYPE is not set during configure time.
|
|
||||||
ADD_SUBDIRECTORY(vio)
|
|
||||||
ADD_SUBDIRECTORY(dbug)
|
ADD_SUBDIRECTORY(dbug)
|
||||||
ADD_SUBDIRECTORY(strings)
|
ADD_SUBDIRECTORY(strings)
|
||||||
|
ADD_SUBDIRECTORY(vio)
|
||||||
ADD_SUBDIRECTORY(regex)
|
ADD_SUBDIRECTORY(regex)
|
||||||
ADD_SUBDIRECTORY(mysys)
|
ADD_SUBDIRECTORY(mysys)
|
||||||
ADD_SUBDIRECTORY(scripts)
|
|
||||||
ADD_SUBDIRECTORY(zlib)
|
|
||||||
ADD_SUBDIRECTORY(extra/yassl)
|
|
||||||
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
|
|
||||||
ADD_SUBDIRECTORY(extra)
|
|
||||||
ADD_SUBDIRECTORY(client)
|
|
||||||
ADD_SUBDIRECTORY(sql)
|
|
||||||
ADD_SUBDIRECTORY(libmysql)
|
ADD_SUBDIRECTORY(libmysql)
|
||||||
ADD_SUBDIRECTORY(libservices)
|
|
||||||
ADD_SUBDIRECTORY(tests)
|
|
||||||
ADD_SUBDIRECTORY(unittest/mytap)
|
IF(WITH_UNIT_TESTS)
|
||||||
ADD_SUBDIRECTORY(unittest/examples)
|
ENABLE_TESTING()
|
||||||
ADD_SUBDIRECTORY(unittest/mysys)
|
ENDIF()
|
||||||
IF(WITH_EMBEDDED_SERVER)
|
IF(WITH_UNIT_TESTS)
|
||||||
|
ADD_SUBDIRECTORY(unittest/mytap)
|
||||||
|
ADD_SUBDIRECTORY(unittest/mysys)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY(extra)
|
||||||
|
IF(NOT WITHOUT_SERVER)
|
||||||
|
ADD_SUBDIRECTORY(tests)
|
||||||
|
ADD_SUBDIRECTORY(client)
|
||||||
|
ADD_SUBDIRECTORY(sql)
|
||||||
|
ADD_SUBDIRECTORY(sql/share)
|
||||||
|
ADD_SUBDIRECTORY(libservices)
|
||||||
|
OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
|
||||||
|
IF(WITH_EMBEDDED_SERVER)
|
||||||
ADD_SUBDIRECTORY(libmysqld)
|
ADD_SUBDIRECTORY(libmysqld)
|
||||||
ADD_SUBDIRECTORY(libmysqld/examples)
|
ADD_SUBDIRECTORY(libmysqld/examples)
|
||||||
ENDIF(WITH_EMBEDDED_SERVER)
|
ENDIF(WITH_EMBEDDED_SERVER)
|
||||||
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
|
|
||||||
|
ADD_SUBDIRECTORY(mysql-test)
|
||||||
|
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
|
||||||
|
ADD_SUBDIRECTORY(support-files)
|
||||||
|
ADD_SUBDIRECTORY(scripts)
|
||||||
|
ADD_SUBDIRECTORY(sql-bench)
|
||||||
|
IF(UNIX)
|
||||||
|
ADD_SUBDIRECTORY(man)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
INCLUDE(cmake/abi_check.cmake)
|
||||||
|
|
||||||
|
CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/my_config.h)
|
||||||
|
CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/config.h)
|
||||||
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
|
||||||
|
${CMAKE_BINARY_DIR}/include/mysql_version.h )
|
||||||
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
|
||||||
|
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
|
||||||
|
|
||||||
|
# Packaging
|
||||||
|
IF(WIN32)
|
||||||
|
SET(CPACK_GENERATOR "ZIP")
|
||||||
|
ELSE()
|
||||||
|
SET(CPACK_GENERATOR "TGZ")
|
||||||
|
ENDIF()
|
||||||
|
INCLUDE(CPack)
|
||||||
|
INSTALL(FILES COPYING EXCEPTIONS-CLIENT LICENSE.mysql DESTINATION ${INSTALL_DOCREADMEDIR} OPTIONAL)
|
||||||
|
INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR})
|
||||||
|
IF(UNIX)
|
||||||
|
INSTALL(FILES Docs/INSTALL-BINARY DESTINATION
|
||||||
|
${INSTALL_DOCREADMEDIR})
|
||||||
|
ENDIF()
|
||||||
|
# MYSQL_DOCS_LOCATON is used in "make dist", points to the documentation directory
|
||||||
|
SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied")
|
||||||
|
MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION)
|
||||||
|
INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR}
|
||||||
|
PATTERN "INSTALL-BINARY" EXCLUDE
|
||||||
|
PATTERN "Makefile.*" EXCLUDE
|
||||||
|
PATTERN "myisam.txt" EXCLUDE
|
||||||
|
PATTERN "glibc*" EXCLUDE
|
||||||
|
PATTERN "sp-imp-spec.txt" EXCLUDE
|
||||||
|
PATTERN "linuxthreads.txt" EXCLUDE
|
||||||
|
)
|
||||||
|
@ -19,7 +19,8 @@ AUTOMAKE_OPTIONS = foreign
|
|||||||
|
|
||||||
# These are built from source in the Docs directory
|
# These are built from source in the Docs directory
|
||||||
EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
|
EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
|
||||||
README COPYING EXCEPTIONS-CLIENT CMakeLists.txt
|
README COPYING EXCEPTIONS-CLIENT \
|
||||||
|
CMakeLists.txt configure.cmake config.h.cmake BUILD-CMAKE
|
||||||
|
|
||||||
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
|
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
|
||||||
@readline_topdir@ sql-common scripts \
|
@readline_topdir@ sql-common scripts \
|
||||||
@ -28,8 +29,8 @@ SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
|
|||||||
@sql_server@ @man_dirs@ tests \
|
@sql_server@ @man_dirs@ tests \
|
||||||
netware @libmysqld_dirs@ \
|
netware @libmysqld_dirs@ \
|
||||||
mysql-test support-files sql-bench \
|
mysql-test support-files sql-bench \
|
||||||
win
|
win \
|
||||||
|
cmake
|
||||||
DIST_SUBDIRS = . include Docs zlib \
|
DIST_SUBDIRS = . include Docs zlib \
|
||||||
cmd-line-utils sql-common scripts \
|
cmd-line-utils sql-common scripts \
|
||||||
pstack libservices \
|
pstack libservices \
|
||||||
@ -38,6 +39,7 @@ DIST_SUBDIRS = . include Docs zlib \
|
|||||||
netware libmysqld \
|
netware libmysqld \
|
||||||
mysql-test support-files sql-bench \
|
mysql-test support-files sql-bench \
|
||||||
win \
|
win \
|
||||||
|
cmake \
|
||||||
BUILD
|
BUILD
|
||||||
DISTCLEANFILES = ac_available_languages_fragment
|
DISTCLEANFILES = ac_available_languages_fragment
|
||||||
|
|
||||||
@ -58,6 +60,7 @@ dist-hook:
|
|||||||
--datadir=$(distdir)/win/data \
|
--datadir=$(distdir)/win/data \
|
||||||
--srcdir=$(top_srcdir)
|
--srcdir=$(top_srcdir)
|
||||||
storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
|
storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
|
||||||
|
test ! -f configure.am || $(INSTALL_DATA) configure.am $(distdir)
|
||||||
|
|
||||||
all-local: @ABI_CHECK@
|
all-local: @ABI_CHECK@
|
||||||
|
|
||||||
|
@ -12,67 +12,60 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
INCLUDE_DIRECTORIES(
|
||||||
${CMAKE_SOURCE_DIR}/zlib
|
${CMAKE_SOURCE_DIR}/include
|
||||||
${CMAKE_SOURCE_DIR}/extra/yassl/include
|
${ZLIB_INCLUDE_DIR}
|
||||||
|
${SSL_INCLUDE_DIRS}
|
||||||
${CMAKE_SOURCE_DIR}/libmysql
|
${CMAKE_SOURCE_DIR}/libmysql
|
||||||
${CMAKE_SOURCE_DIR}/regex
|
${CMAKE_SOURCE_DIR}/regex
|
||||||
${CMAKE_SOURCE_DIR}/sql
|
${CMAKE_SOURCE_DIR}/sql
|
||||||
${CMAKE_SOURCE_DIR}/strings)
|
${CMAKE_SOURCE_DIR}/strings
|
||||||
|
${READLINE_INCLUDE_DIR}
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
|
ADD_DEFINITIONS(${READLINE_DEFINES})
|
||||||
|
ADD_DEFINITIONS(${SSL_DEFINES})
|
||||||
|
MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc)
|
||||||
TARGET_LINK_LIBRARIES(mysql mysqlclient)
|
TARGET_LINK_LIBRARIES(mysql mysqlclient)
|
||||||
|
IF(UNIX)
|
||||||
|
TARGET_LINK_LIBRARIES(mysql ${READLINE_LIBRARY})
|
||||||
|
ENDIF(UNIX)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysqltest mysqltest.cc)
|
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc)
|
||||||
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
|
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
|
||||||
TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex dbug)
|
TARGET_LINK_LIBRARIES(mysqltest mysqlclient regex)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
|
|
||||||
|
MYSQL_ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
|
||||||
TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient)
|
TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c ../mysys/mf_getdate.c)
|
MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c)
|
||||||
TARGET_LINK_LIBRARIES(mysqldump mysqlclient)
|
TARGET_LINK_LIBRARIES(mysqldump mysqlclient)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysqlimport mysqlimport.c)
|
MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c)
|
||||||
TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
|
TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c ../mysys/my_getpagesize.c)
|
MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c)
|
||||||
TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient)
|
TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient)
|
||||||
ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
|
ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysqlshow mysqlshow.c)
|
MYSQL_ADD_EXECUTABLE(mysqlshow mysqlshow.c)
|
||||||
TARGET_LINK_LIBRARIES(mysqlshow mysqlclient)
|
TARGET_LINK_LIBRARIES(mysqlshow mysqlclient)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc
|
MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc)
|
||||||
../mysys/mf_tempdir.c
|
|
||||||
../mysys/my_new.cc
|
|
||||||
../mysys/my_bit.c
|
|
||||||
../mysys/my_bitmap.c
|
|
||||||
../mysys/my_vle.c
|
|
||||||
../mysys/base64.c)
|
|
||||||
TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient)
|
TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysqladmin mysqladmin.cc)
|
MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc)
|
||||||
TARGET_LINK_LIBRARIES(mysqladmin mysqlclient)
|
TARGET_LINK_LIBRARIES(mysqladmin mysqlclient)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysqlslap mysqlslap.c)
|
MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c)
|
||||||
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
|
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
|
||||||
TARGET_LINK_LIBRARIES(mysqlslap mysqlclient mysys zlib dbug)
|
TARGET_LINK_LIBRARIES(mysqlslap mysqlclient)
|
||||||
|
|
||||||
ADD_EXECUTABLE(echo echo.c)
|
ADD_EXECUTABLE(echo echo.c)
|
||||||
|
|
||||||
IF(EMBED_MANIFESTS)
|
SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap
|
||||||
MYSQL_EMBED_MANIFEST("mysql" "asInvoker")
|
PROPERTIES HAS_CXX TRUE)
|
||||||
MYSQL_EMBED_MANIFEST("mysqltest" "asInvoker")
|
|
||||||
MYSQL_EMBED_MANIFEST("mysqlcheck" "asInvoker")
|
|
||||||
MYSQL_EMBED_MANIFEST("mysqldump" "asInvoker")
|
|
||||||
MYSQL_EMBED_MANIFEST("mysqlimport" "asInvoker")
|
|
||||||
MYSQL_EMBED_MANIFEST("mysql_upgrade" "asInvoker")
|
|
||||||
MYSQL_EMBED_MANIFEST("mysqlshow" "asInvoker")
|
|
||||||
MYSQL_EMBED_MANIFEST("mysqlbinlog" "asInvoker")
|
|
||||||
MYSQL_EMBED_MANIFEST("mysqladmin" "asInvoker")
|
|
||||||
MYSQL_EMBED_MANIFEST("echo" "asInvoker")
|
|
||||||
ENDIF(EMBED_MANIFESTS)
|
|
||||||
|
|
||||||
|
@ -107,8 +107,9 @@ sql_src=log_event.h mysql_priv.h rpl_constants.h \
|
|||||||
rpl_tblmap.h rpl_tblmap.cc \
|
rpl_tblmap.h rpl_tblmap.cc \
|
||||||
log_event.cc my_decimal.h my_decimal.cc \
|
log_event.cc my_decimal.h my_decimal.cc \
|
||||||
log_event_old.h log_event_old.cc \
|
log_event_old.h log_event_old.cc \
|
||||||
|
rpl_record_old.h rpl_record_old.cc \
|
||||||
rpl_utility.h rpl_utility.cc \
|
rpl_utility.h rpl_utility.cc \
|
||||||
rpl_record_old.h rpl_record_old.cc
|
transaction.h
|
||||||
strings_src=decimal.c dtoa.c
|
strings_src=decimal.c dtoa.c
|
||||||
|
|
||||||
link_sources:
|
link_sources:
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
enum options_client
|
enum options_client
|
||||||
{
|
{
|
||||||
OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
|
OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET,
|
||||||
OPT_PAGER, OPT_NOPAGER, OPT_TEE, OPT_NOTEE,
|
OPT_PAGER, OPT_TEE,
|
||||||
OPT_LOW_PRIORITY, OPT_AUTO_REPAIR, OPT_COMPRESS,
|
OPT_LOW_PRIORITY, OPT_AUTO_REPAIR, OPT_COMPRESS,
|
||||||
OPT_DROP, OPT_LOCKS, OPT_KEYWORDS, OPT_DELAYED, OPT_OPTIMIZE,
|
OPT_DROP, OPT_LOCKS, OPT_KEYWORDS, OPT_DELAYED, OPT_OPTIMIZE,
|
||||||
OPT_FTB, OPT_LTB, OPT_ENC, OPT_O_ENC, OPT_ESC, OPT_TABLES,
|
OPT_FTB, OPT_LTB, OPT_ENC, OPT_O_ENC, OPT_ESC, OPT_TABLES,
|
||||||
@ -48,8 +48,8 @@ enum options_client
|
|||||||
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
|
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
|
||||||
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
|
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
|
||||||
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
|
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
|
||||||
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_SERVER_ARG,
|
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_SERVER_ARG,
|
||||||
OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
|
OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
|
||||||
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
|
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
|
||||||
#ifdef HAVE_NDBCLUSTER_DB
|
#ifdef HAVE_NDBCLUSTER_DB
|
||||||
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
|
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
|
||||||
|
@ -1373,7 +1373,7 @@ static struct my_option my_long_options[] =
|
|||||||
(uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
|
(uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
|
||||||
0, 0},
|
0, 0},
|
||||||
{"no-auto-rehash", 'A',
|
{"no-auto-rehash", 'A',
|
||||||
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.",
|
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect.",
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"auto-vertical-output", OPT_AUTO_VERTICAL_OUTPUT,
|
{"auto-vertical-output", OPT_AUTO_VERTICAL_OUTPUT,
|
||||||
"Automatically switch to vertical output mode if the result is wider than the terminal width.",
|
"Automatically switch to vertical output mode if the result is wider than the terminal width.",
|
||||||
@ -1425,9 +1425,6 @@ static struct my_option my_long_options[] =
|
|||||||
"Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.",
|
"Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.",
|
||||||
(uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
(uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||||
0, 0},
|
0, 0},
|
||||||
{"no-named-commands", 'g',
|
|
||||||
"Named commands are disabled. Use \\* form only, or use named commands only in the beginning of a line ending with a semicolon (;) Since version 10.9 the client now starts with this option ENABLED by default! Disable with '-G'. Long format commands still work from the first line. WARNING: option deprecated; use --disable-named-commands instead.",
|
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
||||||
{"ignore-spaces", 'i', "Ignore space after function names.",
|
{"ignore-spaces", 'i', "Ignore space after function names.",
|
||||||
(uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
|
(uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||||
0, 0, 0, 0},
|
0, 0, 0, 0},
|
||||||
@ -1449,7 +1446,7 @@ static struct my_option my_long_options[] =
|
|||||||
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
|
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
|
||||||
(uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL,
|
(uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL,
|
||||||
NO_ARG, 1, 0, 0, 0, 0, 0},
|
NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||||
{"skip-line-numbers", 'L', "Don't write line number for errors. WARNING: -L is deprecated, use long version of this option instead.", 0, 0, 0, GET_NO_ARG,
|
{"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG,
|
||||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered,
|
{"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered,
|
||||||
(uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
@ -1457,11 +1454,8 @@ static struct my_option my_long_options[] =
|
|||||||
(uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL,
|
(uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL,
|
||||||
NO_ARG, 1, 0, 0, 0, 0, 0},
|
NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||||
{"skip-column-names", 'N',
|
{"skip-column-names", 'N',
|
||||||
"Don't write column names in results. WARNING: -N is deprecated, use long version of this options instead.",
|
"Don't write column names in results.",
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"set-variable", 'O',
|
|
||||||
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
|
|
||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
|
||||||
{"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C)",
|
{"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C)",
|
||||||
(uchar**) &opt_sigint_ignore, (uchar**) &opt_sigint_ignore, 0, GET_BOOL,
|
(uchar**) &opt_sigint_ignore, (uchar**) &opt_sigint_ignore, 0, GET_BOOL,
|
||||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
@ -1472,9 +1466,6 @@ static struct my_option my_long_options[] =
|
|||||||
{"pager", OPT_PAGER,
|
{"pager", OPT_PAGER,
|
||||||
"Pager to use to display results. If you don't supply an option the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.",
|
"Pager to use to display results. If you don't supply an option the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.",
|
||||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"no-pager", OPT_NOPAGER,
|
|
||||||
"Disable pager and print to stdout. See interactive help (\\h) also. WARNING: option deprecated; use --disable-pager instead.",
|
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
||||||
#endif
|
#endif
|
||||||
{"password", 'p',
|
{"password", 'p',
|
||||||
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
||||||
@ -1520,8 +1511,6 @@ static struct my_option my_long_options[] =
|
|||||||
{"tee", OPT_TEE,
|
{"tee", OPT_TEE,
|
||||||
"Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.",
|
"Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.",
|
||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. WARNING: option deprecated; use --disable-tee instead", 0, 0, 0, GET_NO_ARG,
|
|
||||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
|
||||||
#ifndef DONT_ALLOW_USER_CHANGE
|
#ifndef DONT_ALLOW_USER_CHANGE
|
||||||
{"user", 'u', "User for login if not current user.", (uchar**) ¤t_user,
|
{"user", 'u', "User for login if not current user.", (uchar**) ¤t_user,
|
||||||
(uchar**) ¤t_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) ¤t_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
@ -1660,11 +1649,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
else
|
else
|
||||||
init_tee(argument);
|
init_tee(argument);
|
||||||
break;
|
break;
|
||||||
case OPT_NOTEE:
|
|
||||||
printf("WARNING: option deprecated; use --disable-tee instead.\n");
|
|
||||||
if (opt_outfile)
|
|
||||||
end_tee();
|
|
||||||
break;
|
|
||||||
case OPT_PAGER:
|
case OPT_PAGER:
|
||||||
if (argument == disabled_my_option)
|
if (argument == disabled_my_option)
|
||||||
opt_nopager= 1;
|
opt_nopager= 1;
|
||||||
@ -1683,10 +1667,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
opt_nopager= 1;
|
opt_nopager= 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OPT_NOPAGER:
|
|
||||||
printf("WARNING: option deprecated; use --disable-pager instead.\n");
|
|
||||||
opt_nopager= 1;
|
|
||||||
break;
|
|
||||||
case OPT_MYSQL_PROTOCOL:
|
case OPT_MYSQL_PROTOCOL:
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||||
|
@ -1077,11 +1077,6 @@ static struct my_option my_long_options[] =
|
|||||||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
(uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG,
|
(uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG,
|
||||||
0, 0, 0, 0, 0, 0},
|
0, 0, 0, 0, 0, 0},
|
||||||
{"position", 'j', "Deprecated. Use --start-position instead.",
|
|
||||||
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
|
|
||||||
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
|
|
||||||
/* COM_BINLOG_DUMP accepts only 4 bytes for the position */
|
|
||||||
(ulonglong)(~(uint32)0), 0, 0, 0},
|
|
||||||
{"protocol", OPT_MYSQL_PROTOCOL,
|
{"protocol", OPT_MYSQL_PROTOCOL,
|
||||||
"The protocol of connection (tcp,socket,pipe,memory).",
|
"The protocol of connection (tcp,socket,pipe,memory).",
|
||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
@ -1120,7 +1115,7 @@ static struct my_option my_long_options[] =
|
|||||||
"(you should probably use quotes for your shell to set it properly).",
|
"(you should probably use quotes for your shell to set it properly).",
|
||||||
(uchar**) &start_datetime_str, (uchar**) &start_datetime_str,
|
(uchar**) &start_datetime_str, (uchar**) &start_datetime_str,
|
||||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"start-position", OPT_START_POSITION,
|
{"start-position", 'j',
|
||||||
"Start reading the binlog at position N. Applies to the first binlog "
|
"Start reading the binlog at position N. Applies to the first binlog "
|
||||||
"passed on the command line.",
|
"passed on the command line.",
|
||||||
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
|
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
|
||||||
|
@ -184,9 +184,6 @@ HASH ignore_table;
|
|||||||
|
|
||||||
static struct my_option my_long_options[] =
|
static struct my_option my_long_options[] =
|
||||||
{
|
{
|
||||||
{"all", 'a', "Deprecated. Use --create-options instead.",
|
|
||||||
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
|
|
||||||
0, 0, 0, 0, 0},
|
|
||||||
{"all-databases", 'A',
|
{"all-databases", 'A',
|
||||||
"Dump all the databases. This will be same as --databases with all databases selected.",
|
"Dump all the databases. This will be same as --databases with all databases selected.",
|
||||||
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||||
@ -239,7 +236,7 @@ static struct my_option my_long_options[] =
|
|||||||
{"compress", 'C', "Use compression in server/client protocol.",
|
{"compress", 'C', "Use compression in server/client protocol.",
|
||||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||||
0, 0, 0},
|
0, 0, 0},
|
||||||
{"create-options", OPT_CREATE_OPTIONS,
|
{"create-options", 'a',
|
||||||
"Include all MySQL specific create options.",
|
"Include all MySQL specific create options.",
|
||||||
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
|
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
|
||||||
0, 0, 0, 0, 0},
|
0, 0, 0, 0, 0},
|
||||||
@ -304,9 +301,6 @@ static struct my_option my_long_options[] =
|
|||||||
(uchar**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
|
(uchar**) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
|
||||||
{"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
|
{"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
|
||||||
(uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"first-slave", 'x', "Deprecated, renamed to --lock-all-tables.",
|
|
||||||
(uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
|
|
||||||
0, 0, 0, 0, 0, 0},
|
|
||||||
{"flush-logs", 'F', "Flush logs file in server before starting dump. "
|
{"flush-logs", 'F', "Flush logs file in server before starting dump. "
|
||||||
"Note that if you dump many databases at once (using the option "
|
"Note that if you dump many databases at once (using the option "
|
||||||
"--databases= or --all-databases), the logs will be flushed for "
|
"--databases= or --all-databases), the logs will be flushed for "
|
||||||
@ -394,8 +388,7 @@ static struct my_option my_long_options[] =
|
|||||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"no-data", 'd', "No row information.", (uchar**) &opt_no_data,
|
{"no-data", 'd', "No row information.", (uchar**) &opt_no_data,
|
||||||
(uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"no-set-names", 'N',
|
{"no-set-names", 'N', "Same as--skip-set-charset.",
|
||||||
"Deprecated. Use --skip-set-charset instead.",
|
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"opt", OPT_OPTIMIZE,
|
{"opt", OPT_OPTIMIZE,
|
||||||
"Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.",
|
"Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.",
|
||||||
@ -433,9 +426,6 @@ static struct my_option my_long_options[] =
|
|||||||
"Add 'SET NAMES default_character_set' to the output.",
|
"Add 'SET NAMES default_character_set' to the output.",
|
||||||
(uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
|
(uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
|
||||||
0, 0, 0, 0, 0},
|
0, 0, 0, 0, 0},
|
||||||
{"set-variable", 'O',
|
|
||||||
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
|
|
||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
|
||||||
#ifdef HAVE_SMEM
|
#ifdef HAVE_SMEM
|
||||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
|
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
|
||||||
|
@ -67,33 +67,33 @@
|
|||||||
#define MAX_COLUMNS 256
|
#define MAX_COLUMNS 256
|
||||||
#define MAX_EMBEDDED_SERVER_ARGS 64
|
#define MAX_EMBEDDED_SERVER_ARGS 64
|
||||||
#define MAX_DELIMITER_LENGTH 16
|
#define MAX_DELIMITER_LENGTH 16
|
||||||
|
#define DEFAULT_MAX_CONN 128
|
||||||
|
|
||||||
/* Flags controlling send and reap */
|
/* Flags controlling send and reap */
|
||||||
#define QUERY_SEND_FLAG 1
|
#define QUERY_SEND_FLAG 1
|
||||||
#define QUERY_REAP_FLAG 2
|
#define QUERY_REAP_FLAG 2
|
||||||
|
|
||||||
#ifndef HAVE_SETENV
|
#ifndef HAVE_SETENV
|
||||||
#error implement our portable setenv replacement in mysys
|
static int setenv(const char *name, const char *value, int overwrite);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION,
|
OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION,
|
||||||
OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
|
OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
|
||||||
OPT_MAX_CONNECT_RETRIES, OPT_MARK_PROGRESS, OPT_LOG_DIR, OPT_TAIL_LINES,
|
OPT_MAX_CONNECT_RETRIES, OPT_MAX_CONNECTIONS, OPT_MARK_PROGRESS,
|
||||||
OPT_RESULT_FORMAT_VERSION
|
OPT_LOG_DIR, OPT_TAIL_LINES, OPT_RESULT_FORMAT_VERSION,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int record= 0, opt_sleep= -1;
|
static int record= 0, opt_sleep= -1;
|
||||||
static char *opt_db= 0, *opt_pass= 0;
|
static char *opt_db= 0, *opt_pass= 0;
|
||||||
const char *opt_user= 0, *opt_host= 0, *unix_sock= 0, *opt_basedir= "./";
|
const char *opt_user= 0, *opt_host= 0, *unix_sock= 0, *opt_basedir= "./";
|
||||||
#ifdef HAVE_SMEM
|
|
||||||
static char *shared_memory_base_name=0;
|
static char *shared_memory_base_name=0;
|
||||||
#endif
|
|
||||||
const char *opt_logdir= "";
|
const char *opt_logdir= "";
|
||||||
const char *opt_include= 0, *opt_charsets_dir;
|
const char *opt_include= 0, *opt_charsets_dir;
|
||||||
static int opt_port= 0;
|
static int opt_port= 0;
|
||||||
static int opt_max_connect_retries;
|
static int opt_max_connect_retries;
|
||||||
static int opt_result_format_version;
|
static int opt_result_format_version;
|
||||||
|
static int opt_max_connections= DEFAULT_MAX_CONN;
|
||||||
static my_bool opt_compress= 0, silent= 0, verbose= 0;
|
static my_bool opt_compress= 0, silent= 0, verbose= 0;
|
||||||
static my_bool debug_info_flag= 0, debug_check_flag= 0;
|
static my_bool debug_info_flag= 0, debug_check_flag= 0;
|
||||||
static my_bool tty_password= 0;
|
static my_bool tty_password= 0;
|
||||||
@ -103,7 +103,7 @@ static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
|
|||||||
static my_bool view_protocol= 0, view_protocol_enabled= 0;
|
static my_bool view_protocol= 0, view_protocol_enabled= 0;
|
||||||
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
|
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
|
||||||
static my_bool parsing_disabled= 0;
|
static my_bool parsing_disabled= 0;
|
||||||
static my_bool display_result_vertically= FALSE,
|
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
|
||||||
display_metadata= FALSE, display_result_sorted= FALSE;
|
display_metadata= FALSE, display_result_sorted= FALSE;
|
||||||
static my_bool disable_query_log= 0, disable_result_log= 0;
|
static my_bool disable_query_log= 0, disable_result_log= 0;
|
||||||
static my_bool disable_warnings= 0;
|
static my_bool disable_warnings= 0;
|
||||||
@ -140,6 +140,7 @@ struct st_block
|
|||||||
int line; /* Start line of block */
|
int line; /* Start line of block */
|
||||||
my_bool ok; /* Should block be executed */
|
my_bool ok; /* Should block be executed */
|
||||||
enum block_cmd cmd; /* Command owning the block */
|
enum block_cmd cmd; /* Command owning the block */
|
||||||
|
char delim[MAX_DELIMITER_LENGTH]; /* Delimiter before block */
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct st_block block_stack[32];
|
static struct st_block block_stack[32];
|
||||||
@ -235,6 +236,8 @@ struct st_connection
|
|||||||
char *name;
|
char *name;
|
||||||
size_t name_len;
|
size_t name_len;
|
||||||
MYSQL_STMT* stmt;
|
MYSQL_STMT* stmt;
|
||||||
|
/* Set after send to disallow other queries before reap */
|
||||||
|
my_bool pending;
|
||||||
|
|
||||||
#ifdef EMBEDDED_LIBRARY
|
#ifdef EMBEDDED_LIBRARY
|
||||||
const char *cur_query;
|
const char *cur_query;
|
||||||
@ -244,7 +247,8 @@ struct st_connection
|
|||||||
int query_done;
|
int query_done;
|
||||||
#endif /*EMBEDDED_LIBRARY*/
|
#endif /*EMBEDDED_LIBRARY*/
|
||||||
};
|
};
|
||||||
struct st_connection connections[128];
|
|
||||||
|
struct st_connection *connections= NULL;
|
||||||
struct st_connection* cur_con= NULL, *next_con, *connections_end;
|
struct st_connection* cur_con= NULL, *next_con, *connections_end;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -278,6 +282,7 @@ enum enum_commands {
|
|||||||
Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR,
|
Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR,
|
||||||
Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
|
Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
|
||||||
Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_SORTED_RESULT,
|
Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_SORTED_RESULT,
|
||||||
|
Q_LOWERCASE,
|
||||||
Q_START_TIMER, Q_END_TIMER,
|
Q_START_TIMER, Q_END_TIMER,
|
||||||
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
|
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
|
||||||
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
|
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
|
||||||
@ -290,7 +295,7 @@ enum enum_commands {
|
|||||||
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
|
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
|
||||||
Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
|
Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
|
||||||
Q_RESULT_FORMAT_VERSION,
|
Q_RESULT_FORMAT_VERSION,
|
||||||
Q_MOVE_FILE, Q_SEND_EVAL,
|
Q_MOVE_FILE, Q_REMOVE_FILES_WILDCARD, Q_SEND_EVAL,
|
||||||
Q_UNKNOWN, /* Unknown command. */
|
Q_UNKNOWN, /* Unknown command. */
|
||||||
Q_COMMENT, /* Comments, ignored. */
|
Q_COMMENT, /* Comments, ignored. */
|
||||||
Q_COMMENT_WITH_COMMAND,
|
Q_COMMENT_WITH_COMMAND,
|
||||||
@ -350,6 +355,7 @@ const char *command_names[]=
|
|||||||
"query_vertical",
|
"query_vertical",
|
||||||
"query_horizontal",
|
"query_horizontal",
|
||||||
"sorted_result",
|
"sorted_result",
|
||||||
|
"lowercase_result",
|
||||||
"start_timer",
|
"start_timer",
|
||||||
"end_timer",
|
"end_timer",
|
||||||
"character_set",
|
"character_set",
|
||||||
@ -386,6 +392,7 @@ const char *command_names[]=
|
|||||||
"shutdown_server",
|
"shutdown_server",
|
||||||
"result_format",
|
"result_format",
|
||||||
"move_file",
|
"move_file",
|
||||||
|
"remove_files_wildcard",
|
||||||
"send_eval",
|
"send_eval",
|
||||||
|
|
||||||
0
|
0
|
||||||
@ -490,6 +497,8 @@ void free_replace();
|
|||||||
void do_get_replace_regex(struct st_command *command);
|
void do_get_replace_regex(struct st_command *command);
|
||||||
void free_replace_regex();
|
void free_replace_regex();
|
||||||
|
|
||||||
|
/* Used by sleep */
|
||||||
|
void check_eol_junk_line(const char *eol);
|
||||||
|
|
||||||
void free_all_replace(){
|
void free_all_replace(){
|
||||||
free_replace();
|
free_replace();
|
||||||
@ -1036,7 +1045,7 @@ void check_command_args(struct st_command *command,
|
|||||||
}
|
}
|
||||||
/* Check for too many arguments passed */
|
/* Check for too many arguments passed */
|
||||||
ptr= command->last_argument;
|
ptr= command->last_argument;
|
||||||
while(ptr <= command->end)
|
while(ptr <= command->end && *ptr != '#')
|
||||||
{
|
{
|
||||||
if (*ptr && *ptr != ' ')
|
if (*ptr && *ptr != ' ')
|
||||||
die("Extra argument '%s' passed to '%.*s'",
|
die("Extra argument '%s' passed to '%.*s'",
|
||||||
@ -1094,6 +1103,7 @@ void close_connections()
|
|||||||
mysql_close(next_con->util_mysql);
|
mysql_close(next_con->util_mysql);
|
||||||
my_free(next_con->name, MYF(MY_ALLOW_ZERO_PTR));
|
my_free(next_con->name, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
}
|
}
|
||||||
|
my_free(connections, MYF(MY_WME));
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1120,7 +1130,7 @@ void close_files()
|
|||||||
if (cur_file->file && cur_file->file != stdin)
|
if (cur_file->file && cur_file->file != stdin)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("closing file: %s", cur_file->file_name));
|
DBUG_PRINT("info", ("closing file: %s", cur_file->file_name));
|
||||||
my_fclose(cur_file->file, MYF(0));
|
fclose(cur_file->file);
|
||||||
}
|
}
|
||||||
my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
|
my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
cur_file->file_name= 0;
|
cur_file->file_name= 0;
|
||||||
@ -1134,6 +1144,7 @@ void free_used_memory()
|
|||||||
uint i;
|
uint i;
|
||||||
DBUG_ENTER("free_used_memory");
|
DBUG_ENTER("free_used_memory");
|
||||||
|
|
||||||
|
if (connections)
|
||||||
close_connections();
|
close_connections();
|
||||||
close_files();
|
close_files();
|
||||||
my_hash_free(&var_hash);
|
my_hash_free(&var_hash);
|
||||||
@ -2495,7 +2506,7 @@ int open_file(const char *name)
|
|||||||
if (cur_file == file_stack_end)
|
if (cur_file == file_stack_end)
|
||||||
die("Source directives are nesting too deep");
|
die("Source directives are nesting too deep");
|
||||||
cur_file++;
|
cur_file++;
|
||||||
if (!(cur_file->file = my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
|
if (!(cur_file->file = fopen(buff, "rb")))
|
||||||
{
|
{
|
||||||
cur_file--;
|
cur_file--;
|
||||||
die("Could not open '%s' for reading, errno: %d", buff, errno);
|
die("Could not open '%s' for reading, errno: %d", buff, errno);
|
||||||
@ -2707,6 +2718,10 @@ void do_exec(struct st_command *command)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* exec command is interpreted externally and will not take newlines */
|
||||||
|
while(replace(&ds_cmd, "\n", 1, " ", 1) == 0)
|
||||||
|
;
|
||||||
|
|
||||||
DBUG_PRINT("info", ("Executing '%s' as '%s'",
|
DBUG_PRINT("info", ("Executing '%s' as '%s'",
|
||||||
command->first_argument, ds_cmd.str));
|
command->first_argument, ds_cmd.str));
|
||||||
|
|
||||||
@ -2930,6 +2945,81 @@ void do_remove_file(struct st_command *command)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
SYNOPSIS
|
||||||
|
do_remove_files_wildcard
|
||||||
|
command called command
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
remove_files_wildcard <directory> [<file_name_pattern>]
|
||||||
|
Remove the files in <directory> optionally matching <file_name_pattern>
|
||||||
|
*/
|
||||||
|
|
||||||
|
void do_remove_files_wildcard(struct st_command *command)
|
||||||
|
{
|
||||||
|
int error= 0;
|
||||||
|
uint i;
|
||||||
|
MY_DIR *dir_info;
|
||||||
|
FILEINFO *file;
|
||||||
|
char dir_separator[2];
|
||||||
|
static DYNAMIC_STRING ds_directory;
|
||||||
|
static DYNAMIC_STRING ds_wild;
|
||||||
|
static DYNAMIC_STRING ds_file_to_remove;
|
||||||
|
char dirname[FN_REFLEN];
|
||||||
|
|
||||||
|
const struct command_arg rm_args[] = {
|
||||||
|
{ "directory", ARG_STRING, TRUE, &ds_directory,
|
||||||
|
"Directory containing files to delete" },
|
||||||
|
{ "filename", ARG_STRING, FALSE, &ds_wild, "File pattern to delete" }
|
||||||
|
};
|
||||||
|
DBUG_ENTER("do_remove_files_wildcard");
|
||||||
|
|
||||||
|
check_command_args(command, command->first_argument,
|
||||||
|
rm_args, sizeof(rm_args)/sizeof(struct command_arg),
|
||||||
|
' ');
|
||||||
|
fn_format(dirname, ds_directory.str, "", "", MY_UNPACK_FILENAME);
|
||||||
|
|
||||||
|
DBUG_PRINT("info", ("listing directory: %s", dirname));
|
||||||
|
/* Note that my_dir sorts the list if not given any flags */
|
||||||
|
if (!(dir_info= my_dir(dirname, MYF(MY_DONT_SORT | MY_WANT_STAT))))
|
||||||
|
{
|
||||||
|
error= 1;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
init_dynamic_string(&ds_file_to_remove, dirname, 1024, 1024);
|
||||||
|
dir_separator[0]= FN_LIBCHAR;
|
||||||
|
dir_separator[1]= 0;
|
||||||
|
dynstr_append(&ds_file_to_remove, dir_separator);
|
||||||
|
for (i= 0; i < (uint) dir_info->number_off_files; i++)
|
||||||
|
{
|
||||||
|
file= dir_info->dir_entry + i;
|
||||||
|
/* Remove only regular files, i.e. no directories etc. */
|
||||||
|
/* if (!MY_S_ISREG(file->mystat->st_mode)) */
|
||||||
|
/* MY_S_ISREG does not work here on Windows, just skip directories */
|
||||||
|
if (MY_S_ISDIR(file->mystat->st_mode))
|
||||||
|
continue;
|
||||||
|
if (ds_wild.length &&
|
||||||
|
wild_compare(file->name, ds_wild.str, 0))
|
||||||
|
continue;
|
||||||
|
ds_file_to_remove.length= ds_directory.length + 1;
|
||||||
|
ds_file_to_remove.str[ds_directory.length + 1]= 0;
|
||||||
|
dynstr_append(&ds_file_to_remove, file->name);
|
||||||
|
DBUG_PRINT("info", ("removing file: %s", ds_file_to_remove.str));
|
||||||
|
error= my_delete(ds_file_to_remove.str, MYF(0)) != 0;
|
||||||
|
if (error)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
my_dirend(dir_info);
|
||||||
|
|
||||||
|
end:
|
||||||
|
handle_command_error(command, error);
|
||||||
|
dynstr_free(&ds_directory);
|
||||||
|
dynstr_free(&ds_wild);
|
||||||
|
dynstr_free(&ds_file_to_remove);
|
||||||
|
DBUG_VOID_RETURN;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
do_copy_file
|
do_copy_file
|
||||||
@ -3690,13 +3780,22 @@ void do_perl(struct st_command *command)
|
|||||||
sizeof(perl_args)/sizeof(struct command_arg),
|
sizeof(perl_args)/sizeof(struct command_arg),
|
||||||
' ');
|
' ');
|
||||||
|
|
||||||
|
ds_script= command->content;
|
||||||
|
/* If it hasn't been done already by a loop iteration, fill it in */
|
||||||
|
if (! ds_script.str)
|
||||||
|
{
|
||||||
/* If no delimiter was provided, use EOF */
|
/* If no delimiter was provided, use EOF */
|
||||||
if (ds_delimiter.length == 0)
|
if (ds_delimiter.length == 0)
|
||||||
dynstr_set(&ds_delimiter, "EOF");
|
dynstr_set(&ds_delimiter, "EOF");
|
||||||
|
|
||||||
init_dynamic_string(&ds_script, "", 1024, 1024);
|
init_dynamic_string(&ds_script, "", 1024, 1024);
|
||||||
read_until_delimiter(&ds_script, &ds_delimiter);
|
read_until_delimiter(&ds_script, &ds_delimiter);
|
||||||
|
command->content= ds_script;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This function could be called even if "false", so check before doing */
|
||||||
|
if (cur_block->ok)
|
||||||
|
{
|
||||||
DBUG_PRINT("info", ("Executing perl: %s", ds_script.str));
|
DBUG_PRINT("info", ("Executing perl: %s", ds_script.str));
|
||||||
|
|
||||||
/* Create temporary file name */
|
/* Create temporary file name */
|
||||||
@ -3732,7 +3831,7 @@ void do_perl(struct st_command *command)
|
|||||||
my_delete(temp_file_path, MYF(0));
|
my_delete(temp_file_path, MYF(0));
|
||||||
|
|
||||||
handle_command_error(command, WEXITSTATUS(error));
|
handle_command_error(command, WEXITSTATUS(error));
|
||||||
dynstr_free(&ds_script);
|
}
|
||||||
dynstr_free(&ds_delimiter);
|
dynstr_free(&ds_delimiter);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
@ -4140,10 +4239,19 @@ void do_let(struct st_command *command)
|
|||||||
int do_sleep(struct st_command *command, my_bool real_sleep)
|
int do_sleep(struct st_command *command, my_bool real_sleep)
|
||||||
{
|
{
|
||||||
int error= 0;
|
int error= 0;
|
||||||
char *p= command->first_argument;
|
char *sleep_start, *sleep_end;
|
||||||
char *sleep_start, *sleep_end= command->end;
|
|
||||||
double sleep_val;
|
double sleep_val;
|
||||||
|
char *p;
|
||||||
|
static DYNAMIC_STRING ds_sleep;
|
||||||
|
const struct command_arg sleep_args[] = {
|
||||||
|
{ "sleep_delay", ARG_STRING, TRUE, &ds_sleep, "Number of seconds to sleep." }
|
||||||
|
};
|
||||||
|
check_command_args(command, command->first_argument, sleep_args,
|
||||||
|
sizeof(sleep_args)/sizeof(struct command_arg),
|
||||||
|
' ');
|
||||||
|
|
||||||
|
p= ds_sleep.str;
|
||||||
|
sleep_end= ds_sleep.str + ds_sleep.length;
|
||||||
while (my_isspace(charset_info, *p))
|
while (my_isspace(charset_info, *p))
|
||||||
p++;
|
p++;
|
||||||
if (!*p)
|
if (!*p)
|
||||||
@ -4152,11 +4260,13 @@ int do_sleep(struct st_command *command, my_bool real_sleep)
|
|||||||
/* Check that arg starts with a digit, not handled by my_strtod */
|
/* Check that arg starts with a digit, not handled by my_strtod */
|
||||||
if (!my_isdigit(charset_info, *sleep_start))
|
if (!my_isdigit(charset_info, *sleep_start))
|
||||||
die("Invalid argument to %.*s \"%s\"", command->first_word_len,
|
die("Invalid argument to %.*s \"%s\"", command->first_word_len,
|
||||||
command->query,command->first_argument);
|
command->query, sleep_start);
|
||||||
sleep_val= my_strtod(sleep_start, &sleep_end, &error);
|
sleep_val= my_strtod(sleep_start, &sleep_end, &error);
|
||||||
|
check_eol_junk_line(sleep_end);
|
||||||
if (error)
|
if (error)
|
||||||
die("Invalid argument to %.*s \"%s\"", command->first_word_len,
|
die("Invalid argument to %.*s \"%s\"", command->first_word_len,
|
||||||
command->query, command->first_argument);
|
command->query, command->first_argument);
|
||||||
|
dynstr_free(&ds_sleep);
|
||||||
|
|
||||||
/* Fixed sleep time selected by --sleep option */
|
/* Fixed sleep time selected by --sleep option */
|
||||||
if (opt_sleep >= 0 && !real_sleep)
|
if (opt_sleep >= 0 && !real_sleep)
|
||||||
@ -4165,7 +4275,6 @@ int do_sleep(struct st_command *command, my_bool real_sleep)
|
|||||||
DBUG_PRINT("info", ("sleep_val: %f", sleep_val));
|
DBUG_PRINT("info", ("sleep_val: %f", sleep_val));
|
||||||
if (sleep_val)
|
if (sleep_val)
|
||||||
my_sleep((ulong) (sleep_val * 1000000L));
|
my_sleep((ulong) (sleep_val * 1000000L));
|
||||||
command->last_argument= sleep_end;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4351,12 +4460,13 @@ typedef struct
|
|||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
uint code;
|
uint code;
|
||||||
|
const char *text;
|
||||||
} st_error;
|
} st_error;
|
||||||
|
|
||||||
static st_error global_error_names[] =
|
static st_error global_error_names[] =
|
||||||
{
|
{
|
||||||
#include <mysqld_ername.h>
|
#include <mysqld_ername.h>
|
||||||
{ 0, 0 }
|
{ 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
uint get_errcode_from_name(char *error_name, char *error_end)
|
uint get_errcode_from_name(char *error_name, char *error_end)
|
||||||
@ -4703,6 +4813,7 @@ void do_close_connection(struct st_command *command)
|
|||||||
if (con->util_mysql)
|
if (con->util_mysql)
|
||||||
mysql_close(con->util_mysql);
|
mysql_close(con->util_mysql);
|
||||||
con->util_mysql= 0;
|
con->util_mysql= 0;
|
||||||
|
con->pending= FALSE;
|
||||||
|
|
||||||
my_free(con->name, MYF(0));
|
my_free(con->name, MYF(0));
|
||||||
|
|
||||||
@ -5037,7 +5148,7 @@ void do_connect(struct st_command *command)
|
|||||||
{
|
{
|
||||||
if (!(con_slot= find_connection_by_name("-closed_connection-")))
|
if (!(con_slot= find_connection_by_name("-closed_connection-")))
|
||||||
die("Connection limit exhausted, you can have max %d connections",
|
die("Connection limit exhausted, you can have max %d connections",
|
||||||
(int) (sizeof(connections)/sizeof(struct st_connection)));
|
opt_max_connections);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EMBEDDED_LIBRARY
|
#ifdef EMBEDDED_LIBRARY
|
||||||
@ -5156,6 +5267,12 @@ int do_done(struct st_command *command)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (*cur_block->delim)
|
||||||
|
{
|
||||||
|
/* Restore "old" delimiter after false if block */
|
||||||
|
strcpy (delimiter, cur_block->delim);
|
||||||
|
delimiter_length= strlen(delimiter);
|
||||||
|
}
|
||||||
/* Pop block from stack, goto next line */
|
/* Pop block from stack, goto next line */
|
||||||
cur_block--;
|
cur_block--;
|
||||||
parser.current_line++;
|
parser.current_line++;
|
||||||
@ -5214,6 +5331,7 @@ void do_block(enum block_cmd cmd, struct st_command* command)
|
|||||||
cur_block++;
|
cur_block++;
|
||||||
cur_block->cmd= cmd;
|
cur_block->cmd= cmd;
|
||||||
cur_block->ok= FALSE;
|
cur_block->ok= FALSE;
|
||||||
|
cur_block->delim[0]= '\0';
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5250,6 +5368,15 @@ void do_block(enum block_cmd cmd, struct st_command* command)
|
|||||||
if (not_expr)
|
if (not_expr)
|
||||||
cur_block->ok = !cur_block->ok;
|
cur_block->ok = !cur_block->ok;
|
||||||
|
|
||||||
|
if (cur_block->ok)
|
||||||
|
{
|
||||||
|
cur_block->delim[0]= '\0';
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
/* Remember "old" delimiter if entering a false if block */
|
||||||
|
strcpy (cur_block->delim, delimiter);
|
||||||
|
}
|
||||||
|
|
||||||
DBUG_PRINT("info", ("OK: %d", cur_block->ok));
|
DBUG_PRINT("info", ("OK: %d", cur_block->ok));
|
||||||
|
|
||||||
var_free(&v);
|
var_free(&v);
|
||||||
@ -5352,7 +5479,7 @@ int read_line(char *buf, int size)
|
|||||||
found_eof:
|
found_eof:
|
||||||
if (cur_file->file != stdin)
|
if (cur_file->file != stdin)
|
||||||
{
|
{
|
||||||
my_fclose(cur_file->file, MYF(0));
|
fclose(cur_file->file);
|
||||||
cur_file->file= 0;
|
cur_file->file= 0;
|
||||||
}
|
}
|
||||||
my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
|
my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR));
|
||||||
@ -5792,6 +5919,10 @@ static struct my_option my_long_options[] =
|
|||||||
"Max number of connection attempts when connecting to server",
|
"Max number of connection attempts when connecting to server",
|
||||||
(uchar**) &opt_max_connect_retries, (uchar**) &opt_max_connect_retries, 0,
|
(uchar**) &opt_max_connect_retries, (uchar**) &opt_max_connect_retries, 0,
|
||||||
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
|
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
|
||||||
|
{"max-connections", OPT_MAX_CONNECTIONS,
|
||||||
|
"Max number of open connections to server",
|
||||||
|
(uchar**) &opt_max_connections, (uchar**) &opt_max_connections, 0,
|
||||||
|
GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0},
|
||||||
{"password", 'p', "Password to use when connecting to server.",
|
{"password", 'p', "Password to use when connecting to server.",
|
||||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
@ -5821,12 +5952,10 @@ static struct my_option my_long_options[] =
|
|||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"server-file", 'F', "Read embedded server arguments from file.",
|
{"server-file", 'F', "Read embedded server arguments from file.",
|
||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
#ifdef HAVE_SMEM
|
|
||||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name,
|
"Base name of shared memory.", (uchar**) &shared_memory_base_name,
|
||||||
(uchar**) &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
(uchar**) &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||||
0, 0, 0},
|
0, 0, 0},
|
||||||
#endif
|
|
||||||
{"silent", 's', "Suppress all normal output. Synonym for --quiet.",
|
{"silent", 's', "Suppress all normal output. Synonym for --quiet.",
|
||||||
(uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
|
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
|
||||||
@ -5964,7 +6093,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
fn_format(buff, argument, "", "", MY_UNPACK_FILENAME);
|
fn_format(buff, argument, "", "", MY_UNPACK_FILENAME);
|
||||||
DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
|
DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
|
||||||
if (!(cur_file->file=
|
if (!(cur_file->file=
|
||||||
my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
|
fopen(buff, "rb")))
|
||||||
die("Could not open '%s' for reading, errno: %d", buff, errno);
|
die("Could not open '%s' for reading, errno: %d", buff, errno);
|
||||||
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
|
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
|
||||||
cur_file->lineno= 1;
|
cur_file->lineno= 1;
|
||||||
@ -6583,7 +6712,10 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
|
|||||||
wait_query_thread_end(cn);
|
wait_query_thread_end(cn);
|
||||||
#endif /*EMBEDDED_LIBRARY*/
|
#endif /*EMBEDDED_LIBRARY*/
|
||||||
if (!(flags & QUERY_REAP_FLAG))
|
if (!(flags & QUERY_REAP_FLAG))
|
||||||
|
{
|
||||||
|
cn->pending= TRUE;
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
|
}
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -6668,6 +6800,7 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
|
|||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
||||||
|
cn->pending= FALSE;
|
||||||
/*
|
/*
|
||||||
We save the return code (mysql_errno(mysql)) from the last call sent
|
We save the return code (mysql_errno(mysql)) from the last call sent
|
||||||
to the server into the mysqltest builtin variable $mysql_errno. This
|
to the server into the mysqltest builtin variable $mysql_errno. This
|
||||||
@ -7144,6 +7277,9 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||||||
|
|
||||||
init_dynamic_string(&ds_warnings, NULL, 0, 256);
|
init_dynamic_string(&ds_warnings, NULL, 0, 256);
|
||||||
|
|
||||||
|
if (cn->pending && (flags & QUERY_SEND_FLAG))
|
||||||
|
die ("Cannot run query on connection between send and reap");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Evaluate query if this is an eval command
|
Evaluate query if this is an eval command
|
||||||
*/
|
*/
|
||||||
@ -7666,12 +7802,6 @@ int main(int argc, char **argv)
|
|||||||
/* Init expected errors */
|
/* Init expected errors */
|
||||||
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
|
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
|
||||||
|
|
||||||
/* Init connections */
|
|
||||||
memset(connections, 0, sizeof(connections));
|
|
||||||
connections_end= connections +
|
|
||||||
(sizeof(connections)/sizeof(struct st_connection)) - 1;
|
|
||||||
next_con= connections + 1;
|
|
||||||
|
|
||||||
#ifdef EMBEDDED_LIBRARY
|
#ifdef EMBEDDED_LIBRARY
|
||||||
/* set appropriate stack for the 'query' threads */
|
/* set appropriate stack for the 'query' threads */
|
||||||
(void) pthread_attr_init(&cn_thd_attrib);
|
(void) pthread_attr_init(&cn_thd_attrib);
|
||||||
@ -7698,7 +7828,14 @@ int main(int argc, char **argv)
|
|||||||
1024, 0, 0, get_var_key, var_free, MYF(0)))
|
1024, 0, 0, get_var_key, var_free, MYF(0)))
|
||||||
die("Variable hash initialization failed");
|
die("Variable hash initialization failed");
|
||||||
|
|
||||||
var_set_string("$MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
|
var_set_string("MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
|
||||||
|
var_set_string("MYSQL_SYSTEM_TYPE", SYSTEM_TYPE);
|
||||||
|
var_set_string("MYSQL_MACHINE_TYPE", MACHINE_TYPE);
|
||||||
|
if (sizeof(void *) == 8) {
|
||||||
|
var_set_string("MYSQL_SYSTEM_ARCHITECTURE", "64");
|
||||||
|
} else {
|
||||||
|
var_set_string("MYSQL_SYSTEM_ARCHITECTURE", "32");
|
||||||
|
}
|
||||||
|
|
||||||
memset(&master_pos, 0, sizeof(master_pos));
|
memset(&master_pos, 0, sizeof(master_pos));
|
||||||
|
|
||||||
@ -7726,6 +7863,13 @@ int main(int argc, char **argv)
|
|||||||
verbose_msg("Tracing progress in '%s'.", progress_file.file_name());
|
verbose_msg("Tracing progress in '%s'.", progress_file.file_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Init connections, allocate 1 extra as buffer + 1 for default */
|
||||||
|
connections= (struct st_connection*)
|
||||||
|
my_malloc((opt_max_connections+2) * sizeof(struct st_connection),
|
||||||
|
MYF(MY_WME | MY_ZEROFILL));
|
||||||
|
connections_end= connections + opt_max_connections +1;
|
||||||
|
next_con= connections + 1;
|
||||||
|
|
||||||
var_set_int("$PS_PROTOCOL", ps_protocol);
|
var_set_int("$PS_PROTOCOL", ps_protocol);
|
||||||
var_set_int("$SP_PROTOCOL", sp_protocol);
|
var_set_int("$SP_PROTOCOL", sp_protocol);
|
||||||
var_set_int("$VIEW_PROTOCOL", view_protocol);
|
var_set_int("$VIEW_PROTOCOL", view_protocol);
|
||||||
@ -7829,7 +7973,8 @@ int main(int argc, char **argv)
|
|||||||
command->type= Q_COMMENT;
|
command->type= Q_COMMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
my_bool ok_to_do= cur_block->ok;
|
/* delimiter needs to be executed so we can continue to parse */
|
||||||
|
my_bool ok_to_do= cur_block->ok || command->type == Q_DELIMITER;
|
||||||
/*
|
/*
|
||||||
Some commands need to be "done" the first time if they may get
|
Some commands need to be "done" the first time if they may get
|
||||||
re-iterated over in a true context. This can only happen if there's
|
re-iterated over in a true context. This can only happen if there's
|
||||||
@ -7887,6 +8032,7 @@ int main(int argc, char **argv)
|
|||||||
case Q_ECHO: do_echo(command); command_executed++; break;
|
case Q_ECHO: do_echo(command); command_executed++; break;
|
||||||
case Q_SYSTEM: do_system(command); break;
|
case Q_SYSTEM: do_system(command); break;
|
||||||
case Q_REMOVE_FILE: do_remove_file(command); break;
|
case Q_REMOVE_FILE: do_remove_file(command); break;
|
||||||
|
case Q_REMOVE_FILES_WILDCARD: do_remove_files_wildcard(command); break;
|
||||||
case Q_MKDIR: do_mkdir(command); break;
|
case Q_MKDIR: do_mkdir(command); break;
|
||||||
case Q_RMDIR: do_rmdir(command); break;
|
case Q_RMDIR: do_rmdir(command); break;
|
||||||
case Q_LIST_FILES: do_list_files(command); break;
|
case Q_LIST_FILES: do_list_files(command); break;
|
||||||
@ -7924,6 +8070,13 @@ int main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
display_result_sorted= TRUE;
|
display_result_sorted= TRUE;
|
||||||
break;
|
break;
|
||||||
|
case Q_LOWERCASE:
|
||||||
|
/*
|
||||||
|
Turn on lowercasing of result, will be reset after next
|
||||||
|
command
|
||||||
|
*/
|
||||||
|
display_result_lower= TRUE;
|
||||||
|
break;
|
||||||
case Q_LET: do_let(command); break;
|
case Q_LET: do_let(command); break;
|
||||||
case Q_EVAL_RESULT:
|
case Q_EVAL_RESULT:
|
||||||
die("'eval_result' command is deprecated");
|
die("'eval_result' command is deprecated");
|
||||||
@ -8168,8 +8321,9 @@ int main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
free_all_replace();
|
free_all_replace();
|
||||||
|
|
||||||
/* Also reset "sorted_result" */
|
/* Also reset "sorted_result" and "lowercase"*/
|
||||||
display_result_sorted= FALSE;
|
display_result_sorted= FALSE;
|
||||||
|
display_result_lower= FALSE;
|
||||||
}
|
}
|
||||||
last_command_executed= command_executed;
|
last_command_executed= command_executed;
|
||||||
|
|
||||||
@ -9509,7 +9663,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
|
|||||||
if (pa->length+length >= pa->max_length)
|
if (pa->length+length >= pa->max_length)
|
||||||
{
|
{
|
||||||
if (!(new_pos= (uchar*) my_realloc((uchar*) pa->str,
|
if (!(new_pos= (uchar*) my_realloc((uchar*) pa->str,
|
||||||
(uint) (pa->max_length+PS_MALLOC),
|
(uint) (pa->length+length+PS_MALLOC),
|
||||||
MYF(MY_WME))))
|
MYF(MY_WME))))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
if (new_pos != pa->str)
|
if (new_pos != pa->str)
|
||||||
@ -9520,7 +9674,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
|
|||||||
char*);
|
char*);
|
||||||
pa->str=new_pos;
|
pa->str=new_pos;
|
||||||
}
|
}
|
||||||
pa->max_length+=PS_MALLOC;
|
pa->max_length= pa->length+length+PS_MALLOC;
|
||||||
}
|
}
|
||||||
if (pa->typelib.count >= pa->max_count-1)
|
if (pa->typelib.count >= pa->max_count-1)
|
||||||
{
|
{
|
||||||
@ -9573,6 +9727,18 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
|
|||||||
fix_win_paths(val, len);
|
fix_win_paths(val, len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (display_result_lower)
|
||||||
|
{
|
||||||
|
/* Convert to lower case, and do this first */
|
||||||
|
char lower[512];
|
||||||
|
char *c= lower;
|
||||||
|
for (const char *v= val; *v; v++)
|
||||||
|
*c++= my_tolower(charset_info, *v);
|
||||||
|
*c= '\0';
|
||||||
|
/* Copy from this buffer instead */
|
||||||
|
val= lower;
|
||||||
|
}
|
||||||
|
|
||||||
if (glob_replace_regex)
|
if (glob_replace_regex)
|
||||||
{
|
{
|
||||||
/* Regex replace */
|
/* Regex replace */
|
||||||
@ -9676,3 +9842,18 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input)
|
|||||||
delete_dynamic(&lines);
|
delete_dynamic(&lines);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_SETENV
|
||||||
|
static int setenv(const char *name, const char *value, int overwrite)
|
||||||
|
{
|
||||||
|
size_t buflen= strlen(name) + strlen(value) + 2;
|
||||||
|
char *envvar= (char *)malloc(buflen);
|
||||||
|
if(!envvar)
|
||||||
|
return ENOMEM;
|
||||||
|
strcpy(envvar, name);
|
||||||
|
strcat(envvar, "=");
|
||||||
|
strcat(envvar, value);
|
||||||
|
putenv(envvar);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
39
cmake/Makefile.am
Normal file
39
cmake/Makefile.am
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
EXTRA_DIST = \
|
||||||
|
cmake_parse_arguments.cmake \
|
||||||
|
cpack_source_ignore_files.cmake \
|
||||||
|
package_name.cmake \
|
||||||
|
configurable_file_content.in \
|
||||||
|
check_minimal_version.cmake \
|
||||||
|
create_initial_db.cmake.in \
|
||||||
|
make_dist.cmake.in \
|
||||||
|
dtrace.cmake \
|
||||||
|
abi_check.cmake \
|
||||||
|
bison.cmake \
|
||||||
|
configure.pl \
|
||||||
|
character_sets.cmake \
|
||||||
|
libutils.cmake \
|
||||||
|
readline.cmake \
|
||||||
|
mysql_version.cmake \
|
||||||
|
install_macros.cmake \
|
||||||
|
ssl.cmake \
|
||||||
|
plugin.cmake \
|
||||||
|
zlib.cmake \
|
||||||
|
stack_direction.c \
|
||||||
|
do_abi_check.cmake \
|
||||||
|
merge_archives_unix.cmake.in \
|
||||||
|
dtrace_prelink.cmake \
|
||||||
|
versioninfo.rc.in \
|
||||||
|
mysql_add_executable.cmake \
|
||||||
|
install_layout.cmake \
|
||||||
|
build_configurations/mysql_release.cmake \
|
||||||
|
os/Windows.cmake \
|
||||||
|
os/WindowsCache.cmake \
|
||||||
|
os/Linux.cmake \
|
||||||
|
os/SunOS.cmake \
|
||||||
|
os/Darwin.cmake \
|
||||||
|
os/HP-UX.cmake \
|
||||||
|
os/AIX.cmake \
|
||||||
|
os/OS400.cmake \
|
||||||
|
os/Cygwin.cmake
|
||||||
|
|
||||||
|
|
62
cmake/abi_check.cmake
Normal file
62
cmake/abi_check.cmake
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
#
|
||||||
|
# Headers which need to be checked for abi/api compatibility.
|
||||||
|
# API_PREPROCESSOR_HEADER will be used until mysql_priv.h stablizes
|
||||||
|
# after which TEST_PREPROCESSOR_HEADER will be used.
|
||||||
|
#
|
||||||
|
# We use gcc specific preprocessing command and sed/diff, so it will
|
||||||
|
# only be run on Unix and only if gcc is used.
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
IF(CMAKE_C_COMPILER MATCHES "ccache$")
|
||||||
|
SET(COMPILER ${CMAKE_C_COMPILER_ARG1})
|
||||||
|
STRING(REGEX REPLACE "^ " "" COMPILER ${COMPILER})
|
||||||
|
ELSE()
|
||||||
|
SET(COMPILER ${CMAKE_C_COMPILER})
|
||||||
|
ENDIF()
|
||||||
|
SET(API_PREPROCESSOR_HEADER
|
||||||
|
${CMAKE_SOURCE_DIR}/include/mysql/plugin.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/mysql.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v1.h
|
||||||
|
${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v2.h
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(TEST_PREPROCESSOR_HEADER
|
||||||
|
${CMAKE_SOURCE_DIR}/sql/mysql_priv.h
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(abi_check ALL
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DCOMPILER=${COMPILER}
|
||||||
|
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
|
||||||
|
-DBINARY_DIR=${CMAKE_BINARY_DIR}
|
||||||
|
"-DABI_HEADERS=${API_PREPROCESSOR_HEADER}"
|
||||||
|
-P ${CMAKE_SOURCE_DIR}/cmake/do_abi_check.cmake
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(abi_check_all
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DCMAKE_C_COMPILER=${COMPILER}
|
||||||
|
-DCMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}
|
||||||
|
-DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}
|
||||||
|
"-DABI_HEADERS=${TEST_PREPROCESSOR_HEADER}"
|
||||||
|
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/do_abi_check.cmake
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
80
cmake/bison.cmake
Normal file
80
cmake/bison.cmake
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||||
|
# On Solaris, /opt/csw often contains a newer bison
|
||||||
|
IF(NOT BISON_EXECUTABLE AND EXISTS /opt/csw/bin/bison)
|
||||||
|
SET(BISON_EXECUTABLE /opt/csw/bin/bison)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
|
||||||
|
MARK_AS_ADVANCED(BISON_EXECUTABLE "")
|
||||||
|
IF(NOT BISON_EXECUTABLE)
|
||||||
|
MESSAGE("Warning: Bison executable not found in PATH")
|
||||||
|
ELSEIF(BISON_EXECUTABLE AND NOT BISON_USABLE)
|
||||||
|
# Check version as well
|
||||||
|
EXEC_PROGRAM(${BISON_EXECUTABLE} ARGS --version OUTPUT_VARIABLE BISON_VERSION_STR)
|
||||||
|
# Get first line in case it's multiline
|
||||||
|
STRING(REGEX REPLACE "([^\n]+).*" "\\1" FIRST_LINE "${BISON_VERSION_STR}")
|
||||||
|
# get version information
|
||||||
|
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\1" BISON_VERSION_MAJOR "${FIRST_LINE}")
|
||||||
|
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\2" BISON_VERSION_MINOR "${FIRST_LINE}")
|
||||||
|
IF (BISON_VERSION_MAJOR LESS 2)
|
||||||
|
MESSAGE("Warning: bison version is old. please update to version 2")
|
||||||
|
ELSE()
|
||||||
|
SET(BISON_USABLE 1 CACHE INTERNAL "Bison version 2 or higher")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Use bison to generate C++ and header file
|
||||||
|
MACRO (RUN_BISON input_yy output_cc output_h)
|
||||||
|
IF(BISON_TOO_OLD)
|
||||||
|
IF(EXISTS ${output_cc} AND EXISTS ${output_h})
|
||||||
|
SET(BISON_USABLE FALSE)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
IF(BISON_USABLE)
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${output_cc}
|
||||||
|
${output_h}
|
||||||
|
COMMAND ${BISON_EXECUTABLE} -y -p MYSQL
|
||||||
|
--output=${output_cc}
|
||||||
|
--defines=${output_h}
|
||||||
|
${input_yy}
|
||||||
|
DEPENDS ${input_yy}
|
||||||
|
)
|
||||||
|
ELSE()
|
||||||
|
# Bison is missing or not usable, e.g too old
|
||||||
|
IF(EXISTS ${output_cc} AND EXISTS ${output_h})
|
||||||
|
IF(${input_yy} IS_NEWER_THAN ${output_cc} OR ${input_yy} IS_NEWER_THAN ${output_h})
|
||||||
|
# Possibly timestamps are messed up in source distribution.
|
||||||
|
MESSAGE("Warning: no usable bison found, ${input_yy} will not be rebuilt.")
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
# Output files are missing, bail out.
|
||||||
|
SET(ERRMSG
|
||||||
|
"Bison (GNU parser generator) is required to build MySQL."
|
||||||
|
"Please install bison."
|
||||||
|
)
|
||||||
|
IF(WIN32)
|
||||||
|
SET(ERRMSG ${ERRMSG}
|
||||||
|
"You can download bison from http://gnuwin32.sourceforge.net/packages/bison.htm "
|
||||||
|
"Choose 'Complete package, except sources' installation. We recommend to "
|
||||||
|
"install bison into a directory without spaces, e.g C:\\GnuWin32.")
|
||||||
|
ENDIF()
|
||||||
|
MESSAGE(FATAL_ERROR ${ERRMSG})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
187
cmake/build_configurations/mysql_release.cmake
Normal file
187
cmake/build_configurations/mysql_release.cmake
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# This file includes build settings used for MySQL release
|
||||||
|
|
||||||
|
|
||||||
|
SET(FEATURE_SET "community" CACHE STRING
|
||||||
|
" Selection of features. Options are
|
||||||
|
- xsmall :
|
||||||
|
- small: embedded
|
||||||
|
- classic: embedded + archive + federated + blackhole
|
||||||
|
- large : embedded + archive + federated + blackhole + innodb
|
||||||
|
- xlarge: embedded + archive + federated + blackhole + innodb + partition
|
||||||
|
- community: all features (currently == xlarge)
|
||||||
|
"
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(FEATURE_SET_xsmall 1)
|
||||||
|
SET(FEATURE_SET_small 2)
|
||||||
|
SET(FEATURE_SET_classic 3)
|
||||||
|
SET(FEATURE_SET_large 5)
|
||||||
|
SET(FEATURE_SET_xlarge 6)
|
||||||
|
SET(FEATURE_SET_community 7)
|
||||||
|
|
||||||
|
IF(FEATURE_SET)
|
||||||
|
STRING(TOLOWER ${FEATURE_SET} feature_set)
|
||||||
|
SET(num ${FEATURE_SET_${feature_set}})
|
||||||
|
IF(NOT num)
|
||||||
|
MESSAGE(FATAL_ERROR "Invalid FEATURE_SET option '${feature_set}'.
|
||||||
|
Should be xsmall, small, classic, large, or community
|
||||||
|
")
|
||||||
|
ENDIF()
|
||||||
|
SET(WITH_PARTITION_STORAGE_ENGINE OFF)
|
||||||
|
IF(num EQUAL FEATURE_SET_xsmall)
|
||||||
|
SET(WITH_NONE ON)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(num GREATER FEATURE_SET_xsmall)
|
||||||
|
SET(WITH_EMBEDDED_SERVER ON CACHE BOOL "")
|
||||||
|
ENDIF()
|
||||||
|
IF(num GREATER FEATURE_SET_small)
|
||||||
|
SET(WITH_ARCHIVE_STORAGE_ENGINE ON)
|
||||||
|
SET(WITH_BLACKHOLE_STORAGE_ENGINE ON)
|
||||||
|
SET(WITH_FEDERATED_STORAGE_ENGINE ON)
|
||||||
|
ENDIF()
|
||||||
|
IF(num GREATER FEATURE_SET_classic)
|
||||||
|
SET(WITH_INNOBASE_STORAGE_ENGINE ON)
|
||||||
|
ENDIF()
|
||||||
|
IF(num GREATER FEATURE_SET_large)
|
||||||
|
SET(WITH_PARTITION_STORAGE_ENGINE ON)
|
||||||
|
ENDIF()
|
||||||
|
IF(num GREATER FEATURE_SET_xlarge)
|
||||||
|
# OPTION(WITH_ALL ON)
|
||||||
|
# better no set this, otherwise server would be linked
|
||||||
|
# statically with experimental stuff like audit_null
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Update cache with current values, remove engines we do not care about
|
||||||
|
# from build.
|
||||||
|
FOREACH(eng ARCHIVE BLACKHOLE FEDERATED INNOBASE PARTITION EXAMPLE)
|
||||||
|
IF(NOT WITH_${eng}_STORAGE_ENGINE)
|
||||||
|
SET(WITHOUT_${eng}_STORAGE_ENGINE ON CACHE BOOL "")
|
||||||
|
MARK_AS_ADVANCED(WITHOUT_${eng}_STORAGE_ENGINE)
|
||||||
|
SET(WITH_${eng}_STORAGE_ENGINE OFF CACHE BOOL "")
|
||||||
|
ELSE()
|
||||||
|
SET(WITH_${eng}_STORAGE_ENGINE ON CACHE BOOL "")
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(WITHOUT_AUDIT_NULL ON CACHE BOOL "")
|
||||||
|
SET(WITHOUT_DAEMON_EXAMPLE ON CACHE BOOL "")
|
||||||
|
|
||||||
|
OPTION(ENABLE_LOCAL_INFILE "" ON)
|
||||||
|
SET(WITH_SSL bundled CACHE STRING "")
|
||||||
|
SET(WITH_ZLIB bundled CACHE STRING "")
|
||||||
|
|
||||||
|
|
||||||
|
IF(NOT COMPILATION_COMMENT)
|
||||||
|
SET(COMPILATION_COMMENT "MySQL Community Server (GPL)")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
# Sign executables with authenticode certificate
|
||||||
|
SET(SIGNCODE 1 CACHE BOOL "")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(UNIX)
|
||||||
|
SET(WITH_EXTRA_CHARSETS all CACHE STRING "")
|
||||||
|
IF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
|
||||||
|
OPTION(WITH_READLINE "" ON)
|
||||||
|
ELSE()
|
||||||
|
OPTION(WITH_LIBEDIT "" ON)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
OPTION(WITH_PIC "" ON) # Why?
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
# Compiler options
|
||||||
|
IF(UNIX)
|
||||||
|
# Default GCC flags
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O3 -static-libgcc -fno-omit-frame-pointer")
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O3 -static-libgcc -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
# HPUX flags
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
|
||||||
|
IF(CMAKE_C_COMPILER_ID MATCHES "HP")
|
||||||
|
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
|
||||||
|
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g +O2 +DD64 +DSitanium2 -mt -AC99")
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g +O2 +DD64 +DSitanium2 -mt -Aa")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
SET(WITH_SSL)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Linux flags
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
|
||||||
|
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-static-intel -g -O3 -unroll2 -ip -mp -restrict")
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-static-intel -g -O3 -unroll2 -ip -mp -restrict")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# OSX flags
|
||||||
|
IF(APPLE)
|
||||||
|
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Solaris flags
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||||
|
IF(CMAKE_SYSTEM_VERSION VERSION_GREATER "5.9")
|
||||||
|
# Link mysqld with mtmalloc on Solaris 10 and later
|
||||||
|
SET(WITH_MYSQLD_LDFLAGS "-lmtmalloc" CACHE STRING "")
|
||||||
|
ENDIF()
|
||||||
|
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
||||||
|
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
|
||||||
|
IF(CMAKE_SIZEOF_VOIDP EQUAL 4)
|
||||||
|
# Solaris x86
|
||||||
|
SET(CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
|
"-g -xO2 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
|
"-g0 -xO2 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
|
||||||
|
ELSE()
|
||||||
|
# Solaris x64
|
||||||
|
SET(CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
|
"-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
|
"-g0 -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic")
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
IF(CMAKE_SIZEOF_VOIDP EQUAL 4)
|
||||||
|
# Solaris sparc 32 bit
|
||||||
|
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -xO3 -Xa -xstrconst -mt -xarch=sparc")
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g0 -xO3 -noex -mt -xarch=sparc")
|
||||||
|
ELSE()
|
||||||
|
# Solaris sparc 64 bit
|
||||||
|
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -xO3 -Xa -xstrconst -mt")
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g0 -xO3 -noex -mt")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||||
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
|
||||||
|
CACHE STRING "Compile flags")
|
||||||
|
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}"
|
||||||
|
CACHE STRING "Compile flags")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
27
cmake/cat.cmake
Normal file
27
cmake/cat.cmake
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Concatenate files
|
||||||
|
#
|
||||||
|
# Parameters :
|
||||||
|
# IN - input files (list)
|
||||||
|
# OUT - output file
|
||||||
|
FILE(WRITE ${OUT} "")
|
||||||
|
FOREACH(FILENAME ${IN})
|
||||||
|
FILE(READ ${FILENAME} CONTENTS)
|
||||||
|
FILE(APPEND ${OUT} "${CONTENTS}")
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
|
59
cmake/character_sets.cmake
Normal file
59
cmake/character_sets.cmake
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
#Charsets and collations
|
||||||
|
IF(NOT DEFAULT_CHARSET)
|
||||||
|
SET(DEFAULT_CHARSET "latin1")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT DEFAULT_COLLATIONS)
|
||||||
|
SET(DEFAULT_COLLATION "latin1_swedish_ci")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(CHARSETS ${DEFAULT_CHARSET} latin1 utf8 utf8mb4)
|
||||||
|
SET(CHARSETS_COMPLEX big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
|
||||||
|
|
||||||
|
SET(CHARSETS_AVAILABLE
|
||||||
|
binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257
|
||||||
|
cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8
|
||||||
|
greek hebrew hp8 keybcs2 koi8r koi8u
|
||||||
|
latin1 latin2 latin5 latin7 macce macroman
|
||||||
|
sjis swe7 tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
|
||||||
|
|
||||||
|
|
||||||
|
SET (EXTRA_CHARSETS "all")
|
||||||
|
SET(WITH_EXTRA_CHARSETS ${EXTRA_CHARSETS} CACHE
|
||||||
|
STRING "Options are: none, complex, all")
|
||||||
|
|
||||||
|
|
||||||
|
IF(WITH_EXTRA_CHARSETS MATCHES "complex")
|
||||||
|
SET(CHARSETS ${CHARSETS} ${CHARSETS_COMPLEX})
|
||||||
|
ELSEIF(WITH_EXTRA_CHARSETS MATCHES "all")
|
||||||
|
SET(CHARSETS ${CHARSETS} ${CHARSETS_AVAILABLE})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(MYSQL_DEFAULT_CHARSET_NAME "${DEFAULT_CHARSET}")
|
||||||
|
SET(MYSQL_DEFAULT_COLLATION_NAME "${DEFAULT_COLLATION}")
|
||||||
|
|
||||||
|
FOREACH(cs in ${CHARSETS})
|
||||||
|
SET(HAVE_CHARSET_${cs} 1)
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
SET(HAVE_UCA_COLLATIONS 1)
|
||||||
|
|
||||||
|
SET(HAVE_UTF8_GENERAL_CS 1)
|
||||||
|
SET(USE_MB 1)
|
||||||
|
SET(USE_MB_IDENT 1)
|
||||||
|
|
19
cmake/check_minimal_version.cmake
Normal file
19
cmake/check_minimal_version.cmake
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# This is a helper script is used to check for the minimal required version
|
||||||
|
# It helps to decide whether to use autoconf based configure or cmake's
|
||||||
|
# configure
|
||||||
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
|
47
cmake/cmake_parse_arguments.cmake
Normal file
47
cmake/cmake_parse_arguments.cmake
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
# Copyright (C) 2007 MySQL AB, 2009 Sun Microsystems,Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Handy macro to parse macro arguments
|
||||||
|
MACRO(CMAKE_PARSE_ARGUMENTS prefix arg_names option_names)
|
||||||
|
SET(DEFAULT_ARGS)
|
||||||
|
FOREACH(arg_name ${arg_names})
|
||||||
|
SET(${prefix}_${arg_name})
|
||||||
|
ENDFOREACH(arg_name)
|
||||||
|
FOREACH(option ${option_names})
|
||||||
|
SET(${prefix}_${option} FALSE)
|
||||||
|
ENDFOREACH(option)
|
||||||
|
|
||||||
|
SET(current_arg_name DEFAULT_ARGS)
|
||||||
|
SET(current_arg_list)
|
||||||
|
FOREACH(arg ${ARGN})
|
||||||
|
SET(larg_names ${arg_names})
|
||||||
|
LIST(FIND larg_names "${arg}" is_arg_name)
|
||||||
|
IF (is_arg_name GREATER -1)
|
||||||
|
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
||||||
|
SET(current_arg_name ${arg})
|
||||||
|
SET(current_arg_list)
|
||||||
|
ELSE (is_arg_name GREATER -1)
|
||||||
|
SET(loption_names ${option_names})
|
||||||
|
LIST(FIND loption_names "${arg}" is_option)
|
||||||
|
IF (is_option GREATER -1)
|
||||||
|
SET(${prefix}_${arg} TRUE)
|
||||||
|
ELSE (is_option GREATER -1)
|
||||||
|
SET(current_arg_list ${current_arg_list} ${arg})
|
||||||
|
ENDIF (is_option GREATER -1)
|
||||||
|
ENDIF (is_arg_name GREATER -1)
|
||||||
|
ENDFOREACH(arg)
|
||||||
|
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
||||||
|
ENDMACRO()
|
1
cmake/configurable_file_content.in
Normal file
1
cmake/configurable_file_content.in
Normal file
@ -0,0 +1 @@
|
|||||||
|
@CMAKE_CONFIGURABLE_FILE_CONTENT@
|
190
cmake/configure.pl
Normal file
190
cmake/configure.pl
Normal file
@ -0,0 +1,190 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
use strict;
|
||||||
|
use Cwd 'abs_path';
|
||||||
|
use File::Basename;
|
||||||
|
|
||||||
|
my $cmakeargs = "";
|
||||||
|
|
||||||
|
# Find source root directory
|
||||||
|
# Assume this script is in <srcroot>/cmake
|
||||||
|
my $srcdir = dirname(dirname(abs_path($0)));
|
||||||
|
my $cmake_install_prefix="";
|
||||||
|
|
||||||
|
# Sets installation directory, bindir, libdir, libexecdir etc
|
||||||
|
# the equivalent CMake variables are given without prefix
|
||||||
|
# e.g if --prefix is /usr and --bindir is /usr/bin
|
||||||
|
# then cmake variable (INSTALL_BINDIR) must be just "bin"
|
||||||
|
|
||||||
|
sub set_installdir
|
||||||
|
{
|
||||||
|
my($path, $varname) = @_;
|
||||||
|
my $prefix_length = length($cmake_install_prefix);
|
||||||
|
if (($prefix_length > 0) && (index($path,$cmake_install_prefix) == 0))
|
||||||
|
{
|
||||||
|
# path is under the prefix, so remove the prefix and maybe following "/"
|
||||||
|
$path = substr($path, $prefix_length);
|
||||||
|
if(length($path) > 0)
|
||||||
|
{
|
||||||
|
my $char = substr($path, 0, 1);
|
||||||
|
if($char eq "/")
|
||||||
|
{
|
||||||
|
$path= substr($path, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(length($path) > 0)
|
||||||
|
{
|
||||||
|
$cmakeargs = $cmakeargs." -D".$varname."=".$path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# CMake understands CC and CXX env.variables correctly, if they contain 1 or 2 tokens
|
||||||
|
# e.g CXX=gcc and CXX="ccache gcc" are ok. However it could have a problem if there
|
||||||
|
# (recognizing gcc) with more tokens ,e.g CXX="ccache gcc --pipe".
|
||||||
|
# The problem is simply fixed by splitting compiler and flags, e.g
|
||||||
|
# CXX="ccache gcc --pipe" => CXX=ccache gcc CXXFLAGS=--pipe
|
||||||
|
|
||||||
|
sub check_compiler
|
||||||
|
{
|
||||||
|
my ($varname, $flagsvarname) = @_;
|
||||||
|
my @tokens = split(/ /,$ENV{$varname});
|
||||||
|
if($#tokens >= 2)
|
||||||
|
{
|
||||||
|
$ENV{$varname} = $tokens[0]." ".$tokens[1];
|
||||||
|
my $flags;
|
||||||
|
|
||||||
|
for(my $i=2; $i<=$#tokens; $i++)
|
||||||
|
{
|
||||||
|
$flags= $flags." ".$tokens[$i];
|
||||||
|
}
|
||||||
|
if(defined $ENV{$flagsvarname})
|
||||||
|
{
|
||||||
|
$flags = $flags." ".$ENV{$flagsvarname};
|
||||||
|
}
|
||||||
|
$ENV{$flagsvarname}=$flags;
|
||||||
|
print("$varname=$ENV{$varname}\n");
|
||||||
|
print("$flagsvarname=$ENV{$flagsvarname}\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
check_compiler("CC", "CFLAGS");
|
||||||
|
check_compiler("CXX", "CXXFLAGS");
|
||||||
|
|
||||||
|
foreach my $option (@ARGV)
|
||||||
|
{
|
||||||
|
if (substr ($option, 0, 2) eq "--")
|
||||||
|
{
|
||||||
|
$option = substr($option, 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
# This must be environment variable
|
||||||
|
my @v = split('=', $option);
|
||||||
|
my $name = shift(@v);
|
||||||
|
if(@v)
|
||||||
|
{
|
||||||
|
$ENV{$name} = join('=', @v);
|
||||||
|
}
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~ /srcdir/)
|
||||||
|
{
|
||||||
|
$srcdir = substr($option,7);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~ /help/)
|
||||||
|
{
|
||||||
|
system("cmake ${srcdir} -LH");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
if($option =~ /with-plugins=/)
|
||||||
|
{
|
||||||
|
my @plugins= split(/,/, substr($option,13));
|
||||||
|
foreach my $p (@plugins)
|
||||||
|
{
|
||||||
|
$p =~ s/-/_/g;
|
||||||
|
$cmakeargs = $cmakeargs." -DWITH_".uc($p)."=1";
|
||||||
|
}
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~ /with-extra-charsets=/)
|
||||||
|
{
|
||||||
|
my $charsets= substr($option,20);
|
||||||
|
$cmakeargs = $cmakeargs." -DWITH_EXTRA_CHARSETS=".$charsets;
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~ /without-plugin=/)
|
||||||
|
{
|
||||||
|
$cmakeargs = $cmakeargs." -DWITHOUT_".uc(substr($option,15))."=1";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~ /with-zlib-dir=bundled/)
|
||||||
|
{
|
||||||
|
$cmakeargs = $cmakeargs." -DWITH_ZLIB=bundled";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~ /with-zlib-dir=/)
|
||||||
|
{
|
||||||
|
$cmakeargs = $cmakeargs." -DWITH_ZLIB=system";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~ /with-ssl=/)
|
||||||
|
{
|
||||||
|
$cmakeargs = $cmakeargs." -DWITH_SSL=yes";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~ /with-ssl/)
|
||||||
|
{
|
||||||
|
$cmakeargs = $cmakeargs." -DWITH_SSL=bundled";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~ /prefix=/)
|
||||||
|
{
|
||||||
|
$cmake_install_prefix= substr($option, 7);
|
||||||
|
$cmakeargs = $cmakeargs." -DCMAKE_INSTALL_PREFIX=".$cmake_install_prefix;
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~/bindir=/)
|
||||||
|
{
|
||||||
|
set_installdir(substr($option,7), "INSTALL_BINDIR");
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~/libdir=/)
|
||||||
|
{
|
||||||
|
set_installdir(substr($option,7), "INSTALL_LIBDIR");
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~/libexecdir=/)
|
||||||
|
{
|
||||||
|
set_installdir(substr($option,11), "INSTALL_SBINDIR");
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if($option =~/includedir=/)
|
||||||
|
{
|
||||||
|
set_installdir(substr($option,11), "INSTALL_INCLUDEDIR");
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($option =~ /extra-charsets=all/)
|
||||||
|
{
|
||||||
|
$cmakeargs = $cmakeargs." -DWITH_CHARSETS=all";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($option =~ /extra-charsets=complex/)
|
||||||
|
{
|
||||||
|
$cmakeargs = $cmakeargs." -DWITH_CHARSETS=complex";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($option =~ /localstatedir=/)
|
||||||
|
{
|
||||||
|
$cmakeargs = $cmakeargs." -DMYSQL_DATADIR=".substr($option,14);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
$option = uc($option);
|
||||||
|
$option =~ s/-/_/g;
|
||||||
|
$cmakeargs = $cmakeargs." -D".$option."=1";
|
||||||
|
}
|
||||||
|
|
||||||
|
print("configure.pl : calling cmake $srcdir $cmakeargs\n");
|
||||||
|
my $rc = system("cmake $srcdir $cmakeargs");
|
||||||
|
exit($rc);
|
40
cmake/cpack_source_ignore_files.cmake
Normal file
40
cmake/cpack_source_ignore_files.cmake
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
SET(CPACK_SOURCE_IGNORE_FILES
|
||||||
|
\\\\.bzr/
|
||||||
|
\\\\.bzr-mysql
|
||||||
|
\\\\.bzrignore
|
||||||
|
CMakeCache\\\\.txt
|
||||||
|
cmake_dist\\\\.cmake
|
||||||
|
CPackSourceConfig\\\\.cmake
|
||||||
|
CPackConfig.cmake
|
||||||
|
/cmake_install\\\\.cmake
|
||||||
|
/CTestTestfile\\\\.cmake
|
||||||
|
/CMakeFiles/
|
||||||
|
/version_resources/
|
||||||
|
/_CPack_Packages/
|
||||||
|
$\\\\.gz
|
||||||
|
$\\\\.zip
|
||||||
|
/CMakeFiles/
|
||||||
|
/version_resources/
|
||||||
|
/_CPack_Packages/
|
||||||
|
scripts/make_binary_distribution$
|
||||||
|
scripts/msql2mysql$
|
||||||
|
scripts/mysql_config$
|
||||||
|
scripts/mysql_convert_table_format$
|
||||||
|
scripts/mysql_find_rows$
|
||||||
|
scripts/mysql_fix_extensions$
|
||||||
|
scripts/mysql_install_db$
|
||||||
|
scripts/mysql_secure_installation$
|
||||||
|
scripts/mysql_setpermission$
|
||||||
|
scripts/mysql_zap$
|
||||||
|
scripts/mysqlaccess$
|
||||||
|
scripts/mysqld_multi$
|
||||||
|
scripts/mysqld_safe$
|
||||||
|
scripts/mysqldumpslow$
|
||||||
|
scripts/mysqlhotcopy$
|
||||||
|
Makefile$
|
||||||
|
include/config\\\\.h$
|
||||||
|
include/my_config\\\\.h$
|
||||||
|
/autom4te\\\\.cache/
|
||||||
|
errmsg\\\\.sys$
|
||||||
|
#
|
||||||
|
)
|
81
cmake/create_initial_db.cmake.in
Normal file
81
cmake/create_initial_db.cmake.in
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# This script creates initial database for packaging on Windows
|
||||||
|
SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
|
||||||
|
SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
|
||||||
|
SET(MYSQLD_EXECUTABLE "@MYSQLD_EXECUTABLE@")
|
||||||
|
SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@")
|
||||||
|
SET(WIN32 "@WIN32@")
|
||||||
|
# Force Visual Studio to output to stdout
|
||||||
|
IF(ENV{VS_UNICODE_OUTPUT})
|
||||||
|
SET ($ENV{VS_UNICODE_OUTPUT})
|
||||||
|
ENDIF()
|
||||||
|
IF(CMAKE_CFG_INTDIR AND CONFIG)
|
||||||
|
#Resolve build configuration variables
|
||||||
|
STRING(REPLACE "${CMAKE_CFG_INTDIR}" ${CONFIG} MYSQLD_EXECUTABLE
|
||||||
|
"${MYSQLD_EXECUTABLE}")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Create bootstrapper SQL script
|
||||||
|
FILE(WRITE bootstrap.sql "use mysql;\n" )
|
||||||
|
FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql
|
||||||
|
fill_help_tables.sql)
|
||||||
|
FILE(STRINGS ${CMAKE_SOURCE_DIR}/scripts/${FILENAME} CONTENTS)
|
||||||
|
FOREACH(STR ${CONTENTS})
|
||||||
|
IF(NOT STR MATCHES "@current_hostname")
|
||||||
|
FILE(APPEND bootstrap.sql "${STR}\n")
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
|
||||||
|
FILE(REMOVE_RECURSE mysql)
|
||||||
|
MAKE_DIRECTORY(mysql)
|
||||||
|
IF(WIN32)
|
||||||
|
SET(CONSOLE --console)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(BOOTSTRAP_COMMAND
|
||||||
|
${MYSQLD_EXECUTABLE}
|
||||||
|
--no-defaults
|
||||||
|
${CONSOLE}
|
||||||
|
--bootstrap
|
||||||
|
--lc-messages-dir=${CMAKE_CURRENT_BINARY_DIR}/share
|
||||||
|
--basedir=.
|
||||||
|
--datadir=.
|
||||||
|
--loose-skip-innodb
|
||||||
|
--loose-skip-ndbcluster
|
||||||
|
--max_allowed_packet=8M
|
||||||
|
--net_buffer_length=16K
|
||||||
|
)
|
||||||
|
|
||||||
|
GET_FILENAME_COMPONENT(CWD . ABSOLUTE)
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND "@CMAKE_COMMAND@" -E echo Executing ${BOOTSTRAP_COMMAND}
|
||||||
|
)
|
||||||
|
EXECUTE_PROCESS (
|
||||||
|
COMMAND "@CMAKE_COMMAND@" -E echo input file bootstrap.sql, current directory ${CWD}
|
||||||
|
)
|
||||||
|
EXECUTE_PROCESS (
|
||||||
|
COMMAND ${BOOTSTRAP_COMMAND} INPUT_FILE bootstrap.sql OUTPUT_VARIABLE OUT
|
||||||
|
ERROR_VARIABLE ERR
|
||||||
|
RESULT_VARIABLE RESULT
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(NOT RESULT EQUAL 0)
|
||||||
|
MESSAGE(FATAL_ERROR "Could not create initial database \n ${OUT} \n ${ERR}")
|
||||||
|
ENDIF()
|
||||||
|
|
78
cmake/do_abi_check.cmake
Normal file
78
cmake/do_abi_check.cmake
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
#
|
||||||
|
# Rules for checking that the abi/api has not changed.
|
||||||
|
#
|
||||||
|
# The following steps are followed in the do_abi_check rule below
|
||||||
|
#
|
||||||
|
# 1) Generate preprocessor output for the files that need to
|
||||||
|
# be tested for abi/api changes. use -nostdinc to prevent
|
||||||
|
# generation of preprocessor output for system headers. This
|
||||||
|
# results in messages in stderr saying that these headers
|
||||||
|
# were not found. Redirect the stderr output to /dev/null
|
||||||
|
# to prevent seeing these messages.
|
||||||
|
# 2) sed the output to
|
||||||
|
# 2.1) remove blank lines and lines that begin with "# "
|
||||||
|
# 2.2) When gcc -E is run on the Mac OS and solaris sparc platforms it
|
||||||
|
# introduces a line of output that shows up as a difference between
|
||||||
|
# the .pp and .out files. Remove these OS specific preprocessor text
|
||||||
|
# inserted by the preprocessor.
|
||||||
|
# 3) diff the generated file and the canons (.pp files already in
|
||||||
|
# the repository).
|
||||||
|
# 4) delete the .out file that is generated.
|
||||||
|
#
|
||||||
|
# If the diff fails, the generated file is not removed. This will
|
||||||
|
# be useful for analysis of ABI differences (e.g. using a visual
|
||||||
|
# diff tool).
|
||||||
|
#
|
||||||
|
# A ABI change that causes a build to fail will always be accompanied
|
||||||
|
# by new canons (.out files). The .out files that are not removed will
|
||||||
|
# be replaced as the new .pp files.
|
||||||
|
#
|
||||||
|
# e.g. If include/mysql/plugin.h has an ABI change then this rule would
|
||||||
|
# leave a <build directory>/abi_check.out file.
|
||||||
|
#
|
||||||
|
# A developer with a justified API change will then do a
|
||||||
|
# mv <build directory>/abi_check.out include/mysql/plugin.pp
|
||||||
|
# to replace the old canons with the new ones.
|
||||||
|
#
|
||||||
|
|
||||||
|
SET(abi_check_out ${BINARY_DIR}/abi_check.out)
|
||||||
|
|
||||||
|
FOREACH(file ${ABI_HEADERS})
|
||||||
|
SET(tmpfile ${file}.pp.tmp)
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${COMPILER}
|
||||||
|
-E -nostdinc -dI -I${SOURCE_DIR}/include -I${BINARY_DIR}/include
|
||||||
|
-I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql ${file}
|
||||||
|
ERROR_QUIET OUTPUT_FILE ${tmpfile})
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND sed -e
|
||||||
|
"/^# /d" -e "/^[ ]*$/d" -e "/^#pragma GCC set_debug_pwd/d" -e "/^#ident/d"
|
||||||
|
RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
|
||||||
|
IF(NOT ${result} EQUAL 0)
|
||||||
|
MESSAGE(FATAL_ERROR "sed returned error ${result}")
|
||||||
|
ENDIF()
|
||||||
|
FILE(REMOVE ${tmpfile})
|
||||||
|
EXECUTE_PROCESS(COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE
|
||||||
|
result)
|
||||||
|
IF(NOT ${result} EQUAL 0)
|
||||||
|
MESSAGE(FATAL_ERROR
|
||||||
|
"ABI check found difference between ${file}.pp and ${abi_check_out}")
|
||||||
|
ENDIF()
|
||||||
|
FILE(REMOVE ${abi_check_out})
|
||||||
|
ENDFOREACH()
|
||||||
|
|
176
cmake/dtrace.cmake
Normal file
176
cmake/dtrace.cmake
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Check if OS supports DTrace
|
||||||
|
MACRO(CHECK_DTRACE)
|
||||||
|
FIND_PROGRAM(DTRACE dtrace)
|
||||||
|
MARK_AS_ADVANCED(DTRACE)
|
||||||
|
|
||||||
|
# On FreeBSD, dtrace does not handle userland tracing yet
|
||||||
|
IF(DTRACE AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||||
|
SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace")
|
||||||
|
ENDIF()
|
||||||
|
SET(HAVE_DTRACE ${ENABLE_DTRACE})
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||||
|
IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||||
|
SET(DTRACE_FLAGS -32 CACHE INTERNAL "DTrace architecture flags")
|
||||||
|
ELSE()
|
||||||
|
SET(DTRACE_FLAGS -64 CACHE INTERNAL "DTrace architecture flags")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
CHECK_DTRACE()
|
||||||
|
|
||||||
|
# Produce a header file with
|
||||||
|
# DTrace macros
|
||||||
|
MACRO (DTRACE_HEADER provider header header_no_dtrace)
|
||||||
|
IF(ENABLE_DTRACE)
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${header} ${header_no_dtrace}
|
||||||
|
COMMAND ${DTRACE} -h -s ${provider} -o ${header}
|
||||||
|
COMMAND perl ${CMAKE_SOURCE_DIR}/scripts/dheadgen.pl -f ${provider} > ${header_no_dtrace}
|
||||||
|
DEPENDS ${provider}
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
|
||||||
|
# Create provider headers
|
||||||
|
IF(ENABLE_DTRACE)
|
||||||
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/probes_mysql.d.base
|
||||||
|
${CMAKE_BINARY_DIR}/include/probes_mysql.d COPYONLY)
|
||||||
|
DTRACE_HEADER(
|
||||||
|
${CMAKE_BINARY_DIR}/include/probes_mysql.d
|
||||||
|
${CMAKE_BINARY_DIR}/include/probes_mysql_dtrace.h
|
||||||
|
${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h
|
||||||
|
)
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
# Systemtap object
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${DTRACE} -G -s ${CMAKE_SOURCE_DIR}/include/probes_mysql.d.base
|
||||||
|
-o ${CMAKE_BINARY_DIR}/probes_mysql.o
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
ADD_CUSTOM_TARGET(gen_dtrace_header
|
||||||
|
DEPENDS
|
||||||
|
${CMAKE_BINARY_DIR}/include/probes_mysql.d
|
||||||
|
${CMAKE_BINARY_DIR}/include/probes_mysql_dtrace.h
|
||||||
|
${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_COMPILER_IS_GNUCXX
|
||||||
|
AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||||
|
IF(NOT DEFINED BUGGY_GCC_NO_DTRACE_MODULES)
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} --version
|
||||||
|
OUTPUT_VARIABLE out)
|
||||||
|
IF(out MATCHES "3.4.6")
|
||||||
|
# This gcc causes crashes in dlopen() for dtraced shared libs,
|
||||||
|
# while standard shipped with Solaris10 3.4.3 is ok
|
||||||
|
SET(BUGGY_GCC_NO_DTRACE_MODULES 1 CACHE INTERNAL "")
|
||||||
|
ELSE()
|
||||||
|
SET(BUGGY_GCC_NO_DTRACE_MODULES 0 CACHE INTERNAL "")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FUNCTION(DTRACE_INSTRUMENT target)
|
||||||
|
IF(BUGGY_GCC_NO_DTRACE_MODULES)
|
||||||
|
GET_TARGET_PROPERTY(target_type ${target} TYPE)
|
||||||
|
IF(target_type MATCHES "MODULE_LIBRARY")
|
||||||
|
RETURN()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
IF(ENABLE_DTRACE)
|
||||||
|
ADD_DEPENDENCIES(${target} gen_dtrace_header)
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
TARGET_LINK_LIBRARIES(${target} ${CMAKE_BINARY_DIR}/probes_mysql.o)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# On Solaris, invoke dtrace -G to generate object file and
|
||||||
|
# link it together with target.
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||||
|
SET(objdir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir)
|
||||||
|
SET(outfile ${objdir}/${target}_dtrace.o)
|
||||||
|
GET_TARGET_PROPERTY(target_type ${target} TYPE)
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
TARGET ${target} PRE_LINK
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DDTRACE=${DTRACE}
|
||||||
|
-DOUTFILE=${outfile}
|
||||||
|
-DDFILE=${CMAKE_BINARY_DIR}/include/probes_mysql.d
|
||||||
|
-DDTRACE_FLAGS=${DTRACE_FLAGS}
|
||||||
|
-DDIRS=.
|
||||||
|
-DTYPE=${target_type}
|
||||||
|
-P ${CMAKE_SOURCE_DIR}/cmake/dtrace_prelink.cmake
|
||||||
|
WORKING_DIRECTORY ${objdir}
|
||||||
|
)
|
||||||
|
# Add full object path to linker flags
|
||||||
|
GET_TARGET_PROPERTY(target_type ${target} TYPE)
|
||||||
|
IF(NOT target_type MATCHES "STATIC")
|
||||||
|
SET_TARGET_PROPERTIES(${target} PROPERTIES LINK_FLAGS "${outfile}")
|
||||||
|
ELSE()
|
||||||
|
# For static library flags, add the object to the library.
|
||||||
|
# Note: DTrace probes in static libraries are unusable currently
|
||||||
|
# (see explanation for DTRACE_INSTRUMENT_STATIC_LIBS below)
|
||||||
|
# but maybe one day this will be fixed.
|
||||||
|
GET_TARGET_PROPERTY(target_location ${target} LOCATION)
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
TARGET ${target} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_AR} r ${target_location} ${outfile}
|
||||||
|
COMMAND ${CMAKE_RANLIB} ${target_location}
|
||||||
|
)
|
||||||
|
# Used in DTRACE_INSTRUMENT_WITH_STATIC_LIBS
|
||||||
|
SET(TARGET_OBJECT_DIRECTORY_${target} ${objdir} CACHE INTERNAL "")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
|
||||||
|
# Ugly workaround for Solaris' DTrace inability to use probes
|
||||||
|
# from static libraries, discussed e.g in this thread
|
||||||
|
# (http://opensolaris.org/jive/thread.jspa?messageID=432454)
|
||||||
|
# We have to collect all object files that may be instrumented
|
||||||
|
# and go into the mysqld (also those that come from in static libs)
|
||||||
|
# run them again through dtrace -G to generate an ELF file that links
|
||||||
|
# to mysqld.
|
||||||
|
MACRO (DTRACE_INSTRUMENT_STATIC_LIBS target libs)
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND ENABLE_DTRACE)
|
||||||
|
FOREACH(lib ${libs})
|
||||||
|
SET(dirs ${dirs} ${TARGET_OBJECT_DIRECTORY_${lib}})
|
||||||
|
ENDFOREACH()
|
||||||
|
SET (obj ${CMAKE_CURRENT_BINARY_DIR}/${target}_dtrace_all.o)
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${obj}
|
||||||
|
DEPENDS ${libs}
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
-DDTRACE=${DTRACE}
|
||||||
|
-DOUTFILE=${obj}
|
||||||
|
-DDFILE=${CMAKE_BINARY_DIR}/include/probes_mysql.d
|
||||||
|
-DDTRACE_FLAGS=${DTRACE_FLAGS}
|
||||||
|
"-DDIRS=${dirs}"
|
||||||
|
-DTYPE=MERGE
|
||||||
|
-P ${CMAKE_SOURCE_DIR}/cmake/dtrace_prelink.cmake
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
ADD_CUSTOM_TARGET(${target}_dtrace_all DEPENDS ${obj})
|
||||||
|
ADD_DEPENDENCIES(${target} ${target}_dtrace_all)
|
||||||
|
TARGET_LINK_LIBRARIES(${target} ${obj})
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
83
cmake/dtrace_prelink.cmake
Normal file
83
cmake/dtrace_prelink.cmake
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Generates an ELF object file with dtrace entry points.
|
||||||
|
# This object that must to be linked with together with
|
||||||
|
# the target. This script needs to run on Solaris only
|
||||||
|
|
||||||
|
# Do not follow symlinks in GLOB_RECURSE
|
||||||
|
CMAKE_POLICY(SET CMP0009 NEW)
|
||||||
|
FILE(REMOVE ${OUTFILE})
|
||||||
|
|
||||||
|
MACRO(CONVERT_TO_RELATIVE_PATHS files rel_paths)
|
||||||
|
GET_FILENAME_COMPONENT(abs_dir . ABSOLUTE)
|
||||||
|
SET(${rel_paths})
|
||||||
|
FOREACH(file ${files})
|
||||||
|
FILE(RELATIVE_PATH rel ${abs_dir} ${file})
|
||||||
|
LIST(APPEND ${rel_paths} ${rel})
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
IF(TYPE STREQUAL "MERGE")
|
||||||
|
# Rerun dtrace on objects that are already in static libraries.
|
||||||
|
# Object paths are stored in text files named 'dtrace_objects'
|
||||||
|
# in the input directores. We have to copy the objects into temp.
|
||||||
|
# directory, as running dtrace -G on original files will change
|
||||||
|
# timestamps and cause rebuilds or the libraries / excessive
|
||||||
|
# relink
|
||||||
|
FILE(REMOVE_RECURSE dtrace_objects_merge)
|
||||||
|
MAKE_DIRECTORY(dtrace_objects_merge)
|
||||||
|
|
||||||
|
FOREACH(dir ${DIRS})
|
||||||
|
FILE(STRINGS ${dir}/dtrace_objects OBJS)
|
||||||
|
FOREACH(obj ${OBJS})
|
||||||
|
IF(obj)
|
||||||
|
EXECUTE_PROCESS(COMMAND cp ${obj} dtrace_objects_merge)
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDFOREACH()
|
||||||
|
FILE(GLOB_RECURSE OBJECTS dtrace_objects_merge/*.o)
|
||||||
|
CONVERT_TO_RELATIVE_PATHS("${OBJECTS}" REL_OBJECTS)
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${DTRACE} ${DTRACE_FLAGS} -o ${OUTFILE} -G -s ${DFILE} ${REL_OBJECTS}
|
||||||
|
)
|
||||||
|
RETURN()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FOREACH(dir ${DIRS})
|
||||||
|
FILE(GLOB_RECURSE OBJECTS ${dir}/*.o)
|
||||||
|
CONVERT_TO_RELATIVE_PATHS("${OBJECTS}" REL)
|
||||||
|
LIST(APPEND REL_OBJECTS ${REL})
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
FILE(WRITE dtrace_timestamp "")
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${DTRACE} ${DTRACE_FLAGS} -o ${OUTFILE} -G -s ${DFILE} ${REL_OBJECTS}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Save objects that contain dtrace probes in a file.
|
||||||
|
# This file is used when script is called with -DTYPE=MERGE
|
||||||
|
# to dtrace from static libs.
|
||||||
|
# To find objects with probes, look at the timestamp, it was updated
|
||||||
|
# by dtrace -G run
|
||||||
|
IF(TYPE MATCHES "STATIC")
|
||||||
|
FILE(WRITE dtrace_objects "")
|
||||||
|
FOREACH(obj ${REL_OBJECTS})
|
||||||
|
IF(${obj} IS_NEWER_THAN dtrace_timestamp)
|
||||||
|
GET_FILENAME_COMPONENT(obj_absolute_path ${obj} ABSOLUTE)
|
||||||
|
FILE(APPEND dtrace_objects "${obj_absolute_path}\n" )
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
128
cmake/install_layout.cmake
Executable file
128
cmake/install_layout.cmake
Executable file
@ -0,0 +1,128 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# The purpose of this file is to set the default installation layout.
|
||||||
|
# Currently, there are 2 different installation layouts ,
|
||||||
|
# one is used in tar.gz packages (Windows zip is about the same), another one
|
||||||
|
# in RPMs.
|
||||||
|
|
||||||
|
# There are currently 2 layouts defines, named STANDALONE (tar.gz layout)
|
||||||
|
# and UNIX (rpm layout). To force a directory layout when invoking cmake use
|
||||||
|
# -DINSTALL_LAYOUT=[STANDALONE|UNIX].
|
||||||
|
# This wil use a predefined layout. There is a possibility to further fine-tune
|
||||||
|
# installation directories. Several variables are can be overwritten
|
||||||
|
#
|
||||||
|
# - INSTALL_BINDIR (directory with client executables and Unix shell scripts)
|
||||||
|
# - INSTALL_SBINDIR (directory with mysqld)
|
||||||
|
# - INSTALL_LIBDIR (directory with client end embedded libraries)
|
||||||
|
# - INSTALL_PLUGINDIR (directory for plugins)
|
||||||
|
# - INSTALL_INCLUDEDIR (directory for MySQL headers)
|
||||||
|
# - INSTALL_DOCDIR (documentation)
|
||||||
|
# - INSTALL_MANDIR (man pages)
|
||||||
|
# - INSTALL_SCRIPTDIR (several scripts, rarely used)
|
||||||
|
# - INSTALL_MYSQLSHAREDIR (MySQL character sets and localized error messages)
|
||||||
|
# - INSTALL_SHAREDIR (location of aclocal/mysql.m4)
|
||||||
|
# - INSTALL_SQLBENCHDIR (sql-bench)
|
||||||
|
# - INSTALL_MYSQLTESTDIR (mysql-test)
|
||||||
|
# - INSTALL_DOCREADMEDIR (readme and similar)
|
||||||
|
# - INSTALL_SUPPORTFILESDIR (used only in standalone installer)
|
||||||
|
|
||||||
|
# Default installation layout on Unix is UNIX (kent wants it so)
|
||||||
|
IF(NOT INSTALL_LAYOUT)
|
||||||
|
IF(WIN32)
|
||||||
|
SET(DEFAULT_INSTALL_LAYOUT "STANDALONE")
|
||||||
|
ELSE()
|
||||||
|
SET(DEFAULT_INSTALL_LAYOUT "UNIX")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}"
|
||||||
|
CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer) or UNIX")
|
||||||
|
|
||||||
|
IF(NOT INSTALL_LAYOUT MATCHES "STANDALONE")
|
||||||
|
IF(NOT INSTALL_LAYOUT MATCHES "UNIX")
|
||||||
|
SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(UNIX)
|
||||||
|
IF(INSTALL_LAYOUT MATCHES "UNIX")
|
||||||
|
SET(default_prefix "/usr")
|
||||||
|
ELSE()
|
||||||
|
SET(default_prefix "/usr/local/mysql")
|
||||||
|
ENDIF()
|
||||||
|
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
|
SET(CMAKE_INSTALL_PREFIX ${default_prefix}
|
||||||
|
CACHE PATH "install prefix" FORCE)
|
||||||
|
ENDIF()
|
||||||
|
SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc"
|
||||||
|
CACHE PATH "config directory (for my.cnf)")
|
||||||
|
MARK_AS_ADVANCED(SYSCONFDIR)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# STANDALONE layout
|
||||||
|
SET(INSTALL_BINDIR_STANDALONE "bin")
|
||||||
|
SET(INSTALL_SBINDIR_STANDALONE "bin")
|
||||||
|
SET(INSTALL_LIBDIR_STANDALONE "lib")
|
||||||
|
SET(INSTALL_INCLUDEDIR_STANDALONE "include")
|
||||||
|
SET(INSTALL_PLUGINDIR_STANDALONE "lib/plugin")
|
||||||
|
SET(INSTALL_DOCDIR_STANDALONE "docs")
|
||||||
|
SET(INSTALL_MANDIR_STANDALONE "man")
|
||||||
|
SET(INSTALL_MYSQLSHAREDIR_STANDALONE "share")
|
||||||
|
SET(INSTALL_SHAREDIR_STANDALONE "share")
|
||||||
|
SET(INSTALL_SCRIPTDIR_STANDALONE "scripts")
|
||||||
|
SET(INSTALL_MYSQLTESTDIR_STANDALONE "mysql-test")
|
||||||
|
SET(INSTALL_SQLBENCHROOTDIR_STANDALONE ".")
|
||||||
|
SET(INSTALL_DOCREADMEDIR_STANDALONE ".")
|
||||||
|
SET(INSTALL_SUPPORTFILESDIR_STANDALONE "support-files")
|
||||||
|
SET(INSTALL_MYSQLDATADIR_STANDALONE "data")
|
||||||
|
|
||||||
|
# UNIX layout
|
||||||
|
SET(INSTALL_BINDIR_UNIX "bin")
|
||||||
|
SET(INSTALL_SBINDIR_UNIX "sbin")
|
||||||
|
SET(INSTALL_LIBDIR_UNIX "lib/mysql")
|
||||||
|
SET(INSTALL_PLUGINDIR_UNIX "lib/mysql/plugin")
|
||||||
|
SET(INSTALL_DOCDIR_UNIX "share/mysql/doc/MySQL-server-${MYSQL_NO_DASH_VERSION}")
|
||||||
|
SET(INSTALL_MANDIR_UNIX "share/mysql/man")
|
||||||
|
SET(INSTALL_INCLUDEDIR_UNIX "include/mysql")
|
||||||
|
SET(INSTALL_MYSQLSHAREDIR_UNIX "share/mysql")
|
||||||
|
SET(INSTALL_SHAREDIR_UNIX "share")
|
||||||
|
SET(INSTALL_SCRIPTDIR_UNIX "bin")
|
||||||
|
SET(INSTALL_MYSQLTESTDIR_UNIX "mysql-test")
|
||||||
|
SET(INSTALL_SQLBENCHROOTDIR_UNIX "")
|
||||||
|
SET(INSTALL_DOCREADMEDIR_UNIX "share/mysql/doc/MySQL-server-${MYSQL_NO_DASH_VERSION}")
|
||||||
|
SET(INSTALL_SUPPORTFILESDIR_UNIX "")
|
||||||
|
SET(INSTALL_MYSQLDATADIR_UNIX "var")
|
||||||
|
|
||||||
|
|
||||||
|
# Clear cached variables if install layout was changed
|
||||||
|
IF(OLD_INSTALL_LAYOUT)
|
||||||
|
IF(NOT OLD_INSTALL_LAYOUT STREQUAL INSTALL_LAYOUR)
|
||||||
|
SET(FORCE FORCE)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "")
|
||||||
|
|
||||||
|
# Set INSTALL_FOODIR variables for chosen layout
|
||||||
|
# (for example, INSTALL_BINDIR will be defined as
|
||||||
|
# ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE layout is chosen)
|
||||||
|
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN
|
||||||
|
MYSQLTEST SQLBENCHROOT DOCREADME SUPPORTFILES MYSQLDATA)
|
||||||
|
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
|
||||||
|
CACHE STRING "${var} installation directory" ${FORCE})
|
||||||
|
MARK_AS_ADVANCED(INSTALL_${var}DIR)
|
||||||
|
ENDFOREACH()
|
213
cmake/install_macros.cmake
Normal file
213
cmake/install_macros.cmake
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
|
||||||
|
MACRO (INSTALL_DEBUG_SYMBOLS targets)
|
||||||
|
IF(MSVC)
|
||||||
|
FOREACH(target ${targets})
|
||||||
|
GET_TARGET_PROPERTY(location ${target} LOCATION)
|
||||||
|
GET_TARGET_PROPERTY(type ${target} TYPE)
|
||||||
|
IF(NOT INSTALL_LOCATION)
|
||||||
|
IF(type MATCHES "STATIC_LIBRARY" OR type MATCHES "MODULE_LIBRARY" OR type MATCHES "SHARED_LIBRARY")
|
||||||
|
SET(INSTALL_LOCATION "lib")
|
||||||
|
ELSEIF(type MATCHES "EXECUTABLE")
|
||||||
|
SET(INSTALL_LOCATION "bin")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(FATAL_ERROR "cannot determine type of ${target}. Don't now where to install")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
STRING(REPLACE ".exe" ".pdb" pdb_location ${location})
|
||||||
|
STRING(REPLACE ".dll" ".pdb" pdb_location ${pdb_location})
|
||||||
|
STRING(REPLACE ".lib" ".pdb" pdb_location ${pdb_location})
|
||||||
|
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
|
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" pdb_location ${pdb_location})
|
||||||
|
ENDIF()
|
||||||
|
INSTALL(FILES ${pdb_location} DESTINATION ${INSTALL_LOCATION})
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
# Install symbolic link to CMake target.
|
||||||
|
# the link is created in the same directory as target
|
||||||
|
# and extension will be the same as for target file.
|
||||||
|
MACRO(INSTALL_SYMLINK linkbasename target destination)
|
||||||
|
IF(UNIX)
|
||||||
|
GET_TARGET_PROPERTY(location ${target} LOCATION)
|
||||||
|
GET_FILENAME_COMPONENT(path ${location} PATH)
|
||||||
|
GET_FILENAME_COMPONENT(name_we ${location} NAME_WE)
|
||||||
|
GET_FILENAME_COMPONENT(ext ${location} EXT)
|
||||||
|
SET(output ${path}/${linkbasename}${ext})
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${output}
|
||||||
|
COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${output}
|
||||||
|
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
|
||||||
|
${name_we}${ext}
|
||||||
|
${linkbasename}${ext}
|
||||||
|
WORKING_DIRECTORY ${path}
|
||||||
|
DEPENDS ${target}
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(symlink_${linkbasename}${ext}
|
||||||
|
ALL
|
||||||
|
DEPENDS ${output})
|
||||||
|
SET_TARGET_PROPERTIES(symlink_${linkbasename}${ext} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||||
|
IF(CMAKE_GENERATOR MATCHES "Xcode")
|
||||||
|
# For Xcode, replace project config with install config
|
||||||
|
STRING(REPLACE "${CMAKE_CFG_INTDIR}"
|
||||||
|
"\${CMAKE_INSTALL_CONFIG_NAME}" output ${output})
|
||||||
|
ENDIF()
|
||||||
|
INSTALL(FILES ${output} DESTINATION ${destination})
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
OPTION(SIGNCODE "Sign executables and dlls with digital certificate" OFF)
|
||||||
|
MARK_AS_ADVANCED(SIGNCODE)
|
||||||
|
IF(SIGNCODE)
|
||||||
|
SET(SIGNTOOL_PARAMETERS
|
||||||
|
/a /t http://timestamp.verisign.com/scripts/timstamp.dll
|
||||||
|
CACHE STRING "parameters for signtool (list)")
|
||||||
|
FIND_PROGRAM(SIGNTOOL_EXECUTABLE signtool)
|
||||||
|
IF(NOT SIGNTOOL_EXECUTABLE)
|
||||||
|
MESSAGE(FATAL_ERROR
|
||||||
|
"signtool is not found. Signing executables not possible")
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT DEFINED SIGNCODE_ENABLED)
|
||||||
|
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/testsign.c "int main(){return 0;}")
|
||||||
|
MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/testsign)
|
||||||
|
TRY_COMPILE(RESULT ${CMAKE_CURRENT_BINARY_DIR}/testsign ${CMAKE_CURRENT_BINARY_DIR}/testsign.c
|
||||||
|
COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/testsign.exe
|
||||||
|
)
|
||||||
|
|
||||||
|
EXECUTE_PROCESS(COMMAND
|
||||||
|
${SIGNTOOL_EXECUTABLE} sign ${SIGNTOOL_PARAMETERS} ${CMAKE_CURRENT_BINARY_DIR}/testsign.exe
|
||||||
|
RESULT_VARIABLE ERR ERROR_QUIET OUTPUT_QUIET
|
||||||
|
)
|
||||||
|
IF(ERR EQUAL 0)
|
||||||
|
SET(SIGNCODE_ENABLED 1 CACHE INTERNAL "Can sign executables")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "Disable authenticode signing for executables")
|
||||||
|
SET(SIGNCODE_ENABLED 0 CACHE INTERNAL "Invalid or missing certificate")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
MARK_AS_ADVANCED(SIGNTOOL_EXECUTABLE SIGNTOOL_PARAMETERS)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MACRO(SIGN_TARGET target)
|
||||||
|
GET_TARGET_PROPERTY(target_type ${target} TYPE)
|
||||||
|
IF(target_type AND NOT target_type MATCHES "STATIC")
|
||||||
|
GET_TARGET_PROPERTY(target_location ${target} LOCATION)
|
||||||
|
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
|
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}"
|
||||||
|
target_location ${target_location})
|
||||||
|
ENDIF()
|
||||||
|
INSTALL(CODE
|
||||||
|
"EXECUTE_PROCESS(COMMAND
|
||||||
|
${SIGNTOOL_EXECUTABLE} sign ${SIGNTOOL_PARAMETERS} ${target_location}
|
||||||
|
RESULT_VARIABLE ERR)
|
||||||
|
IF(NOT \${ERR} EQUAL 0)
|
||||||
|
MESSAGE(FATAL_ERROR \"Error signing ${target_location}\")
|
||||||
|
ENDIF()
|
||||||
|
")
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
|
||||||
|
# Installs targets, also installs pdbs on Windows.
|
||||||
|
#
|
||||||
|
# More stuff can be added later, e.g signing
|
||||||
|
# or pre-link custom targets (one example is creating
|
||||||
|
# version resource for windows executables)
|
||||||
|
|
||||||
|
FUNCTION(MYSQL_INSTALL_TARGETS)
|
||||||
|
CMAKE_PARSE_ARGUMENTS(ARG
|
||||||
|
"DESTINATION"
|
||||||
|
""
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
SET(TARGETS ${ARG_DEFAULT_ARGS})
|
||||||
|
IF(NOT TARGETS)
|
||||||
|
MESSAGE(FATAL_ERROR "Need target list for MYSQL_INSTALL_TARGETS")
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT ARG_DESTINATION)
|
||||||
|
MESSAGE(FATAL_ERROR "Need DESTINATION parameter for MYSQL_INSTALL_TARGETS")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# If signing is required, sign executables before installing
|
||||||
|
FOREACH(target ${TARGETS})
|
||||||
|
IF(SIGNCODE AND SIGNCODE_ENABLED)
|
||||||
|
SIGN_TARGET(${target})
|
||||||
|
ENDIF()
|
||||||
|
ADD_VERSION_INFO(${target})
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION})
|
||||||
|
SET(INSTALL_LOCATION ${ARG_DESTINATION} )
|
||||||
|
INSTALL_DEBUG_SYMBOLS("${TARGETS}")
|
||||||
|
SET(INSTALL_LOCATION)
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
# Optionally install mysqld/client/embedded from debug build run. outside of the current build dir
|
||||||
|
# (unless multi-config generator is used like Visual Studio or Xcode).
|
||||||
|
# For Makefile generators we default Debug build directory to ${buildroot}/../debug.
|
||||||
|
GET_FILENAME_COMPONENT(BINARY_PARENTDIR ${CMAKE_BINARY_DIR} PATH)
|
||||||
|
SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug build")
|
||||||
|
|
||||||
|
|
||||||
|
FUNCTION(INSTALL_DEBUG_TARGET target)
|
||||||
|
CMAKE_PARSE_ARGUMENTS(ARG
|
||||||
|
"DESTINATION;RENAME"
|
||||||
|
""
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
GET_TARGET_PROPERTY(target_type ${target} TYPE)
|
||||||
|
IF(ARG_RENAME)
|
||||||
|
SET(RENAME_PARAM RENAME ${ARG_RENAME}${CMAKE_${target_type}_SUFFIX})
|
||||||
|
ELSE()
|
||||||
|
SET(RENAME_PARAM)
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT ARG_DESTINATION)
|
||||||
|
MESSAGE(FATAL_ERROR "Need DESTINATION parameter for INSTALL_DEBUG_TARGET")
|
||||||
|
ENDIF()
|
||||||
|
GET_TARGET_PROPERTY(target_location ${target} LOCATION)
|
||||||
|
IF(CMAKE_GENERATOR MATCHES "Makefiles")
|
||||||
|
STRING(REPLACE "${CMAKE_BINARY_DIR}" "${DEBUGBUILDDIR}" debug_target_location "${target_location}")
|
||||||
|
ELSE()
|
||||||
|
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "Debug" debug_target_location "${target_location}" )
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
INSTALL(FILES ${debug_target_location}
|
||||||
|
DESTINATION ${ARG_DESTINATION}
|
||||||
|
${RENAME_PARAM}
|
||||||
|
CONFIGURATIONS Release RelWithDebInfo
|
||||||
|
OPTIONAL)
|
||||||
|
|
||||||
|
IF(MSVC)
|
||||||
|
GET_FILENAME_COMPONENT(ext ${debug_target_location} EXT)
|
||||||
|
STRING(REPLACE "${ext}" ".pdb" debug_pdb_target_location "${debug_target_location}" )
|
||||||
|
IF(RENAME_PARAM)
|
||||||
|
STRING(REPLACE "${ext}" ".pdb" "${ARG_RENAME}" pdb_rename)
|
||||||
|
SET(PDB_RENAME_PARAM RENAME ${pdb_rename})
|
||||||
|
ENDIF()
|
||||||
|
INSTALL(FILES ${debug_pdb_target_location}
|
||||||
|
DESTINATION ${ARG_DESTINATION}
|
||||||
|
${RPDB_RENAME_PARAM}
|
||||||
|
CONFIGURATIONS Release RelWithDebInfo
|
||||||
|
OPTIONAL)
|
||||||
|
ENDIF()
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
296
cmake/libutils.cmake
Normal file
296
cmake/libutils.cmake
Normal file
@ -0,0 +1,296 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
|
||||||
|
# This file exports macros that emulate some functionality found in GNU libtool
|
||||||
|
# on Unix systems. One such feature is convenience libraries. In this context,
|
||||||
|
# convenience library is a static library that can be linked to shared library
|
||||||
|
# On systems that force position-independent code, linking into shared library
|
||||||
|
# normally requires compilation with a special flag (often -fPIC). To enable
|
||||||
|
# linking static libraries to shared, we compile source files that come into
|
||||||
|
# static library with the PIC flag (${CMAKE_SHARED_LIBRARY_C_FLAGS} in CMake)
|
||||||
|
# Some systems, like Windows or OSX do not need special compilation (Windows
|
||||||
|
# never uses PIC and OSX always uses it).
|
||||||
|
#
|
||||||
|
# The intention behind convenience libraries is simplify the build and to reduce
|
||||||
|
# excessive recompiles.
|
||||||
|
|
||||||
|
# Except for convenience libraries, this file provides macros to merge static
|
||||||
|
# libraries (we need it for mysqlclient) and to create shared library out of
|
||||||
|
# convenience libraries(again, for mysqlclient)
|
||||||
|
|
||||||
|
# Following macros are exported
|
||||||
|
# - ADD_CONVENIENCE_LIBRARY(target source1...sourceN)
|
||||||
|
# This macro creates convenience library. The functionality is similar to
|
||||||
|
# ADD_LIBRARY(target STATIC source1...sourceN), the difference is that resulting
|
||||||
|
# library can always be linked to shared library
|
||||||
|
#
|
||||||
|
# - MERGE_LIBRARIES(target [STATIC|SHARED|MODULE] [linklib1 .... linklibN]
|
||||||
|
# [EXPORTS exported_func1 .... exported_func_N]
|
||||||
|
# [OUTPUT_NAME output_name]
|
||||||
|
# This macro merges several static libraries into a single one or creates a shared
|
||||||
|
# library from several convenience libraries
|
||||||
|
|
||||||
|
# Important global flags
|
||||||
|
# - WITH_PIC : If set, it is assumed that everything is compiled as position
|
||||||
|
# independent code (that is CFLAGS/CMAKE_C_FLAGS contain -fPIC or equivalent)
|
||||||
|
# If defined, ADD_CONVENIENCE_LIBRARY does not add PIC flag to compile flags
|
||||||
|
#
|
||||||
|
# - DISABLE_SHARED: If set, it is assumed that shared libraries are not produced
|
||||||
|
# during the build. ADD_CONVENIENCE_LIBRARY does not add anything to compile flags
|
||||||
|
|
||||||
|
|
||||||
|
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
IF(WIN32 OR CYGWIN OR APPLE OR WITH_PIC OR DISABLE_SHARED OR NOT CMAKE_SHARED_LIBRARY_C_FLAGS)
|
||||||
|
SET(_SKIP_PIC 1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
|
||||||
|
# CREATE_EXPORT_FILE (VAR target api_functions)
|
||||||
|
# Internal macro, used to create source file for shared libraries that
|
||||||
|
# otherwise consists entirely of "convenience" libraries. On Windows,
|
||||||
|
# also exports API functions as dllexport. On unix, creates a dummy file
|
||||||
|
# that references all exports and this prevents linker from creating an
|
||||||
|
# empty library(there are unportable alternatives, --whole-archive)
|
||||||
|
MACRO(CREATE_EXPORT_FILE VAR TARGET API_FUNCTIONS)
|
||||||
|
IF(WIN32)
|
||||||
|
SET(DUMMY ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_dummy.c)
|
||||||
|
SET(EXPORTS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_exports.def)
|
||||||
|
CONFIGURE_FILE_CONTENT("" ${DUMMY})
|
||||||
|
SET(CONTENT "EXPORTS\n")
|
||||||
|
FOREACH(FUNC ${API_FUNCTIONS})
|
||||||
|
SET(CONTENT "${CONTENT} ${FUNC}\n")
|
||||||
|
ENDFOREACH()
|
||||||
|
CONFIGURE_FILE_CONTENT(${CONTENT} ${EXPORTS})
|
||||||
|
SET(${VAR} ${DUMMY} ${EXPORTS})
|
||||||
|
ELSE()
|
||||||
|
SET(EXPORTS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_exports_file.cc)
|
||||||
|
SET(CONTENT)
|
||||||
|
FOREACH(FUNC ${API_FUNCTIONS})
|
||||||
|
SET(CONTENT "${CONTENT} extern void* ${FUNC}\;\n")
|
||||||
|
ENDFOREACH()
|
||||||
|
SET(CONTENT "${CONTENT} void *${TARGET}_api_funcs[] = {\n")
|
||||||
|
FOREACH(FUNC ${API_FUNCTIONS})
|
||||||
|
SET(CONTENT "${CONTENT} &${FUNC},\n")
|
||||||
|
ENDFOREACH()
|
||||||
|
SET(CONTENT "${CONTENT} (void *)0\n}\;")
|
||||||
|
CONFIGURE_FILE_CONTENT(${CONTENT} ${EXPORTS})
|
||||||
|
SET(${VAR} ${EXPORTS})
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
|
||||||
|
# MYSQL_ADD_CONVENIENCE_LIBRARY(name source1...sourceN)
|
||||||
|
# Create static library that can be linked to shared library.
|
||||||
|
# On systems that force position-independent code, adds -fPIC or
|
||||||
|
# equivalent flag to compile flags.
|
||||||
|
MACRO(ADD_CONVENIENCE_LIBRARY)
|
||||||
|
SET(TARGET ${ARGV0})
|
||||||
|
SET(SOURCES ${ARGN})
|
||||||
|
LIST(REMOVE_AT SOURCES 0)
|
||||||
|
ADD_LIBRARY(${TARGET} STATIC ${SOURCES})
|
||||||
|
IF(NOT _SKIP_PIC)
|
||||||
|
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES COMPILE_FLAGS
|
||||||
|
"${CMAKE_SHARED_LIBRARY_C_FLAGS}")
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
|
||||||
|
# Write content to file, using CONFIGURE_FILE
|
||||||
|
# The advantage compared to FILE(WRITE) is that timestamp
|
||||||
|
# does not change if file already has the same content
|
||||||
|
MACRO(CONFIGURE_FILE_CONTENT content file)
|
||||||
|
SET(CMAKE_CONFIGURABLE_FILE_CONTENT
|
||||||
|
"${content}\n")
|
||||||
|
CONFIGURE_FILE(
|
||||||
|
${MYSQL_CMAKE_SCRIPT_DIR}/configurable_file_content.in
|
||||||
|
${file}
|
||||||
|
@ONLY)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
# Merge static libraries into a big static lib. The resulting library
|
||||||
|
# should not not have dependencies on other static libraries.
|
||||||
|
# We use it in MySQL to merge mysys,dbug,vio etc into mysqlclient
|
||||||
|
|
||||||
|
MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
|
||||||
|
# To produce a library we need at least one source file.
|
||||||
|
# It is created by ADD_CUSTOM_COMMAND below and will helps
|
||||||
|
# also help to track dependencies.
|
||||||
|
SET(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_depends.c)
|
||||||
|
ADD_LIBRARY(${TARGET} STATIC ${SOURCE_FILE})
|
||||||
|
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME})
|
||||||
|
|
||||||
|
SET(OSLIBS)
|
||||||
|
FOREACH(LIB ${LIBS_TO_MERGE})
|
||||||
|
GET_TARGET_PROPERTY(LIB_LOCATION ${LIB} LOCATION)
|
||||||
|
GET_TARGET_PROPERTY(LIB_TYPE ${LIB} TYPE)
|
||||||
|
IF(NOT LIB_LOCATION)
|
||||||
|
# 3rd party library like libz.so. Make sure that everything
|
||||||
|
# that links to our library links to this one as well.
|
||||||
|
LIST(APPEND OSLIBS ${LIB})
|
||||||
|
ELSE()
|
||||||
|
# This is a target in current project
|
||||||
|
# (can be a static or shared lib)
|
||||||
|
IF(LIB_TYPE STREQUAL "STATIC_LIBRARY")
|
||||||
|
SET(STATIC_LIBS ${STATIC_LIBS} ${LIB_LOCATION})
|
||||||
|
ADD_DEPENDENCIES(${TARGET} ${LIB})
|
||||||
|
# Extract dependend OS libraries
|
||||||
|
GET_DEPENDEND_OS_LIBS(${LIB} LIB_OSLIBS)
|
||||||
|
LIST(APPEND OSLIBS ${LIB_OSLIBS})
|
||||||
|
ELSE()
|
||||||
|
# This is a shared library our static lib depends on.
|
||||||
|
LIST(APPEND OSLIBS ${LIB})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
IF(OSLIBS)
|
||||||
|
LIST(REMOVE_DUPLICATES OSLIBS)
|
||||||
|
TARGET_LINK_LIBRARIES(${TARGET} ${OSLIBS})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Make the generated dummy source file depended on all static input
|
||||||
|
# libs. If input lib changes,the source file is touched
|
||||||
|
# which causes the desired effect (relink).
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${SOURCE_FILE}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch ${SOURCE_FILE}
|
||||||
|
DEPENDS ${STATIC_LIBS})
|
||||||
|
|
||||||
|
IF(MSVC)
|
||||||
|
# To merge libs, just pass them to lib.exe command line.
|
||||||
|
SET(LINKER_EXTRA_FLAGS "")
|
||||||
|
FOREACH(LIB ${STATIC_LIBS})
|
||||||
|
SET(LINKER_EXTRA_FLAGS "${LINKER_EXTRA_FLAGS} ${LIB}")
|
||||||
|
ENDFOREACH()
|
||||||
|
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES STATIC_LIBRARY_FLAGS
|
||||||
|
"${LINKER_EXTRA_FLAGS}")
|
||||||
|
ELSE()
|
||||||
|
GET_TARGET_PROPERTY(TARGET_LOCATION ${TARGET} LOCATION)
|
||||||
|
IF(APPLE)
|
||||||
|
# Use OSX's libtool to merge archives (ihandles universal
|
||||||
|
# binaries properly)
|
||||||
|
ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD
|
||||||
|
COMMAND rm ${TARGET_LOCATION}
|
||||||
|
COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION}
|
||||||
|
${STATIC_LIBS}
|
||||||
|
)
|
||||||
|
ELSE()
|
||||||
|
# Generic Unix, Cygwin or MinGW. In post-build step, call
|
||||||
|
# script, that extracts objects from archives with "ar x"
|
||||||
|
# and repacks them with "ar r"
|
||||||
|
SET(TARGET ${TARGET})
|
||||||
|
CONFIGURE_FILE(
|
||||||
|
${MYSQL_CMAKE_SCRIPT_DIR}/merge_archives_unix.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET}.cmake
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD
|
||||||
|
COMMAND rm ${TARGET_LOCATION}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -P
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET}.cmake
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
# Create libs from libs.
|
||||||
|
# Merges static libraries, creates shared libraries out of convenience libraries.
|
||||||
|
# MERGE_LIBRARIES(target [STATIC|SHARED|MODULE]
|
||||||
|
# [linklib1 .... linklibN]
|
||||||
|
# [EXPORTS exported_func1 .... exportedFuncN]
|
||||||
|
# [OUTPUT_NAME output_name]
|
||||||
|
#)
|
||||||
|
MACRO(MERGE_LIBRARIES)
|
||||||
|
CMAKE_PARSE_ARGUMENTS(ARG
|
||||||
|
"EXPORTS;OUTPUT_NAME"
|
||||||
|
"STATIC;SHARED;MODULE;NOINSTALL"
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
LIST(GET ARG_DEFAULT_ARGS 0 TARGET)
|
||||||
|
SET(LIBS ${ARG_DEFAULT_ARGS})
|
||||||
|
LIST(REMOVE_AT LIBS 0)
|
||||||
|
IF(ARG_STATIC)
|
||||||
|
IF (NOT ARG_OUTPUT_NAME)
|
||||||
|
SET(ARG_OUTPUT_NAME ${TARGET})
|
||||||
|
ENDIF()
|
||||||
|
MERGE_STATIC_LIBS(${TARGET} ${ARG_OUTPUT_NAME} "${LIBS}")
|
||||||
|
ELSEIF(ARG_SHARED OR ARG_MODULE)
|
||||||
|
IF(ARG_SHARED)
|
||||||
|
SET(LIBTYPE SHARED)
|
||||||
|
ELSE()
|
||||||
|
SET(LIBTYPE MODULE)
|
||||||
|
ENDIF()
|
||||||
|
# check for non-PIC libraries
|
||||||
|
IF(NOT _SKIP_PIC)
|
||||||
|
FOREACH(LIB ${LIBS})
|
||||||
|
GET_TARGET_PROPERTY(${LIB} TYPE LIBTYPE)
|
||||||
|
IF(LIBTYPE STREQUAL "STATIC_LIBRARY")
|
||||||
|
GET_TARGET_PROPERTY(LIB COMPILE_FLAGS LIB_COMPILE_FLAGS)
|
||||||
|
STRING(REPLACE "${CMAKE_SHARED_LIBRARY_C_FLAGS}"
|
||||||
|
"<PIC_FLAG>" LIB_COMPILE_FLAGS ${LIB_COMPILE_FLAG})
|
||||||
|
IF(NOT LIB_COMPILE_FLAGS MATCHES "<PIC_FLAG>")
|
||||||
|
MESSAGE(FATAL_ERROR
|
||||||
|
"Attempted to link non-PIC static library ${LIB} to shared library ${TARGET}\n"
|
||||||
|
"Please use ADD_CONVENIENCE_LIBRARY, instead of ADD_LIBRARY for ${LIB}"
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
CREATE_EXPORT_FILE(SRC ${TARGET} "${ARG_EXPORTS}")
|
||||||
|
ADD_LIBRARY(${TARGET} ${LIBTYPE} ${SRC})
|
||||||
|
TARGET_LINK_LIBRARIES(${TARGET} ${LIBS})
|
||||||
|
IF(ARG_OUTPUT_NAME)
|
||||||
|
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES OUTPUT_NAME "${ARG_OUTPUT_NAME}")
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(FATAL_ERROR "Unknown library type")
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT ARG_NOINSTALL)
|
||||||
|
MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${INSTALL_LIBDIR}")
|
||||||
|
ENDIF()
|
||||||
|
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_INTERFACE_LIBRARIES "")
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
FUNCTION(GET_DEPENDEND_OS_LIBS target result)
|
||||||
|
SET(deps ${${target}_LIB_DEPENDS})
|
||||||
|
IF(deps)
|
||||||
|
FOREACH(lib ${deps})
|
||||||
|
# Filter out keywords for used for debug vs optimized builds
|
||||||
|
IF(NOT lib MATCHES "general" AND NOT lib MATCHES "debug" AND NOT lib MATCHES "optimized")
|
||||||
|
GET_TARGET_PROPERTY(lib_location ${lib} LOCATION)
|
||||||
|
IF(NOT lib_location)
|
||||||
|
SET(ret ${ret} ${lib})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
SET(${result} ${ret} PARENT_SCOPE)
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
MACRO(RESTRICT_SYMBOL_EXPORTS target)
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
|
||||||
|
CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
|
||||||
|
IF(HAVE_VISIBILITY_HIDDEN)
|
||||||
|
GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS)
|
||||||
|
IF(NOT COMPILE_FLAGS)
|
||||||
|
# Avoid COMPILE_FLAGS-NOTFOUND
|
||||||
|
SET(COMPILE_FLAGS)
|
||||||
|
ENDIF()
|
||||||
|
SET_TARGET_PROPERTIES(${target} PROPERTIES
|
||||||
|
COMPILE_FLAGS "${COMPILE_FLAGS} -fvisibility=hidden")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
184
cmake/make_dist.cmake.in
Normal file
184
cmake/make_dist.cmake.in
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Make source distribution
|
||||||
|
# If bzr is present, run bzr export, add output of BUILD/autorun.sh
|
||||||
|
# if autotools are present, also pack bison output into it.
|
||||||
|
# Otherwise, just run cpack with source configuration.
|
||||||
|
|
||||||
|
SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
|
||||||
|
SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
|
||||||
|
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "@CPACK_SOURCE_PACKAGE_FILE_NAME@")
|
||||||
|
SET(GLIBTOOLIZE_EXECUTABLE "@GLIBTOOLIZE_EXECUTABLE@")
|
||||||
|
SET(LIBTOOLIZE_EXECUTABLE "@LIBTOOLIZE_EXECUTABLE@")
|
||||||
|
SET(ACLOCAL_EXECUTABLE "@ACLOCAL_EXECUTABLE@")
|
||||||
|
SET(AUTOCONF_EXECUTABLE "@AUTOCONF_EXECUTABLE@")
|
||||||
|
SET(AUTOHEADER_EXECUTABLE "@AUTOHEADER_EXECUTABLE@")
|
||||||
|
SET(AUTOMAKE_EXECUTABLE "@AUTOMAKE_EXECUTABLE@")
|
||||||
|
SET(CMAKE_CPACK_COMMAND "@CMAKE_CPACK_COMMAND@")
|
||||||
|
SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
|
||||||
|
SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
|
||||||
|
SET(GTAR_EXECUTABLE "@GTAR_EXECUTABLE@")
|
||||||
|
SET(TAR_EXECUTABLE "@TAR_EXECUTABLE@")
|
||||||
|
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
|
||||||
|
SET(CMAKE_MAKE_PROGRAM "@CMAKE_MAKE_PROGRAM@")
|
||||||
|
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
|
||||||
|
|
||||||
|
SET(MYSQL_DOCS_LOCATION "@MYSQL_DOCS_LOCATION@")
|
||||||
|
|
||||||
|
|
||||||
|
SET(PACKAGE_DIR ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME})
|
||||||
|
|
||||||
|
FILE(REMOVE_RECURSE ${PACKAGE_DIR})
|
||||||
|
FILE(REMOVE ${PACKAGE_DIR}.tar.gz )
|
||||||
|
|
||||||
|
IF(BZR_EXECUTABLE)
|
||||||
|
MESSAGE(STATUS "Running bzr export")
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND "${BZR_EXECUTABLE}" export
|
||||||
|
${PACKAGE_DIR}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
RESULT_VARIABLE RESULT
|
||||||
|
)
|
||||||
|
|
||||||
|
IF(NOT RESULT EQUAL 0)
|
||||||
|
SET(BZR_EXECUTABLE)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT BZR_EXECUTABLE)
|
||||||
|
MESSAGE(STATUS "bzr not found or source dir is not a repo, use CPack")
|
||||||
|
|
||||||
|
IF(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||||
|
# In-source build is the worst option, we have to cleanup source tree.
|
||||||
|
|
||||||
|
# Save bison output first.
|
||||||
|
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
|
||||||
|
${CMAKE_BINARY_DIR}/sql_yacc.cc COPY_ONLY)
|
||||||
|
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h
|
||||||
|
${CMAKE_BINARY_DIR}/sql_yacc.h COPY_ONLY)
|
||||||
|
|
||||||
|
IF(CMAKE_GENERATOR MATCHES "Makefiles")
|
||||||
|
# make clean
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${CMAKE_MAKE_PROGRAM} clean
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Restore bison output
|
||||||
|
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.cc
|
||||||
|
${CMAKE_BINARY_DIR}/sql/sql_yacc.cc COPY_ONLY)
|
||||||
|
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.h
|
||||||
|
${CMAKE_BINARY_DIR}/sql/sql_yacc.h COPY_ONLY)
|
||||||
|
FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.cc)
|
||||||
|
FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.h)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${CMAKE_CPACK_COMMAND} -G TGZ --config ./CPackSourceConfig.cmake
|
||||||
|
${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake
|
||||||
|
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
)
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E tar xzf
|
||||||
|
${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
|
||||||
|
${PACK_SOURCE_PACKAGE_FILE_NAME}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Try to pack output of BUILD/autorun, if autotools are present
|
||||||
|
IF(GLIBTOOLIZE_EXECUTABLE OR LIBTOOLIZE_EXECUTABLE)
|
||||||
|
IF(ACLOCAL_EXECUTABLE AND AUTOMAKE_EXECUTABLE AND AUTOCONF_EXECUTABLE
|
||||||
|
AND AUTOHEADER_EXECUTABLE)
|
||||||
|
SET(HAVE_AUTOTOOLS 1)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(HAVE_AUTOTOOLS)
|
||||||
|
EXECUTE_PROCESS(COMMAND BUILD/autorun.sh
|
||||||
|
WORKING_DIRECTORY ${PACKAGE_DIR})
|
||||||
|
ELSE()
|
||||||
|
MESSAGE( "Autotools not found, resulting source package can only be built"
|
||||||
|
" with cmake")
|
||||||
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/configure.pl
|
||||||
|
${PACKAGE_DIR}/configure
|
||||||
|
COPYONLY)
|
||||||
|
IF(UNIX)
|
||||||
|
EXECUTE_PROCESS(COMMAND chmod +x ${PACKAGE_DIR}/configure)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Copy bison output
|
||||||
|
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h
|
||||||
|
${PACKAGE_DIR}/sql/sql_yacc.h COPYONLY)
|
||||||
|
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
|
||||||
|
${PACKAGE_DIR}/sql/sql_yacc.cc COPYONLY)
|
||||||
|
|
||||||
|
# Add documentation, if user has specified where to find them
|
||||||
|
IF(MYSQL_DOCS_LOCATION)
|
||||||
|
MESSAGE("Copying documentation files from " ${MYSQL_DOCS_LOCATION})
|
||||||
|
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_directory "${MYSQL_DOCS_LOCATION}" "${PACKAGE_DIR}")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# In case we used CPack, it could have copied some
|
||||||
|
# extra files that are not usable on different machines.
|
||||||
|
FILE(REMOVE ${PACKAGE_DIR}/CMakeCache.txt)
|
||||||
|
FILE(REMOVE_RECURSE ${PACKAGE_DIR}/autom4te.cache)
|
||||||
|
|
||||||
|
# When packing source, prefer gnu tar to "cmake -P tar"
|
||||||
|
# cmake does not preserve timestamps.gnuwin32 tar is broken, cygwin is ok
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
IF (EXISTS C:/cygwin/bin/tar.exe)
|
||||||
|
SET(TAR_EXECUTABLE C:/cygwin/bin/tar.exe)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(GTAR_EXECUTABLE)
|
||||||
|
SET(GNUTAR ${GTAR_EXECUTABLE})
|
||||||
|
ELSEIF(TAR_EXECUTABLE)
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND "${TAR_EXECUTABLE}" --version
|
||||||
|
RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUT ERROR_VARIABLE ERR
|
||||||
|
)
|
||||||
|
IF(RESULT EQUAL 0 AND OUT MATCHES "GNU")
|
||||||
|
SET(GNUTAR ${TAR_EXECUTABLE})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET($ENV{GZIP} "--best")
|
||||||
|
|
||||||
|
IF(GNUTAR)
|
||||||
|
SET(PACK_COMMAND
|
||||||
|
${GNUTAR} cfz
|
||||||
|
${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
|
||||||
|
${CPACK_SOURCE_PACKAGE_FILE_NAME}
|
||||||
|
)
|
||||||
|
ELSE()
|
||||||
|
SET(PACK_COMMAND ${CMAKE_COMMAND} -E tar cfz
|
||||||
|
${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz
|
||||||
|
${CPACK_SOURCE_PACKAGE_FILE_NAME}
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Creating source package")
|
||||||
|
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${PACK_COMMAND}
|
||||||
|
)
|
||||||
|
MESSAGE(STATUS "Source package ${PACKAGE_DIR}.tar.gz created")
|
62
cmake/merge_archives_unix.cmake.in
Normal file
62
cmake/merge_archives_unix.cmake.in
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# This script merges many static libraries into
|
||||||
|
# one big library on Unix.
|
||||||
|
SET(TARGET_LOCATION "@TARGET_LOCATION@")
|
||||||
|
SET(TARGET "@TARGET@")
|
||||||
|
SET(STATIC_LIBS "@STATIC_LIBS@")
|
||||||
|
SET(CMAKE_CURRENT_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@")
|
||||||
|
SET(CMAKE_AR "@CMAKE_AR@")
|
||||||
|
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||||
|
|
||||||
|
|
||||||
|
SET(TEMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/merge_archives_${TARGET})
|
||||||
|
MAKE_DIRECTORY(${TEMP_DIR})
|
||||||
|
# Extract each archive to its own subdirectory(avoid object filename clashes)
|
||||||
|
FOREACH(LIB ${STATIC_LIBS})
|
||||||
|
GET_FILENAME_COMPONENT(NAME_NO_EXT ${LIB} NAME_WE)
|
||||||
|
SET(TEMP_SUBDIR ${TEMP_DIR}/${NAME_NO_EXT})
|
||||||
|
MAKE_DIRECTORY(${TEMP_SUBDIR})
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${CMAKE_AR} -x ${LIB}
|
||||||
|
WORKING_DIRECTORY ${TEMP_SUBDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
FILE(GLOB_RECURSE LIB_OBJECTS "${TEMP_SUBDIR}/*")
|
||||||
|
SET(OBJECTS ${OBJECTS} ${LIB_OBJECTS})
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
# Use relative paths, makes command line shorter.
|
||||||
|
GET_FILENAME_COMPONENT(ABS_TEMP_DIR ${TEMP_DIR} ABSOLUTE)
|
||||||
|
FOREACH(OBJ ${OBJECTS})
|
||||||
|
FILE(RELATIVE_PATH OBJ ${ABS_TEMP_DIR} ${OBJ})
|
||||||
|
FILE(TO_NATIVE_PATH ${OBJ} OBJ)
|
||||||
|
SET(ALL_OBJECTS ${ALL_OBJECTS} ${OBJ})
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
FILE(TO_NATIVE_PATH ${TARGET_LOCATION} ${TARGET_LOCATION})
|
||||||
|
# Now pack the objects into library with ar.
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${CMAKE_AR} -r ${TARGET_LOCATION} ${ALL_OBJECTS}
|
||||||
|
WORKING_DIRECTORY ${TEMP_DIR}
|
||||||
|
)
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND ${CMAKE_RANLIB} ${TARGET_LOCATION}
|
||||||
|
WORKING_DIRECTORY ${TEMP_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
FILE(REMOVE_RECURSE ${TEMP_DIR})
|
49
cmake/mysql_add_executable.cmake
Normal file
49
cmake/mysql_add_executable.cmake
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Add executable plus some additional MySQL specific stuff
|
||||||
|
# Usage (same as for standard CMake's ADD_EXECUTABLE)
|
||||||
|
#
|
||||||
|
# MYSQL_ADD_EXECUTABLE(target source1...sourceN)
|
||||||
|
#
|
||||||
|
# MySQL specifics:
|
||||||
|
# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory
|
||||||
|
# On Windows :
|
||||||
|
# - add version resource
|
||||||
|
# - instruct CPack to do autenticode signing if SIGNCODE is set
|
||||||
|
|
||||||
|
INCLUDE(cmake_parse_arguments)
|
||||||
|
|
||||||
|
FUNCTION (MYSQL_ADD_EXECUTABLE)
|
||||||
|
# Pass-through arguments for ADD_EXECUTABLE
|
||||||
|
CMAKE_PARSE_ARGUMENTS(ARG
|
||||||
|
"WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION"
|
||||||
|
""
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
LIST(GET ARG_DEFAULT_ARGS 0 target)
|
||||||
|
LIST(REMOVE_AT ARG_DEFAULT_ARGS 0)
|
||||||
|
|
||||||
|
SET(sources ${ARG_DEFAULT_ARGS})
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
|
||||||
|
# tell CPack where to install
|
||||||
|
IF(NOT ARG_EXCLUDE_FROM_ALL)
|
||||||
|
IF(NOT ARG_DESTINATION)
|
||||||
|
SET(ARG_DESTINATION ${INSTALL_BINDIR})
|
||||||
|
ENDIF()
|
||||||
|
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION})
|
||||||
|
ENDIF()
|
||||||
|
ENDFUNCTION()
|
160
cmake/mysql_version.cmake
Normal file
160
cmake/mysql_version.cmake
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Read value for a variable from configure.in
|
||||||
|
|
||||||
|
MACRO(MYSQL_GET_CONFIG_VALUE keyword var)
|
||||||
|
IF(NOT ${var})
|
||||||
|
IF (EXISTS ${CMAKE_SOURCE_DIR}/configure.in)
|
||||||
|
FILE (STRINGS ${CMAKE_SOURCE_DIR}/configure.in str REGEX "^[ ]*${keyword}=")
|
||||||
|
IF(str)
|
||||||
|
STRING(REPLACE "${keyword}=" "" str ${str})
|
||||||
|
STRING(REGEX REPLACE "[ ].*" "" str ${str})
|
||||||
|
SET(${var} ${str} CACHE INTERNAL "Config variable")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
|
||||||
|
# Read mysql version for configure script
|
||||||
|
|
||||||
|
MACRO(GET_MYSQL_VERSION)
|
||||||
|
|
||||||
|
IF(NOT VERSION_STRING)
|
||||||
|
IF(EXISTS ${CMAKE_SOURCE_DIR}/configure.in)
|
||||||
|
FILE(STRINGS ${CMAKE_SOURCE_DIR}/configure.in str REGEX "AM_INIT_AUTOMAKE")
|
||||||
|
STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][^ \\)]+" VERSION_STRING "${str}")
|
||||||
|
IF(NOT VERSION_STRING)
|
||||||
|
STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION_STRING "${str}")
|
||||||
|
IF(NOT VERSION_STRING)
|
||||||
|
FILE(STRINGS configure.in str REGEX "AC_INIT\\(")
|
||||||
|
STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][a-zAZ0-9]+" VERSION_STRING "${str}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
IF(NOT VERSION_STRING)
|
||||||
|
MESSAGE(FATAL_ERROR
|
||||||
|
"VERSION_STRING cannot be parsed, please specify -DVERSION_STRING=major.minor.patch-extra"
|
||||||
|
"when calling cmake")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(VERSION ${VERSION_STRING})
|
||||||
|
|
||||||
|
# Remove trailing (non-numeric) part of the version string
|
||||||
|
STRING(REGEX REPLACE "[^\\.0-9].*" "" VERSION_STRING ${VERSION_STRING})
|
||||||
|
|
||||||
|
STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" MAJOR_VERSION "${VERSION_STRING}")
|
||||||
|
STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" MINOR_VERSION "${VERSION_STRING}")
|
||||||
|
STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" PATCH "${VERSION_STRING}")
|
||||||
|
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
|
||||||
|
SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}")
|
||||||
|
MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH}")
|
||||||
|
MARK_AS_ADVANCED(VERSION MYSQL_VERSION_ID MYSQL_BASE_VERSION)
|
||||||
|
SET(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
|
||||||
|
SET(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
|
||||||
|
SET(CPACK_PACKAGE_VERSION_PATCH ${PATCH})
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
# Get mysql version and other interesting variables
|
||||||
|
GET_MYSQL_VERSION()
|
||||||
|
|
||||||
|
MYSQL_GET_CONFIG_VALUE("PROTOCOL_VERSION" PROTOCOL_VERSION)
|
||||||
|
MYSQL_GET_CONFIG_VALUE("DOT_FRM_VERSION" DOT_FRM_VERSION)
|
||||||
|
MYSQL_GET_CONFIG_VALUE("MYSQL_TCP_PORT_DEFAULT" MYSQL_TCP_PORT_DEFAULT)
|
||||||
|
MYSQL_GET_CONFIG_VALUE("MYSQL_UNIX_ADDR_DEFAULT" MYSQL_UNIX_ADDR_DEFAULT)
|
||||||
|
MYSQL_GET_CONFIG_VALUE("SHARED_LIB_MAJOR_VERSION" SHARED_LIB_MAJOR_VERSION)
|
||||||
|
IF(NOT MYSQL_TCP_PORT_DEFAULT)
|
||||||
|
SET(MYSQL_TCP_PORT_DEFAULT "3306")
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT MYSQL_TCP_PORT)
|
||||||
|
SET(MYSQL_TCP_PORT ${MYSQL_TCP_PORT_DEFAULT})
|
||||||
|
SET(MYSQL_TCP_PORT_DEFAULT "0")
|
||||||
|
ELSEIF(MYSQL_TCP_PORT EQUAL MYSQL_TCP_PORT_DEFAULT)
|
||||||
|
SET(MYSQL_TCP_PORT_DEFAULT "0")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
IF(NOT MYSQL_UNIX_ADDR)
|
||||||
|
SET(MYSQL_UNIX_ADDR "/tmp/mysql.sock")
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT COMPILATION_COMMENT)
|
||||||
|
SET(COMPILATION_COMMENT "Source distribution")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDE(package_name)
|
||||||
|
IF(NOT CPACK_PACKAGE_FILE_NAME)
|
||||||
|
GET_PACKAGE_FILE_NAME(CPACK_PACKAGE_FILE_NAME)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME)
|
||||||
|
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mysql-${VERSION}")
|
||||||
|
ENDIF()
|
||||||
|
SET(CPACK_PACKAGE_VENDOR "Sun Microsystems, Inc")
|
||||||
|
SET(CPACK_SOURCE_GENERATOR "TGZ")
|
||||||
|
INCLUDE(cpack_source_ignore_files)
|
||||||
|
|
||||||
|
# Defintions for windows version resources
|
||||||
|
SET(PRODUCTNAME "MySQL Server")
|
||||||
|
SET(COMPANYNAME ${CPACK_PACKAGE_VENDOR})
|
||||||
|
|
||||||
|
# Add version information to the exe and dll files
|
||||||
|
# Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
|
||||||
|
# for more info.
|
||||||
|
IF(MSVC)
|
||||||
|
GET_TARGET_PROPERTY(location gen_versioninfo LOCATION)
|
||||||
|
IF(NOT location)
|
||||||
|
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
SET(FILETYPE VFT_APP)
|
||||||
|
CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in
|
||||||
|
${CMAKE_BINARY_DIR}/versioninfo_exe.rc)
|
||||||
|
|
||||||
|
SET(FILETYPE VFT_DLL)
|
||||||
|
CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in
|
||||||
|
${CMAKE_BINARY_DIR}/versioninfo_dll.rc)
|
||||||
|
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${CMAKE_BINARY_DIR}/versioninfo_exe.res
|
||||||
|
${CMAKE_BINARY_DIR}/versioninfo_dll.res
|
||||||
|
COMMAND ${CMAKE_RC_COMPILER} versioninfo_exe.rc
|
||||||
|
COMMAND ${CMAKE_RC_COMPILER} versioninfo_dll.rc
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
)
|
||||||
|
ADD_CUSTOM_TARGET(gen_versioninfo
|
||||||
|
DEPENDS
|
||||||
|
${CMAKE_BINARY_DIR}/versioninfo_exe.res
|
||||||
|
${CMAKE_BINARY_DIR}/versioninfo_dll.res
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FUNCTION(ADD_VERSION_INFO target)
|
||||||
|
GET_TARGET_PROPERTY(target_type ${target} TYPE)
|
||||||
|
ADD_DEPENDENCIES(${target} gen_versioninfo)
|
||||||
|
IF(target_type MATCHES "SHARED" OR target_type MATCHES "MODULE")
|
||||||
|
SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS
|
||||||
|
"\"${CMAKE_BINARY_DIR}/versioninfo_dll.res\"")
|
||||||
|
ELSEIF(target_type MATCHES "EXE")
|
||||||
|
SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS
|
||||||
|
"${target_link_flags} \"${CMAKE_BINARY_DIR}/versioninfo_exe.res\"")
|
||||||
|
ENDIF()
|
||||||
|
ENDFUNCTION()
|
||||||
|
ELSE()
|
||||||
|
FUNCTION(ADD_VERSION_INFO)
|
||||||
|
ENDFUNCTION()
|
||||||
|
ENDIF()
|
33
cmake/os/AIX.cmake
Normal file
33
cmake/os/AIX.cmake
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
|
||||||
|
#Enable 64 bit file offsets
|
||||||
|
SET(_LARGE_FILES 1)
|
||||||
|
|
||||||
|
# Fix xlC oddity - it complains about same inline function defined multiple times
|
||||||
|
# in different compilation units
|
||||||
|
INCLUDE(CheckCXXCompilerFlag)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-qstaticinline" HAVE_QSTATICINLINE)
|
||||||
|
IF(HAVE_QSTATICINLINE)
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qstaticinline")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# The following is required to export all symbols
|
||||||
|
# (also with leading underscore)
|
||||||
|
STRING(REPLACE "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS
|
||||||
|
${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}")
|
||||||
|
STRING(REPLACE "-bexpall" "-bexpfull" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS
|
||||||
|
"${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")
|
17
cmake/os/Cygwin.cmake
Normal file
17
cmake/os/Cygwin.cmake
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Cygwin is not Windows
|
||||||
|
SET(WIN32 0)
|
34
cmake/os/Darwin.cmake
Normal file
34
cmake/os/Darwin.cmake
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# This file includes OSX specific options and quirks, related to system checks
|
||||||
|
|
||||||
|
# Workaround for CMake bug#9051
|
||||||
|
# (CMake does not pass CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET when
|
||||||
|
# running TRY_COMPILE)
|
||||||
|
|
||||||
|
IF(CMAKE_OSX_SYSROOT)
|
||||||
|
SET(ENV{CMAKE_OSX_SYSROOT} ${CMAKE_OSX_SYSROOT})
|
||||||
|
ENDIF()
|
||||||
|
IF(CMAKE_OSX_SYSROOT)
|
||||||
|
SET(ENV{MACOSX_DEPLOYMENT_TARGET} ${OSX_DEPLOYMENT_TARGET})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||||
|
# Workaround linker problems on OSX 10.4
|
||||||
|
IF(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.5")
|
||||||
|
ADD_DEFINITIONS(-fno-common)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
20
cmake/os/FreeBSD.cmake
Normal file
20
cmake/os/FreeBSD.cmake
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# This file includes FreeBSD specific options and quirks, related to system checks
|
||||||
|
#Legacy option, maybe not needed anymore , taken as is from autotools build
|
||||||
|
ADD_DEFINITIONS(-DNET_RETRY_COUNT=1000000)
|
||||||
|
|
47
cmake/os/HP-UX.cmake
Normal file
47
cmake/os/HP-UX.cmake
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
INCLUDE(CheckCXXSourceCompiles)
|
||||||
|
# Enable 64 bit file offsets
|
||||||
|
SET(_LARGEFILE64_SOURCE 1)
|
||||||
|
SET(_FILE_OFFSET_BITS 64)
|
||||||
|
# If Itanium make shared library suffix .so
|
||||||
|
# OS understands both .sl and .so. CMake would
|
||||||
|
# use .sl, however MySQL prefers .so
|
||||||
|
IF(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "9000")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so" CACHE INTERNAL "" FORCE)
|
||||||
|
SET(CMAKE_SHARED_MODULE_SUFFIX ".so" CACHE INTERNAL "" FORCE)
|
||||||
|
ENDIF()
|
||||||
|
IF(CMAKE_SYSTEM MATCHES "11")
|
||||||
|
ADD_DEFINITIONS(-DHPUX11)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_CXX_COMPILER_ID MATCHES "HP")
|
||||||
|
# Enable standard C++ flags if required
|
||||||
|
# HP seems a bit traditional and "new" features like ANSI for-scope
|
||||||
|
# still require special flag to be set
|
||||||
|
CHECK_CXX_SOURCE_COMPILES(
|
||||||
|
"int main()
|
||||||
|
{
|
||||||
|
for(int i=0; i<1; i++);
|
||||||
|
for(int i=0; i<1; i++);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_ANSI_FOR_SCOPE)
|
||||||
|
IF(NOT HAVE_ANSI_FOR_SCOPE)
|
||||||
|
# Enable conformant behavior
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Aa")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
47
cmake/os/Linux.cmake
Normal file
47
cmake/os/Linux.cmake
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# This file includes Linux specific options and quirks, related to system checks
|
||||||
|
|
||||||
|
INCLUDE(CheckSymbolExists)
|
||||||
|
|
||||||
|
# Something that needs to be set on legacy reasons
|
||||||
|
SET(TARGET_OS_LINUX 1)
|
||||||
|
SET(HAVE_NPTL 1)
|
||||||
|
SET(_GNU_SOURCE 1)
|
||||||
|
|
||||||
|
# Fix CMake (< 2.8) flags. -rdynamic exports too many symbols.
|
||||||
|
FOREACH(LANG C CXX)
|
||||||
|
STRING(REPLACE "-rdynamic" ""
|
||||||
|
CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS
|
||||||
|
${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}
|
||||||
|
)
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
# Ensure we have clean build for shared libraries
|
||||||
|
# without unresolved symbols
|
||||||
|
SET(LINK_FLAG_NO_UNDEFINED "--Wl,--no-undefined")
|
||||||
|
|
||||||
|
# 64 bit file offset support flag
|
||||||
|
SET(_FILE_OFFSET_BITS 64)
|
||||||
|
|
||||||
|
# Linux specific HUGETLB /large page support
|
||||||
|
CHECK_SYMBOL_EXISTS(SHM_HUGETLB sys/shm.h HAVE_DECL_SHM_HUGETLB)
|
||||||
|
IF(HAVE_DECL_SHM_HUGETLB)
|
||||||
|
SET(HAVE_LARGE_PAGES 1)
|
||||||
|
SET(HUGETLB_USE_PROC_MEMINFO 1)
|
||||||
|
SET(HAVE_LARGE_PAGE_OPTION 1)
|
||||||
|
ENDIF()
|
17
cmake/os/OS400.cmake
Normal file
17
cmake/os/OS400.cmake
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
GET_FILENAME_COMPONENT(_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
INCLUDE(${_SCRIPT_DIR}/AIX.cmake)
|
96
cmake/os/SunOS.cmake
Normal file
96
cmake/os/SunOS.cmake
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
INCLUDE(CheckSymbolExists)
|
||||||
|
INCLUDE(CheckCSourceRuns)
|
||||||
|
INCLUDE(CheckCSourceCompiles)
|
||||||
|
|
||||||
|
SET(TARGET_OS_SOLARIS 1)
|
||||||
|
# Enable 64 bit file offsets
|
||||||
|
SET(_FILE_OFFSET_BITS 64)
|
||||||
|
|
||||||
|
# Legacy option, without it my_pthread is having problems
|
||||||
|
ADD_DEFINITIONS(-DHAVE_RWLOCK_T)
|
||||||
|
|
||||||
|
# On Solaris, use of intrinsics will screw the lib search logic
|
||||||
|
# Force using -lm, so rint etc are found.
|
||||||
|
SET(LIBM m)
|
||||||
|
|
||||||
|
# CMake defined -lthread as thread flag. This crashes in dlopen
|
||||||
|
# when trying to load plugins workaround with -lpthread
|
||||||
|
SET(CMAKE_THREADS_LIBS_INIT -lpthread CACHE INTERNAL "" FORCE)
|
||||||
|
|
||||||
|
# Solaris specific large page support
|
||||||
|
CHECK_SYMBOL_EXISTS(MHA_MAPSIZE_VA sys/mman.h HAVE_DECL_MHA_MAPSIZE_VA)
|
||||||
|
IF(HAVE_DECL_MHA_MAPSIZE_VA)
|
||||||
|
SET(HAVE_SOLARIS_LARGE_PAGES 1)
|
||||||
|
SET(HAVE_LARGE_PAGE_OPTION 1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
# Solaris atomics
|
||||||
|
CHECK_C_SOURCE_RUNS(
|
||||||
|
"
|
||||||
|
#include <atomic.h>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int foo = -10; int bar = 10;
|
||||||
|
int64_t foo64 = -10; int64_t bar64 = 10;
|
||||||
|
if (atomic_add_int_nv((uint_t *)&foo, bar) || foo)
|
||||||
|
return -1;
|
||||||
|
bar = atomic_swap_uint((uint_t *)&foo, (uint_t)bar);
|
||||||
|
if (bar || foo != 10)
|
||||||
|
return -1;
|
||||||
|
bar = atomic_cas_uint((uint_t *)&bar, (uint_t)foo, 15);
|
||||||
|
if (bar)
|
||||||
|
return -1;
|
||||||
|
if (atomic_add_64_nv((volatile uint64_t *)&foo64, bar64) || foo64)
|
||||||
|
return -1;
|
||||||
|
bar64 = atomic_swap_64((volatile uint64_t *)&foo64, (uint64_t)bar64);
|
||||||
|
if (bar64 || foo64 != 10)
|
||||||
|
return -1;
|
||||||
|
bar64 = atomic_cas_64((volatile uint64_t *)&bar64, (uint_t)foo64, 15);
|
||||||
|
if (bar64)
|
||||||
|
return -1;
|
||||||
|
atomic_or_64((volatile uint64_t *)&bar64, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_SOLARIS_ATOMIC)
|
||||||
|
|
||||||
|
|
||||||
|
# Check is special processor flag needs to be set on older GCC
|
||||||
|
#that defaults to v8 sparc . Code here is taken from my_rdtsc.c
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SIZEOF_VOID_P EQUAL 4
|
||||||
|
AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
|
||||||
|
SET(SOURCE
|
||||||
|
"
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
long high\;
|
||||||
|
long low\;
|
||||||
|
__asm __volatile__ (\"rd %%tick,%1\; srlx %1,32,%0\" : \"=r\" ( high), \"=r\" (low))\;
|
||||||
|
return 0\;
|
||||||
|
} ")
|
||||||
|
CHECK_C_SOURCE_COMPILES(${SOURCE} HAVE_SPARC32_TICK)
|
||||||
|
IF(NOT HAVE_SPARC32_TICK)
|
||||||
|
SET(CMAKE_REQUIRED_FLAGS "-mcpu=v9")
|
||||||
|
CHECK_C_SOURCE_COMPILES(${SOURCE} HAVE_SPARC32_TICK_WITH_V9)
|
||||||
|
SET(CMAKE_REQUIRED_FLAGS)
|
||||||
|
IF(HAVE_SPARC32_TICK_WITH_V9)
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=v9")
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=v9")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
196
cmake/os/Windows.cmake
Normal file
196
cmake/os/Windows.cmake
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# This file includes Windows specific hacks, mostly around compiler flags
|
||||||
|
|
||||||
|
INCLUDE (CheckCSourceCompiles)
|
||||||
|
INCLUDE (CheckCXXSourceCompiles)
|
||||||
|
INCLUDE (CheckStructHasMember)
|
||||||
|
INCLUDE (CheckLibraryExists)
|
||||||
|
INCLUDE (CheckFunctionExists)
|
||||||
|
INCLUDE (CheckCCompilerFlag)
|
||||||
|
INCLUDE (CheckCSourceRuns)
|
||||||
|
INCLUDE (CheckSymbolExists)
|
||||||
|
INCLUDE (CheckTypeSize)
|
||||||
|
|
||||||
|
# Optionally read user configuration, generated by configure.js.
|
||||||
|
# This is left for backward compatibility reasons only.
|
||||||
|
INCLUDE(${CMAKE_BINARY_DIR}/win/configure.data OPTIONAL)
|
||||||
|
|
||||||
|
# avoid running system checks by using pre-cached check results
|
||||||
|
# system checks are expensive on VS since every tiny program is to be compiled in
|
||||||
|
# a VC solution.
|
||||||
|
GET_FILENAME_COMPONENT(_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
INCLUDE(${_SCRIPT_DIR}/WindowsCache.cmake)
|
||||||
|
|
||||||
|
|
||||||
|
# OS display name (version_compile_os etc).
|
||||||
|
# Used by the test suite to ignore bugs on some platforms,
|
||||||
|
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||||
|
SET(SYSTEM_TYPE "Win64")
|
||||||
|
ELSE()
|
||||||
|
SET(SYSTEM_TYPE "Win32")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Intel compiler is almost Visual C++
|
||||||
|
# (same compile flags etc). Set MSVC flag
|
||||||
|
IF(CMAKE_C_COMPILER MATCHES "icl")
|
||||||
|
SET(MSVC TRUE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
|
||||||
|
ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501")
|
||||||
|
# Speed up build process excluding unused header files
|
||||||
|
ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN")
|
||||||
|
|
||||||
|
# Adjust compiler and linker flags
|
||||||
|
IF(MINGW AND CMAKE_SIZEOF_VOIDP EQUAL 4)
|
||||||
|
# mininal architecture flags, i486 enables GCC atomics
|
||||||
|
ADD_DEFINITIONS(-march=i486)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(MSVC)
|
||||||
|
# Enable debug info also in Release build, and create PDB to be able to analyze
|
||||||
|
# crashes
|
||||||
|
FOREACH(lang C CXX)
|
||||||
|
SET(CMAKE_${lang}_FLAGS_RELEASE "${CMAKE_${lang}_FLAGS_RELEASE} /Zi")
|
||||||
|
ENDFOREACH()
|
||||||
|
FOREACH(type EXE SHARED MODULE)
|
||||||
|
SET(CMAKE_{type}_LINKER_FLAGS_RELEASE "${CMAKE_${type}_LINKER_FLAGS_RELEASE} /debug")
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
# Force static runtime libraries
|
||||||
|
FOREACH(flag
|
||||||
|
CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG_INIT
|
||||||
|
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG_INIT)
|
||||||
|
STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
# Remove support for exceptions
|
||||||
|
FOREACH(flag CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_INIT)
|
||||||
|
STRING(REPLACE "/EHsc" "" "${flag}" "${${flag}}")
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
# Fix CMake's predefined huge stack size
|
||||||
|
FOREACH(type EXE SHARED MODULE)
|
||||||
|
STRING(REGEX REPLACE "/STACK:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS "${CMAKE_${type}_LINKER_FLAGS}")
|
||||||
|
STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}")
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
ADD_DEFINITIONS(-DPTHREAD_STACK_MIN=1048576)
|
||||||
|
# Mark 32 bit executables large address aware so they can
|
||||||
|
# use > 2GB address space
|
||||||
|
IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
|
||||||
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Speed up multiprocessor build
|
||||||
|
IF (MSVC_VERSION GREATER 1400)
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
#TODO: update the code and remove the disabled warnings
|
||||||
|
ADD_DEFINITIONS(/wd4800 /wd4805)
|
||||||
|
IF (MSVC_VERSION GREATER 1310)
|
||||||
|
ADD_DEFINITIONS(/wd4996)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||||
|
# _WIN64 is defined by the compiler itself.
|
||||||
|
# Yet, we define it here again to work around a bug with Intellisense
|
||||||
|
# described here: http://tinyurl.com/2cb428.
|
||||||
|
# Syntax highlighting is important for proper debugger functionality.
|
||||||
|
ADD_DEFINITIONS("-D_WIN64")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Always link with socket library
|
||||||
|
LINK_LIBRARIES(ws2_32)
|
||||||
|
# ..also for tests
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES ws2_32)
|
||||||
|
|
||||||
|
# System checks
|
||||||
|
SET(SIGNAL_WITH_VIO_CLOSE 1) # Something that runtime team needs
|
||||||
|
|
||||||
|
# IPv6 constants appeared in Vista SDK first. We need to define them in any case if they are
|
||||||
|
# not in headers, to handle dual mode sockets correctly.
|
||||||
|
CHECK_SYMBOL_EXISTS(IPPROTO_IPV6 "winsock2.h" HAVE_IPPROTO_IPV6)
|
||||||
|
IF(NOT HAVE_IPPROTO_IPV6)
|
||||||
|
SET(HAVE_IPPROTO_IPV6 41)
|
||||||
|
ENDIF()
|
||||||
|
CHECK_SYMBOL_EXISTS(IPV6_V6ONLY "winsock2.h;ws2ipdef.h" HAVE_IPV6_V6ONLY)
|
||||||
|
IF(NOT HAVE_IPV6_V6ONLY)
|
||||||
|
SET(IPV6_V6ONLY 27)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Some standard functions exist there under different
|
||||||
|
# names (e.g popen is _popen or strok_r is _strtok_s)
|
||||||
|
# If a replacement function exists, HAVE_FUNCTION is
|
||||||
|
# defined to 1. CMake variable <function_name> will also
|
||||||
|
# be defined to the replacement name.
|
||||||
|
# So for example, CHECK_FUNCTION_REPLACEMENT(popen _popen)
|
||||||
|
# will define HAVE_POPEN to 1 and set variable named popen
|
||||||
|
# to _popen. If the header template, one needs to have
|
||||||
|
# cmakedefine popen @popen@ which will expand to
|
||||||
|
# define popen _popen after CONFIGURE_FILE
|
||||||
|
|
||||||
|
MACRO(CHECK_FUNCTION_REPLACEMENT function replacement)
|
||||||
|
STRING(TOUPPER ${function} function_upper)
|
||||||
|
CHECK_FUNCTION_EXISTS(${function} HAVE_${function_upper})
|
||||||
|
IF(NOT HAVE_${function_upper})
|
||||||
|
CHECK_FUNCTION_EXISTS(${replacement} HAVE_${replacement})
|
||||||
|
IF(HAVE_${replacement})
|
||||||
|
SET(HAVE_${function_upper} 1 )
|
||||||
|
SET(${function} ${replacement})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
MACRO(CHECK_SYMBOL_REPLACEMENT symbol replacement header)
|
||||||
|
STRING(TOUPPER ${symbol} symbol_upper)
|
||||||
|
CHECK_SYMBOL_EXISTS(${symbol} ${header} HAVE_${symbol_upper})
|
||||||
|
IF(NOT HAVE_${symbol_upper})
|
||||||
|
CHECK_SYMBOL_EXISTS(${replacement} ${header} HAVE_${replacement})
|
||||||
|
IF(HAVE_${replacement})
|
||||||
|
SET(HAVE_${symbol_upper} 1)
|
||||||
|
SET(${symbol} ${replacement})
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
CHECK_SYMBOL_REPLACEMENT(S_IROTH _S_IREAD sys/stat.h)
|
||||||
|
CHECK_SYMBOL_REPLACEMENT(S_IFIFO _S_IFIFO sys/stat.h)
|
||||||
|
CHECK_SYMBOL_REPLACEMENT(SIGQUIT SIGTERM signal.h)
|
||||||
|
CHECK_SYMBOL_REPLACEMENT(SIGPIPE SIGINT signal.h)
|
||||||
|
CHECK_SYMBOL_REPLACEMENT(isnan _isnan float.h)
|
||||||
|
CHECK_SYMBOL_REPLACEMENT(finite _finite float.h)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(popen _popen)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(pclose _pclose)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(access _access)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(strcasecmp _stricmp)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(strncasecmp _strnicmp)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(snprintf _snprintf)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(strtok_r strtok_s)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(strtoll _strtoi64)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(strtoull _strtoui64)
|
||||||
|
CHECK_FUNCTION_REPLACEMENT(vsnprintf _vsnprintf)
|
||||||
|
CHECK_TYPE_SIZE(ssize_t SIZE_OF_SSIZE_T)
|
||||||
|
IF(NOT HAVE_SIZE_OF_SSIZE_T)
|
||||||
|
SET(ssize_t SSIZE_T)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(FN_NO_CASE_SENSE 1)
|
344
cmake/os/WindowsCache.cmake
Normal file
344
cmake/os/WindowsCache.cmake
Normal file
@ -0,0 +1,344 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Avoid system checks on Windows by pre-caching results. Most of the system checks
|
||||||
|
# are not relevant for Windows anyway and it takes lot more time to run them,
|
||||||
|
# since CMake to creates a Visual Studio project for each tiny test.
|
||||||
|
# Note that only we cache values on VC++ only, MinGW would give slightly
|
||||||
|
# different results.
|
||||||
|
|
||||||
|
IF(MSVC)
|
||||||
|
SET(HAVE_ACCESS 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_AIO_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_AIO_READ CACHE INTERNAL "")
|
||||||
|
SET(HAVE_ALARM CACHE INTERNAL "")
|
||||||
|
SET(HAVE_ALLOCA_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_ARPA_INET_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_ASM_MSR_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BACKTRACE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BACKTRACE_SYMBOLS CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BACKTRACE_SYMBOLS_FD CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BCMP CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BFILL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BMOVE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BSD_SIGNALS CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BSEARCH 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BSS_START CACHE INTERNAL "")
|
||||||
|
SET(HAVE_BZERO CACHE INTERNAL "")
|
||||||
|
SET(HAVE_CHOWN CACHE INTERNAL "")
|
||||||
|
SET(HAVE_CLOCK_GETTIME CACHE INTERNAL "")
|
||||||
|
SET(HAVE_COMPRESS CACHE INTERNAL "")
|
||||||
|
SET(HAVE_CRYPT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_CRYPT_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_CUSERID CACHE INTERNAL "")
|
||||||
|
SET(HAVE_CXX_NEW 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_DECL_MADVISE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_DIRECTIO CACHE INTERNAL "")
|
||||||
|
SET(HAVE_DIRENT_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_DLERROR CACHE INTERNAL "")
|
||||||
|
SET(HAVE_DLFCN_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_DLOPEN CACHE INTERNAL "")
|
||||||
|
SET(HAVE_DOPRNT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_EXECINFO_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FCHMOD CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FCNTL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FCNTL_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FCNTL_NONBLOCK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FCONVERT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FDATASYNC CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FENV_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FESETROUND CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FGETLN CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FINITE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FINITE_IN_MATH_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FLOATINGPOINT_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FLOAT_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FLOCKFILE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FNMATCH_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FPSETMASK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FPU_CONTROL_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FSEEKO CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FSYNC CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FTIME 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_FTRUNCATE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETCWD 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETHOSTBYNAME_R CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETHOSTBYNAME_R_RETURN_INT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETHRTIME CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETLINE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETNAMEINFO CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETPAGESIZE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETPASS CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETPASSPHRASE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETPWNAM CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETPWUID CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETRLIMIT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETRUSAGE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETTIMEOFDAY CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GETWD CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GMTIME_R CACHE INTERNAL "")
|
||||||
|
SET(HAVE_GRP_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_IA64INTRIN_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_IEEEFP_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_INDEX CACHE INTERNAL "")
|
||||||
|
SET(HAVE_INITGROUPS CACHE INTERNAL "")
|
||||||
|
SET(HAVE_INTTYPES_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_IPPROTO_IPV6 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_IPV6 TRUE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_IPV6_V6ONLY 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_ISINF CACHE INTERNAL "")
|
||||||
|
SET(HAVE_ISNAN CACHE INTERNAL "")
|
||||||
|
SET(HAVE_ISSETUGID CACHE INTERNAL "")
|
||||||
|
SET(HAVE_LANGINFO_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_LDIV 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_LIMITS_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_LOCALE_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_LOCALTIME_R CACHE INTERNAL "")
|
||||||
|
SET(HAVE_LOG2 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_LONGJMP 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_LRAND48 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_LSTAT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MADVISE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MALLINFO CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MALLOC_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MEMALIGN CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MEMCPY 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MEMMOVE 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MEMORY_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MKSTEMP CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MLOCK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MLOCKALL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MMAP CACHE INTERNAL "")
|
||||||
|
SET(HAVE_MMAP64 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_NETINET_IN6_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_NETINET_IN_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_NL_LANGINFO CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PASE_ENVIRONMENT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PATHS_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PCLOSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PERROR 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_POLL_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_POPEN CACHE INTERNAL "")
|
||||||
|
SET(HAVE_POLL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PORT_CREATE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PORT_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_POSIX_FALLOCATE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_POSIX_SIGNALS CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PREAD CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PRINTSTACK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_ATTR_CREATE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_ATTR_GETSTACKSIZE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_ATTR_SETSCOPE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_ATTR_SETSTACKSIZE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_CONDATTR_CREATE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_CONDATTR_SETCLOCK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_INIT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_KEY_DELETE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_RWLOCK_RDLOCK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_SIGMASK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_THREADMASK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_YIELD_NP CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PTHREAD_YIELD_ZERO_ARG CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PUTENV 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_PWD_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_RDTSCLL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_READDIR_R CACHE INTERNAL "")
|
||||||
|
SET(HAVE_READLINK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_READ_REAL_TIME CACHE INTERNAL "")
|
||||||
|
SET(HAVE_REALPATH CACHE INTERNAL "")
|
||||||
|
SET(HAVE_REGCOMP CACHE INTERNAL "")
|
||||||
|
SET(HAVE_RENAME 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_RE_COMP CACHE INTERNAL "")
|
||||||
|
SET(HAVE_RINT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_RWLOCK_INIT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SCHED_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SCHED_YIELD CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SELECT 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SELECT_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SEMAPHORE_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SETENV CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SETFD CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SETLOCALE 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SHMAT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SHMCTL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SHMDT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SHMGET CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGACTION CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGADDSET CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGEMPTYSET CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGHOLD CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGINT 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGPIPE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGQUIT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGSET CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGTERM 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGTHREADMASK CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIGWAIT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_BOOL FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_CHAR TRUE CACHE INTERNAL "")
|
||||||
|
SET(SIZEOF_CHAR 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_CHARP TRUE CACHE INTERNAL "")
|
||||||
|
SET(SIZEOF_CHARP ${CMAKE_SIZEOF_VOID_P} CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_IN6_ADDR TRUE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_INT TRUE CACHE INTERNAL "")
|
||||||
|
SET(SIZEOF_INT 4 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_INT16 FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_INT32 FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_INT64 FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_INT8 FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_LONG TRUE CACHE INTERNAL "")
|
||||||
|
SET(SIZEOF_LONG 4 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_LONG_LONG TRUE CACHE INTERNAL "")
|
||||||
|
SET(SIZEOF_LONG_LONG 8 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_MODE_T FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_OFF_T TRUE CACHE INTERNAL "")
|
||||||
|
SET(SIZEOF_OFF_T 4 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_SHORT TRUE CACHE INTERNAL "")
|
||||||
|
SET(SIZEOF_SHORT 2 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_SIGSET_T FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_SIZE_T TRUE CACHE INTERNAL "")
|
||||||
|
SET(SIZEOF_SIZE_T ${CMAKE_SIZEOF_VOID_P} CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_SOCKADDR_IN6 TRUE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_SOCKLEN_T FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_UCHAR FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_UINT FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_UINT16 FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_UINT32 FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_UINT64 FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_UINT8 FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_ULONG FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZEOF_U_INT32_T FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SIZE_OF_SSIZE_T FALSE CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SLEEP CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SNPRINTF CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SOCKADDR_STORAGE_SS_FAMILY 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SOLARIS_STYLE_GETHOST CACHE INTERNAL "")
|
||||||
|
SET(STACK_DIRECTION -1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STDARG_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STDDEF_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STDINT_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STDLIB_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STPCPY CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRCASECMP CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRCOLL 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRDUP 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRERROR 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRINGS_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRING_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRLCAT CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRLCPY CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRNCASECMP CACHE INTERNAL "")
|
||||||
|
IF(MSVC_VERSION GREATER 1310)
|
||||||
|
SET(HAVE_STRNLEN 1 CACHE INTERNAL "")
|
||||||
|
ENDIF()
|
||||||
|
SET(HAVE_STRPBRK 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRSEP CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRSIGNAL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRSTR 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRTOK_R CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRTOL 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRTOLL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRTOUL 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_STRTOULL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SVR3_SIGNALS CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYNCH_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYSENT_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_CDEFS_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_DIR_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_ERRLIST CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_FILE_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_FPU_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_IOCTL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_IOCTL_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_IPC_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_MALLOC_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_MMAN_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_PARAM_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_PRCTL_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_PTEM_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_PTE_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_RESOURCE_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_SELECT_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_SHM_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_SOCKET_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_STAT_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_STREAM_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_TERMCAP_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_TIMEB_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_TIMES_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_TIME_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_TYPES_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_UN_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_UTIME_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_VADVISE_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_SYS_WAIT_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TCGETATTR CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TELL 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TEMPNAM 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TERMCAP_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TERMIOS_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TERMIO_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TERM_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_THR_SETCONCURRENCY CACHE INTERNAL "")
|
||||||
|
SET(HAVE_THR_YIELD CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TIME 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TIMES CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TIMESPEC_TS_SEC CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TIME_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_TZNAME 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_UNISTD_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_UTIME_H CACHE INTERNAL "")
|
||||||
|
SET(HAVE_VALLOC CACHE INTERNAL "")
|
||||||
|
SET(HAVE_VARARGS_H 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE_VASPRINTF CACHE INTERNAL "")
|
||||||
|
SET(HAVE_VPRINTF 1 CACHE INTERNAL "")
|
||||||
|
IF(MSVC_VERSION GREATER 1310)
|
||||||
|
SET(HAVE_VSNPRINTF 1 CACHE INTERNAL "")
|
||||||
|
ENDIF()
|
||||||
|
SET(HAVE_WEAK_SYMBOL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_WORDS_BIGENDIAN TRUE CACHE INTERNAL "")
|
||||||
|
SET(WORDS_BIGENDIAN CACHE INTERNAL "")
|
||||||
|
SET(HAVE__S_IFIFO 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__S_IREAD 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__finite 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__isnan 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__pclose 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__popen 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__snprintf 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__stricmp 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__strnicmp 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__strtoi64 1 CACHE INTERNAL "")
|
||||||
|
SET(HAVE__strtoui64 1 CACHE INTERNAL "")
|
||||||
|
IF(MSVC_VERSION GREATER 1310)
|
||||||
|
SET(HAVE_strtok_s 1 CACHE INTERNAL "")
|
||||||
|
ENDIF()
|
||||||
|
SET(STDC_HEADERS CACHE 1 INTERNAL "")
|
||||||
|
SET(STRUCT_DIRENT_HAS_D_INO CACHE INTERNAL "")
|
||||||
|
SET(STRUCT_DIRENT_HAS_D_INO CACHE INTERNAL "")
|
||||||
|
SET(STRUCT_DIRENT_HAS_D_NAMLEN CACHE INTERNAL "")
|
||||||
|
SET(TIME_WITH_SYS_TIME CACHE INTERNAL "")
|
||||||
|
SET(TIOCSTAT_IN_SYS_IOCTL CACHE INTERNAL "")
|
||||||
|
SET(HAVE_S_IROTH CACHE INTERNAL "")
|
||||||
|
SET(HAVE_S_IFIFO CACHE INTERNAL "")
|
||||||
|
SET(QSORT_TYPE_IS_VOID 1 CACHE INTERNAL "")
|
||||||
|
SET(SIGNAL_RETURN_TYPE_IS_VOID 1 CACHE INTERNAL "")
|
||||||
|
SET(C_HAS_inline CACHE INTERNAL "")
|
||||||
|
SET(C_HAS___inline 1 CACHE INTERNAL "")
|
||||||
|
SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "")
|
||||||
|
SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "")
|
||||||
|
ENDIF()
|
125
cmake/package_name.cmake
Normal file
125
cmake/package_name.cmake
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
# Copyright (C) 2010 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Produce meaningful package name for the binary package
|
||||||
|
# The logic is rather involved with special cases for different OSes
|
||||||
|
MACRO(GET_PACKAGE_FILE_NAME Var)
|
||||||
|
IF(NOT VERSION)
|
||||||
|
MESSAGE(FATAL_ERROR
|
||||||
|
"Variable VERSION needs to be set prior to calling GET_PACKAGE_FILE_NAME")
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT SYSTEM_NAME_AND_PROCESSOR)
|
||||||
|
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 1)
|
||||||
|
SET(DEFAULT_PLATFORM ${CMAKE_SYSTEM_NAME})
|
||||||
|
SET(DEFAULT_MACHINE ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
|
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
SET(64BIT 1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 0)
|
||||||
|
SET(DEFAULT_PLATFORM "win")
|
||||||
|
IF(64BIT)
|
||||||
|
SET(DEFAULT_MACHINE "x64")
|
||||||
|
ELSE()
|
||||||
|
SET(DEFAULT_MACHINE "32")
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
IF(NOT 64BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||||
|
SET(DEFAULT_MACHINE "i686")
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||||
|
# SunOS 5.10=> solaris10
|
||||||
|
STRING(REPLACE "5." "" VER "${CMAKE_SYSTEM_VERSION}")
|
||||||
|
SET(DEFAULT_PLATFORM "solaris${VER}")
|
||||||
|
IF(64BIT)
|
||||||
|
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
|
||||||
|
SET(DEFAULT_MACHINE "x86_64")
|
||||||
|
ELSE()
|
||||||
|
SET(DEFAULT_MACHINE "${CMAKE_SYSTEM_PROCESSOR}-64bit")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
|
||||||
|
STRING(REPLACE "B." "" VER "${CMAKE_SYSTEM_VERSION}")
|
||||||
|
SET(DEFAULT_PLATFORM "hpux${VER}")
|
||||||
|
IF(64BIT)
|
||||||
|
SET(DEFAULT_MACHINE "${CMAKE_SYSTEM_PROCESSOR}-64bit")
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "AIX")
|
||||||
|
SET(DEFAULT_PLATFORM "${CMAKE_SYSTEM_NAME}5.${CMAKE_SYSTEM_VERSION}")
|
||||||
|
IF(64BIT)
|
||||||
|
SET(DEFAULT_MACHINE "${CMAKE_SYSTEM_PROCESSOR}-64bit")
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||||
|
STRING(REGEX MATCH "[0-9]+\\.[0-9]+" VER "${CMAKE_SYSTEM_VERSION}")
|
||||||
|
SET(DEFAULT_PLATFORM "${CMAKE_SYSTEM_NAME}${VER}")
|
||||||
|
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64")
|
||||||
|
SET(DEFAULT_MACHINE "x86_64")
|
||||||
|
IF(NOT 64BIT)
|
||||||
|
SET(DEFAULT_MACHINE "i386")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
IF(CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||||
|
SET(DEFAULT_PLATFORM "osx${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
|
ELSE()
|
||||||
|
SET(VER "${CMAKE_SYSTEM_VERSION}")
|
||||||
|
STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VER "${VER}")
|
||||||
|
# Subtract 4 from Darwin version to get correct osx10.X
|
||||||
|
MATH(EXPR VER "${VER} -4")
|
||||||
|
SET(DEFAULT_PLATFORM "osx10.${VER}")
|
||||||
|
ENDIF()
|
||||||
|
LIST(LENGTH CMAKE_OSX_ARCHITECTURES LEN)
|
||||||
|
IF(LEN GREATER 1)
|
||||||
|
SET(DEFAULT_MACHINE "universal")
|
||||||
|
ELSE()
|
||||||
|
SET(DEFAULT_MACHINE "${CMAKE_OSX_ARCHITECTURES}")
|
||||||
|
ENDIF()
|
||||||
|
IF(DEFAULT_MACHINE MATCHES "i386")
|
||||||
|
SET(DEFAULT_MACHINE "x86")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT PLATFORM)
|
||||||
|
SET(PLATFORM ${DEFAULT_PLATFORM})
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT MACHINE)
|
||||||
|
SET(MACHINE ${DEFAULT_MACHINE})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE)
|
||||||
|
SET(SYSTEM_NAME_AND_PROCESSOR "${PLATFORM}-${MACHINE}")
|
||||||
|
ELSE()
|
||||||
|
SET(SYSTEM_NAME_AND_PROCESSOR "${PLATFORM}${MACHINE}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(SHORT_PRODUCT_TAG)
|
||||||
|
SET(PRODUCT_TAG "-${SHORT_PRODUCT_TAG}")
|
||||||
|
ELSEIF(MYSQL_SERVER_SUFFIX)
|
||||||
|
SET(PRODUCT_TAG "${MYSQL_SERVER_SUFFIX}") # Already has a leading dash
|
||||||
|
ELSE()
|
||||||
|
SET(PRODUCT_TAG)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(package_name "mysql${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}")
|
||||||
|
|
||||||
|
# Sometimes package suffix is added (something like "-icc-glibc23")
|
||||||
|
IF(PACKAGE_SUFFIX)
|
||||||
|
SET(package_name "${package_name}${PACKAGE_SUFFIX}")
|
||||||
|
ENDIF()
|
||||||
|
STRING(TOLOWER ${package_name} package_name)
|
||||||
|
SET(${Var} ${package_name})
|
||||||
|
ENDMACRO()
|
186
cmake/plugin.cmake
Normal file
186
cmake/plugin.cmake
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
|
||||||
|
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
|
||||||
|
|
||||||
|
# MYSQL_ADD_PLUGIN(plugin_name source1...sourceN
|
||||||
|
# [STORAGE_ENGINE]
|
||||||
|
# [MANDATORY|DEFAULT]
|
||||||
|
# [STATIC_ONLY|DYNAMIC_ONLY]
|
||||||
|
# [MODULE_OUTPUT_NAME module_name]
|
||||||
|
# [STATIC_OUTPUT_NAME static_name]
|
||||||
|
# [RECOMPILE_FOR_EMBEDDED]
|
||||||
|
# [LINK_LIBRARIES lib1...libN]
|
||||||
|
# [DEPENDENCIES target1...targetN]
|
||||||
|
|
||||||
|
MACRO(MYSQL_ADD_PLUGIN)
|
||||||
|
CMAKE_PARSE_ARGUMENTS(ARG
|
||||||
|
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
|
||||||
|
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED"
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add common include directories
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
||||||
|
${CMAKE_SOURCE_DIR}/sql
|
||||||
|
${CMAKE_SOURCE_DIR}/regex
|
||||||
|
${SSL_INCLUDE_DIRS}
|
||||||
|
${ZLIB_INCLUDE_DIR})
|
||||||
|
|
||||||
|
LIST(GET ARG_DEFAULT_ARGS 0 plugin)
|
||||||
|
SET(SOURCES ${ARG_DEFAULT_ARGS})
|
||||||
|
LIST(REMOVE_AT SOURCES 0)
|
||||||
|
STRING(TOUPPER ${plugin} plugin)
|
||||||
|
STRING(TOLOWER ${plugin} target)
|
||||||
|
|
||||||
|
# Figure out whether to build plugin
|
||||||
|
IF(WITH_PLUGIN_${plugin})
|
||||||
|
SET(WITH_${plugin} 1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_${plugin}_STORAGE_ENGINE
|
||||||
|
OR WITH_{$plugin}
|
||||||
|
OR WITH_ALL
|
||||||
|
OR WITH_MAX
|
||||||
|
OR ARG_DEFAULT
|
||||||
|
AND NOT WITHOUT_${plugin}_STORAGE_ENGINE
|
||||||
|
AND NOT WITHOUT_${plugin}
|
||||||
|
AND NOT ARG_MODULE_ONLY)
|
||||||
|
|
||||||
|
SET(WITH_${plugin} 1)
|
||||||
|
ELSEIF(WITHOUT_${plugin}_STORAGE_ENGINE OR WITH_NONE OR ${plugin}_DISABLED)
|
||||||
|
SET(WITHOUT_${plugin} 1)
|
||||||
|
SET(WITH_${plugin}_STORAGE_ENGINE 0)
|
||||||
|
SET(WITH_${plugin} 0)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
IF(ARG_MANDATORY)
|
||||||
|
SET(WITH_${plugin} 1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
IF(ARG_STORAGE_ENGINE)
|
||||||
|
SET(with_var "WITH_${plugin}_STORAGE_ENGINE" )
|
||||||
|
ELSE()
|
||||||
|
SET(with_var "WITH_${plugin}")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT ARG_DEPENDENCIES)
|
||||||
|
SET(ARG_DEPENDENCIES)
|
||||||
|
ENDIF()
|
||||||
|
# Build either static library or module
|
||||||
|
IF (WITH_${plugin} AND NOT ARG_MODULE_ONLY)
|
||||||
|
ADD_LIBRARY(${target} STATIC ${SOURCES})
|
||||||
|
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITONS "MYSQL_SERVER")
|
||||||
|
DTRACE_INSTRUMENT(${target})
|
||||||
|
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
|
||||||
|
IF(WITH_EMBEDDED_SERVER)
|
||||||
|
# Embedded library should contain PIC code and be linkable
|
||||||
|
# to shared libraries (on systems that need PIC)
|
||||||
|
IF(ARG_RECOMPILE_FOR_EMBEDDED OR NOT _SKIP_PIC)
|
||||||
|
# Recompile some plugins for embedded
|
||||||
|
ADD_CONVENIENCE_LIBRARY(${target}_embedded ${SOURCES})
|
||||||
|
DTRACE_INSTRUMENT(${target}_embedded)
|
||||||
|
IF(ARG_RECOMPILE_FOR_EMBEDDED)
|
||||||
|
SET_TARGET_PROPERTIES(${target}_embedded
|
||||||
|
PROPERTIES COMPILE_DEFINITIONS "MYSQL_SERVER;EMBEDDED_LIBRARY")
|
||||||
|
ENDIF()
|
||||||
|
ADD_DEPENDENCIES(${target}_embedded GenError)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(ARG_STATIC_OUTPUT_NAME)
|
||||||
|
SET_TARGET_PROPERTIES(${target} PROPERTIES
|
||||||
|
OUTPUT_NAME ${ARG_STATIC_OUTPUT_NAME})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Update mysqld dependencies
|
||||||
|
SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS}
|
||||||
|
${target} CACHE INTERNAL "" FORCE)
|
||||||
|
|
||||||
|
IF(ARG_MANDATORY)
|
||||||
|
SET(${with_var} ON CACHE INTERNAL "Link ${plugin} statically to the server"
|
||||||
|
FORCE)
|
||||||
|
ELSE()
|
||||||
|
SET(${with_var} ON CACHE BOOL "Link ${plugin} statically to the server"
|
||||||
|
FORCE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(ARG_MANDATORY)
|
||||||
|
SET (mysql_mandatory_plugins
|
||||||
|
"${mysql_mandatory_plugins} builtin_${target}_plugin,"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
ELSE()
|
||||||
|
SET (mysql_optional_plugins
|
||||||
|
"${mysql_optional_plugins} builtin_${target}_plugin,"
|
||||||
|
PARENT_SCOPE)
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(NOT WITHOUT_${plugin} AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS)
|
||||||
|
IF(NOT ARG_MODULE_OUTPUT_NAME)
|
||||||
|
IF(ARG_STORAGE_ENGINE)
|
||||||
|
SET(ARG_MODULE_OUTPUT_NAME "ha_${target}")
|
||||||
|
ELSE()
|
||||||
|
SET(ARG_MODULE_OUTPUT_NAME "${target}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ADD_LIBRARY(${target} MODULE ${SOURCES})
|
||||||
|
DTRACE_INSTRUMENT(${target})
|
||||||
|
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX ""
|
||||||
|
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
|
||||||
|
IF(ARG_LINK_LIBRARIES)
|
||||||
|
TARGET_LINK_LIBRARIES (${target} ${ARG_LINK_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
TARGET_LINK_LIBRARIES (${target} mysqlservices)
|
||||||
|
|
||||||
|
# Plugin uses symbols defined in mysqld executable.
|
||||||
|
# Some operating systems like Windows and OSX and are pretty strict about
|
||||||
|
# unresolved symbols. Others are less strict and allow unresolved symbols
|
||||||
|
# in shared libraries. On Linux for example, CMake does not even add
|
||||||
|
# executable to the linker command line (it would result into link error).
|
||||||
|
# Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate
|
||||||
|
# an additional dependency.
|
||||||
|
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
TARGET_LINK_LIBRARIES (${target} mysqld ${ARG_LINK_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
|
||||||
|
|
||||||
|
IF(NOT ARG_MODULE_ONLY)
|
||||||
|
# set cached variable, e.g with checkbox in GUI
|
||||||
|
SET(${with_var} OFF CACHE BOOL "Link ${plugin} statically to the server"
|
||||||
|
FORCE)
|
||||||
|
ENDIF()
|
||||||
|
SET_TARGET_PROPERTIES(${target} PROPERTIES
|
||||||
|
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
|
||||||
|
# Install dynamic library
|
||||||
|
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR})
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
|
||||||
|
# Add all CMake projects under storage and plugin
|
||||||
|
# subdirectories, configure sql_builtins.cc
|
||||||
|
MACRO(CONFIGURE_PLUGINS)
|
||||||
|
FILE(GLOB dirs_storage ${CMAKE_SOURCE_DIR}/storage/*)
|
||||||
|
FILE(GLOB dirs_plugin ${CMAKE_SOURCE_DIR}/plugin/*)
|
||||||
|
FOREACH(dir ${dirs_storage} ${dirs_plugin})
|
||||||
|
IF (EXISTS ${dir}/CMakeLists.txt)
|
||||||
|
ADD_SUBDIRECTORY(${dir})
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDMACRO()
|
229
cmake/readline.cmake
Normal file
229
cmake/readline.cmake
Normal file
@ -0,0 +1,229 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
MACRO (MYSQL_CHECK_MULTIBYTE)
|
||||||
|
CHECK_INCLUDE_FILE(wctype.h HAVE_WCTYPE_H)
|
||||||
|
CHECK_INCLUDE_FILE(wchar.h HAVE_WCHAR_H)
|
||||||
|
IF(HAVE_WCHAR_H)
|
||||||
|
SET(CMAKE_EXTRA_INCLUDE_FILES wchar.h)
|
||||||
|
CHECK_TYPE_SIZE(mbstate_t SIZEOF_MBSTATE_T)
|
||||||
|
SET(CMAKE_EXTRA_INCLUDE_FILES)
|
||||||
|
IF(SIZEOF_MBSTATE_T)
|
||||||
|
SET(HAVE_MBSTATE_T 1)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
CHECK_C_SOURCE_COMPILES("
|
||||||
|
#include <langinfo.h>
|
||||||
|
int main(int ac, char **av)
|
||||||
|
{
|
||||||
|
char *cs = nl_langinfo(CODESET);
|
||||||
|
return 0;
|
||||||
|
}"
|
||||||
|
HAVE_LANGINFO_CODESET)
|
||||||
|
|
||||||
|
CHECK_FUNCTION_EXISTS(mbrlen HAVE_MBRLEN)
|
||||||
|
CHECK_FUNCTION_EXISTS(mbscmp HAVE_MBSCMP)
|
||||||
|
CHECK_FUNCTION_EXISTS(mbsrtowcs HAVE_MBSRTOWCS)
|
||||||
|
CHECK_FUNCTION_EXISTS(wcrtomb HAVE_WCRTOMB)
|
||||||
|
CHECK_FUNCTION_EXISTS(mbrtowc HAVE_MBRTOWC)
|
||||||
|
CHECK_FUNCTION_EXISTS(wcscoll HAVE_WCSCOLL)
|
||||||
|
CHECK_FUNCTION_EXISTS(wcsdup HAVE_WCSDUP)
|
||||||
|
CHECK_FUNCTION_EXISTS(wcwidth HAVE_WCWIDTH)
|
||||||
|
CHECK_FUNCTION_EXISTS(wctype HAVE_WCTYPE)
|
||||||
|
CHECK_FUNCTION_EXISTS(iswlower HAVE_ISWLOWER)
|
||||||
|
CHECK_FUNCTION_EXISTS(iswupper HAVE_ISWUPPER)
|
||||||
|
CHECK_FUNCTION_EXISTS(towlower HAVE_TOWLOWER)
|
||||||
|
CHECK_FUNCTION_EXISTS(towupper HAVE_TOWUPPER)
|
||||||
|
CHECK_FUNCTION_EXISTS(iswctype HAVE_ISWCTYPE)
|
||||||
|
|
||||||
|
SET(CMAKE_EXTRA_INCLUDE_FILES wchar.h)
|
||||||
|
CHECK_TYPE_SIZE(wchar_t SIZEOF_WCHAR_T)
|
||||||
|
IF(SIZEOF_WCHAR_T)
|
||||||
|
SET(HAVE_WCHAR_T 1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(CMAKE_EXTRA_INCLUDE_FILES wctype.h)
|
||||||
|
CHECK_TYPE_SIZE(wctype_t SIZEOF_WCTYPE_T)
|
||||||
|
IF(SIZEOF_WCTYPE_T)
|
||||||
|
SET(HAVE_WCTYPE_T 1)
|
||||||
|
ENDIF()
|
||||||
|
CHECK_TYPE_SIZE(wint_t SIZEOF_WINT_T)
|
||||||
|
IF(SIZEOF_WINT_T)
|
||||||
|
SET(HAVE_WINT_T 1)
|
||||||
|
ENDIF()
|
||||||
|
SET(CMAKE_EXTRA_INCLUDE_FILES)
|
||||||
|
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO (FIND_CURSES)
|
||||||
|
FIND_PACKAGE(Curses)
|
||||||
|
MARK_AS_ADVANCED(CURSES_CURSES_H_PATH CURSES_FORM_LIBRARY CURSES_HAVE_CURSES_H)
|
||||||
|
IF(NOT CURSES_FOUND)
|
||||||
|
SET(ERRORMSG "Curses library not found. Please install appropriate package,
|
||||||
|
remove CMakeCache.txt and rerun cmake.")
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
SET(ERRORMSG ${ERRORMSG}
|
||||||
|
"On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates "
|
||||||
|
"it is ncurses-devel.")
|
||||||
|
ENDIF()
|
||||||
|
MESSAGE(FATAL_ERROR ${ERRORMSG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CURSES_HAVE_CURSES_H)
|
||||||
|
SET(HAVE_CURSES_H 1 CACHE INTERNAL "")
|
||||||
|
ELSEIF(CURSES_HAVE_NCURSES_H)
|
||||||
|
SET(HAVE_NCURSES_H 1 CACHE INTERNAL "")
|
||||||
|
ENDIF()
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "HP")
|
||||||
|
# CMake uses full path to library /lib/libcurses.sl
|
||||||
|
# On Itanium, it results into architecture mismatch+
|
||||||
|
# the library is for PA-RISC
|
||||||
|
SET(CURSES_LIBRARY "curses" CACHE INTERNAL "" FORCE)
|
||||||
|
SET(CURSES_CURSES_LIBRARY "curses" CACHE INTERNAL "" FORCE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
# -Wl,--as-needed breaks linking with -lcurses, e.g on Fedora
|
||||||
|
# Lower-level libcurses calls are exposed by libtinfo
|
||||||
|
CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} tputs "" HAVE_TPUTS_IN_CURSES)
|
||||||
|
IF(NOT HAVE_TPUTS_IN_CURSES)
|
||||||
|
CHECK_LIBRARY_EXISTS(tinfo tputs "" HAVE_TPUTS_IN_TINFO)
|
||||||
|
IF(HAVE_TPUTS_IN_TINFO)
|
||||||
|
SET(CURSES_LIBRARY tinfo)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO (MYSQL_USE_BUNDLED_READLINE)
|
||||||
|
SET(USE_NEW_READLINE_INTERFACE 1)
|
||||||
|
SET(HAVE_HIST_ENTRY)
|
||||||
|
SET(USE_LIBEDIT_INTERFACE)
|
||||||
|
SET(READLINE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/cmd-line-utils)
|
||||||
|
SET(READLINE_LIBRARY readline)
|
||||||
|
FIND_CURSES()
|
||||||
|
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/cmd-line-utils/readline)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO (MYSQL_USE_BUNDLED_LIBEDIT)
|
||||||
|
SET(USE_LIBEDIT_INTERFACE 1)
|
||||||
|
SET(HAVE_HIST_ENTRY 1)
|
||||||
|
SET(READLINE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/cmd-line-utils/libedit)
|
||||||
|
SET(READLINE_LIBRARY edit)
|
||||||
|
FIND_CURSES()
|
||||||
|
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/cmd-line-utils/libedit)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
|
||||||
|
MACRO (MYSQL_FIND_SYSTEM_READLINE name)
|
||||||
|
|
||||||
|
FIND_PATH(${name}_INCLUDE_DIR readline/readline.h )
|
||||||
|
FIND_LIBRARY(${name}_LIBRARY NAMES ${name})
|
||||||
|
MARK_AS_ADVANCED(${name}_INCLUDE_DIR ${name}_LIBRARY)
|
||||||
|
|
||||||
|
INCLUDE(CheckCXXSourceCompiles)
|
||||||
|
SET(CMAKE_REQUIRES_LIBRARIES ${${name}_LIBRARY})
|
||||||
|
|
||||||
|
IF(${name}_LIBRARY AND ${name}_INCLUDE_DIR)
|
||||||
|
SET(SYSTEM_READLINE_FOUND 1)
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES ${${name}_LIBRARY})
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <readline/readline.h>
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
HIST_ENTRY entry;
|
||||||
|
return 0;
|
||||||
|
}"
|
||||||
|
${name}_HAVE_HIST_ENTRY)
|
||||||
|
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <readline/readline.h>
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
char res= *(*rl_completion_entry_function)(0,0);
|
||||||
|
completion_matches(0,0);
|
||||||
|
}"
|
||||||
|
${name}_USE_LIBEDIT_INTERFACE)
|
||||||
|
|
||||||
|
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <readline/readline.h>
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
rl_completion_func_t *func1= (rl_completion_func_t*)0;
|
||||||
|
rl_compentry_func_t *func2= (rl_compentry_func_t*)0;
|
||||||
|
}"
|
||||||
|
${name}_USE_NEW_READLINE_INTERFACE)
|
||||||
|
|
||||||
|
IF(${name}_USE_LIBEDIT_INTERFACE OR ${name}_USE_NEW_READLINE_INTERFACE)
|
||||||
|
SET(READLINE_LIBRARY ${${name}_LIBRARY})
|
||||||
|
SET(READLINE_INCLUDE_DIR ${${name}_INCLUDE_DIR})
|
||||||
|
SET(HAVE_HIST_ENTRY ${${name}_HAVE_HIST_ENTRY})
|
||||||
|
SET(USE_LIBEDIT_INTERFACE ${${name}_USE_LIBEDIT_INTERFACE})
|
||||||
|
SET(USE_NEW_READLINE_INTERFACE ${${name}_USE_NEW_READLINE_INTERFACE})
|
||||||
|
SET(READLINE_FOUND 1)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
|
||||||
|
MACRO (MYSQL_CHECK_READLINE)
|
||||||
|
IF (NOT WIN32)
|
||||||
|
MYSQL_CHECK_MULTIBYTE()
|
||||||
|
IF(NOT CYGWIN)
|
||||||
|
SET(WITH_LIBEDIT ON CACHE BOOL "Use bundled libedit")
|
||||||
|
SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline")
|
||||||
|
ELSE()
|
||||||
|
# Bundled libedit does not compile on cygwin, only readline
|
||||||
|
SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Handle mutual exclusion of WITH_READLINE/WITH_LIBEDIT variables
|
||||||
|
# We save current setting to recognize when user switched between
|
||||||
|
# WITH_READLINE and WITH_LIBEDIT
|
||||||
|
IF(WITH_READLINE)
|
||||||
|
IF(NOT SAVE_READLINE_SETTING OR SAVE_READLINE_SETTING MATCHES
|
||||||
|
"WITH_LIBEDIT")
|
||||||
|
SET(WITH_LIBEDIT OFF CACHE BOOL "Use bundled libedit" FORCE)
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(WITH_LIBEDIT)
|
||||||
|
IF(NOT SAVE_READLINE_SETTING OR SAVE_READLINE_SETTING MATCHES
|
||||||
|
"WITH_READLINE")
|
||||||
|
SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline" FORCE)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_READLINE)
|
||||||
|
MYSQL_USE_BUNDLED_READLINE()
|
||||||
|
SET(SAVE_READLINE_SETTING WITH_READLINE CACHE INTERNAL "" FORCE)
|
||||||
|
ELSEIF(WITH_LIBEDIT)
|
||||||
|
MYSQL_USE_BUNDLED_LIBEDIT()
|
||||||
|
SET(SAVE_READLINE_SETTING WITH_LIBEDIT CACHE INTERNAL "" FORCE)
|
||||||
|
ELSE()
|
||||||
|
MYSQL_FIND_SYSTEM_READLINE(readline)
|
||||||
|
IF(NOT READLINE_FOUND)
|
||||||
|
MYSQL_FIND_SYSTEM_READLINE(edit)
|
||||||
|
IF(NOT READLINE_FOUND)
|
||||||
|
MESSAGE(FATAL_ERROR "Cannot find system readline or libedit libraries.Use WITH_READLINE or WITH_LIBEDIT")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF(NOT WIN32)
|
||||||
|
ENDMACRO()
|
||||||
|
|
90
cmake/ssl.cmake
Normal file
90
cmake/ssl.cmake
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
MACRO (CHANGE_SSL_SETTINGS string)
|
||||||
|
SET(WITH_SSL ${string} CACHE STRING "Options are : no, bundled, yes (prefer os library if present otherwise use bundled), system (use os library)" FORCE)
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
MACRO (MYSQL_USE_BUNDLED_SSL)
|
||||||
|
SET(INC_DIRS
|
||||||
|
${CMAKE_SOURCE_DIR}/extra/yassl/include
|
||||||
|
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include
|
||||||
|
)
|
||||||
|
SET(SSL_LIBRARIES yassl taocrypt)
|
||||||
|
SET(SSL_INCLUDE_DIRS ${INC_DIRS})
|
||||||
|
SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
|
||||||
|
SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL")
|
||||||
|
CHANGE_SSL_SETTINGS("bundled")
|
||||||
|
#Remove -fno-implicit-templates
|
||||||
|
#(yassl sources cannot be compiled with it)
|
||||||
|
SET(SAVE_CXX_FLAGS ${CXX_FLAGS})
|
||||||
|
IF(CMAKE_CXX_FLAGS)
|
||||||
|
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS
|
||||||
|
${CMAKE_CXX_FLAGS})
|
||||||
|
ENDIF()
|
||||||
|
ADD_SUBDIRECTORY(extra/yassl)
|
||||||
|
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
|
||||||
|
SET(CXX_FLAGS ${SAVE_CXX_FLAGS})
|
||||||
|
GET_TARGET_PROPERTY(src yassl SOURCES)
|
||||||
|
FOREACH(file ${src})
|
||||||
|
SET(SSL_SOURCES ${SSL_SOURCES} ${CMAKE_SOURCE_DIR}/extra/yassl/${file})
|
||||||
|
ENDFOREACH()
|
||||||
|
GET_TARGET_PROPERTY(src taocrypt SOURCES)
|
||||||
|
FOREACH(file ${src})
|
||||||
|
SET(SSL_SOURCES ${SSL_SOURCES} ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/${file})
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
# MYSQL_CHECK_SSL
|
||||||
|
#
|
||||||
|
# Provides the following configure options:
|
||||||
|
# WITH_SSL=[yes|no|bundled]
|
||||||
|
MACRO (MYSQL_CHECK_SSL)
|
||||||
|
IF(NOT WITH_SSL)
|
||||||
|
IF(WIN32)
|
||||||
|
CHANGE_SSL_SETTINGS("bundled")
|
||||||
|
ELSE()
|
||||||
|
CHANGE_SSL_SETTINGS("no")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_SSL STREQUAL "bundled")
|
||||||
|
MYSQL_USE_BUNDLED_SSL()
|
||||||
|
ELSEIF(WITH_SSL STREQUAL "system" OR WITH_SSL STREQUAL "yes")
|
||||||
|
# Check for system library
|
||||||
|
SET(OPENSSL_FIND_QUIETLY TRUE)
|
||||||
|
INCLUDE(FindOpenSSL)
|
||||||
|
FIND_LIBRARY(CRYPTO_LIBRARY crypto)
|
||||||
|
MARK_AS_ADVANCED(CRYPTO_LIBRARY)
|
||||||
|
INCLUDE(CheckSymbolExists)
|
||||||
|
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
|
||||||
|
HAVE_SHA512_DIGEST_LENGTH)
|
||||||
|
IF(OPENSSL_FOUND AND CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
|
||||||
|
SET(SSL_SOURCES "")
|
||||||
|
SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY})
|
||||||
|
SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||||
|
SET(SSL_INTERNAL_INCLUDE_DIRS "")
|
||||||
|
SET(SSL_DEFINES "-DHAVE_OPENSSL")
|
||||||
|
CHANGE_SSL_SETTINGS("system")
|
||||||
|
ELSE()
|
||||||
|
IF(WITH_SSL STREQUAL "system")
|
||||||
|
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
|
||||||
|
ENDIF()
|
||||||
|
MYSQL_USE_BUNDLED_SSL()
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(NOT WITH_SSL STREQUAL "no")
|
||||||
|
MESSAGE(SEND_ERROR "Wrong option for WITH_SSL. Valid values are : yes, no, bundled")
|
||||||
|
ENDIF()
|
||||||
|
ENDMACRO()
|
31
cmake/stack_direction.c
Normal file
31
cmake/stack_direction.c
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/* Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
|
||||||
|
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-1301 USA */
|
||||||
|
|
||||||
|
/* Check stack direction (0-down, 1-up) */
|
||||||
|
int f(int *a)
|
||||||
|
{
|
||||||
|
int b;
|
||||||
|
return(&b > a)?1:0;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
Prevent compiler optimizations by calling function
|
||||||
|
through pointer.
|
||||||
|
*/
|
||||||
|
volatile int (*ptr_f)(int *) = f;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int a;
|
||||||
|
return ptr_f(&a);
|
||||||
|
}
|
23
cmake/versioninfo.rc.in
Normal file
23
cmake/versioninfo.rc.in
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include <windows.h>
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0
|
||||||
|
PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0
|
||||||
|
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||||
|
FILEFLAGS 0
|
||||||
|
FILEOS VOS__WINDOWS32
|
||||||
|
FILETYPE @FILETYPE@
|
||||||
|
FILESUBTYPE VFT2_UNKNOWN
|
||||||
|
BEGIN
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
BEGIN
|
||||||
|
BLOCK "040904E4"
|
||||||
|
BEGIN
|
||||||
|
VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0"
|
||||||
|
VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0"
|
||||||
|
END
|
||||||
|
END
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Translation", 0x409, 1252
|
||||||
|
END
|
||||||
|
END
|
73
cmake/zlib.cmake
Normal file
73
cmake/zlib.cmake
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
MACRO (MYSQL_USE_BUNDLED_ZLIB)
|
||||||
|
SET(ZLIB_LIBRARY zlib)
|
||||||
|
SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib)
|
||||||
|
SET(ZLIB_FOUND TRUE)
|
||||||
|
SET(WITH_ZLIB "bundled" CACHE STRING "Use bundled zlib")
|
||||||
|
ADD_SUBDIRECTORY(zlib)
|
||||||
|
GET_TARGET_PROPERTY(src zlib SOURCES)
|
||||||
|
FOREACH(file ${src})
|
||||||
|
SET(ZLIB_SOURCES ${ZLIB_SOURCES} ${CMAKE_SOURCE_DIR}/zlib/${file})
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
# MYSQL_CHECK_ZLIB_WITH_COMPRESS
|
||||||
|
#
|
||||||
|
# Provides the following configure options:
|
||||||
|
# WITH_ZLIB_BUNDLED
|
||||||
|
# If this is set,we use bindled zlib
|
||||||
|
# If this is not set,search for system zlib.
|
||||||
|
# if system zlib is not found, use bundled copy
|
||||||
|
# ZLIB_LIBRARIES, ZLIB_INCLUDE_DIR and ZLIB_SOURCES
|
||||||
|
# are set after this macro has run
|
||||||
|
|
||||||
|
MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM_NAME STREQUAL "OS400" OR
|
||||||
|
CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
|
||||||
|
CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
# Use bundled zlib on some platforms by default (system one is too
|
||||||
|
# old or not existent)
|
||||||
|
IF (NOT WITH_ZLIB)
|
||||||
|
SET(WITH_ZLIB "bundled" CACHE STRING "By default use bundled zlib on this platform")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_ZLIB STREQUAL "bundled")
|
||||||
|
MYSQL_USE_BUNDLED_ZLIB()
|
||||||
|
ELSE()
|
||||||
|
SET(ZLIB_FIND_QUIETLY TRUE)
|
||||||
|
INCLUDE(FindZLIB)
|
||||||
|
IF(ZLIB_FOUND)
|
||||||
|
INCLUDE(CheckFunctionExists)
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES z)
|
||||||
|
CHECK_FUNCTION_EXISTS(crc32 HAVE_CRC32)
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
IF(HAVE_CRC32)
|
||||||
|
SET(ZLIB_LIBRARY z CACHE INTERNAL "System zlib library")
|
||||||
|
SET(WITH_ZLIB "system" CACHE STRING "Which zlib to use (possible values are 'bundled' or 'system')")
|
||||||
|
SET(ZLIB_SOURCES "")
|
||||||
|
ELSE()
|
||||||
|
SET(ZLIB_FOUND FALSE CACHE INTERNAL "Zlib found but not usable")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
IF(NOT ZLIB_FOUND)
|
||||||
|
MYSQL_USE_BUNDLED_ZLIB()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
SET(HAVE_COMPRESS 1)
|
||||||
|
ENDMACRO()
|
167
cmd-line-utils/libedit/CMakeLists.txt
Normal file
167
cmd-line-utils/libedit/CMakeLists.txt
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||||
|
INCLUDE(CheckIncludeFile)
|
||||||
|
include(CheckFunctionExists)
|
||||||
|
CHECK_INCLUDE_FILES(term.h HAVE_TERM_H)
|
||||||
|
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_LIBRARY})
|
||||||
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
|
#include <term.h>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
tgoto(0,0,0);
|
||||||
|
return 0;
|
||||||
|
}" HAVE_DECL_TGOTO)
|
||||||
|
SET(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||||
|
#On Solaris, default awk is next to unusable while the xpg4 one is ok.
|
||||||
|
IF(EXISTS /usr/xpg4/bin/awk)
|
||||||
|
SET(AWK_EXECUTABLE /usr/xpg4/bin/awk)
|
||||||
|
ENDIF()
|
||||||
|
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "OS400")
|
||||||
|
#Workaround for cases, where /usr/bin/gawk is not executable
|
||||||
|
IF(EXISTS /QOpenSys/usr/bin/awk)
|
||||||
|
SET(AWK_EXECUTABLE /QOpenSys/usr/bin/awk)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT AWK_EXECUTABLE)
|
||||||
|
FIND_PROGRAM(AWK_EXECUTABLE NAMES gawk awk DOC "path to the awk executable")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(AWK_EXECUTABLE)
|
||||||
|
SET(AWK ${AWK_EXECUTABLE})
|
||||||
|
CONFIGURE_FILE(makelist.sh ${CMAKE_CURRENT_BINARY_DIR}/makelist @ONLY)
|
||||||
|
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
|
||||||
|
CHECK_INCLUDE_FILE(vis.h HAVE_VIS_H)
|
||||||
|
IF(HAVE_VIS_H)
|
||||||
|
CHECK_FUNCTION_EXISTS(strvis HAVE_STRVIS)
|
||||||
|
IF(NOT HAVE_STRVIS)
|
||||||
|
SET(HAVE_VIS_H FALSE CACHE INTERNAL "" FORCE)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
CHECK_FUNCTION_EXISTS(strvis HAVE_STRVIS)
|
||||||
|
IF(NOT HAVE_STRVIS)
|
||||||
|
SET(LIBEDIT_EXTRA_SOURCES ${LIBEDIT_EXTRA_SOURCES} np/vis.c)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
CHECK_FUNCTION_EXISTS(strunvis HAVE_STRUNVIS)
|
||||||
|
IF(NOT HAVE_STRUNVIS)
|
||||||
|
SET(LIBEDIT_EXTRA_SOURCES ${LIBEDIT_EXTRA_SOURCES} np/unvis.c)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
CHECK_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY)
|
||||||
|
IF(NOT HAVE_STRLCPY)
|
||||||
|
SET(LIBEDIT_EXTRA_SOURCES ${LIBEDIT_EXTRA_SOURCES} np/strlcpy.c)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
|
||||||
|
IF(NOT HAVE_STRLCAT)
|
||||||
|
SET(LIBEDIT_EXTRA_SOURCES ${LIBEDIT_EXTRA_SOURCES} np/strlcat.c)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
CHECK_FUNCTION_EXISTS(fgetln HAVE_FGETLN)
|
||||||
|
IF(NOT HAVE_FGETLN)
|
||||||
|
SET(LIBEDIT_EXTRA_SOURCES ${LIBEDIT_EXTRA_SOURCES} np/fgetln.c)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Generate headers
|
||||||
|
FOREACH(SRCBASENAME vi emacs common)
|
||||||
|
SET(SRC ${CMAKE_CURRENT_SOURCE_DIR}/${SRCBASENAME}.c)
|
||||||
|
SET(HDR ${CMAKE_CURRENT_BINARY_DIR}/${SRCBASENAME}.h)
|
||||||
|
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${HDR}
|
||||||
|
COMMAND sh ./makelist -h ${SRC} > ${HDR}
|
||||||
|
DEPENDS ${SRC})
|
||||||
|
|
||||||
|
SET(AHDR ${AHDR} ${HDR})
|
||||||
|
SET(ASRC ${ASRC} ${SRC})
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
# Generate source files
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/help.c
|
||||||
|
COMMAND sh ./makelist -bc ${ASRC} > help.c
|
||||||
|
DEPENDS ${ASRC}
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/help.h
|
||||||
|
COMMAND sh ./makelist -bh ${ASRC} > help.h
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
DEPENDS ${ASRC}
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fcns.h
|
||||||
|
COMMAND sh ./makelist -fh ${AHDR} > fcns.h
|
||||||
|
VERBATIM
|
||||||
|
DEPENDS ${AHDR}
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fcns.c
|
||||||
|
COMMAND sh ./makelist -fc ${AHDR} > fcns.c
|
||||||
|
VERBATIM
|
||||||
|
DEPENDS ${AHDR}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(
|
||||||
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
${CURSES_INCLUDE_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(LIBEDIT_SOURCES
|
||||||
|
chared.c
|
||||||
|
el.c
|
||||||
|
history.c
|
||||||
|
map.c
|
||||||
|
prompt.c
|
||||||
|
readline.c
|
||||||
|
search.c
|
||||||
|
tokenizer.c
|
||||||
|
vi.c
|
||||||
|
common.c
|
||||||
|
emacs.c
|
||||||
|
hist.c
|
||||||
|
key.c
|
||||||
|
parse.c
|
||||||
|
read.c
|
||||||
|
refresh.c
|
||||||
|
sig.c
|
||||||
|
term.c
|
||||||
|
tty.c
|
||||||
|
filecomplete.c
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/help.c
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/help.h
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/fcns.c
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/fcns.h
|
||||||
|
${AHDR}
|
||||||
|
${LIBEDIT_EXTRA_SOURCES}
|
||||||
|
)
|
||||||
|
ADD_LIBRARY(edit ${LIBEDIT_SOURCES})
|
||||||
|
TARGET_LINK_LIBRARIES(edit ${CURSES_LIBRARY})
|
||||||
|
|
@ -23,7 +23,7 @@ noinst_HEADERS = chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.
|
|||||||
sys.h config.h hist.h map.h prompt.h read.h \
|
sys.h config.h hist.h map.h prompt.h read.h \
|
||||||
search.h tty.h filecomplete.h np/vis.h
|
search.h tty.h filecomplete.h np/vis.h
|
||||||
|
|
||||||
EXTRA_DIST = makelist.sh
|
EXTRA_DIST = makelist.sh CMakeLists.txt
|
||||||
|
|
||||||
CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c
|
CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c
|
||||||
|
|
||||||
|
60
cmd-line-utils/readline/CMakeLists.txt
Normal file
60
cmd-line-utils/readline/CMakeLists.txt
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
# Copyright (C) 2007 MySQL AB
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; version 2 of the License.
|
||||||
|
#
|
||||||
|
# This program is 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-1301 USA
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
||||||
|
${CMAKE_SOURCE_DIR}/cmd-line-utils)
|
||||||
|
|
||||||
|
ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNO_KILL_INTR -DMYSQL_CLIENT_NO_THREADS)
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${CURSES_INCLUDE_PATH})
|
||||||
|
|
||||||
|
ADD_LIBRARY(readline
|
||||||
|
readline.c
|
||||||
|
funmap.c
|
||||||
|
keymaps.c
|
||||||
|
vi_mode.c
|
||||||
|
parens.c
|
||||||
|
rltty.c
|
||||||
|
complete.c
|
||||||
|
bind.c
|
||||||
|
isearch.c
|
||||||
|
display.c
|
||||||
|
signals.c
|
||||||
|
util.c
|
||||||
|
kill.c
|
||||||
|
undo.c
|
||||||
|
macro.c
|
||||||
|
input.c
|
||||||
|
callback.c
|
||||||
|
terminal.c
|
||||||
|
xmalloc.c
|
||||||
|
history.c
|
||||||
|
histsearch.c
|
||||||
|
histexpand.c
|
||||||
|
histfile.c
|
||||||
|
nls.c
|
||||||
|
search.c
|
||||||
|
shell.c
|
||||||
|
tilde.c
|
||||||
|
misc.c
|
||||||
|
text.c
|
||||||
|
mbutil.c
|
||||||
|
compat.c
|
||||||
|
savestring.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# Declare dependency
|
||||||
|
# so every executable that links with readline links with curses as well
|
||||||
|
TARGET_LINK_LIBRARIES(readline ${CURSES_LIBRARY})
|
@ -29,7 +29,7 @@ noinst_HEADERS = readline.h chardefs.h keymaps.h \
|
|||||||
tilde.h rlconf.h rltty.h ansi_stdlib.h \
|
tilde.h rlconf.h rltty.h ansi_stdlib.h \
|
||||||
tcap.h rlstdc.h
|
tcap.h rlstdc.h
|
||||||
|
|
||||||
EXTRA_DIST= emacs_keymap.c vi_keymap.c
|
EXTRA_DIST= emacs_keymap.c vi_keymap.c CMakeLists.txt
|
||||||
|
|
||||||
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR
|
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR
|
||||||
|
|
||||||
|
657
config.h.cmake
Normal file
657
config.h.cmake
Normal file
@ -0,0 +1,657 @@
|
|||||||
|
/* Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
|
||||||
|
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-1301 USA */
|
||||||
|
|
||||||
|
#ifndef MY_CONFIG_H
|
||||||
|
#define MY_CONFIG_H
|
||||||
|
#cmakedefine DOT_FRM_VERSION @DOT_FRM_VERSION@
|
||||||
|
/* Headers we may want to use. */
|
||||||
|
#cmakedefine STDC_HEADERS 1
|
||||||
|
#cmakedefine _GNU_SOURCE 1
|
||||||
|
#cmakedefine HAVE_ALLOCA_H 1
|
||||||
|
#cmakedefine HAVE_AIO_H 1
|
||||||
|
#cmakedefine HAVE_ARPA_INET_H 1
|
||||||
|
#cmakedefine HAVE_BSEARCH 1
|
||||||
|
#cmakedefine HAVE_CRYPT_H 1
|
||||||
|
#cmakedefine HAVE_CURSES_H 1
|
||||||
|
#cmakedefine HAVE_CXXABI_H 1
|
||||||
|
#cmakedefine HAVE_NCURSES_H 1
|
||||||
|
#cmakedefine HAVE_DIRENT_H 1
|
||||||
|
#cmakedefine HAVE_DLFCN_H 1
|
||||||
|
#cmakedefine HAVE_EXECINFO_H 1
|
||||||
|
#cmakedefine HAVE_FCNTL_H 1
|
||||||
|
#cmakedefine HAVE_FENV_H 1
|
||||||
|
#cmakedefine HAVE_FLOAT_H 1
|
||||||
|
#cmakedefine HAVE_FLOATINGPOINT_H 1
|
||||||
|
#cmakedefine HAVE_FNMATCH_H 1
|
||||||
|
#cmakedefine HAVE_FPU_CONTROL_H 1
|
||||||
|
#cmakedefine HAVE_GRP_H 1
|
||||||
|
#cmakedefine HAVE_EXPLICIT_TEMPLATE_INSTANTIATION 1
|
||||||
|
#cmakedefine HAVE_IEEEFP_H 1
|
||||||
|
#cmakedefine HAVE_INTTYPES_H 1
|
||||||
|
#cmakedefine HAVE_LIMITS_H 1
|
||||||
|
#cmakedefine HAVE_LOCALE_H 1
|
||||||
|
#cmakedefine HAVE_MALLOC_H 1
|
||||||
|
#cmakedefine HAVE_MEMORY_H 1
|
||||||
|
#cmakedefine HAVE_NETINET_IN_H 1
|
||||||
|
#cmakedefine HAVE_PATHS_H 1
|
||||||
|
#cmakedefine HAVE_POLL_H 1
|
||||||
|
#cmakedefine HAVE_PORT_H 1
|
||||||
|
#cmakedefine HAVE_PWD_H 1
|
||||||
|
#cmakedefine HAVE_SCHED_H 1
|
||||||
|
#cmakedefine HAVE_SELECT_H 1
|
||||||
|
#cmakedefine HAVE_SOLARIS_LARGE_PAGES 1
|
||||||
|
#cmakedefine HAVE_STDDEF_H 1
|
||||||
|
#cmakedefine HAVE_STDLIB_H 1
|
||||||
|
#cmakedefine HAVE_STDARG_H 1
|
||||||
|
#cmakedefine HAVE_STRINGS_H 1
|
||||||
|
#cmakedefine HAVE_STRING_H 1
|
||||||
|
#cmakedefine HAVE_STDINT_H 1
|
||||||
|
#cmakedefine HAVE_SEMAPHORE_H 1
|
||||||
|
#cmakedefine HAVE_SYNCH_H 1
|
||||||
|
#cmakedefine HAVE_SYSENT_H 1
|
||||||
|
#cmakedefine HAVE_SYS_DIR_H 1
|
||||||
|
#cmakedefine HAVE_SYS_CDEFS_H 1
|
||||||
|
#cmakedefine HAVE_SYS_FILE_H 1
|
||||||
|
#cmakedefine HAVE_SYS_FPU_H 1
|
||||||
|
#cmakedefine HAVE_SYS_IOCTL_H 1
|
||||||
|
#cmakedefine HAVE_SYS_IPC_H 1
|
||||||
|
#cmakedefine HAVE_SYS_MALLOC_H 1
|
||||||
|
#cmakedefine HAVE_SYS_MMAN_H 1
|
||||||
|
#cmakedefine HAVE_SYS_PTE_H 1
|
||||||
|
#cmakedefine HAVE_SYS_PTEM_H 1
|
||||||
|
#cmakedefine HAVE_SYS_PRCTL_H 1
|
||||||
|
#cmakedefine HAVE_SYS_RESOURCE_H 1
|
||||||
|
#cmakedefine HAVE_SYS_SELECT_H 1
|
||||||
|
#cmakedefine HAVE_SYS_SHM_H 1
|
||||||
|
#cmakedefine HAVE_SYS_SOCKET_H 1
|
||||||
|
#cmakedefine HAVE_SYS_STAT_H 1
|
||||||
|
#cmakedefine HAVE_SYS_STREAM_H 1
|
||||||
|
#cmakedefine HAVE_SYS_TERMCAP_H 1
|
||||||
|
#cmakedefine HAVE_SYS_TIMEB_H 1
|
||||||
|
#cmakedefine HAVE_SYS_TYPES_H 1
|
||||||
|
#cmakedefine HAVE_SYS_UN_H 1
|
||||||
|
#cmakedefine HAVE_SYS_VADVISE_H 1
|
||||||
|
#cmakedefine HAVE_TERM_H 1
|
||||||
|
#cmakedefine HAVE_TERMIOS_H 1
|
||||||
|
#cmakedefine HAVE_TERMIO_H 1
|
||||||
|
#cmakedefine HAVE_TERMCAP_H 1
|
||||||
|
#cmakedefine HAVE_UNISTD_H 1
|
||||||
|
#cmakedefine HAVE_UTIME_H 1
|
||||||
|
#cmakedefine HAVE_VARARGS_H 1
|
||||||
|
#cmakedefine HAVE_VIS_H 1
|
||||||
|
#cmakedefine HAVE_SYS_UTIME_H 1
|
||||||
|
#cmakedefine HAVE_SYS_WAIT_H 1
|
||||||
|
#cmakedefine HAVE_SYS_PARAM_H 1
|
||||||
|
|
||||||
|
/* Libraries */
|
||||||
|
#cmakedefine HAVE_LIBPTHREAD 1
|
||||||
|
#cmakedefine HAVE_LIBM 1
|
||||||
|
#cmakedefine HAVE_LIBDL 1
|
||||||
|
#cmakedefine HAVE_LIBRT 1
|
||||||
|
#cmakedefine HAVE_LIBSOCKET 1
|
||||||
|
#cmakedefine HAVE_LIBNSL 1
|
||||||
|
#cmakedefine HAVE_LIBCRYPT 1
|
||||||
|
#cmakedefine HAVE_LIBMTMALLOC 1
|
||||||
|
#cmakedefine HAVE_LIBWRAP 1
|
||||||
|
/* Does "struct timespec" have a "sec" and "nsec" field? */
|
||||||
|
#cmakedefine HAVE_TIMESPEC_TS_SEC 1
|
||||||
|
|
||||||
|
/* Readline */
|
||||||
|
#cmakedefine HAVE_HIST_ENTRY 1
|
||||||
|
#cmakedefine USE_LIBEDIT_INTERFACE 1
|
||||||
|
#cmakedefine USE_NEW_READLINE_INTERFACE 1
|
||||||
|
|
||||||
|
#cmakedefine FIONREAD_IN_SYS_IOCTL 1
|
||||||
|
#cmakedefine GWINSZ_IN_SYS_IOCTL 1
|
||||||
|
#cmakedefine TIOCSTAT_IN_SYS_IOCTL 1
|
||||||
|
|
||||||
|
/* Functions we may want to use. */
|
||||||
|
#cmakedefine HAVE_AIOWAIT 1
|
||||||
|
#cmakedefine HAVE_ALARM 1
|
||||||
|
#cmakedefine HAVE_ALLOCA 1
|
||||||
|
#cmakedefine HAVE_BCMP 1
|
||||||
|
#cmakedefine HAVE_BFILL 1
|
||||||
|
#cmakedefine HAVE_BMOVE 1
|
||||||
|
#cmakedefine HAVE_BZERO 1
|
||||||
|
#cmakedefine HAVE_INDEX 1
|
||||||
|
#cmakedefine HAVE_CLOCK_GETTIME 1
|
||||||
|
#cmakedefine HAVE_CRYPT 1
|
||||||
|
#cmakedefine HAVE_CUSERID 1
|
||||||
|
#cmakedefine HAVE_DIRECTIO 1
|
||||||
|
#cmakedefine HAVE_DLERROR 1
|
||||||
|
#cmakedefine HAVE_DLOPEN 1
|
||||||
|
#cmakedefine HAVE_DOPRNT 1
|
||||||
|
#cmakedefine HAVE_FCHMOD 1
|
||||||
|
#cmakedefine HAVE_FCNTL 1
|
||||||
|
#cmakedefine HAVE_FCONVERT 1
|
||||||
|
#cmakedefine HAVE_FDATASYNC 1
|
||||||
|
#cmakedefine HAVE_FESETROUND 1
|
||||||
|
#cmakedefine HAVE_FINITE 1
|
||||||
|
#cmakedefine HAVE_FP_EXCEPT 1
|
||||||
|
#cmakedefine HAVE_FPSETMASK 1
|
||||||
|
#cmakedefine HAVE_FSEEKO 1
|
||||||
|
#cmakedefine HAVE_FSYNC 1
|
||||||
|
#cmakedefine HAVE_GETADDRINFO 1
|
||||||
|
#cmakedefine HAVE_GETCWD 1
|
||||||
|
#cmakedefine HAVE_GETHOSTBYADDR_R 1
|
||||||
|
#cmakedefine HAVE_GETHOSTBYNAME_R 1
|
||||||
|
#cmakedefine HAVE_GETHRTIME 1
|
||||||
|
#cmakedefine HAVE_GETLINE 1
|
||||||
|
#cmakedefine HAVE_GETNAMEINFO 1
|
||||||
|
#cmakedefine HAVE_GETPAGESIZE 1
|
||||||
|
#cmakedefine HAVE_GETPASS 1
|
||||||
|
#cmakedefine HAVE_GETPASSPHRASE 1
|
||||||
|
#cmakedefine HAVE_GETPWNAM 1
|
||||||
|
#cmakedefine HAVE_GETPWUID 1
|
||||||
|
#cmakedefine HAVE_GETRLIMIT 1
|
||||||
|
#cmakedefine HAVE_GETRUSAGE 1
|
||||||
|
#cmakedefine HAVE_GETTIMEOFDAY 1
|
||||||
|
#cmakedefine HAVE_GETWD 1
|
||||||
|
#cmakedefine HAVE_GMTIME_R 1
|
||||||
|
#cmakedefine gmtime_r @gmtime_r@
|
||||||
|
#cmakedefine HAVE_INITGROUPS 1
|
||||||
|
#cmakedefine HAVE_ISSETUGID 1
|
||||||
|
#cmakedefine HAVE_ISNAN 1
|
||||||
|
#cmakedefine HAVE_ISINF 1
|
||||||
|
#cmakedefine HAVE_LARGE_PAGE_OPTION 1
|
||||||
|
#cmakedefine HAVE_LDIV 1
|
||||||
|
#cmakedefine HAVE_LRAND48 1
|
||||||
|
#cmakedefine HAVE_LOCALTIME_R 1
|
||||||
|
#cmakedefine HAVE_LOG2 1
|
||||||
|
#cmakedefine HAVE_LONGJMP 1
|
||||||
|
#cmakedefine HAVE_LSTAT 1
|
||||||
|
#cmakedefine HAVE_NPTL 1
|
||||||
|
#cmakedefine HAVE_NL_LANGINFO 1
|
||||||
|
#cmakedefine HAVE_MADVISE 1
|
||||||
|
#cmakedefine HAVE_DECL_MADVISE 1
|
||||||
|
#cmakedefine HAVE_DECL_TGOTO 1
|
||||||
|
#cmakedefine HAVE_DECL_MHA_MAPSIZE_VA
|
||||||
|
#cmakedefine HAVE_MALLINFO 1
|
||||||
|
#cmakedefine HAVE_MEMCPY 1
|
||||||
|
#cmakedefine HAVE_MEMMOVE 1
|
||||||
|
#cmakedefine HAVE_MKSTEMP 1
|
||||||
|
#cmakedefine HAVE_MLOCKALL 1
|
||||||
|
#cmakedefine HAVE_MMAP 1
|
||||||
|
#cmakedefine HAVE_MMAP64 1
|
||||||
|
#cmakedefine HAVE_PERROR 1
|
||||||
|
#cmakedefine HAVE_POLL 1
|
||||||
|
#cmakedefine HAVE_PORT_CREATE 1
|
||||||
|
#cmakedefine HAVE_POSIX_FALLOCATE 1
|
||||||
|
#cmakedefine HAVE_PREAD 1
|
||||||
|
#cmakedefine HAVE_PAUSE_INSTRUCTION 1
|
||||||
|
#cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_ATTR_CREATE 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_ATTR_SETPRIO 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_ATTR_SETSCOPE 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_CONDATTR_CREATE 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_CONDATTR_SETCLOCK 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_INIT 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_KEY_DELETE 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_KEY_DELETE 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_KILL 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_RWLOCK_RDLOCK 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_SETPRIO_NP 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_SETSCHEDPARAM 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_SIGMASK 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_THREADMASK 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_YIELD_NP 1
|
||||||
|
#cmakedefine HAVE_PTHREAD_YIELD_ZERO_ARG 1
|
||||||
|
#cmakedefine HAVE_PUTENV 1
|
||||||
|
#cmakedefine HAVE_RE_COMP 1
|
||||||
|
#cmakedefine HAVE_REGCOMP 1
|
||||||
|
#cmakedefine HAVE_READDIR_R 1
|
||||||
|
#cmakedefine HAVE_READLINK 1
|
||||||
|
#cmakedefine HAVE_REALPATH 1
|
||||||
|
#cmakedefine HAVE_RENAME 1
|
||||||
|
#cmakedefine HAVE_RINT 1
|
||||||
|
#cmakedefine HAVE_RWLOCK_INIT 1
|
||||||
|
#cmakedefine HAVE_SCHED_YIELD 1
|
||||||
|
#cmakedefine HAVE_SELECT 1
|
||||||
|
#cmakedefine HAVE_SETFD 1
|
||||||
|
#cmakedefine HAVE_SETENV 1
|
||||||
|
#cmakedefine HAVE_SETLOCALE 1
|
||||||
|
#cmakedefine HAVE_SIGADDSET 1
|
||||||
|
#cmakedefine HAVE_SIGEMPTYSET 1
|
||||||
|
#cmakedefine HAVE_SIGHOLD 1
|
||||||
|
#cmakedefine HAVE_SIGSET 1
|
||||||
|
#cmakedefine HAVE_SIGSET_T 1
|
||||||
|
#cmakedefine HAVE_SIGACTION 1
|
||||||
|
#cmakedefine HAVE_SIGTHREADMASK 1
|
||||||
|
#cmakedefine HAVE_SIGWAIT 1
|
||||||
|
#cmakedefine HAVE_SLEEP 1
|
||||||
|
#cmakedefine HAVE_SNPRINTF 1
|
||||||
|
#cmakedefine HAVE_STPCPY 1
|
||||||
|
#cmakedefine HAVE_STRERROR 1
|
||||||
|
#cmakedefine HAVE_STRCOLL 1
|
||||||
|
#cmakedefine HAVE_STRSIGNAL 1
|
||||||
|
#cmakedefine HAVE_STRLCPY 1
|
||||||
|
#cmakedefine HAVE_STRLCAT 1
|
||||||
|
#cmakedefine HAVE_FGETLN 1
|
||||||
|
#cmakedefine HAVE_STRNLEN 1
|
||||||
|
#cmakedefine HAVE_STRPBRK 1
|
||||||
|
#cmakedefine HAVE_STRSEP 1
|
||||||
|
#cmakedefine HAVE_STRSTR 1
|
||||||
|
#cmakedefine HAVE_STRTOK_R 1
|
||||||
|
#cmakedefine HAVE_STRTOL 1
|
||||||
|
#cmakedefine HAVE_STRTOLL 1
|
||||||
|
#cmakedefine HAVE_STRTOUL 1
|
||||||
|
#cmakedefine HAVE_STRTOULL 1
|
||||||
|
#cmakedefine HAVE_SHMAT 1
|
||||||
|
#cmakedefine HAVE_SHMCTL 1
|
||||||
|
#cmakedefine HAVE_SHMDT 1
|
||||||
|
#cmakedefine HAVE_SHMGET 1
|
||||||
|
#cmakedefine HAVE_TELL 1
|
||||||
|
#cmakedefine HAVE_TEMPNAM 1
|
||||||
|
#cmakedefine HAVE_THR_SETCONCURRENCY 1
|
||||||
|
#cmakedefine HAVE_THR_YIELD 1
|
||||||
|
#cmakedefine HAVE_VALLOC 1
|
||||||
|
#define HAVE_VIO_READ_BUFF 1
|
||||||
|
#cmakedefine HAVE_VASPRINTF 1
|
||||||
|
#cmakedefine HAVE_VPRINTF 1
|
||||||
|
#cmakedefine HAVE_VSNPRINTF 1
|
||||||
|
#cmakedefine HAVE_FTRUNCATE 1
|
||||||
|
#cmakedefine HAVE_TZNAME 1
|
||||||
|
#cmakedefine HAVE_AIO_READ 1
|
||||||
|
/* Symbols we may use */
|
||||||
|
#cmakedefine HAVE_SYS_ERRLIST 1
|
||||||
|
/* used by stacktrace functions */
|
||||||
|
#cmakedefine HAVE_BSS_START 1
|
||||||
|
#cmakedefine HAVE_BACKTRACE 1
|
||||||
|
#cmakedefine HAVE_BACKTRACE_SYMBOLS 1
|
||||||
|
#cmakedefine HAVE_BACKTRACE_SYMBOLS_FD 1
|
||||||
|
#cmakedefine HAVE_PRINTSTACK 1
|
||||||
|
#cmakedefine HAVE_STRUCT_SOCKADDR_IN6 1
|
||||||
|
#cmakedefine HAVE_STRUCT_IN6_ADDR 1
|
||||||
|
#cmakedefine HAVE_NETINET_IN6_H 1
|
||||||
|
#cmakedefine HAVE_IPV6 1
|
||||||
|
#cmakedefine ss_family @ss_family@
|
||||||
|
#cmakedefine HAVE_TIMESPEC_TS_SEC 1
|
||||||
|
#cmakedefine STRUCT_DIRENT_HAS_D_INO 1
|
||||||
|
#cmakedefine STRUCT_DIRENT_HAS_D_NAMLEN 1
|
||||||
|
#cmakedefine SPRINTF_RETURNS_INT 1
|
||||||
|
|
||||||
|
#define USE_MB 1
|
||||||
|
#define USE_MB_IDENT 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Types we may use */
|
||||||
|
#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@
|
||||||
|
#if SIZEOF_CHAR
|
||||||
|
# define HAVE_CHAR 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
/*
|
||||||
|
Special handling required for OSX to support universal binaries that
|
||||||
|
mix 32 and 64 bit architectures.
|
||||||
|
*/
|
||||||
|
#if(__LP64__)
|
||||||
|
#define SIZEOF_LONG 8
|
||||||
|
#else
|
||||||
|
#define SIZEOF_LONG 4
|
||||||
|
#endif
|
||||||
|
#define SIZEOF_CHARP SIZEOF_LONG
|
||||||
|
#define SIZEOF_SIZE_T SIZEOF_LONG
|
||||||
|
#else
|
||||||
|
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@
|
||||||
|
#cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@
|
||||||
|
#cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if SIZEOF_LONG
|
||||||
|
# define HAVE_LONG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if SIZEOF_CHARP
|
||||||
|
#define HAVE_CHARP 1
|
||||||
|
#define SIZEOF_VOIDP SIZEOF_CHARP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@
|
||||||
|
#if SIZEOF_SHORT
|
||||||
|
# define HAVE_SHORT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_INT @SIZEOF_INT@
|
||||||
|
#if SIZEOF_INT
|
||||||
|
# define HAVE_INT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@
|
||||||
|
#if SIZEOF_LONG_LONG
|
||||||
|
# define HAVE_LONG_LONG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@
|
||||||
|
#if SIZEOF_OFF_T
|
||||||
|
#define HAVE_OFF_T 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_SIGSET_T @SIZEOF_SIGSET_T@
|
||||||
|
#if SIZEOF_SIGSET_T
|
||||||
|
#define HAVE_SIGSET_T 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if SIZEOF_SIZE_T
|
||||||
|
#define HAVE_SIZE_T 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_UCHAR @SIZEOF_UCHAR@
|
||||||
|
#if SIZEOF_UCHAR
|
||||||
|
#define HAVE_UCHAR 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_UINT @SIZEOF_UINT@
|
||||||
|
#if SIZEOF_UINT
|
||||||
|
#define HAVE_UINT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_ULONG @SIZEOF_ULONG@
|
||||||
|
#if SIZEOF_ULONG
|
||||||
|
#define HAVE_ULONG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_INT8 @SIZEOF_INT8@
|
||||||
|
#if SIZEOF_INT8
|
||||||
|
#define HAVE_INT8 1
|
||||||
|
#endif
|
||||||
|
#cmakedefine SIZEOF_UINT8 @SIZEOF_UINT8@
|
||||||
|
#if SIZEOF_UINT8
|
||||||
|
#define HAVE_UINT8 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_INT16 @SIZEOF_INT16@
|
||||||
|
#if SIZEOF_INT16
|
||||||
|
# define HAVE_INT16 1
|
||||||
|
#endif
|
||||||
|
#cmakedefine SIZEOF_UINT16 @SIZEOF_UINT16@
|
||||||
|
#if SIZEOF_UINT16
|
||||||
|
#define HAVE_UINT16 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_INT32 @SIZEOF_INT32@
|
||||||
|
#if SIZEOF_INT32
|
||||||
|
#define HAVE_INT32 1
|
||||||
|
#endif
|
||||||
|
#cmakedefine SIZEOF_UINT32 @SIZEOF_UINT32@
|
||||||
|
#if SIZEOF_UINT32
|
||||||
|
#define HAVE_UINT32 1
|
||||||
|
#endif
|
||||||
|
#cmakedefine SIZEOF_U_INT32_T @SIZEOF_U_INT32_T@
|
||||||
|
#if SIZEOF_U_INT32_T
|
||||||
|
#define HAVE_U_INT32_T 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_INT64 @SIZEOF_INT64@
|
||||||
|
#if SIZEOF_INT64
|
||||||
|
#define HAVE_INT64 1
|
||||||
|
#endif
|
||||||
|
#cmakedefine SIZEOF_UINT64 @SIZEOF_UINT64@
|
||||||
|
#if SIZEOF_UINT64
|
||||||
|
#define HAVE_UINT64 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@
|
||||||
|
|
||||||
|
#cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@
|
||||||
|
#if SIZEOF_BOOL
|
||||||
|
#define HAVE_BOOL 1
|
||||||
|
#endif
|
||||||
|
#cmakedefine HAVE_MBSTATE_T
|
||||||
|
|
||||||
|
#define MAX_INDEXES 64
|
||||||
|
|
||||||
|
#cmakedefine QSORT_TYPE_IS_VOID 1
|
||||||
|
#define RETQSORTTYPE void
|
||||||
|
|
||||||
|
#cmakedefine SIGNAL_RETURN_TYPE_IS_VOID 1
|
||||||
|
#define RETSIGTYPE void
|
||||||
|
#if SIGNAL_RETURN_TYPE_IS_VOID
|
||||||
|
#define VOID_SIGHANDLER 1
|
||||||
|
#endif
|
||||||
|
#define STRUCT_RLIMIT struct rlimit
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#if __BIG_ENDIAN
|
||||||
|
#define WORDS_BIGENDIAN 1
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#cmakedefine WORDS_BIGENDIAN 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to `__inline__' or `__inline' if that's what the C compiler calls
|
||||||
|
it, or to nothing if 'inline' is not supported under any name. */
|
||||||
|
#cmakedefine C_HAS_inline 1
|
||||||
|
#if !(C_HAS_inline)
|
||||||
|
#ifndef __cplusplus
|
||||||
|
# define inline @C_INLINE@
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#cmakedefine TARGET_OS_LINUX 1
|
||||||
|
#cmakedefine TARGET_OS_SOLARIS 1
|
||||||
|
|
||||||
|
#cmakedefine HAVE_WCTYPE_H 1
|
||||||
|
#cmakedefine HAVE_WCHAR_H 1
|
||||||
|
#cmakedefine HAVE_LANGINFO_H 1
|
||||||
|
#cmakedefine HAVE_MBRLEN
|
||||||
|
#cmakedefine HAVE_MBSCMP
|
||||||
|
#cmakedefine HAVE_MBSRTOWCS
|
||||||
|
#cmakedefine HAVE_WCRTOMB
|
||||||
|
#cmakedefine HAVE_MBRTOWC
|
||||||
|
#cmakedefine HAVE_WCSCOLL
|
||||||
|
#cmakedefine HAVE_WCSDUP
|
||||||
|
#cmakedefine HAVE_WCWIDTH
|
||||||
|
#cmakedefine HAVE_WCTYPE
|
||||||
|
#cmakedefine HAVE_ISWLOWER 1
|
||||||
|
#cmakedefine HAVE_ISWUPPER 1
|
||||||
|
#cmakedefine HAVE_TOWLOWER 1
|
||||||
|
#cmakedefine HAVE_TOWUPPER 1
|
||||||
|
#cmakedefine HAVE_ISWCTYPE 1
|
||||||
|
#cmakedefine HAVE_WCHAR_T 1
|
||||||
|
#cmakedefine HAVE_WCTYPE_T 1
|
||||||
|
#cmakedefine HAVE_WINT_T 1
|
||||||
|
|
||||||
|
|
||||||
|
#cmakedefine HAVE_STRCASECMP 1
|
||||||
|
#cmakedefine HAVE_STRNCASECMP 1
|
||||||
|
#cmakedefine HAVE_STRDUP 1
|
||||||
|
#cmakedefine HAVE_LANGINFO_CODESET
|
||||||
|
#cmakedefine HAVE_TCGETATTR 1
|
||||||
|
#cmakedefine HAVE_FLOCKFILE 1
|
||||||
|
|
||||||
|
#cmakedefine HAVE_WEAK_SYMBOL 1
|
||||||
|
#cmakedefine HAVE_ABI_CXA_DEMANGLE 1
|
||||||
|
|
||||||
|
|
||||||
|
#cmakedefine HAVE_POSIX_SIGNALS 1
|
||||||
|
#cmakedefine HAVE_BSD_SIGNALS 1
|
||||||
|
#cmakedefine HAVE_SVR3_SIGNALS 1
|
||||||
|
#cmakedefine HAVE_V7_SIGNALS 1
|
||||||
|
|
||||||
|
|
||||||
|
#cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1
|
||||||
|
#cmakedefine HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE 1
|
||||||
|
#cmakedefine HAVE_GETHOSTBYNAME_R_RETURN_INT 1
|
||||||
|
|
||||||
|
#cmakedefine MY_ATOMIC_MODE_DUMMY 1
|
||||||
|
#cmakedefine MY_ATOMIC_MODE_RWLOCKS 1
|
||||||
|
#cmakedefine HAVE_GCC_ATOMIC_BUILTINS 1
|
||||||
|
#cmakedefine HAVE_SOLARIS_ATOMIC 1
|
||||||
|
#cmakedefine HAVE_DECL_SHM_HUGETLB 1
|
||||||
|
#cmakedefine HAVE_LARGE_PAGES 1
|
||||||
|
#cmakedefine HUGETLB_USE_PROC_MEMINFO 1
|
||||||
|
#cmakedefine NO_FCNTL_NONBLOCK 1
|
||||||
|
#cmakedefine NO_ALARM 1
|
||||||
|
|
||||||
|
#cmakedefine _LARGE_FILES 1
|
||||||
|
#cmakedefine _LARGEFILE_SOURCE 1
|
||||||
|
#cmakedefine _LARGEFILE64_SOURCE 1
|
||||||
|
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
|
||||||
|
|
||||||
|
#cmakedefine TIME_WITH_SYS_TIME 1
|
||||||
|
|
||||||
|
#cmakedefine STACK_DIRECTION @STACK_DIRECTION@
|
||||||
|
|
||||||
|
#define THREAD 1
|
||||||
|
#define THREAD_SAFE_CLIENT 1
|
||||||
|
|
||||||
|
#define SYSTEM_TYPE "@SYSTEM_TYPE@"
|
||||||
|
#define MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@"
|
||||||
|
#cmakedefine HAVE_DTRACE 1
|
||||||
|
|
||||||
|
#cmakedefine SIGNAL_WITH_VIO_CLOSE 1
|
||||||
|
|
||||||
|
/* Windows stuff, mostly functions, that have Posix analogs but named differently */
|
||||||
|
#cmakedefine S_IROTH @S_IROTH@
|
||||||
|
#cmakedefine S_IFIFO @S_IFIFO@
|
||||||
|
#cmakedefine IPPROTO_IPV6 @IPPROTO_IPV6@
|
||||||
|
#cmakedefine IPV6_V6ONLY @IPV6_V6ONLY@
|
||||||
|
#cmakedefine sigset_t @sigset_t@
|
||||||
|
#cmakedefine mode_t @mode_t@
|
||||||
|
#cmakedefine SIGQUIT @SIGQUIT@
|
||||||
|
#cmakedefine SIGPIPE @SIGPIPE@
|
||||||
|
#cmakedefine isnan @isnan@
|
||||||
|
#cmakedefine finite @finite@
|
||||||
|
#cmakedefine popen @popen@
|
||||||
|
#cmakedefine pclose @pclose@
|
||||||
|
#cmakedefine ssize_t @ssize_t@
|
||||||
|
#cmakedefine strcasecmp @strcasecmp@
|
||||||
|
#cmakedefine strncasecmp @strncasecmp@
|
||||||
|
#cmakedefine snprintf @snprintf@
|
||||||
|
#cmakedefine strtok_r @strtok_r@
|
||||||
|
#cmakedefine strtoll @strtoll@
|
||||||
|
#cmakedefine strtoull @strtoull@
|
||||||
|
#cmakedefine vsnprintf @vsnprintf@
|
||||||
|
#if (_MSC_VER > 1310)
|
||||||
|
#define HAVE_SETENV
|
||||||
|
#define setenv(a,b,c) _putenv_s(a,b)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
MySQL features
|
||||||
|
*/
|
||||||
|
#cmakedefine ENABLED_LOCAL_INFILE 1
|
||||||
|
#cmakedefine ENABLED_PROFILING 1
|
||||||
|
#cmakedefine EXTRA_DEBUG 1
|
||||||
|
#cmakedefine BACKUP_TEST 1
|
||||||
|
#cmakedefine CYBOZU 1
|
||||||
|
|
||||||
|
/* Character sets and collations */
|
||||||
|
#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "latin1"
|
||||||
|
#cmakedefine MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
|
||||||
|
|
||||||
|
#cmakedefine USE_MB 1
|
||||||
|
#cmakedefine USE_MB_IDENT 1
|
||||||
|
#cmakedefine USE_STRCOLL 1
|
||||||
|
|
||||||
|
/* This should mean case insensitive file system */
|
||||||
|
#cmakedefine FN_NO_CASE_SENSE 1
|
||||||
|
|
||||||
|
#cmakedefine HAVE_CHARSET_armscii8 1
|
||||||
|
#cmakedefine HAVE_CHARSET_ascii
|
||||||
|
#cmakedefine HAVE_CHARSET_big5 1
|
||||||
|
#cmakedefine HAVE_CHARSET_cp1250 1
|
||||||
|
#cmakedefine HAVE_CHARSET_cp1251 1
|
||||||
|
#cmakedefine HAVE_CHARSET_cp1256 1
|
||||||
|
#cmakedefine HAVE_CHARSET_cp1257 1
|
||||||
|
#cmakedefine HAVE_CHARSET_cp850 1
|
||||||
|
#cmakedefine HAVE_CHARSET_cp852 1
|
||||||
|
#cmakedefine HAVE_CHARSET_cp866 1
|
||||||
|
#cmakedefine HAVE_CHARSET_cp932 1
|
||||||
|
#cmakedefine HAVE_CHARSET_dec8 1
|
||||||
|
#cmakedefine HAVE_CHARSET_eucjpms 1
|
||||||
|
#cmakedefine HAVE_CHARSET_euckr 1
|
||||||
|
#cmakedefine HAVE_CHARSET_gb2312 1
|
||||||
|
#cmakedefine HAVE_CHARSET_gbk 1
|
||||||
|
#cmakedefine HAVE_CHARSET_geostd8 1
|
||||||
|
#cmakedefine HAVE_CHARSET_greek 1
|
||||||
|
#cmakedefine HAVE_CHARSET_hebrew 1
|
||||||
|
#cmakedefine HAVE_CHARSET_hp8 1
|
||||||
|
#cmakedefine HAVE_CHARSET_keybcs2 1
|
||||||
|
#cmakedefine HAVE_CHARSET_koi8r 1
|
||||||
|
#cmakedefine HAVE_CHARSET_koi8u 1
|
||||||
|
#cmakedefine HAVE_CHARSET_latin1 1
|
||||||
|
#cmakedefine HAVE_CHARSET_latin2 1
|
||||||
|
#cmakedefine HAVE_CHARSET_latin5 1
|
||||||
|
#cmakedefine HAVE_CHARSET_latin7 1
|
||||||
|
#cmakedefine HAVE_CHARSET_macce 1
|
||||||
|
#cmakedefine HAVE_CHARSET_macroman 1
|
||||||
|
#cmakedefine HAVE_CHARSET_sjis 1
|
||||||
|
#cmakedefine HAVE_CHARSET_swe7 1
|
||||||
|
#cmakedefine HAVE_CHARSET_tis620 1
|
||||||
|
#cmakedefine HAVE_CHARSET_ucs2 1
|
||||||
|
#cmakedefine HAVE_CHARSET_ujis 1
|
||||||
|
#cmakedefine HAVE_CHARSET_utf8mb4 1
|
||||||
|
#cmakedefine HAVE_CHARSET_utf8mb3 1
|
||||||
|
#cmakedefine HAVE_CHARSET_utf8 1
|
||||||
|
#cmakedefine HAVE_CHARSET_utf16 1
|
||||||
|
#cmakedefine HAVE_CHARSET_utf32 1
|
||||||
|
#cmakedefine HAVE_UCA_COLLATIONS 1
|
||||||
|
#cmakedefine HAVE_COMPRESS 1
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Stuff that always need to be defined (compile breaks without it)
|
||||||
|
*/
|
||||||
|
#define HAVE_SPATIAL 1
|
||||||
|
#define HAVE_RTREE_KEYS 1
|
||||||
|
#define HAVE_QUERY_CACHE 1
|
||||||
|
#define BIG_TABLES 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
Important storage engines (those that really need define
|
||||||
|
WITH_<ENGINE>_STORAGE_ENGINE for the whole server)
|
||||||
|
*/
|
||||||
|
#cmakedefine WITH_MYISAM_STORAGE_ENGINE 1
|
||||||
|
#cmakedefine WITH_MYISAMMRG_STORAGE_ENGINE 1
|
||||||
|
#cmakedefine WITH_HEAP_STORAGE_ENGINE 1
|
||||||
|
#cmakedefine WITH_CSV_STORAGE_ENGINE 1
|
||||||
|
#cmakedefine WITH_PARTITION_STORAGE_ENGINE 1
|
||||||
|
#cmakedefine WITH_PERFSCHEMA_STORAGE_ENGINE 1
|
||||||
|
#cmakedefine WITH_NDBCLUSTER_STORAGE_ENGINE 1
|
||||||
|
#if (WITH_NDBCLUSTER_STORAGE_ENGINE) && !defined(EMBEDDED_LIBRARY)
|
||||||
|
#define HAVE_NDB_BINLOG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#cmakedefine DEFAULT_MYSQL_HOME "@DEFAULT_MYSQL_HOME@"
|
||||||
|
#cmakedefine SHAREDIR "@SHAREDIR@"
|
||||||
|
#cmakedefine DEFAULT_BASEDIR "@DEFAULT_BASEDIR@"
|
||||||
|
#cmakedefine MYSQL_DATADIR "@MYSQL_DATADIR@"
|
||||||
|
#cmakedefine DEFAULT_CHARSET_HOME "@DEFAULT_CHARSET_HOME@"
|
||||||
|
#cmakedefine PLUGINDIR "@PLUGINDIR@"
|
||||||
|
#cmakedefine DEFAULT_SYSCONFDIR "@DEFAULT_SYSCONFDIR@"
|
||||||
|
|
||||||
|
#define PACKAGE "mysql"
|
||||||
|
#define PACKAGE_BUGREPORT ""
|
||||||
|
#define PACKAGE_NAME "MySQL Server"
|
||||||
|
#define PACKAGE_STRING "MySQL Server @VERSION@"
|
||||||
|
#define PACKAGE_TARNAME "mysql"
|
||||||
|
#define PACKAGE_VERSION "@VERSION@"
|
||||||
|
#define VERSION "@VERSION@"
|
||||||
|
#define PROTOCOL_VERSION 10
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -13,11 +13,11 @@ define(CHARSETS_AVAILABLE1,armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257)
|
|||||||
define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8)
|
define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8)
|
||||||
define(CHARSETS_AVAILABLE3,greek hebrew hp8 keybcs2 koi8r koi8u)
|
define(CHARSETS_AVAILABLE3,greek hebrew hp8 keybcs2 koi8r koi8u)
|
||||||
define(CHARSETS_AVAILABLE4,latin1 latin2 latin5 latin7 macce macroman)
|
define(CHARSETS_AVAILABLE4,latin1 latin2 latin5 latin7 macce macroman)
|
||||||
define(CHARSETS_AVAILABLE5,sjis swe7 tis620 ucs2 ujis utf8)
|
define(CHARSETS_AVAILABLE5,sjis swe7 tis620 ucs2 ujis utf8mb4 utf8 utf16 utf32)
|
||||||
|
|
||||||
DEFAULT_CHARSET=latin1
|
DEFAULT_CHARSET=latin1
|
||||||
CHARSETS_AVAILABLE="CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 CHARSETS_AVAILABLE4 CHARSETS_AVAILABLE5"
|
CHARSETS_AVAILABLE="CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 CHARSETS_AVAILABLE4 CHARSETS_AVAILABLE5"
|
||||||
CHARSETS_COMPLEX="big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8"
|
CHARSETS_COMPLEX="big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8mb4 utf8 utf16 utf32"
|
||||||
|
|
||||||
AC_DIVERT_POP
|
AC_DIVERT_POP
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ AC_ARG_WITH(extra-charsets,
|
|||||||
|
|
||||||
AC_MSG_CHECKING("character sets")
|
AC_MSG_CHECKING("character sets")
|
||||||
|
|
||||||
CHARSETS="$default_charset latin1 utf8"
|
CHARSETS="$default_charset latin1 utf8mb4 utf8"
|
||||||
|
|
||||||
if test "$extra_charsets" = no; then
|
if test "$extra_charsets" = no; then
|
||||||
CHARSETS="$CHARSETS"
|
CHARSETS="$CHARSETS"
|
||||||
@ -195,8 +195,23 @@ do
|
|||||||
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
|
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
|
||||||
AC_DEFINE(USE_MB_IDENT, 1)
|
AC_DEFINE(USE_MB_IDENT, 1)
|
||||||
;;
|
;;
|
||||||
|
utf8mb4)
|
||||||
|
AC_DEFINE(HAVE_CHARSET_utf8mb4, 1, [Define to enable utf8mb4])
|
||||||
|
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
|
||||||
|
AC_DEFINE(USE_MB_IDENT, 1)
|
||||||
|
;;
|
||||||
utf8)
|
utf8)
|
||||||
AC_DEFINE(HAVE_CHARSET_utf8, 1, [Define to enable ut8])
|
AC_DEFINE(HAVE_CHARSET_utf8, 1, [Define to enable utf8])
|
||||||
|
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
|
||||||
|
AC_DEFINE(USE_MB_IDENT, 1)
|
||||||
|
;;
|
||||||
|
utf16)
|
||||||
|
AC_DEFINE(HAVE_CHARSET_utf16, 1, [Define to enable utf16])
|
||||||
|
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
|
||||||
|
AC_DEFINE(USE_MB_IDENT, 1)
|
||||||
|
;;
|
||||||
|
utf32)
|
||||||
|
AC_DEFINE(HAVE_CHARSET_utf32, 1, [Define to enable utf32])
|
||||||
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
|
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
|
||||||
AC_DEFINE(USE_MB_IDENT, 1)
|
AC_DEFINE(USE_MB_IDENT, 1)
|
||||||
;;
|
;;
|
||||||
@ -381,6 +396,48 @@ case $default_charset in
|
|||||||
fi
|
fi
|
||||||
default_charset_collations="$UTFC"
|
default_charset_collations="$UTFC"
|
||||||
;;
|
;;
|
||||||
|
utf8mb4)
|
||||||
|
default_charset_default_collation="utf8mb4_general_ci"
|
||||||
|
define(UTFC1, utf8mb4_general_ci utf8mb4_bin)
|
||||||
|
define(UTFC2, utf8mb4_czech_ci utf8mb4_danish_ci)
|
||||||
|
define(UTFC3, utf8mb4_esperanto_ci utf8mb4_estonian_ci utf8mb4_hungarian_ci)
|
||||||
|
define(UTFC4, utf8mb4_icelandic_ci utf8mb4_latvian_ci utf8mb4_lithuanian_ci)
|
||||||
|
define(UTFC5, utf8mb4_persian_ci utf8mb4_polish_ci utf8mb4_romanian_ci)
|
||||||
|
define(UTFC6, utf8mb4_sinhala_ci utf8mb4_slovak_ci utf8mb4_slovenian_ci)
|
||||||
|
define(UTFC7, utf8mb4_spanish2_ci utf8mb4_spanish_ci)
|
||||||
|
define(UTFC8, utf8mb4_swedish_ci utf8mb4_turkish_ci)
|
||||||
|
define(UTFC9, utf8mb4_unicode_ci)
|
||||||
|
UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
|
||||||
|
default_charset_collations="$UTFC"
|
||||||
|
;;
|
||||||
|
utf16)
|
||||||
|
default_charset_default_collation="utf16_general_ci"
|
||||||
|
define(UTFC1, utf16_general_ci utf16_bin)
|
||||||
|
define(UTFC2, utf16_czech_ci utf16_danish_ci)
|
||||||
|
define(UTFC3, utf16_esperanto_ci utf16_estonian_ci utf16_hungarian_ci)
|
||||||
|
define(UTFC4, utf16_icelandic_ci utf16_latvian_ci utf16_lithuanian_ci)
|
||||||
|
define(UTFC5, utf16_persian_ci utf16_polish_ci utf16_romanian_ci)
|
||||||
|
define(UTFC6, utf16_sinhala_ci utf16_slovak_ci utf16_slovenian_ci)
|
||||||
|
define(UTFC7, utf16_spanish2_ci utf16_spanish_ci)
|
||||||
|
define(UTFC8, utf16_swedish_ci utf16_turkish_ci)
|
||||||
|
define(UTFC9, utf16_unicode_ci)
|
||||||
|
UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
|
||||||
|
default_charset_collations="$UTFC"
|
||||||
|
;;
|
||||||
|
utf32)
|
||||||
|
default_charset_default_collation="utf32_general_ci"
|
||||||
|
define(UTFC1, utf32_general_ci utf32_bin)
|
||||||
|
define(UTFC2, utf32_czech_ci utf32_danish_ci)
|
||||||
|
define(UTFC3, utf32_esperanto_ci utf32_estonian_ci utf32_hungarian_ci)
|
||||||
|
define(UTFC4, utf32_icelandic_ci utf32_latvian_ci utf32_lithuanian_ci)
|
||||||
|
define(UTFC5, utf32_persian_ci utf32_polish_ci utf32_romanian_ci)
|
||||||
|
define(UTFC6, utf32_sinhala_ci utf32_slovak_ci utf32_slovenian_ci)
|
||||||
|
define(UTFC7, utf32_spanish2_ci utf32_spanish_ci)
|
||||||
|
define(UTFC8, utf32_swedish_ci utf32_turkish_ci)
|
||||||
|
define(UTFC9, utf32_unicode_ci)
|
||||||
|
UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
|
||||||
|
default_charset_collations="$UTFC"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE).
|
AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE).
|
||||||
See the Installation chapter in the Reference Manual.])
|
See the Installation chapter in the Reference Manual.])
|
||||||
|
1006
configure.cmake
Normal file
1006
configure.cmake
Normal file
File diff suppressed because it is too large
Load Diff
@ -839,7 +839,7 @@ AC_HEADER_DIRENT
|
|||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \
|
AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \
|
||||||
memory.h pwd.h select.h \
|
memory.h pwd.h select.h poll.h \
|
||||||
stdlib.h stddef.h \
|
stdlib.h stddef.h \
|
||||||
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
|
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
|
||||||
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
|
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
|
||||||
@ -3141,7 +3141,9 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
|
|||||||
libmysqld/Makefile libmysqld/examples/Makefile dnl
|
libmysqld/Makefile libmysqld/examples/Makefile dnl
|
||||||
mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl
|
mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl
|
||||||
netware/Makefile sql-bench/Makefile dnl
|
netware/Makefile sql-bench/Makefile dnl
|
||||||
include/mysql_version.h plugin/Makefile win/Makefile)
|
include/mysql_version.h plugin/Makefile win/Makefile
|
||||||
|
cmake/Makefile
|
||||||
|
)
|
||||||
|
|
||||||
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
|
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
|
||||||
|
|
||||||
|
@ -13,11 +13,10 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/dbug)
|
INCLUDE_DIRECTORIES(
|
||||||
|
${CMAKE_SOURCE_DIR}/dbug
|
||||||
SET(DBUG_SOURCES dbug.c factorial.c sanity.c)
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
)
|
||||||
IF(NOT SOURCE_SUBLIBS)
|
SET(DBUG_SOURCES dbug.c sanity.c)
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
ADD_CONVENIENCE_LIBRARY(dbug ${DBUG_SOURCES})
|
||||||
ADD_LIBRARY(dbug ${DBUG_SOURCES})
|
TARGET_LINK_LIBRARIES(dbug mysys)
|
||||||
ENDIF(NOT SOURCE_SUBLIBS)
|
|
||||||
|
@ -12,42 +12,69 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
|
|
||||||
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
INCLUDE_DIRECTORIES(
|
||||||
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
${ZLIB_INCLUDE_DIR}
|
||||||
|
# Following is for perror, in case NDB is compiled in.
|
||||||
|
${CMAKE_SOURCE_DIR}/storage/ndb/include
|
||||||
|
${CMAKE_SOURCE_DIR}/storage/ndb/include/util
|
||||||
|
${CMAKE_SOURCE_DIR}/storage/ndb/include/ndbapi
|
||||||
|
${CMAKE_SOURCE_DIR}/storage/ndb/include/portlib
|
||||||
|
${CMAKE_SOURCE_DIR}/storage/ndb/include/mgmapi)
|
||||||
|
|
||||||
ADD_EXECUTABLE(comp_err comp_err.c)
|
|
||||||
TARGET_LINK_LIBRARIES(comp_err dbug mysys strings zlib)
|
|
||||||
|
|
||||||
GET_TARGET_PROPERTY(COMP_ERR_EXE comp_err LOCATION)
|
IF(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
ADD_EXECUTABLE(comp_err comp_err.c)
|
||||||
|
TARGET_LINK_LIBRARIES(comp_err mysys)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
|
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/include/mysqld_error.h
|
||||||
COMMAND ${COMP_ERR_EXE}
|
${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys
|
||||||
|
COMMAND comp_err
|
||||||
--charset=${PROJECT_SOURCE_DIR}/sql/share/charsets
|
--charset=${PROJECT_SOURCE_DIR}/sql/share/charsets
|
||||||
--out-dir=${PROJECT_SOURCE_DIR}/sql/share/
|
--out-dir=${PROJECT_BINARY_DIR}/sql/share/
|
||||||
--header_file=${PROJECT_SOURCE_DIR}/include/mysqld_error.h
|
--header_file=${PROJECT_BINARY_DIR}/include/mysqld_error.h
|
||||||
--name_file=${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
|
--name_file=${PROJECT_BINARY_DIR}/include/mysqld_ername.h
|
||||||
--state_file=${PROJECT_SOURCE_DIR}/include/sql_state.h
|
--state_file=${PROJECT_BINARY_DIR}/include/sql_state.h
|
||||||
--in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt
|
--in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt
|
||||||
DEPENDS comp_err ${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt)
|
DEPENDS ${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/comp_err.c)
|
||||||
|
|
||||||
ADD_CUSTOM_TARGET(GenError
|
ADD_CUSTOM_TARGET(GenError
|
||||||
ALL
|
ALL
|
||||||
DEPENDS ${PROJECT_SOURCE_DIR}/include/mysqld_error.h)
|
DEPENDS
|
||||||
|
${PROJECT_BINARY_DIR}/include/mysqld_error.h
|
||||||
|
${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys
|
||||||
|
${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt)
|
||||||
|
|
||||||
ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
|
MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
|
||||||
TARGET_LINK_LIBRARIES(my_print_defaults strings mysys dbug taocrypt)
|
TARGET_LINK_LIBRARIES(my_print_defaults mysys)
|
||||||
|
|
||||||
ADD_EXECUTABLE(perror perror.c)
|
MYSQL_ADD_EXECUTABLE(perror perror.c)
|
||||||
TARGET_LINK_LIBRARIES(perror strings mysys dbug)
|
ADD_DEPENDENCIES(perror GenError)
|
||||||
|
TARGET_LINK_LIBRARIES(perror mysys)
|
||||||
|
|
||||||
ADD_EXECUTABLE(resolveip resolveip.c)
|
MYSQL_ADD_EXECUTABLE(resolveip resolveip.c)
|
||||||
TARGET_LINK_LIBRARIES(resolveip strings mysys dbug)
|
TARGET_LINK_LIBRARIES(resolveip mysys)
|
||||||
|
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||||
|
INCLUDE(CheckFunctionExists)
|
||||||
|
INCLUDE(CheckLibraryExists)
|
||||||
|
MY_SEARCH_LIBS(inet_aton "nsl;socket;resolv" SOLARIS_NSL)
|
||||||
|
TARGET_LINK_LIBRARIES(resolveip ${SOLARIS_NSL})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
ADD_EXECUTABLE(replace replace.c)
|
|
||||||
TARGET_LINK_LIBRARIES(replace strings mysys dbug)
|
|
||||||
|
|
||||||
IF(EMBED_MANIFESTS)
|
MYSQL_ADD_EXECUTABLE(replace replace.c)
|
||||||
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
|
TARGET_LINK_LIBRARIES(replace mysys)
|
||||||
ENDIF(EMBED_MANIFESTS)
|
IF(UNIX)
|
||||||
|
MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.c)
|
||||||
|
|
||||||
|
MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.c)
|
||||||
|
TARGET_LINK_LIBRARIES(resolve_stack_dump mysys)
|
||||||
|
|
||||||
|
MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c)
|
||||||
|
TARGET_LINK_LIBRARIES(mysql_waitpid mysys)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
@ -199,11 +199,34 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void print_escaped_string(FILE *f, const char *str)
|
||||||
|
{
|
||||||
|
const char *tmp = str;
|
||||||
|
|
||||||
|
while (tmp[0] != 0)
|
||||||
|
{
|
||||||
|
switch (tmp[0])
|
||||||
|
{
|
||||||
|
case '\\': fprintf(f, "\\\\"); break;
|
||||||
|
case '\'': fprintf(f, "\\\'"); break;
|
||||||
|
case '\"': fprintf(f, "\\\""); break;
|
||||||
|
case '\n': fprintf(f, "\\n"); break;
|
||||||
|
case '\r': fprintf(f, "\\r"); break;
|
||||||
|
default: fprintf(f, "%c", tmp[0]);
|
||||||
|
}
|
||||||
|
tmp++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int create_header_files(struct errors *error_head)
|
static int create_header_files(struct errors *error_head)
|
||||||
{
|
{
|
||||||
uint er_last;
|
uint er_last;
|
||||||
FILE *er_definef, *sql_statef, *er_namef;
|
FILE *er_definef, *sql_statef, *er_namef;
|
||||||
struct errors *tmp_error;
|
struct errors *tmp_error;
|
||||||
|
struct message *er_msg;
|
||||||
|
const char *er_text;
|
||||||
|
|
||||||
DBUG_ENTER("create_header_files");
|
DBUG_ENTER("create_header_files");
|
||||||
LINT_INIT(er_last);
|
LINT_INIT(er_last);
|
||||||
|
|
||||||
@ -245,9 +268,12 @@ static int create_header_files(struct errors *error_head)
|
|||||||
"{ %-40s,\"%s\", \"%s\" },\n", tmp_error->er_name,
|
"{ %-40s,\"%s\", \"%s\" },\n", tmp_error->er_name,
|
||||||
tmp_error->sql_code1, tmp_error->sql_code2);
|
tmp_error->sql_code1, tmp_error->sql_code2);
|
||||||
/*generating er_name file */
|
/*generating er_name file */
|
||||||
fprintf(er_namef, "{ \"%s\", %d },\n", tmp_error->er_name,
|
er_msg= find_message(tmp_error, default_language, 0);
|
||||||
|
er_text = (er_msg ? er_msg->text : "");
|
||||||
|
fprintf(er_namef, "{ \"%s\", %d, \"", tmp_error->er_name,
|
||||||
tmp_error->d_code);
|
tmp_error->d_code);
|
||||||
|
print_escaped_string(er_namef, er_text);
|
||||||
|
fprintf(er_namef, "\" },\n");
|
||||||
}
|
}
|
||||||
/* finishing off with mysqld_error.h */
|
/* finishing off with mysqld_error.h */
|
||||||
fprintf(er_definef, "#define ER_ERROR_LAST %d\n", er_last);
|
fprintf(er_definef, "#define ER_ERROR_LAST %d\n", er_last);
|
||||||
|
@ -184,6 +184,45 @@ static const char *get_ha_error_msg(int code)
|
|||||||
return NullS;
|
return NullS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
uint code;
|
||||||
|
const char *text;
|
||||||
|
} st_error;
|
||||||
|
|
||||||
|
static st_error global_error_names[] =
|
||||||
|
{
|
||||||
|
#include <mysqld_ername.h>
|
||||||
|
{ 0, 0, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Lookup an error by code in the global_error_names array.
|
||||||
|
@param code the code to lookup
|
||||||
|
@param [out] name_ptr the error name, when found
|
||||||
|
@param [out] msg_ptr the error text, when found
|
||||||
|
@return 1 when found, otherwise 0
|
||||||
|
*/
|
||||||
|
int get_ER_error_msg(uint code, const char **name_ptr, const char **msg_ptr)
|
||||||
|
{
|
||||||
|
st_error *tmp_error;
|
||||||
|
|
||||||
|
tmp_error= & global_error_names[0];
|
||||||
|
|
||||||
|
while (tmp_error->name != NULL)
|
||||||
|
{
|
||||||
|
if (tmp_error->code == code)
|
||||||
|
{
|
||||||
|
*name_ptr= tmp_error->name;
|
||||||
|
*msg_ptr= tmp_error->text;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
tmp_error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
static my_bool print_win_error_msg(DWORD error, my_bool verbose)
|
static my_bool print_win_error_msg(DWORD error, my_bool verbose)
|
||||||
@ -211,6 +250,7 @@ int main(int argc,char *argv[])
|
|||||||
{
|
{
|
||||||
int error,code,found;
|
int error,code,found;
|
||||||
const char *msg;
|
const char *msg;
|
||||||
|
const char *name;
|
||||||
char *unknown_error = 0;
|
char *unknown_error = 0;
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
my_bool skip_win_message= 0;
|
my_bool skip_win_message= 0;
|
||||||
@ -316,6 +356,14 @@ int main(int argc,char *argv[])
|
|||||||
else
|
else
|
||||||
puts(msg);
|
puts(msg);
|
||||||
}
|
}
|
||||||
|
if (get_ER_error_msg(code, & name, & msg))
|
||||||
|
{
|
||||||
|
found= 1;
|
||||||
|
if (verbose)
|
||||||
|
printf("MySQL error code %3d (%s): %s\n", code, name, msg);
|
||||||
|
else
|
||||||
|
puts(msg);
|
||||||
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
|
@ -13,16 +13,23 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/include
|
INCLUDE_DIRECTORIES(
|
||||||
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
${CMAKE_SOURCE_DIR}/extra/yassl/include
|
||||||
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include
|
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include
|
||||||
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
|
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
|
||||||
|
|
||||||
ADD_DEFINITIONS("-D_LIB -DYASSL_PREFIX")
|
ADD_DEFINITIONS(${SSL_DEFINES})
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUXX)
|
||||||
|
#Remove -fno-implicit-templates
|
||||||
|
#(yassl sources cannot be compiled with it)
|
||||||
|
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS
|
||||||
|
${CMAKE_CXX_FLAGS})
|
||||||
|
ENDIF()
|
||||||
SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp
|
SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp
|
||||||
src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
|
src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
|
||||||
src/yassl_imp.cpp src/yassl_int.cpp)
|
src/yassl_imp.cpp src/yassl_int.cpp)
|
||||||
IF(NOT SOURCE_SUBLIBS)
|
ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES})
|
||||||
ADD_LIBRARY(yassl ${YASSL_SOURCES})
|
RESTRICT_SYMBOL_EXPORTS(yassl)
|
||||||
ADD_DEPENDENCIES(yassl GenError)
|
|
||||||
ENDIF(NOT SOURCE_SUBLIBS)
|
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL
|
||||||
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include)
|
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include)
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||||
|
ADD_DEFINITIONS(${SSL_DEFINES})
|
||||||
SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp
|
SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp
|
||||||
src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp
|
src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp
|
||||||
src/md4.cpp src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp
|
src/md4.cpp src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp
|
||||||
@ -24,6 +26,6 @@ SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp
|
|||||||
include/error.hpp include/file.hpp include/hash.hpp include/hmac.hpp include/integer.hpp
|
include/error.hpp include/file.hpp include/hash.hpp include/hmac.hpp include/integer.hpp
|
||||||
include/md2.hpp include/md5.hpp include/misc.hpp include/modarith.hpp include/modes.hpp
|
include/md2.hpp include/md5.hpp include/misc.hpp include/modarith.hpp include/modes.hpp
|
||||||
include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp)
|
include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp)
|
||||||
IF(NOT SOURCE_SUBLIBS)
|
ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES})
|
||||||
ADD_LIBRARY(taocrypt ${TAOCRYPT_SOURCES})
|
RESTRICT_SYMBOL_EXPORTS(taocrypt)
|
||||||
ENDIF(NOT SOURCE_SUBLIBS)
|
|
||||||
|
63
include/CMakeLists.txt
Normal file
63
include/CMakeLists.txt
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
SET(HEADERS_GEN_CONFIGURE
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/mysql_version.h
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/my_config.h
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/mysqld_ername.h
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/mysqld_error.h
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/sql_state.h
|
||||||
|
)
|
||||||
|
SET(HEADERS_ABI
|
||||||
|
mysql.h
|
||||||
|
mysql_com.h
|
||||||
|
mysql_time.h
|
||||||
|
my_list.h
|
||||||
|
my_alloc.h
|
||||||
|
typelib.h
|
||||||
|
mysql/plugin.h
|
||||||
|
mysql/plugin_audit.h
|
||||||
|
mysql/plugin_ftparser.h
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(HEADERS
|
||||||
|
${HEADERS_ABI}
|
||||||
|
my_dbug.h
|
||||||
|
m_string.h
|
||||||
|
my_sys.h
|
||||||
|
my_xml.h
|
||||||
|
mysql_embed.h
|
||||||
|
my_pthread.h
|
||||||
|
my_no_pthread.h
|
||||||
|
decimal.h
|
||||||
|
errmsg.h
|
||||||
|
my_global.h
|
||||||
|
my_net.h
|
||||||
|
my_getopt.h
|
||||||
|
sslopt-longopts.h
|
||||||
|
my_dir.h
|
||||||
|
sslopt-vars.h
|
||||||
|
sslopt-case.h
|
||||||
|
sql_common.h
|
||||||
|
keycache.h
|
||||||
|
m_ctype.h
|
||||||
|
my_attribute.h
|
||||||
|
${HEADERS_GEN_CONFIGURE}
|
||||||
|
)
|
||||||
|
|
||||||
|
INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR})
|
||||||
|
INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h")
|
||||||
|
|
||||||
|
|
@ -48,6 +48,7 @@ noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
|
|||||||
atomic/solaris.h
|
atomic/solaris.h
|
||||||
|
|
||||||
EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp probes_mysql.d.base \
|
EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp probes_mysql.d.base \
|
||||||
|
CMakeLists.txt \
|
||||||
mysql/psi/psi_abi_v1.h.pp \
|
mysql/psi/psi_abi_v1.h.pp \
|
||||||
mysql/psi/psi_abi_v2.h.pp
|
mysql/psi/psi_abi_v2.h.pp
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
*/
|
*/
|
||||||
#define make_atomic_add_body64 \
|
#define make_atomic_add_body64 \
|
||||||
int64 tmp=*a; \
|
int64 tmp=*a; \
|
||||||
while (!my_atomic_cas64(a, &tmp, tmp+v)); \
|
while (!my_atomic_cas64(a, &tmp, tmp+v)) ; \
|
||||||
v=tmp;
|
v=tmp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -432,6 +432,9 @@ inline ulonglong double2ulonglong(double d)
|
|||||||
#define HAVE_CHARSET_ucs2 1
|
#define HAVE_CHARSET_ucs2 1
|
||||||
#define HAVE_CHARSET_ujis 1
|
#define HAVE_CHARSET_ujis 1
|
||||||
#define HAVE_CHARSET_utf8 1
|
#define HAVE_CHARSET_utf8 1
|
||||||
|
#define HAVE_CHARSET_utf8mb4 1
|
||||||
|
#define HAVE_CHARSET_utf16 1
|
||||||
|
#define HAVE_CHARSET_utf32 1
|
||||||
|
|
||||||
#define HAVE_UCA_COLLATIONS 1
|
#define HAVE_UCA_COLLATIONS 1
|
||||||
#define HAVE_BOOL 1
|
#define HAVE_BOOL 1
|
||||||
|
@ -67,7 +67,7 @@ typedef struct st_key_cache
|
|||||||
HASH_LINK *free_hash_list; /* list of free hash links */
|
HASH_LINK *free_hash_list; /* list of free hash links */
|
||||||
BLOCK_LINK *free_block_list; /* list of free blocks */
|
BLOCK_LINK *free_block_list; /* list of free blocks */
|
||||||
BLOCK_LINK *block_root; /* memory for block links */
|
BLOCK_LINK *block_root; /* memory for block links */
|
||||||
uchar HUGE_PTR *block_mem; /* memory for block buffers */
|
uchar *block_mem; /* memory for block buffers */
|
||||||
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
|
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
|
||||||
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
|
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
|
||||||
mysql_mutex_t cache_lock; /* to lock access to the cache structure */
|
mysql_mutex_t cache_lock; /* to lock access to the cache structure */
|
||||||
|
@ -38,6 +38,23 @@ extern "C" {
|
|||||||
|
|
||||||
#define my_wc_t ulong
|
#define my_wc_t ulong
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
On i386 we store Unicode->CS conversion tables for
|
||||||
|
some character sets using Big-endian order,
|
||||||
|
to copy two bytes at onces.
|
||||||
|
This gives some performance improvement.
|
||||||
|
*/
|
||||||
|
#ifdef __i386__
|
||||||
|
#define MB2(x) (((x) >> 8) + (((x) & 0xFF) << 8))
|
||||||
|
#define MY_PUT_MB2(s, code) { *((uint16*)(s))= (code); }
|
||||||
|
#else
|
||||||
|
#define MB2(x) (x)
|
||||||
|
#define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct unicase_info_st
|
typedef struct unicase_info_st
|
||||||
{
|
{
|
||||||
uint32 toupper;
|
uint32 toupper;
|
||||||
@ -81,13 +98,14 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
|
|||||||
#define MY_CS_BINSORT 16 /* if binary sort order */
|
#define MY_CS_BINSORT 16 /* if binary sort order */
|
||||||
#define MY_CS_PRIMARY 32 /* if primary collation */
|
#define MY_CS_PRIMARY 32 /* if primary collation */
|
||||||
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */
|
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */
|
||||||
#define MY_CS_UNICODE 128 /* is a charset is full unicode */
|
#define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */
|
||||||
#define MY_CS_READY 256 /* if a charset is initialized */
|
#define MY_CS_READY 256 /* if a charset is initialized */
|
||||||
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
|
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
|
||||||
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
|
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
|
||||||
#define MY_CS_HIDDEN 2048 /* don't display in SHOW */
|
#define MY_CS_HIDDEN 2048 /* don't display in SHOW */
|
||||||
#define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */
|
#define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */
|
||||||
#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */
|
#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */
|
||||||
|
#define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */
|
||||||
#define MY_CHARSET_UNDEFINED 0
|
#define MY_CHARSET_UNDEFINED 0
|
||||||
|
|
||||||
/* Character repertoire flags */
|
/* Character repertoire flags */
|
||||||
@ -95,7 +113,6 @@ extern MY_UNI_CTYPE my_uni_ctype[256];
|
|||||||
#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */
|
#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */
|
||||||
#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
|
#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
|
||||||
|
|
||||||
|
|
||||||
typedef struct my_uni_idx_st
|
typedef struct my_uni_idx_st
|
||||||
{
|
{
|
||||||
uint16 from;
|
uint16 from;
|
||||||
@ -287,10 +304,14 @@ typedef struct charset_info_st
|
|||||||
|
|
||||||
|
|
||||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin;
|
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin;
|
||||||
|
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1;
|
||||||
|
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename;
|
||||||
|
|
||||||
extern CHARSET_INFO my_charset_big5_chinese_ci;
|
extern CHARSET_INFO my_charset_big5_chinese_ci;
|
||||||
extern CHARSET_INFO my_charset_big5_bin;
|
extern CHARSET_INFO my_charset_big5_bin;
|
||||||
extern CHARSET_INFO my_charset_cp932_japanese_ci;
|
extern CHARSET_INFO my_charset_cp932_japanese_ci;
|
||||||
extern CHARSET_INFO my_charset_cp932_bin;
|
extern CHARSET_INFO my_charset_cp932_bin;
|
||||||
|
extern CHARSET_INFO my_charset_cp1250_czech_ci;
|
||||||
extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
|
extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
|
||||||
extern CHARSET_INFO my_charset_eucjpms_bin;
|
extern CHARSET_INFO my_charset_eucjpms_bin;
|
||||||
extern CHARSET_INFO my_charset_euckr_korean_ci;
|
extern CHARSET_INFO my_charset_euckr_korean_ci;
|
||||||
@ -299,7 +320,6 @@ extern CHARSET_INFO my_charset_gb2312_chinese_ci;
|
|||||||
extern CHARSET_INFO my_charset_gb2312_bin;
|
extern CHARSET_INFO my_charset_gb2312_bin;
|
||||||
extern CHARSET_INFO my_charset_gbk_chinese_ci;
|
extern CHARSET_INFO my_charset_gbk_chinese_ci;
|
||||||
extern CHARSET_INFO my_charset_gbk_bin;
|
extern CHARSET_INFO my_charset_gbk_bin;
|
||||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1;
|
|
||||||
extern CHARSET_INFO my_charset_latin1_german2_ci;
|
extern CHARSET_INFO my_charset_latin1_german2_ci;
|
||||||
extern CHARSET_INFO my_charset_latin1_bin;
|
extern CHARSET_INFO my_charset_latin1_bin;
|
||||||
extern CHARSET_INFO my_charset_latin2_czech_ci;
|
extern CHARSET_INFO my_charset_latin2_czech_ci;
|
||||||
@ -312,11 +332,22 @@ extern CHARSET_INFO my_charset_ucs2_bin;
|
|||||||
extern CHARSET_INFO my_charset_ucs2_unicode_ci;
|
extern CHARSET_INFO my_charset_ucs2_unicode_ci;
|
||||||
extern CHARSET_INFO my_charset_ujis_japanese_ci;
|
extern CHARSET_INFO my_charset_ujis_japanese_ci;
|
||||||
extern CHARSET_INFO my_charset_ujis_bin;
|
extern CHARSET_INFO my_charset_ujis_bin;
|
||||||
|
extern CHARSET_INFO my_charset_utf16_bin;
|
||||||
|
extern CHARSET_INFO my_charset_utf16_general_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf16_unicode_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf32_bin;
|
||||||
|
extern CHARSET_INFO my_charset_utf32_general_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf32_unicode_ci;
|
||||||
|
|
||||||
extern CHARSET_INFO my_charset_utf8_general_ci;
|
extern CHARSET_INFO my_charset_utf8_general_ci;
|
||||||
extern CHARSET_INFO my_charset_utf8_unicode_ci;
|
extern CHARSET_INFO my_charset_utf8_unicode_ci;
|
||||||
extern CHARSET_INFO my_charset_utf8_bin;
|
extern CHARSET_INFO my_charset_utf8_bin;
|
||||||
extern CHARSET_INFO my_charset_cp1250_czech_ci;
|
extern CHARSET_INFO my_charset_utf8mb4_bin;
|
||||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename;
|
extern CHARSET_INFO my_charset_utf8mb4_general_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8mb4_unicode_ci;
|
||||||
|
#define MY_UTF8MB3 "utf8"
|
||||||
|
#define MY_UTF8MB4 "utf8mb4"
|
||||||
|
|
||||||
|
|
||||||
/* declarations for simple charsets */
|
/* declarations for simple charsets */
|
||||||
extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
|
extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
|
||||||
@ -413,6 +444,19 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
|
|||||||
char *min_str, char *max_str,
|
char *min_str, char *max_str,
|
||||||
size_t *min_length, size_t *max_length);
|
size_t *min_length, size_t *max_length);
|
||||||
|
|
||||||
|
my_bool my_like_range_utf16(CHARSET_INFO *cs,
|
||||||
|
const char *ptr, size_t ptr_length,
|
||||||
|
pbool escape, pbool w_one, pbool w_many,
|
||||||
|
size_t res_length,
|
||||||
|
char *min_str, char *max_str,
|
||||||
|
size_t *min_length, size_t *max_length);
|
||||||
|
|
||||||
|
my_bool my_like_range_utf32(CHARSET_INFO *cs,
|
||||||
|
const char *ptr, size_t ptr_length,
|
||||||
|
pbool escape, pbool w_one, pbool w_many,
|
||||||
|
size_t res_length,
|
||||||
|
char *min_str, char *max_str,
|
||||||
|
size_t *min_length, size_t *max_length);
|
||||||
|
|
||||||
int my_wildcmp_8bit(CHARSET_INFO *,
|
int my_wildcmp_8bit(CHARSET_INFO *,
|
||||||
const char *str,const char *str_end,
|
const char *str,const char *str_end,
|
||||||
@ -463,6 +507,31 @@ uint my_instr_mb(struct charset_info_st *,
|
|||||||
const char *s, size_t s_length,
|
const char *s, size_t s_length,
|
||||||
my_match_t *match, uint nmatch);
|
my_match_t *match, uint nmatch);
|
||||||
|
|
||||||
|
int my_strnncoll_mb_bin(CHARSET_INFO * cs,
|
||||||
|
const uchar *s, size_t slen,
|
||||||
|
const uchar *t, size_t tlen,
|
||||||
|
my_bool t_is_prefix);
|
||||||
|
|
||||||
|
int my_strnncollsp_mb_bin(CHARSET_INFO *cs,
|
||||||
|
const uchar *a, size_t a_length,
|
||||||
|
const uchar *b, size_t b_length,
|
||||||
|
my_bool diff_if_only_endspace_difference);
|
||||||
|
|
||||||
|
int my_wildcmp_mb_bin(CHARSET_INFO *cs,
|
||||||
|
const char *str,const char *str_end,
|
||||||
|
const char *wildstr,const char *wildend,
|
||||||
|
int escape, int w_one, int w_many);
|
||||||
|
|
||||||
|
int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
|
||||||
|
const char *s, const char *t);
|
||||||
|
|
||||||
|
void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
|
const uchar *key, size_t len,ulong *nr1, ulong *nr2);
|
||||||
|
|
||||||
|
size_t my_strnxfrm_unicode(CHARSET_INFO *,
|
||||||
|
uchar *dst, size_t dstlen,
|
||||||
|
const uchar *src, size_t srclen);
|
||||||
|
|
||||||
int my_wildcmp_unicode(CHARSET_INFO *cs,
|
int my_wildcmp_unicode(CHARSET_INFO *cs,
|
||||||
const char *str, const char *str_end,
|
const char *str, const char *str_end,
|
||||||
const char *wildstr, const char *wildend,
|
const char *wildstr, const char *wildend,
|
||||||
|
@ -77,13 +77,13 @@
|
|||||||
#ifndef make_atomic_add_body
|
#ifndef make_atomic_add_body
|
||||||
#define make_atomic_add_body(S) \
|
#define make_atomic_add_body(S) \
|
||||||
int ## S tmp=*a; \
|
int ## S tmp=*a; \
|
||||||
while (!my_atomic_cas ## S(a, &tmp, tmp+v)); \
|
while (!my_atomic_cas ## S(a, &tmp, tmp+v)) ; \
|
||||||
v=tmp;
|
v=tmp;
|
||||||
#endif
|
#endif
|
||||||
#ifndef make_atomic_fas_body
|
#ifndef make_atomic_fas_body
|
||||||
#define make_atomic_fas_body(S) \
|
#define make_atomic_fas_body(S) \
|
||||||
int ## S tmp=*a; \
|
int ## S tmp=*a; \
|
||||||
while (!my_atomic_cas ## S(a, &tmp, v)); \
|
while (!my_atomic_cas ## S(a, &tmp, v)) ; \
|
||||||
v=tmp;
|
v=tmp;
|
||||||
#endif
|
#endif
|
||||||
#ifndef make_atomic_load_body
|
#ifndef make_atomic_load_body
|
||||||
@ -105,7 +105,7 @@
|
|||||||
warning: 'transparent_union' attribute ignored
|
warning: 'transparent_union' attribute ignored
|
||||||
*/
|
*/
|
||||||
#if defined(__GNUC__) && !defined(__cplusplus) && \
|
#if defined(__GNUC__) && !defined(__cplusplus) && \
|
||||||
! (defined(__APPLE__) && defined(_ARCH_PPC64))
|
! (defined(__APPLE__) && (defined(_ARCH_PPC64) ||defined (_ARCH_PPC)))
|
||||||
/*
|
/*
|
||||||
we want to be able to use my_atomic_xxx functions with
|
we want to be able to use my_atomic_xxx functions with
|
||||||
both signed and unsigned integers. But gcc will issue a warning
|
both signed and unsigned integers. But gcc will issue a warning
|
||||||
|
@ -191,10 +191,11 @@ enum ha_extra_function {
|
|||||||
/* Inform handler that we will do a rename */
|
/* Inform handler that we will do a rename */
|
||||||
HA_EXTRA_PREPARE_FOR_RENAME,
|
HA_EXTRA_PREPARE_FOR_RENAME,
|
||||||
/*
|
/*
|
||||||
Orders MERGE handler to attach or detach its child tables. Used at
|
Special actions for MERGE tables.
|
||||||
begin and end of a statement.
|
|
||||||
*/
|
*/
|
||||||
|
HA_EXTRA_ADD_CHILDREN_LIST,
|
||||||
HA_EXTRA_ATTACH_CHILDREN,
|
HA_EXTRA_ATTACH_CHILDREN,
|
||||||
|
HA_EXTRA_IS_ATTACHED_CHILDREN,
|
||||||
HA_EXTRA_DETACH_CHILDREN
|
HA_EXTRA_DETACH_CHILDREN
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -272,6 +273,7 @@ enum ha_base_keytype {
|
|||||||
#define HA_SPACE_PACK_USED 4 /* Test for if SPACE_PACK used */
|
#define HA_SPACE_PACK_USED 4 /* Test for if SPACE_PACK used */
|
||||||
#define HA_VAR_LENGTH_KEY 8
|
#define HA_VAR_LENGTH_KEY 8
|
||||||
#define HA_NULL_PART_KEY 64
|
#define HA_NULL_PART_KEY 64
|
||||||
|
#define HA_USES_COMMENT 4096
|
||||||
#define HA_USES_PARSER 16384 /* Fulltext index uses [pre]parser */
|
#define HA_USES_PARSER 16384 /* Fulltext index uses [pre]parser */
|
||||||
#define HA_USES_BLOCK_SIZE ((uint) 32768)
|
#define HA_USES_BLOCK_SIZE ((uint) 32768)
|
||||||
#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */
|
#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */
|
||||||
|
@ -68,8 +68,8 @@
|
|||||||
#define C_MODE_END
|
#define C_MODE_END
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
|
#if defined(_WIN32)
|
||||||
#include <config-win.h>
|
#include <my_config.h>
|
||||||
#elif defined(__NETWARE__)
|
#elif defined(__NETWARE__)
|
||||||
#include <my_config.h>
|
#include <my_config.h>
|
||||||
#include <config-netware.h>
|
#include <config-netware.h>
|
||||||
@ -141,6 +141,49 @@
|
|||||||
#define NETWARE_SET_SCREEN_MODE(A)
|
#define NETWARE_SET_SCREEN_MODE(A)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined (_WIN32)
|
||||||
|
/*
|
||||||
|
off_t is 32 bit long. We do not use C runtime functions
|
||||||
|
with off_t but native Win32 file IO APIs, that work with
|
||||||
|
64 bit offsets.
|
||||||
|
*/
|
||||||
|
#undef SIZEOF_OFF_T
|
||||||
|
#define SIZEOF_OFF_T 8
|
||||||
|
|
||||||
|
/*
|
||||||
|
Prevent inclusion of Windows GDI headers - they define symbol
|
||||||
|
ERROR that conflicts with mysql headers.
|
||||||
|
*/
|
||||||
|
#ifndef NOGDI
|
||||||
|
#define NOGDI
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Include common headers.*/
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <ws2tcpip.h> /* SOCKET */
|
||||||
|
#include <io.h> /* access(), chmod() */
|
||||||
|
#include <process.h> /* getpid() */
|
||||||
|
|
||||||
|
#define sleep(a) Sleep((a)*1000)
|
||||||
|
|
||||||
|
/* Define missing access() modes. */
|
||||||
|
#define F_OK 0
|
||||||
|
#define W_OK 2
|
||||||
|
|
||||||
|
/* Define missing file locking constants. */
|
||||||
|
#define F_RDLCK 1
|
||||||
|
#define F_WRLCK 2
|
||||||
|
#define F_UNLCK 3
|
||||||
|
#define F_TO_EOF 0x3FFFFFFF
|
||||||
|
|
||||||
|
/* Shared memory and named pipe connections are supported. */
|
||||||
|
#define HAVE_SMEM 1
|
||||||
|
#define HAVE_NAMED_PIPE 1
|
||||||
|
#define shared_memory_buffer_length 16000
|
||||||
|
#define default_shared_memory_base_name "MYSQL"
|
||||||
|
#endif /* _WIN32*/
|
||||||
|
|
||||||
|
|
||||||
/* Workaround for _LARGE_FILES and _LARGE_FILE_API incompatibility on AIX */
|
/* Workaround for _LARGE_FILES and _LARGE_FILE_API incompatibility on AIX */
|
||||||
#if defined(_AIX) && defined(_LARGE_FILE_API)
|
#if defined(_AIX) && defined(_LARGE_FILE_API)
|
||||||
#undef _LARGE_FILE_API
|
#undef _LARGE_FILE_API
|
||||||
@ -521,8 +564,11 @@ C_MODE_END
|
|||||||
|
|
||||||
/* Go around some bugs in different OS and compilers */
|
/* Go around some bugs in different OS and compilers */
|
||||||
#if defined (HPUX11) && defined(_LARGEFILE_SOURCE)
|
#if defined (HPUX11) && defined(_LARGEFILE_SOURCE)
|
||||||
|
#ifndef _LARGEFILE64_SOURCE
|
||||||
#define _LARGEFILE64_SOURCE
|
#define _LARGEFILE64_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H)
|
#if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H)
|
||||||
#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */
|
#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */
|
||||||
#define HAVE_ULONG
|
#define HAVE_ULONG
|
||||||
@ -680,7 +726,9 @@ C_MODE_END
|
|||||||
/* Some types that is different between systems */
|
/* Some types that is different between systems */
|
||||||
|
|
||||||
typedef int File; /* File descriptor */
|
typedef int File; /* File descriptor */
|
||||||
#ifndef Socket_defined
|
#ifdef _WIN32
|
||||||
|
typedef SOCKET my_socket;
|
||||||
|
#else
|
||||||
typedef int my_socket; /* File descriptor for sockets */
|
typedef int my_socket; /* File descriptor for sockets */
|
||||||
#define INVALID_SOCKET -1
|
#define INVALID_SOCKET -1
|
||||||
#endif
|
#endif
|
||||||
@ -768,8 +816,16 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||||||
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
|
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
|
||||||
#define FN_PARENTDIR ".." /* Parent directory; Must be a string */
|
#define FN_PARENTDIR ".." /* Parent directory; Must be a string */
|
||||||
|
|
||||||
#ifndef FN_LIBCHAR
|
#ifdef _WIN32
|
||||||
|
#define FN_LIBCHAR '\\'
|
||||||
|
#define FN_LIBCHAR2 '/'
|
||||||
|
#define FN_ROOTDIR "\\"
|
||||||
|
#define FN_DEVCHAR ':'
|
||||||
|
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
|
||||||
|
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
|
||||||
|
#else
|
||||||
#define FN_LIBCHAR '/'
|
#define FN_LIBCHAR '/'
|
||||||
|
#define FN_LIBCHAR2 '/'
|
||||||
#define FN_ROOTDIR "/"
|
#define FN_ROOTDIR "/"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -852,6 +908,31 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||||||
#undef remove /* Crashes MySQL on SCO 5.0.0 */
|
#undef remove /* Crashes MySQL on SCO 5.0.0 */
|
||||||
#ifndef __WIN__
|
#ifndef __WIN__
|
||||||
#define closesocket(A) close(A)
|
#define closesocket(A) close(A)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (_MSC_VER)
|
||||||
|
#if !defined(_WIN64)
|
||||||
|
inline double my_ulonglong2double(unsigned long long value)
|
||||||
|
{
|
||||||
|
long long nr=(long long) value;
|
||||||
|
if (nr >= 0)
|
||||||
|
return (double) nr;
|
||||||
|
return (18446744073709551616.0 + (double) nr);
|
||||||
|
}
|
||||||
|
#define ulonglong2double my_ulonglong2double
|
||||||
|
#define my_off_t2double my_ulonglong2double
|
||||||
|
#endif /* _WIN64 */
|
||||||
|
inline unsigned long long my_double2ulonglong(double d)
|
||||||
|
{
|
||||||
|
double t= d - (double) 0x8000000000000000ULL;
|
||||||
|
|
||||||
|
if (t >= 0)
|
||||||
|
return ((unsigned long long) t) + 0x8000000000000000ULL;
|
||||||
|
return (unsigned long long) d;
|
||||||
|
}
|
||||||
|
#define double2ulonglong my_double2ulonglong
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef ulonglong2double
|
#ifndef ulonglong2double
|
||||||
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
||||||
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
||||||
@ -859,7 +940,6 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||||||
#ifndef double2ulonglong
|
#ifndef double2ulonglong
|
||||||
#define double2ulonglong(A) ((ulonglong) (double) (A))
|
#define double2ulonglong(A) ((ulonglong) (double) (A))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef offsetof
|
#ifndef offsetof
|
||||||
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
||||||
@ -1118,15 +1198,18 @@ typedef long long intptr;
|
|||||||
#define SYSTEM_SIZEOF_OFF_T SIZEOF_OFF_T
|
#define SYSTEM_SIZEOF_OFF_T SIZEOF_OFF_T
|
||||||
#endif /* USE_RAID */
|
#endif /* USE_RAID */
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
typedef unsigned long long my_off_t;
|
||||||
|
typedef unsigned long long os_off_t;
|
||||||
|
#else
|
||||||
|
typedef off_t os_off_t;
|
||||||
#if SIZEOF_OFF_T > 4
|
#if SIZEOF_OFF_T > 4
|
||||||
typedef ulonglong my_off_t;
|
typedef ulonglong my_off_t;
|
||||||
#else
|
#else
|
||||||
typedef unsigned long my_off_t;
|
typedef unsigned long my_off_t;
|
||||||
#endif
|
#endif
|
||||||
|
#endif /*_WIN32*/
|
||||||
#define MY_FILEPOS_ERROR (~(my_off_t) 0)
|
#define MY_FILEPOS_ERROR (~(my_off_t) 0)
|
||||||
#if !defined(__WIN__)
|
|
||||||
typedef off_t os_off_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
#define socket_errno WSAGetLastError()
|
#define socket_errno WSAGetLastError()
|
||||||
@ -1153,9 +1236,6 @@ typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
|
|||||||
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
|
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
|
||||||
typedef int myf; /* Type of MyFlags in my_funcs */
|
typedef int myf; /* Type of MyFlags in my_funcs */
|
||||||
typedef char my_bool; /* Small bool */
|
typedef char my_bool; /* Small bool */
|
||||||
#if !defined(bool) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
|
|
||||||
typedef char bool; /* Ordinary boolean values 0 1 */
|
|
||||||
#endif
|
|
||||||
/* Macros for converting *constants* to the right type */
|
/* Macros for converting *constants* to the right type */
|
||||||
#define INT8(v) (int8) (v)
|
#define INT8(v) (int8) (v)
|
||||||
#define INT16(v) (int16) (v)
|
#define INT16(v) (int16) (v)
|
||||||
@ -1548,12 +1628,15 @@ do { doubleget_union _tmp; \
|
|||||||
#define NO_EMBEDDED_ACCESS_CHECKS
|
#define NO_EMBEDDED_ACCESS_CHECKS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_DLOPEN
|
#if defined(_WIN32)
|
||||||
#if defined(__WIN__)
|
#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
|
||||||
#define dlsym(lib, name) GetProcAddress((HMODULE)lib, name)
|
|
||||||
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
|
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
|
||||||
#define dlclose(lib) FreeLibrary((HMODULE)lib)
|
#define dlclose(lib) FreeLibrary((HMODULE)lib)
|
||||||
#elif defined(HAVE_DLFCN_H)
|
#define HAVE_DLOPEN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_DLOPEN
|
||||||
|
#if defined(HAVE_DLFCN_H)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -1611,6 +1694,25 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
|
|||||||
#define bool In_C_you_should_use_my_bool_instead()
|
#define bool In_C_you_should_use_my_bool_instead()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Provide __func__ macro definition for platforms that miss it. */
|
||||||
|
#if __STDC_VERSION__ < 199901L
|
||||||
|
# if __GNUC__ >= 2
|
||||||
|
# define __func__ __FUNCTION__
|
||||||
|
# else
|
||||||
|
# define __func__ "<unknown>"
|
||||||
|
# endif
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
# if _MSC_VER < 1300
|
||||||
|
# define __func__ "<unknown>"
|
||||||
|
# else
|
||||||
|
# define __func__ __FUNCTION__
|
||||||
|
# endif
|
||||||
|
#elif defined(__BORLANDC__)
|
||||||
|
# define __func__ __FUNC__
|
||||||
|
#else
|
||||||
|
# define __func__ "<unknown>"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_RINT
|
#ifndef HAVE_RINT
|
||||||
/**
|
/**
|
||||||
All integers up to this number can be represented exactly as double precision
|
All integers up to this number can be represented exactly as double precision
|
||||||
|
@ -102,6 +102,19 @@ struct timespec {
|
|||||||
(ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
|
(ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Compare two timespec structs.
|
||||||
|
|
||||||
|
@retval 1 If TS1 ends after TS2.
|
||||||
|
|
||||||
|
@retval 0 If TS1 is equal to TS2.
|
||||||
|
|
||||||
|
@retval -1 If TS1 ends before TS2.
|
||||||
|
*/
|
||||||
|
#define cmp_timespec(TS1, TS2) \
|
||||||
|
((TS1.tv.i64 > TS2.tv.i64) ? 1 : \
|
||||||
|
((TS1.tv.i64 < TS2.tv.i64) ? -1 : 0))
|
||||||
|
|
||||||
|
|
||||||
int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
|
int win_pthread_mutex_trylock(pthread_mutex_t *mutex);
|
||||||
int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *);
|
int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *);
|
||||||
@ -121,9 +134,11 @@ struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
|
|||||||
|
|
||||||
void pthread_exit(void *a);
|
void pthread_exit(void *a);
|
||||||
int pthread_join(pthread_t thread, void **value_ptr);
|
int pthread_join(pthread_t thread, void **value_ptr);
|
||||||
|
int pthread_cancel(pthread_t thread);
|
||||||
|
|
||||||
|
#ifndef ETIMEDOUT
|
||||||
#define ETIMEDOUT 145 /* Win32 doesn't have this */
|
#define ETIMEDOUT 145 /* Win32 doesn't have this */
|
||||||
|
#endif
|
||||||
#define HAVE_LOCALTIME_R 1
|
#define HAVE_LOCALTIME_R 1
|
||||||
#define _REENTRANT 1
|
#define _REENTRANT 1
|
||||||
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
||||||
@ -155,6 +170,7 @@ int pthread_join(pthread_t thread, void **value_ptr);
|
|||||||
#define pthread_condattr_init(A)
|
#define pthread_condattr_init(A)
|
||||||
#define pthread_condattr_destroy(A)
|
#define pthread_condattr_destroy(A)
|
||||||
#define pthread_yield() SwitchToThread()
|
#define pthread_yield() SwitchToThread()
|
||||||
|
#define my_sigset(A,B) signal(A,B)
|
||||||
|
|
||||||
#else /* Normal threads */
|
#else /* Normal threads */
|
||||||
|
|
||||||
@ -412,6 +428,33 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
|
|||||||
(ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
|
(ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
|
||||||
}
|
}
|
||||||
#endif /* !set_timespec_nsec */
|
#endif /* !set_timespec_nsec */
|
||||||
|
#endif /* HAVE_TIMESPEC_TS_SEC */
|
||||||
|
|
||||||
|
/**
|
||||||
|
Compare two timespec structs.
|
||||||
|
|
||||||
|
@retval 1 If TS1 ends after TS2.
|
||||||
|
|
||||||
|
@retval 0 If TS1 is equal to TS2.
|
||||||
|
|
||||||
|
@retval -1 If TS1 ends before TS2.
|
||||||
|
*/
|
||||||
|
#ifdef HAVE_TIMESPEC_TS_SEC
|
||||||
|
#ifndef cmp_timespec
|
||||||
|
#define cmp_timespec(TS1, TS2) \
|
||||||
|
((TS1.ts_sec > TS2.ts_sec || \
|
||||||
|
(TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec > TS2.ts_nsec)) ? 1 : \
|
||||||
|
((TS1.ts_sec < TS2.ts_sec || \
|
||||||
|
(TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec < TS2.ts_nsec)) ? -1 : 0))
|
||||||
|
#endif /* !cmp_timespec */
|
||||||
|
#else
|
||||||
|
#ifndef cmp_timespec
|
||||||
|
#define cmp_timespec(TS1, TS2) \
|
||||||
|
((TS1.tv_sec > TS2.tv_sec || \
|
||||||
|
(TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec > TS2.tv_nsec)) ? 1 : \
|
||||||
|
((TS1.tv_sec < TS2.tv_sec || \
|
||||||
|
(TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec < TS2.tv_nsec)) ? -1 : 0))
|
||||||
|
#endif /* !cmp_timespec */
|
||||||
#endif /* HAVE_TIMESPEC_TS_SEC */
|
#endif /* HAVE_TIMESPEC_TS_SEC */
|
||||||
|
|
||||||
/* safe_mutex adds checking to mutex for easier debugging */
|
/* safe_mutex adds checking to mutex for easier debugging */
|
||||||
@ -694,25 +737,32 @@ extern uint thd_lib_detected;
|
|||||||
Warning:
|
Warning:
|
||||||
When compiling without threads, this file is not included.
|
When compiling without threads, this file is not included.
|
||||||
See the *other* declarations of thread_safe_xxx in include/my_global.h
|
See the *other* declarations of thread_safe_xxx in include/my_global.h
|
||||||
|
|
||||||
Second warning:
|
|
||||||
See include/config-win.h, for yet another implementation.
|
|
||||||
*/
|
*/
|
||||||
#ifdef THREAD
|
#ifdef THREAD
|
||||||
#ifndef thread_safe_increment
|
#ifndef thread_safe_increment
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
||||||
|
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
|
||||||
|
#else
|
||||||
#define thread_safe_increment(V,L) \
|
#define thread_safe_increment(V,L) \
|
||||||
(mysql_mutex_lock((L)), (V)++, mysql_mutex_unlock((L)))
|
(mysql_mutex_lock((L)), (V)++, mysql_mutex_unlock((L)))
|
||||||
#define thread_safe_decrement(V,L) \
|
#define thread_safe_decrement(V,L) \
|
||||||
(mysql_mutex_lock((L)), (V)--, mysql_mutex_unlock((L)))
|
(mysql_mutex_lock((L)), (V)--, mysql_mutex_unlock((L)))
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef thread_safe_add
|
#ifndef thread_safe_add
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
|
||||||
|
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
|
||||||
|
#else
|
||||||
#define thread_safe_add(V,C,L) \
|
#define thread_safe_add(V,C,L) \
|
||||||
(mysql_mutex_lock((L)), (V)+=(C), mysql_mutex_unlock((L)))
|
(mysql_mutex_lock((L)), (V)+=(C), mysql_mutex_unlock((L)))
|
||||||
#define thread_safe_sub(V,C,L) \
|
#define thread_safe_sub(V,C,L) \
|
||||||
(mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L)))
|
(mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L)))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
statistics_xxx functions are for non critical statistic,
|
statistics_xxx functions are for non critical statistic,
|
||||||
|
@ -34,6 +34,9 @@ extern int NEAR my_errno; /* Last error in mysys */
|
|||||||
#include <m_ctype.h> /* for CHARSET_INFO */
|
#include <m_ctype.h> /* for CHARSET_INFO */
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <typelib.h>
|
#include <typelib.h>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <malloc.h> /*for alloca*/
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; }
|
#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; }
|
||||||
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
|
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
|
||||||
@ -235,6 +238,9 @@ extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
|
|||||||
extern uint my_file_limit;
|
extern uint my_file_limit;
|
||||||
extern ulong my_thread_stack_size;
|
extern ulong my_thread_stack_size;
|
||||||
|
|
||||||
|
extern const char *(*proc_info_hook)(void *, const char *, const char *,
|
||||||
|
const char *, const unsigned int);
|
||||||
|
|
||||||
#ifdef HAVE_LARGE_PAGES
|
#ifdef HAVE_LARGE_PAGES
|
||||||
extern my_bool my_use_large_pages;
|
extern my_bool my_use_large_pages;
|
||||||
extern uint my_large_page_size;
|
extern uint my_large_page_size;
|
||||||
|
@ -18,10 +18,25 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
On Windows, exports from DLL need to be declared
|
On Windows, exports from DLL need to be declared
|
||||||
|
Also, plugin needs to be declared as extern "C" because MSVC
|
||||||
|
unlike other compilers, uses C++ mangling for variables not only
|
||||||
|
for functions.
|
||||||
*/
|
*/
|
||||||
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
|
#if defined(_MSC_VER)
|
||||||
#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
|
#if defined(MYSQL_DYNAMIC_PLUGIN)
|
||||||
#else
|
#ifdef __cplusplus
|
||||||
|
#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
|
||||||
|
#endif
|
||||||
|
#else /* MYSQL_DYNAMIC_PLUGIN */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define MYSQL_PLUGIN_EXPORT extern "C"
|
||||||
|
#else
|
||||||
|
#define MYSQL_PLUGIN_EXPORT
|
||||||
|
#endif
|
||||||
|
#endif /*MYSQL_DYNAMIC_PLUGIN */
|
||||||
|
#else /*_MSC_VER */
|
||||||
#define MYSQL_PLUGIN_EXPORT
|
#define MYSQL_PLUGIN_EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -88,9 +103,9 @@ typedef struct st_mysql_xid MYSQL_XID;
|
|||||||
|
|
||||||
#ifndef MYSQL_DYNAMIC_PLUGIN
|
#ifndef MYSQL_DYNAMIC_PLUGIN
|
||||||
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
|
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
|
||||||
int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
MYSQL_PLUGIN_EXPORT int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
||||||
int PSIZE= sizeof(struct st_mysql_plugin); \
|
MYSQL_PLUGIN_EXPORT int PSIZE= sizeof(struct st_mysql_plugin); \
|
||||||
struct st_mysql_plugin DECLS[]= {
|
MYSQL_PLUGIN_EXPORT struct st_mysql_plugin DECLS[]= {
|
||||||
#else
|
#else
|
||||||
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
|
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
|
||||||
MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2008-2009 Sun Microsystems, Inc
|
/* Copyright (C) 2008-2010 Sun Microsystems, Inc
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -614,6 +614,9 @@ typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
|
|||||||
/** Delete the current thread instrumentation. */
|
/** Delete the current thread instrumentation. */
|
||||||
typedef void (*delete_current_thread_v1_t)(void);
|
typedef void (*delete_current_thread_v1_t)(void);
|
||||||
|
|
||||||
|
/** Delete a thread instrumentation. */
|
||||||
|
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get a mutex instrumentation locker.
|
Get a mutex instrumentation locker.
|
||||||
@param mutex the instrumented mutex to lock
|
@param mutex the instrumented mutex to lock
|
||||||
@ -890,6 +893,8 @@ struct PSI_v1
|
|||||||
set_thread_v1_t set_thread;
|
set_thread_v1_t set_thread;
|
||||||
/** @sa delete_current_thread_v1_t. */
|
/** @sa delete_current_thread_v1_t. */
|
||||||
delete_current_thread_v1_t delete_current_thread;
|
delete_current_thread_v1_t delete_current_thread;
|
||||||
|
/** @sa delete_thread_v1_t. */
|
||||||
|
delete_thread_v1_t delete_thread;
|
||||||
/** @sa get_thread_mutex_locker_v1_t. */
|
/** @sa get_thread_mutex_locker_v1_t. */
|
||||||
get_thread_mutex_locker_v1_t get_thread_mutex_locker;
|
get_thread_mutex_locker_v1_t get_thread_mutex_locker;
|
||||||
/** @sa get_thread_rwlock_locker_v1_t. */
|
/** @sa get_thread_rwlock_locker_v1_t. */
|
||||||
|
@ -127,6 +127,7 @@ typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread,
|
|||||||
typedef struct PSI_thread* (*get_thread_v1_t)(void);
|
typedef struct PSI_thread* (*get_thread_v1_t)(void);
|
||||||
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
|
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
|
||||||
typedef void (*delete_current_thread_v1_t)(void);
|
typedef void (*delete_current_thread_v1_t)(void);
|
||||||
|
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
|
||||||
typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t)
|
typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t)
|
||||||
(struct PSI_mutex *mutex, enum PSI_mutex_operation op);
|
(struct PSI_mutex *mutex, enum PSI_mutex_operation op);
|
||||||
typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t)
|
typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t)
|
||||||
@ -204,6 +205,7 @@ struct PSI_v1
|
|||||||
get_thread_v1_t get_thread;
|
get_thread_v1_t get_thread;
|
||||||
set_thread_v1_t set_thread;
|
set_thread_v1_t set_thread;
|
||||||
delete_current_thread_v1_t delete_current_thread;
|
delete_current_thread_v1_t delete_current_thread;
|
||||||
|
delete_thread_v1_t delete_thread;
|
||||||
get_thread_mutex_locker_v1_t get_thread_mutex_locker;
|
get_thread_mutex_locker_v1_t get_thread_mutex_locker;
|
||||||
get_thread_rwlock_locker_v1_t get_thread_rwlock_locker;
|
get_thread_rwlock_locker_v1_t get_thread_rwlock_locker;
|
||||||
get_thread_cond_locker_v1_t get_thread_cond_locker;
|
get_thread_cond_locker_v1_t get_thread_cond_locker;
|
||||||
|
@ -32,6 +32,14 @@
|
|||||||
#define SERVER_VERSION_LENGTH 60
|
#define SERVER_VERSION_LENGTH 60
|
||||||
#define SQLSTATE_LENGTH 5
|
#define SQLSTATE_LENGTH 5
|
||||||
|
|
||||||
|
/*
|
||||||
|
Maximum length of comments
|
||||||
|
*/
|
||||||
|
#define TABLE_COMMENT_INLINE_MAXLEN 180 /* pre 6.0: 60 characters */
|
||||||
|
#define TABLE_COMMENT_MAXLEN 2048
|
||||||
|
#define COLUMN_COMMENT_MAXLEN 1024
|
||||||
|
#define INDEX_COMMENT_MAXLEN 1024
|
||||||
|
|
||||||
/*
|
/*
|
||||||
USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain
|
USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain
|
||||||
username and hostname parts of the user identifier with trailing zero in
|
username and hostname parts of the user identifier with trailing zero in
|
||||||
|
@ -64,7 +64,7 @@ typedef my_bool ALARM;
|
|||||||
#if defined(__WIN__)
|
#if defined(__WIN__)
|
||||||
typedef struct st_thr_alarm_entry
|
typedef struct st_thr_alarm_entry
|
||||||
{
|
{
|
||||||
rf_SetTimer crono;
|
UINT_PTR crono;
|
||||||
} thr_alarm_entry;
|
} thr_alarm_entry;
|
||||||
|
|
||||||
#else /* System with posix threads */
|
#else /* System with posix threads */
|
||||||
|
@ -83,7 +83,6 @@ enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1,
|
|||||||
|
|
||||||
|
|
||||||
extern ulong max_write_lock_count;
|
extern ulong max_write_lock_count;
|
||||||
extern ulong table_lock_wait_timeout;
|
|
||||||
extern my_bool thr_lock_inited;
|
extern my_bool thr_lock_inited;
|
||||||
extern enum thr_lock_type thr_upgraded_concurrent_insert_lock;
|
extern enum thr_lock_type thr_upgraded_concurrent_insert_lock;
|
||||||
|
|
||||||
@ -156,19 +155,25 @@ void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data,
|
|||||||
void *status_param);
|
void *status_param);
|
||||||
enum enum_thr_lock_result thr_lock(THR_LOCK_DATA *data,
|
enum enum_thr_lock_result thr_lock(THR_LOCK_DATA *data,
|
||||||
THR_LOCK_OWNER *owner,
|
THR_LOCK_OWNER *owner,
|
||||||
enum thr_lock_type lock_type);
|
enum thr_lock_type lock_type,
|
||||||
|
ulong lock_wait_timeout);
|
||||||
void thr_unlock(THR_LOCK_DATA *data);
|
void thr_unlock(THR_LOCK_DATA *data);
|
||||||
enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
|
enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
|
||||||
uint count, THR_LOCK_OWNER *owner);
|
uint count, THR_LOCK_OWNER *owner,
|
||||||
|
ulong lock_wait_timeout);
|
||||||
void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
|
void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
|
||||||
|
void
|
||||||
|
thr_lock_merge_status(THR_LOCK_DATA **data, uint count);
|
||||||
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
|
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
|
||||||
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
|
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
|
||||||
void thr_print_locks(void); /* For debugging */
|
void thr_print_locks(void); /* For debugging */
|
||||||
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data,
|
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data,
|
||||||
enum thr_lock_type new_lock_type);
|
enum thr_lock_type new_lock_type,
|
||||||
|
ulong lock_wait_timeout);
|
||||||
void thr_downgrade_write_lock(THR_LOCK_DATA *data,
|
void thr_downgrade_write_lock(THR_LOCK_DATA *data,
|
||||||
enum thr_lock_type new_lock_type);
|
enum thr_lock_type new_lock_type);
|
||||||
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data);
|
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data,
|
||||||
|
ulong lock_wait_timeout);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,102 +12,176 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
|
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(
|
||||||
# Note that we don't link with the libraries "strings" or "mysys"
|
${CMAKE_SOURCE_DIR}/include
|
||||||
# here, instead we recompile the files needed and include them
|
|
||||||
# directly. This means we don't have to worry here about if these
|
|
||||||
# libraries are compiled defining USE_TLS or not. Not that it *should*
|
|
||||||
# have been a problem anyway, they don't use thread local storage.
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
|
||||||
${CMAKE_SOURCE_DIR}/libmysql
|
${CMAKE_SOURCE_DIR}/libmysql
|
||||||
${CMAKE_SOURCE_DIR}/regex
|
${CMAKE_SOURCE_DIR}/regex
|
||||||
${CMAKE_SOURCE_DIR}/sql
|
${CMAKE_SOURCE_DIR}/sql
|
||||||
${CMAKE_SOURCE_DIR}/strings)
|
${CMAKE_SOURCE_DIR}/strings
|
||||||
|
${SSL_INCLUDE_DIRS}
|
||||||
|
${SSL_INTERNAL_INCLUDE_DIRS}
|
||||||
|
${ZLIB_INCLUDE_DIR})
|
||||||
|
ADD_DEFINITIONS(${SSL_DEFINES})
|
||||||
|
|
||||||
# We include the source file listing instead of referencing the
|
SET(CLIENT_API_FUNCTIONS
|
||||||
# libraries. At least with CMake 2.4 and Visual Studio 2005 a static
|
load_defaults
|
||||||
# library created from other static libraries would not be complete,
|
mysql_thread_end
|
||||||
# i.e. the libraries listed in TARGET_LINK_LIBRARIES() were just
|
mysql_thread_init
|
||||||
# ignored.
|
myodbc_remove_escape
|
||||||
|
mysql_affected_rows
|
||||||
|
mysql_autocommit
|
||||||
|
mysql_stmt_bind_param
|
||||||
|
mysql_stmt_bind_result
|
||||||
|
mysql_change_user
|
||||||
|
mysql_character_set_name
|
||||||
|
mysql_close
|
||||||
|
mysql_commit
|
||||||
|
mysql_data_seek
|
||||||
|
mysql_debug
|
||||||
|
mysql_dump_debug_info
|
||||||
|
mysql_eof
|
||||||
|
mysql_errno
|
||||||
|
mysql_error
|
||||||
|
mysql_escape_string
|
||||||
|
mysql_hex_string
|
||||||
|
mysql_stmt_execute
|
||||||
|
mysql_stmt_fetch
|
||||||
|
mysql_stmt_fetch_column
|
||||||
|
mysql_fetch_field
|
||||||
|
mysql_fetch_field_direct
|
||||||
|
mysql_fetch_fields
|
||||||
|
mysql_fetch_lengths
|
||||||
|
mysql_fetch_row
|
||||||
|
mysql_field_count
|
||||||
|
mysql_field_seek
|
||||||
|
mysql_field_tell
|
||||||
|
mysql_free_result
|
||||||
|
mysql_get_client_info
|
||||||
|
mysql_get_host_info
|
||||||
|
mysql_get_proto_info
|
||||||
|
mysql_get_server_info
|
||||||
|
mysql_get_client_version
|
||||||
|
mysql_get_ssl_cipher
|
||||||
|
mysql_info
|
||||||
|
mysql_init
|
||||||
|
mysql_insert_id
|
||||||
|
mysql_kill
|
||||||
|
mysql_set_server_option
|
||||||
|
mysql_list_dbs
|
||||||
|
mysql_list_fields
|
||||||
|
mysql_list_processes
|
||||||
|
mysql_list_tables
|
||||||
|
mysql_more_results
|
||||||
|
mysql_next_result
|
||||||
|
mysql_num_fields
|
||||||
|
mysql_num_rows
|
||||||
|
mysql_options
|
||||||
|
mysql_stmt_param_count
|
||||||
|
mysql_stmt_param_metadata
|
||||||
|
mysql_ping
|
||||||
|
mysql_stmt_result_metadata
|
||||||
|
mysql_query
|
||||||
|
mysql_read_query_result
|
||||||
|
mysql_real_connect
|
||||||
|
mysql_real_escape_string
|
||||||
|
mysql_real_query
|
||||||
|
mysql_refresh
|
||||||
|
mysql_rollback
|
||||||
|
mysql_row_seek
|
||||||
|
mysql_row_tell
|
||||||
|
mysql_select_db
|
||||||
|
mysql_stmt_send_long_data
|
||||||
|
mysql_send_query
|
||||||
|
mysql_shutdown
|
||||||
|
mysql_ssl_set
|
||||||
|
mysql_stat
|
||||||
|
mysql_stmt_affected_rows
|
||||||
|
mysql_stmt_close
|
||||||
|
mysql_stmt_reset
|
||||||
|
mysql_stmt_data_seek
|
||||||
|
mysql_stmt_errno
|
||||||
|
mysql_stmt_error
|
||||||
|
mysql_stmt_free_result
|
||||||
|
mysql_stmt_num_rows
|
||||||
|
mysql_stmt_row_seek
|
||||||
|
mysql_stmt_row_tell
|
||||||
|
mysql_stmt_store_result
|
||||||
|
mysql_store_result
|
||||||
|
mysql_thread_id
|
||||||
|
mysql_thread_safe
|
||||||
|
mysql_use_result
|
||||||
|
mysql_warning_count
|
||||||
|
mysql_stmt_sqlstate
|
||||||
|
mysql_sqlstate
|
||||||
|
mysql_get_server_version
|
||||||
|
mysql_stmt_prepare
|
||||||
|
mysql_stmt_init
|
||||||
|
mysql_stmt_insert_id
|
||||||
|
mysql_stmt_attr_get
|
||||||
|
mysql_stmt_attr_set
|
||||||
|
mysql_stmt_field_count
|
||||||
|
mysql_set_local_infile_default
|
||||||
|
mysql_set_local_infile_handler
|
||||||
|
mysql_embedded
|
||||||
|
mysql_server_init
|
||||||
|
mysql_server_end
|
||||||
|
mysql_set_character_set
|
||||||
|
mysql_get_character_set_info
|
||||||
|
mysql_stmt_next_result
|
||||||
|
|
||||||
|
CACHE INTERNAL "Functions exported by client API"
|
||||||
|
|
||||||
# Include and add the directory path
|
)
|
||||||
SET(SOURCE_SUBLIBS TRUE)
|
|
||||||
SET(LIB_SOURCES "")
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt)
|
SET(CLIENT_SOURCES
|
||||||
FOREACH(rpath ${ZLIB_SOURCES})
|
get_password.c
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../zlib/${rpath})
|
libmysql.c
|
||||||
ENDFOREACH(rpath)
|
errmsg.c
|
||||||
|
../sql-common/client.c
|
||||||
|
../sql-common/my_time.c
|
||||||
|
../sql/net_serv.cc
|
||||||
|
../sql-common/pack.c
|
||||||
|
../sql/password.c
|
||||||
|
)
|
||||||
|
ADD_CONVENIENCE_LIBRARY(clientlib ${CLIENT_SOURCES})
|
||||||
|
DTRACE_INSTRUMENT(clientlib)
|
||||||
|
ADD_DEPENDENCIES(clientlib GenError)
|
||||||
|
|
||||||
# FIXME only needed if build type is "Debug", but CMAKE_BUILD_TYPE is
|
SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
|
||||||
# not set during configure time.
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/dbug/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${DBUG_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../dbug/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/CMakeLists.txt)
|
# Merge several convenience libraries into one big mysqlclient
|
||||||
FOREACH(rpath ${TAOCRYPT_SOURCES})
|
# and link them together into shared library.
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/taocrypt/${rpath})
|
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS})
|
||||||
ENDFOREACH(rpath)
|
IF(UNIX)
|
||||||
|
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient ${INSTALL_LIBDIR})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/CMakeLists.txt)
|
# Visual Studio users need debug static library for debug projects
|
||||||
FOREACH(rpath ${YASSL_SOURCES})
|
IF(MSVC)
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/${rpath})
|
INSTALL_DEBUG_TARGET(mysqlclient DESTINATION ${INSTALL_LIBDIR}/debug)
|
||||||
ENDFOREACH(rpath)
|
ENDIF()
|
||||||
|
|
||||||
SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
|
IF(NOT DISABLE_SHARED)
|
||||||
../strings/bmove_upp.c ../mysys/charset-def.c ../mysys/charset.c
|
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
|
||||||
../sql-common/client.c ../strings/ctype-big5.c ../strings/ctype-bin.c
|
IF(UNIX)
|
||||||
../strings/ctype-cp932.c ../strings/ctype-czech.c ../strings/ctype-euc_kr.c
|
# Name of shared library is mysqlclient on Unix
|
||||||
../strings/ctype-eucjpms.c ../strings/ctype-extra.c ../strings/ctype-gb2312.c
|
SET_TARGET_PROPERTIES(libmysql PROPERTIES
|
||||||
../strings/ctype-gbk.c ../strings/ctype-latin1.c ../strings/ctype-mb.c
|
OUTPUT_NAME mysqlclient
|
||||||
../strings/ctype-simple.c ../strings/ctype-sjis.c ../strings/ctype-tis620.c
|
VERSION "${SHARED_LIB_MAJOR_VERSION}.0.0"
|
||||||
../strings/ctype-uca.c ../strings/ctype-ucs2.c ../strings/ctype-ujis.c
|
SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
|
||||||
../strings/ctype-utf8.c ../strings/ctype-win1250ch.c ../strings/ctype.c
|
IF(LINK_FLAG_NO_UNDEFINED)
|
||||||
../mysys/default.c ../strings/dtoa.c errmsg.c ../mysys/errors.c
|
GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS)
|
||||||
../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c
|
IF(NOT libmysql_link_flag)
|
||||||
get_password.c ../strings/int2str.c ../strings/is_prefix.c
|
SET(libmysql_link_flags)
|
||||||
libmysql.c ../mysys/list.c ../strings/llstr.c
|
ENDIF()
|
||||||
../strings/longlong2str.c ../mysys/mf_arr_appstr.c ../mysys/mf_cache.c
|
SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS
|
||||||
../mysys/mf_dirname.c ../mysys/mf_fn_ext.c ../mysys/mf_format.c
|
"${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED}")
|
||||||
../mysys/mf_iocache.c ../mysys/mf_iocache2.c ../mysys/mf_loadpath.c
|
ENDIF()
|
||||||
../mysys/mf_pack.c ../mysys/mf_path.c ../mysys/mf_tempfile.c ../mysys/mf_unixpath.c
|
# clean direct output needs to be set several targets have the same name
|
||||||
../mysys/mf_wcomp.c ../mysys/mulalloc.c ../mysys/my_access.c ../mysys/my_alloc.c
|
#(mysqlclient in this case)
|
||||||
../mysys/my_chsize.c ../mysys/my_compress.c ../mysys/my_create.c
|
SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||||
../mysys/my_delete.c ../mysys/my_div.c ../mysys/my_error.c ../mysys/my_file.c
|
SET_TARGET_PROPERTIES(libmysql PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||||
../mysys/my_fopen.c ../mysys/my_fstream.c ../mysys/my_gethostbyname.c
|
INSTALL_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql ${INSTALL_LIBDIR})
|
||||||
../mysys/my_getopt.c ../mysys/my_getwd.c ../mysys/my_init.c ../mysys/my_lib.c
|
ENDIF()
|
||||||
../mysys/my_malloc.c ../mysys/my_messnc.c ../mysys/my_net.c ../mysys/my_once.c
|
ENDIF()
|
||||||
../mysys/my_open.c ../mysys/my_pread.c ../mysys/my_pthread.c ../mysys/my_read.c
|
|
||||||
../mysys/my_realloc.c ../mysys/my_rename.c ../mysys/my_seek.c
|
|
||||||
../mysys/my_static.c ../strings/my_strtoll10.c ../mysys/my_symlink.c
|
|
||||||
../mysys/my_symlink2.c ../mysys/my_thr_init.c ../sql-common/my_time.c
|
|
||||||
../strings/my_vsnprintf.c ../mysys/my_wincond.c ../mysys/my_winthread.c
|
|
||||||
../mysys/my_write.c ../sql/net_serv.cc ../sql-common/pack.c ../sql/password.c
|
|
||||||
../mysys/safemalloc.c ../mysys/sha1.c ../strings/str2int.c
|
|
||||||
../strings/str_alloc.c ../strings/strcend.c ../strings/strcont.c ../strings/strend.c
|
|
||||||
../strings/strfill.c ../mysys/string.c ../strings/strinstr.c ../strings/strmake.c
|
|
||||||
../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c
|
|
||||||
../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c
|
|
||||||
../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c
|
|
||||||
../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c
|
|
||||||
../mysys/my_getsystime.c ../mysys/my_sync.c ../mysys/my_winerr.c ../mysys/my_winfile.c ${LIB_SOURCES})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ADD_LIBRARY(mysqlclient STATIC ${CLIENT_SOURCES})
|
|
||||||
ADD_DEPENDENCIES(mysqlclient GenError)
|
|
||||||
TARGET_LINK_LIBRARIES(mysqlclient)
|
|
||||||
|
|
||||||
ADD_LIBRARY(libmysql SHARED ${CLIENT_SOURCES} dll.c libmysql.def)
|
|
||||||
ADD_DEPENDENCIES(libmysql GenError)
|
|
||||||
TARGET_LINK_LIBRARIES(libmysql)
|
|
||||||
|
|
||||||
IF(EMBED_MANIFESTS)
|
|
||||||
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
|
|
||||||
ENDIF(EMBED_MANIFESTS)
|
|
||||||
|
@ -1,33 +1,7 @@
|
|||||||
LIBRARY LIBMYSQL
|
LIBRARY LIBMYSQL
|
||||||
VERSION 6.0
|
VERSION 6.0
|
||||||
EXPORTS
|
EXPORTS
|
||||||
_dig_vec_lower
|
|
||||||
_dig_vec_upper
|
|
||||||
bmove_upp
|
|
||||||
delete_dynamic
|
|
||||||
free_defaults
|
|
||||||
getopt_compare_strings
|
|
||||||
getopt_ull_limit_value
|
|
||||||
handle_options
|
|
||||||
init_dynamic_array
|
|
||||||
insert_dynamic
|
|
||||||
int2str
|
|
||||||
is_prefix
|
|
||||||
list_add
|
|
||||||
list_delete
|
|
||||||
load_defaults
|
load_defaults
|
||||||
my_end
|
|
||||||
my_getopt_print_errors
|
|
||||||
my_init
|
|
||||||
my_malloc
|
|
||||||
my_memdup
|
|
||||||
my_no_flags_free
|
|
||||||
my_path
|
|
||||||
mysql_get_parameters
|
|
||||||
my_print_help
|
|
||||||
my_print_variables
|
|
||||||
my_realloc
|
|
||||||
my_strdup
|
|
||||||
mysql_thread_end
|
mysql_thread_end
|
||||||
mysql_thread_init
|
mysql_thread_init
|
||||||
myodbc_remove_escape
|
myodbc_remove_escape
|
||||||
@ -117,22 +91,12 @@ EXPORTS
|
|||||||
mysql_stmt_sqlstate
|
mysql_stmt_sqlstate
|
||||||
mysql_sqlstate
|
mysql_sqlstate
|
||||||
mysql_get_server_version
|
mysql_get_server_version
|
||||||
set_dynamic
|
|
||||||
strcend
|
|
||||||
strcont
|
|
||||||
strdup_root
|
|
||||||
strfill
|
|
||||||
strinstr
|
|
||||||
strmake
|
|
||||||
strmov
|
|
||||||
strxmov
|
|
||||||
mysql_stmt_prepare
|
mysql_stmt_prepare
|
||||||
mysql_stmt_init
|
mysql_stmt_init
|
||||||
mysql_stmt_insert_id
|
mysql_stmt_insert_id
|
||||||
mysql_stmt_attr_get
|
mysql_stmt_attr_get
|
||||||
mysql_stmt_attr_set
|
mysql_stmt_attr_set
|
||||||
mysql_stmt_field_count
|
mysql_stmt_field_count
|
||||||
client_errors
|
|
||||||
mysql_set_local_infile_default
|
mysql_set_local_infile_default
|
||||||
mysql_set_local_infile_handler
|
mysql_set_local_infile_handler
|
||||||
mysql_embedded
|
mysql_embedded
|
||||||
@ -140,5 +104,3 @@ EXPORTS
|
|||||||
mysql_server_end
|
mysql_server_end
|
||||||
mysql_set_character_set
|
mysql_set_character_set
|
||||||
mysql_get_character_set_info
|
mysql_get_character_set_info
|
||||||
get_defaults_options
|
|
||||||
modify_defaults_file
|
|
||||||
|
@ -13,92 +13,38 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DMYSQL_SERVER -DEMBEDDED_LIBRARY -DHAVE_DLOPEN)
|
ADD_DEFINITIONS(-DMYSQL_SERVER -DEMBEDDED_LIBRARY
|
||||||
|
${SSL_DEFINES})
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
INCLUDE_DIRECTORIES(
|
||||||
${CMAKE_SOURCE_DIR}/libmysqld
|
${CMAKE_SOURCE_DIR}/include
|
||||||
${CMAKE_SOURCE_DIR}/libmysql
|
${CMAKE_SOURCE_DIR}/libmysql
|
||||||
${CMAKE_SOURCE_DIR}/sql
|
${CMAKE_SOURCE_DIR}/libmysqld
|
||||||
${CMAKE_SOURCE_DIR}/regex
|
${CMAKE_SOURCE_DIR}/sql
|
||||||
${CMAKE_SOURCE_DIR}/extra/yassl/include
|
${CMAKE_BINARY_DIR}/sql
|
||||||
${CMAKE_SOURCE_DIR}/zlib)
|
${CMAKE_SOURCE_DIR}/regex
|
||||||
|
${ZLIB_INCLUDE_DIR}
|
||||||
|
${SSL_INCLUDE_DIRS}
|
||||||
|
${SSL_INTERNAL_INCLUDE_DIRS}
|
||||||
|
${NDB_CLUSTER_INCLUDES}
|
||||||
|
${CMAKE_SOURCE_DIR}/sql/backup
|
||||||
|
)
|
||||||
|
|
||||||
SET(GEN_SOURCES ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
|
SET(GEN_SOURCES
|
||||||
${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
|
${CMAKE_BINARY_DIR}/sql/sql_yacc.h
|
||||||
${CMAKE_SOURCE_DIR}/sql/message.h
|
${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
|
||||||
${CMAKE_SOURCE_DIR}/sql/message.rc
|
${CMAKE_BINARY_DIR}/sql/lex_hash.h
|
||||||
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
|
)
|
||||||
${CMAKE_SOURCE_DIR}/sql/lex_hash.h)
|
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1)
|
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED TRUE)
|
||||||
|
|
||||||
# Include and add the directory path
|
SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
|
||||||
SET(SOURCE_SUBLIBS TRUE)
|
|
||||||
SET(LIB_SOURCES "")
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${ZLIB_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../zlib/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
|
|
||||||
# FIXME only needed if build type is "Debug", but CMAKE_BUILD_TYPE is
|
|
||||||
# not set during configure time.
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/dbug/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${DBUG_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../dbug/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${TAOCRYPT_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/taocrypt/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${YASSL_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/strings/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${STRINGS_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../strings/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/regex/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${REGEX_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../regex/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/mysys/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${MYSYS_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../mysys/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/vio/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${VIO_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ../vio/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS})
|
|
||||||
STRING(TOUPPER ${ENGINE_LIB} ENGINE_LIB_UPPER)
|
|
||||||
SET(ENGINE_DIR ${${ENGINE_LIB_UPPER}_DIR})
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/${ENGINE_DIR}/CMakeLists.txt)
|
|
||||||
FOREACH(rpath ${${ENGINE_LIB_UPPER}_SOURCES})
|
|
||||||
SET(LIB_SOURCES ${LIB_SOURCES} ${CMAKE_SOURCE_DIR}/storage/${ENGINE_DIR}/${rpath})
|
|
||||||
ENDFOREACH(rpath)
|
|
||||||
ENDFOREACH(ENGINE_LIB)
|
|
||||||
|
|
||||||
|
|
||||||
SET(SOURCE_SUBLIBS FALSE)
|
|
||||||
|
|
||||||
SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
|
|
||||||
../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c
|
../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c
|
||||||
../sql-common/client.c ../sql-common/my_time.c
|
../sql-common/client.c ../sql-common/my_time.c
|
||||||
../sql-common/my_user.c ../sql-common/pack.c
|
../sql-common/my_user.c ../sql-common/pack.c
|
||||||
../sql/password.c ../sql/discover.cc ../sql/derror.cc
|
../sql/password.c ../sql/discover.cc ../sql/derror.cc
|
||||||
../sql/field.cc ../sql/field_conv.cc
|
../sql/field.cc ../sql/field_conv.cc
|
||||||
../sql/filesort.cc ../sql/gstream.cc ../sql/ha_partition.cc
|
../sql/filesort.cc ../sql/gstream.cc
|
||||||
../sql/handler.cc ../sql/hash_filo.cc ../sql/hostname.cc
|
../sql/handler.cc ../sql/hash_filo.cc ../sql/hostname.cc
|
||||||
../sql/init.cc ../sql/item_buff.cc ../sql/item_cmpfunc.cc
|
../sql/init.cc ../sql/item_buff.cc ../sql/item_cmpfunc.cc
|
||||||
../sql/item.cc ../sql/item_create.cc ../sql/item_func.cc
|
../sql/item.cc ../sql/item_create.cc ../sql/item_func.cc
|
||||||
@ -135,29 +81,56 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
|
|||||||
../sql/scheduler.cc ../sql/sql_audit.cc
|
../sql/scheduler.cc ../sql/sql_audit.cc
|
||||||
../sql/event_parse_data.cc
|
../sql/event_parse_data.cc
|
||||||
../sql/sql_signal.cc ../sql/rpl_handler.cc
|
../sql/sql_signal.cc ../sql/rpl_handler.cc
|
||||||
|
../sql/rpl_utility.cc
|
||||||
|
../sql/sys_vars.cc
|
||||||
|
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc
|
||||||
|
../sql/mdl.cc ../sql/transaction.cc
|
||||||
${GEN_SOURCES}
|
${GEN_SOURCES}
|
||||||
${LIB_SOURCES})
|
${MYSYS_LIBWRAP_SOURCE}
|
||||||
|
)
|
||||||
|
|
||||||
# Seems we cannot make a library without at least one source file. So use a
|
|
||||||
# dummy empty file
|
|
||||||
FILE(WRITE cmake_dummy.c " ")
|
|
||||||
|
|
||||||
# Tried use the correct ${GEN_SOURCES} as dependency, worked on Unix
|
ADD_CONVENIENCE_LIBRARY(sql_embedded ${SQL_EMBEDDED_SOURCES})
|
||||||
# but not on Windows and Visual Studio generators. Likely because they
|
DTRACE_INSTRUMENT(sql_embedded)
|
||||||
# are no real targets from the Visual Studio project files view. Added
|
ADD_DEPENDENCIES(sql_embedded GenError GenServerSource)
|
||||||
# custom targets to "sql/CMakeLists.txt" and reference them here.
|
|
||||||
ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQLD_SOURCES})
|
|
||||||
ADD_DEPENDENCIES(mysqlserver GenServerSource GenError)
|
|
||||||
TARGET_LINK_LIBRARIES(mysqlserver)
|
|
||||||
|
|
||||||
# Add any additional libraries requested by engine(s)
|
# On Windows, static embedded server library is called mysqlserver.lib
|
||||||
FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS})
|
# On Unix, it is libmysqld.a
|
||||||
STRING(TOUPPER ${ENGINE_LIB} ENGINE_LIB_UPPER)
|
IF(WIN32)
|
||||||
IF(${ENGINE_LIB_UPPER}_LIBS)
|
SET(MYSQLSERVER_OUTPUT_NAME mysqlserver)
|
||||||
TARGET_LINK_LIBRARIES(mysqlserver ${${ENGINE_LIB_UPPER}_LIBS})
|
ELSE()
|
||||||
ENDIF(${ENGINE_LIB_UPPER}_LIBS)
|
SET(MYSQLSERVER_OUTPUT_NAME mysqld)
|
||||||
ENDFOREACH(ENGINE_LIB)
|
ENDIF()
|
||||||
|
|
||||||
ADD_LIBRARY(libmysqld SHARED cmake_dummy.c libmysqld.def)
|
|
||||||
ADD_DEPENDENCIES(libmysqld mysqlserver)
|
SET(LIBS
|
||||||
TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32)
|
dbug strings regex mysys vio
|
||||||
|
${ZLIB_LIBRARY} ${SSL_LIBRARIES}
|
||||||
|
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
|
||||||
|
${MYSQLD_STATIC_PLUGIN_LIBS} ${NDB_CLIENT_LIBS}
|
||||||
|
sql_embedded
|
||||||
|
)
|
||||||
|
|
||||||
|
# Some storage engine were compiled for embedded specifically
|
||||||
|
# (with corresponding target ${engine}_embedded)
|
||||||
|
SET(EMBEDDED_LIBS)
|
||||||
|
FOREACH(LIB ${LIBS})
|
||||||
|
GET_TARGET_PROPERTY(EMBEDDED_LOCATION ${LIB}_embedded LOCATION)
|
||||||
|
IF(EMBEDDED_LOCATION)
|
||||||
|
LIST(APPEND EMBEDDED_LIBS ${LIB}_embedded)
|
||||||
|
ELSE()
|
||||||
|
LIST(APPEND EMBEDDED_LIBS ${LIB})
|
||||||
|
ENDIF()
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
|
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
|
||||||
|
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME})
|
||||||
|
|
||||||
|
# Visual Studio users need debug static library
|
||||||
|
IF(MSVC)
|
||||||
|
INSTALL_DEBUG_TARGET(mysqlserver DESTINATION ${INSTALL_LIBDIR}/debug)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(MSVC AND NOT DISABLE_SHARED)
|
||||||
|
MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
|
||||||
|
ENDIF()
|
||||||
|
@ -75,11 +75,10 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
|
|||||||
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
|
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
|
||||||
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
|
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
|
||||||
rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
|
rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
|
||||||
debug_sync.cc \
|
debug_sync.cc sql_tablespace.cc transaction.cc \
|
||||||
sql_tablespace.cc \
|
|
||||||
rpl_injector.cc my_user.c partition_info.cc \
|
rpl_injector.cc my_user.c partition_info.cc \
|
||||||
sql_servers.cc sql_audit.cc event_parse_data.cc \
|
sql_servers.cc event_parse_data.cc sql_signal.cc \
|
||||||
sql_signal.cc rpl_handler.cc keycaches.cc
|
rpl_handler.cc mdl.cc keycaches.cc sql_audit.cc
|
||||||
|
|
||||||
libmysqld_int_a_SOURCES= $(libmysqld_sources)
|
libmysqld_int_a_SOURCES= $(libmysqld_sources)
|
||||||
nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
|
nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources)
|
||||||
|
@ -16,23 +16,45 @@
|
|||||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
||||||
${CMAKE_SOURCE_DIR}/libmysqld/include
|
${CMAKE_SOURCE_DIR}/libmysqld/include
|
||||||
${CMAKE_SOURCE_DIR}/regex
|
${CMAKE_SOURCE_DIR}/regex
|
||||||
${CMAKE_SOURCE_DIR}/zlib
|
${READLINE_INCLUDE_DIR}
|
||||||
${CMAKE_SOURCE_DIR}/extra/yassl/include)
|
)
|
||||||
|
|
||||||
# Currently does not work with DBUG, there are missing symbols reported.
|
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
|
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY -UMYSQL_CLIENT)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
|
|
||||||
../../client/mysql.cc ../../client/readline.cc
|
|
||||||
../../client/sql_string.cc)
|
|
||||||
TARGET_LINK_LIBRARIES(mysql_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
|
|
||||||
TARGET_LINK_LIBRARIES(mysql_embedded libmysqld)
|
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc)
|
MYSQL_ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
|
||||||
TARGET_LINK_LIBRARIES(mysqltest_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
|
../../client/mysql.cc ../../client/readline.cc)
|
||||||
TARGET_LINK_LIBRARIES(mysqltest_embedded libmysqld)
|
TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver)
|
||||||
|
IF(UNIX)
|
||||||
|
ADD_DEFINITIONS(${READLINE_DEFINES})
|
||||||
|
TARGET_LINK_LIBRARIES(mysql_embedded ${READLINE_LIBRARY})
|
||||||
|
ENDIF(UNIX)
|
||||||
|
|
||||||
ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
|
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc)
|
||||||
TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32)
|
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver)
|
||||||
TARGET_LINK_LIBRARIES(mysql_client_test_embedded libmysqld)
|
|
||||||
|
|
||||||
|
IF(CMAKE_GENERATOR MATCHES "Xcode")
|
||||||
|
# It does not seem possible to tell Xcode the resulting target might need
|
||||||
|
# to be linked with C++ runtime. The project needs to have at least one C++
|
||||||
|
# file. Add a dummy one.
|
||||||
|
ADD_CUSTOM_COMMAND(OUTPUT
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/mysql_client_test_embedded_dummy.cc
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/mysql_client_test_embedded_dummy.cc
|
||||||
|
)
|
||||||
|
MYSQL_ADD_EXECUTABLE(mysql_client_test_embedded
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/mysql_client_test_embedded_dummy.cc
|
||||||
|
../../tests/mysql_client_test.c)
|
||||||
|
ELSE()
|
||||||
|
MYSQL_ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
|
||||||
|
SET_TARGET_PROPERTIES(mysql_client_test_embedded PROPERTIES HAS_CXX TRUE)
|
||||||
|
ENDIF()
|
||||||
|
TARGET_LINK_LIBRARIES(mysql_client_test_embedded mysqlserver)
|
||||||
|
|
||||||
|
IF(UNIX)
|
||||||
|
SET_TARGET_PROPERTIES(mysql_embedded PROPERTIES ENABLE_EXPORTS TRUE)
|
||||||
|
SET_TARGET_PROPERTIES(mysqltest_embedded PROPERTIES ENABLE_EXPORTS TRUE)
|
||||||
|
SET_TARGET_PROPERTIES(mysql_client_test_embedded PROPERTIES ENABLE_EXPORTS TRUE)
|
||||||
|
ENDIF()
|
||||||
|
@ -118,6 +118,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||||||
net_clear_error(net);
|
net_clear_error(net);
|
||||||
thd->current_stmt= stmt;
|
thd->current_stmt= stmt;
|
||||||
|
|
||||||
|
thd->thread_stack= (char*) &thd;
|
||||||
thd->store_globals(); // Fix if more than one connect
|
thd->store_globals(); // Fix if more than one connect
|
||||||
/*
|
/*
|
||||||
We have to call free_old_query before we start to fill mysql->fields
|
We have to call free_old_query before we start to fill mysql->fields
|
||||||
@ -746,11 +747,6 @@ void THD::clear_data_list()
|
|||||||
cur_data= 0;
|
cur_data= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void THD::clear_error()
|
|
||||||
{
|
|
||||||
if (stmt_da->is_error())
|
|
||||||
stmt_da->reset_diagnostics_area();
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
|
static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
|
||||||
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
|
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
|
||||||
|
24
man/CMakeLists.txt
Normal file
24
man/CMakeLists.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
# Copy man pages
|
||||||
|
FILE(GLOB MAN1_FILES *.1)
|
||||||
|
FILE(GLOB MAN8_FILES *.8)
|
||||||
|
IF(MAN1_FILES)
|
||||||
|
INSTALL(FILES ${MAN1_FILES} DESTINATION ${INSTALL_MANDIR}/man1)
|
||||||
|
ENDIF()
|
||||||
|
IF(MAN8_FILES)
|
||||||
|
INSTALL(FILES ${MAN8_FILES} DESTINATION ${INSTALL_MANDIR}/man8)
|
||||||
|
ENDIF()
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
man1_MANS = @man1_files@
|
man1_MANS = @man1_files@
|
||||||
man8_MANS = @man8_files@
|
man8_MANS = @man8_files@
|
||||||
EXTRA_DIST = $(man1_MANS) $(man8_MANS)
|
EXTRA_DIST = $(man1_MANS) $(man8_MANS) CMakeLists.txt
|
||||||
|
|
||||||
# "make_win_*" are not needed in Unix binary packages,
|
# "make_win_*" are not needed in Unix binary packages,
|
||||||
install-data-hook:
|
install-data-hook:
|
||||||
|
127
mysql-test/CMakeLists.txt
Normal file
127
mysql-test/CMakeLists.txt
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
# Copyright (C) 2009 Sun Microsystems, Inc
|
||||||
|
#
|
||||||
|
# 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-1301 USA
|
||||||
|
|
||||||
|
INSTALL(
|
||||||
|
DIRECTORY .
|
||||||
|
DESTINATION ${INSTALL_MYSQLTESTDIR}
|
||||||
|
PATTERN "var/" EXCLUDE
|
||||||
|
PATTERN "lib/My/SafeProcess" EXCLUDE
|
||||||
|
PATTERN "CPack" EXCLUDE
|
||||||
|
PATTERN "CMake*" EXCLUDE
|
||||||
|
PATTERN "mtr.out*" EXCLUDE
|
||||||
|
PATTERN ".cvsignore" EXCLUDE
|
||||||
|
PATTERN "*.am" EXCLUDE
|
||||||
|
PATTERN "*.in" EXCLUDE
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||||
|
# Enable running mtr from build directory
|
||||||
|
CONFIGURE_FILE(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/mtr.out-of-source
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run.pl
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
ENDIF()
|
||||||
|
IF(UNIX)
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND chmod +x mysql-test-run.pl
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||||
|
./mysql-test-run.pl mtr
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||||
|
./mysql-test-run.pl mysql-test-run
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run DESTINATION mysql-test)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
|
SET(SETCONFIG_COMMAND set MTR_VS_CONFIG=${CMAKE_CFG_INTDIR})
|
||||||
|
ELSEIF(CMAKE_GENERATOR MATCHES "Xcode")
|
||||||
|
SET(SETCONFIG_COMMAND export MTR_VS_CONFIG=${CMAKE_CFG_INTDIR})
|
||||||
|
ELSE()
|
||||||
|
SET(SETCONFIG_COMMAND echo Running tests)
|
||||||
|
ENDIF()
|
||||||
|
IF(CYGWIN)
|
||||||
|
# On cygwin, pretend to be "Unix" system
|
||||||
|
SET(SETOS_COMMAND export MTR_CYGWIN_IS_UNIX=1)
|
||||||
|
ELSE()
|
||||||
|
SET(SETOS_COMMAND echo OS=${CMAKE_SYSTEM_NAME})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(test-force
|
||||||
|
COMMAND ${SETCONFIG_COMMAND}
|
||||||
|
COMMAND ${SETOS_COMMAND}
|
||||||
|
COMMAND perl mysql-test-run.pl --force
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(EXP --experimental=collections/default.experimental)
|
||||||
|
IF(WIN32)
|
||||||
|
SET(SET_ENV set)
|
||||||
|
ELSE()
|
||||||
|
SET(SET_ENV export)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
SET(MTR_FORCE perl ./mysql-test-run.pl --force)
|
||||||
|
IF(EXISTS ${CMAKE_SOURCE_DIR}/mysql-test/suite/nist)
|
||||||
|
SET(TEST_NIST ${MTR_FORCE} --comment=nist suite=nist ${EXP} &&
|
||||||
|
${MTR_FORCE} --comment=nist --force --suite=nist+ps ${EXP})
|
||||||
|
ELSE()
|
||||||
|
SET(TEST_NIST echo "NIST tests not found")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(WITH_EMBEDDED_SERVER)
|
||||||
|
SET(TEST_EMBEDDED ${MTR_FORCE} --comment=embedded --timer --embedded-server
|
||||||
|
--skip-rpl --skip-ndbcluster $(EXP))
|
||||||
|
ELSE()
|
||||||
|
SET(TEST_EMBEDDED echo "Can not test embedded, not compiled in")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(TEST_BT_START
|
||||||
|
COMMAND ${SETCONFIG_COMMAND}
|
||||||
|
COMMAND ${SETOS_COMMAND}
|
||||||
|
COMMAND ${SET_ENV} MTR_BUILD_THREAD=auto
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(test-bt
|
||||||
|
${TEST_BT_START}
|
||||||
|
COMMAND ${MTR_FORCE} --comment=normal --timer --skip-ndbcluster --report-features ${EXP}
|
||||||
|
COMMAND ${MTR_FORCE} --comment=ps --timer --skip-ndbcluster --ps-protocol ${EXP}
|
||||||
|
COMMAND ${MTR_FORCE} --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1 ${EXP}
|
||||||
|
COMMAND ${MTR_FORCE} --comment=funcs2 --suite=funcs_2 ${EXP}
|
||||||
|
COMMAND ${MTR_FORCE} --comment=partitions --suite=parts ${EXP}
|
||||||
|
COMMAND ${MTR_FORCE} --comment=stress --suite=stress ${EXP}
|
||||||
|
COMMAND ${MTR_FORCE} --force --comment=jp --suite=jp ${EXP}
|
||||||
|
COMMAND ${TEST_NIST}
|
||||||
|
COMMAND ${TEST_EMBEDDED}
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(test-bt-fast
|
||||||
|
${TEST_BT_START}
|
||||||
|
COMMAND ${MTR_FORCE} --comment=ps --timer --skip-ndbcluster --ps-protocol --report-features ${EXP}
|
||||||
|
COMMAND ${MTR_FORCE} --comment=stress --suite=stress ${EXP}
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(test-bt-debug
|
||||||
|
${TEST_BT_START}
|
||||||
|
COMMAND ${MTR_FORCE} --comment=debug --timer --skip-ndbcluster --skip-rpl --report-features ${EXP}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
@ -71,7 +71,10 @@ SUBDIRS = lib/My/SafeProcess
|
|||||||
|
|
||||||
EXTRA_DIST = README \
|
EXTRA_DIST = README \
|
||||||
$(test_SCRIPTS) \
|
$(test_SCRIPTS) \
|
||||||
$(nobase_test_DATA)
|
$(nobase_test_DATA) \
|
||||||
|
CMakeLists.txt \
|
||||||
|
mtr.out-of-source
|
||||||
|
|
||||||
|
|
||||||
# List of directories containing test + result files and the
|
# List of directories containing test + result files and the
|
||||||
# related test data files that should be copied
|
# related test data files that should be copied
|
||||||
|
@ -16,9 +16,6 @@ main.plugin # Bug#47146 Linking problem with exampl
|
|||||||
main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||||
main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||||
|
|
||||||
perfschema.tampered_perfschema_table1 @windows # Bug#50478 2010-01-20 alik perfschema.tampered_perfschema_table1 fails sporadically on Windows and Solaris
|
|
||||||
perfschema.tampered_perfschema_table1 @solaris # Bug#50478 2010-01-20 alik perfschema.tampered_perfschema_table1 fails sporadically on Windows and Solaris
|
|
||||||
|
|
||||||
rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically
|
rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically
|
||||||
rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
|
rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
|
||||||
rpl.rpl_innodb_bug28430* # Bug#46029
|
rpl.rpl_innodb_bug28430* # Bug#46029
|
||||||
@ -26,12 +23,8 @@ rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_inn
|
|||||||
rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows
|
rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows
|
||||||
rpl.rpl_plugin_load* @solaris # Bug#47146
|
rpl.rpl_plugin_load* @solaris # Bug#47146
|
||||||
rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
rpl.rpl_row_sp011* @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||||
rpl.rpl_slave_load_remove_tmpfile* @windows # Bug#50474 2010-01-20 alik rpl_slave_load_remove_tmpfile failed on windows debug enabled binary
|
|
||||||
rpl.rpl_sync* @windows # Bug#50473 2010-01-20 alik rpl_sync fails on windows debug enabled binaries
|
|
||||||
rpl.rpl_timezone* # Bug#47017 2009-10-27 alik rpl_timezone fails on PB-2 with mismatch error
|
|
||||||
|
|
||||||
sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun
|
||||||
sys_vars.delayed_insert_limit_func # Bug#50435 2010-01-25 alik sys_vars.delayed_insert_limit_func fails on Ubuntu x86_64 in debug mode
|
|
||||||
|
|
||||||
# Declare all NDB-tests in ndb and rpl_ndb test suites experimental.
|
# Declare all NDB-tests in ndb and rpl_ndb test suites experimental.
|
||||||
# Usually the test cases from ndb and rpl_ndb test suites are not run in PB,
|
# Usually the test cases from ndb and rpl_ndb test suites are not run in PB,
|
||||||
|
10
mysql-test/collections/test-bt
Normal file
10
mysql-test/collections/test-bt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
perl mysql-test-run.pl --force --timer --comment=normal --skip-ndbcluster --report-features --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=ps --skip-ndbcluster --ps-protocol --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=funcs1+ps --suite=funcs_1 --ps-protocol --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=funcs2 --suite=funcs_2 --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=partitions --suite=parts --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=stress --suite=stress --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=jp --suite=jp --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=embedded --embedded-server --skip-rpl --skip-ndbcluster --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=nist --suite=nist --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=nist+ps --suite=nist --ps-protocol --experimental=collections/default.experimental
|
1
mysql-test/collections/test-bt-debug
Normal file
1
mysql-test/collections/test-bt-debug
Normal file
@ -0,0 +1 @@
|
|||||||
|
perl mysql-test-run.pl --force --timer --comment=debug --skip-ndbcluster --skip-rpl --report-features --experimental=collections/default.experimental
|
0
mysql-test/collections/test-bt-debug-fast
Normal file
0
mysql-test/collections/test-bt-debug-fast
Normal file
2
mysql-test/collections/test-bt-fast
Normal file
2
mysql-test/collections/test-bt-fast
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
perl mysql-test-run.pl --force --timer --comment=ps --skip-ndbcluster --ps-protocol --report-features --experimental=collections/default.experimental
|
||||||
|
perl mysql-test-run.pl --force --timer --comment=stress --suite=stress --experimental=collections/default.experimental
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user