110 changed files with 6265 additions and 1030 deletions
-
243BUILD-CMAKE
-
1BUILD/Makefile.am
-
7BUILD/autorun.sh
-
14BUILD/choose_configure.sh
-
499CMakeLists.txt
-
9Makefile.am
-
72client/CMakeLists.txt
-
21cmake/Makefile.am
-
60cmake/abi_check.cmake
-
64cmake/bison.cmake
-
27cmake/cat.cmake
-
63cmake/character_sets.cmake
-
19cmake/check_minimal_version.cmake
-
79cmake/configure.pl
-
84cmake/create_initial_db.cmake.in
-
78cmake/do_abi_check.cmake
-
92cmake/dtrace.cmake
-
34cmake/dtrace_prelink.cmake
-
69cmake/install_macros.cmake
-
176cmake/make_dist.cmake.in
-
62cmake/merge_archives_unix.cmake.in
-
128cmake/misc.cmake
-
142cmake/mysql_version.cmake
-
171cmake/plugin.cmake
-
197cmake/readline.cmake
-
88cmake/ssl.cmake
-
31cmake/stack_direction.c
-
73cmake/zlib.cmake
-
167cmd-line-utils/libedit/CMakeLists.txt
-
2cmd-line-utils/libedit/Makefile.am
-
60cmd-line-utils/readline/CMakeLists.txt
-
2cmd-line-utils/readline/Makefile.am
-
618config.h.cmake
-
1335configure.cmake
-
4configure.in
-
16dbug/CMakeLists.txt
-
76extra/CMakeLists.txt
-
24extra/yassl/CMakeLists.txt
-
11extra/yassl/taocrypt/CMakeLists.txt
-
61include/CMakeLists.txt
-
3include/Makefile.am
-
2include/keycache.h
-
111include/my_global.h
-
18include/my_pthread.h
-
3include/my_sys.h
-
29include/mysql/plugin.h
-
2include/thr_alarm.h
-
198libmysql/CMakeLists.txt
-
169libmysqld/CMakeLists.txt
-
48libmysqld/examples/CMakeLists.txt
-
5libmysqld/lib_sql.cc
-
24man/CMakeLists.txt
-
2man/Makefile.am
-
110mysql-test/CMakeLists.txt
-
5mysql-test/Makefile.am
-
11mysql-test/lib/My/ConfigFactory.pm
-
20mysql-test/lib/My/Find.pm
-
18mysql-test/lib/My/SafeProcess.pm
-
14mysql-test/lib/My/SafeProcess/CMakeLists.txt
-
1mysql-test/lib/My/SafeProcess/safe_kill_win.cc
-
5mysql-test/lib/My/SafeProcess/safe_process_win.cc
-
5mysql-test/mtr.out-of-source
-
161mysql-test/mysql-test-run.pl
-
3mysql-test/t/fulltext_plugin.test
-
44mysys/CMakeLists.txt
-
9mysys/my_create.c
-
5mysys/my_getsystime.c
-
18mysys/my_winthread.c
-
5mysys/mysys_priv.h
-
18plugin/daemon_example/CMakeLists.txt
-
1plugin/daemon_example/Makefile.am
-
18plugin/fulltext/CMakeLists.txt
-
1plugin/fulltext/Makefile.am
-
33plugin/semisync/CMakeLists.txt
-
5regex/CMakeLists.txt
-
4regex/regex2.h
-
280scripts/CMakeLists.txt
-
51sql-bench/CMakeLists.txt
-
2sql-bench/Makefile.am
-
280sql/CMakeLists.txt
-
1sql/nt_servc.cc
-
52sql/share/CMakeLists.txt
-
5sql/share/Makefile.am
-
7sql/sql_builtin.cc.in
-
4sql/sql_class.h
-
1storage/Makefile.am
-
10storage/archive/CMakeLists.txt
-
5storage/blackhole/CMakeLists.txt
-
3storage/csv/CMakeLists.txt
-
2storage/example/CMakeLists.txt
-
8storage/federated/CMakeLists.txt
-
3storage/heap/CMakeLists.txt
-
27storage/ibmdb2i/CMakeLists.txt
-
167storage/innobase/CMakeLists.txt
-
2storage/innobase/include/page0page.ic
-
50storage/myisam/CMakeLists.txt
-
3storage/myisammrg/CMakeLists.txt
-
44storage/mysql_storage_engine.cmake
-
8strings/CMakeLists.txt
-
61support-files/CMakeLists.txt
@ -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 config.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. |
|||
@ -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 |
|||
|
|||
@ -0,0 +1,21 @@ |
|||
EXTRA_DIST = \
|
|||
cat.cmake \
|
|||
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 \
|
|||
misc.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 |
|||
@ -0,0 +1,60 @@ |
|||
# 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 UNIX) |
|||
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) |
|||
|
|||
SET(TEST_PREPROCESSOR_HEADER |
|||
${CMAKE_SOURCE_DIR}/include/mysql/plugin.h |
|||
${CMAKE_SOURCE_DIR}/sql/mysql_priv.h |
|||
${CMAKE_SOURCE_DIR}/include/mysql.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() |
|||
|
|||
@ -0,0 +1,64 @@ |
|||
# 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 |
|||
|
|||
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 -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. |
|||
MESSAGE(FATAL_ERROR "Please install bison.") |
|||
ENDIF() |
|||
ENDIF() |
|||
ENDMACRO() |
|||
@ -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() |
|||
|
|||
|
|||
@ -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 |
|||
|
|||
#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 utf8mb3) |
|||
SET(CHARSETS_COMPLEX big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8 utf8mb3 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 utf8mb3 utf16 utf32) |
|||
|
|||
|
|||
IF(WIN32) |
|||
SET (EXTRA_CHARSETS "all") |
|||
ELSE() |
|||
SET (EXTRA_CHARSETS "none") |
|||
ENDIF() |
|||
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) |
|||
|
|||
@ -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) |
|||
@ -0,0 +1,79 @@ |
|||
#!/usr/bin/perl |
|||
use Switch; |
|||
|
|||
my $cmakeargs=""; |
|||
foreach $option (@ARGV) |
|||
{ |
|||
if (substr ($option, 0, 2) == "--") |
|||
{ |
|||
$option = substr($option, 2); |
|||
} |
|||
if($option =~ /help/) |
|||
{ |
|||
system("cmake -LH"); |
|||
exit(0); |
|||
} |
|||
if($option =~ /with-plugins=/) |
|||
{ |
|||
my @plugins= split(/,/, substr($option,13)); |
|||
foreach $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=bundled"; |
|||
next; |
|||
} |
|||
if($option =~ /with-ssl/) |
|||
{ |
|||
$cmakeargs = $cmakeargs." -DWITH_SSL=yes"; |
|||
next; |
|||
} |
|||
if($option =~ /prefix=/) |
|||
{ |
|||
my $cmake_install_prefix= substr($option, 7); |
|||
$cmakeargs = $cmakeargs." -DCMAKE_INSTALL_PREFIX=".$cmake_install_prefix; |
|||
next; |
|||
} |
|||
if ($options =~ /extra-charsets=all/) |
|||
{ |
|||
$cmakeargs = $cmakeargs." -DWITH_CHARSETS=all"; |
|||
next; |
|||
} |
|||
if ($options =~ /extra-charsets=complex/) |
|||
{ |
|||
$cmakeargs = $cmakeargs." -DWITH_CHARSETS=complex"; |
|||
next; |
|||
} |
|||
$option = uc($option); |
|||
$option =~ s/-/_/g; |
|||
$cmakeargs = $cmakeargs." -D".$option."=1"; |
|||
} |
|||
print("configure.pl : calling cmake . $cmakeargs\n"); |
|||
my $rc = system("cmake . $cmakeargs"); |
|||
exit($rc); |
|||
@ -0,0 +1,84 @@ |
|||
# 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@") |
|||
SET ($ENV{VS_UNICODE_OUTPUT}) |
|||
IF(CMAKE_CFG_INTDIR) |
|||
IF(CONFIG) |
|||
MESSAGE(${CONFIG}) |
|||
#Resolve build configuration variables |
|||
STRING(REPLACE "${CMAKE_CFG_INTDIR}" ${CONFIG} MYSQLD_EXECUTABLE |
|||
"${MYSQLD_EXECUTABLE}") |
|||
ELSE() |
|||
MESSAGE(FATAL_ERROR "Please provide CONFIG parameter to the script") |
|||
ENDIF() |
|||
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() |
|||
|
|||
|
|||
MAKE_DIRECTORY(data) |
|||
FILE(REMOVE_RECURSE data/mysql) |
|||
MAKE_DIRECTORY(data/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() |
|||
|
|||
@ -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() |
|||
|
|||
@ -0,0 +1,92 @@ |
|||
# 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 |
|||
) |
|||
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() |
|||
|
|||
|
|||
MACRO (DTRACE_INSTRUMENT target) |
|||
IF(ENABLE_DTRACE) |
|||
ADD_DEPENDENCIES(${target} gen_dtrace_header) |
|||
|
|||
# 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 ${CMAKE_CURRENT_BINARY_DIR}/${target}_dtrace.o) |
|||
|
|||
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} |
|||
-P ${CMAKE_SOURCE_DIR}/cmake/dtrace_prelink.cmake |
|||
WORKING_DIRECTORY ${OBJDIR} |
|||
) |
|||
SET_TARGET_PROPERTIES(${target} PROPERTIES LINK_FLAGS "${outfile}") |
|||
ENDIF() |
|||
ENDIF() |
|||
ENDMACRO() |
|||
@ -0,0 +1,34 @@ |
|||
# 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(GLOB_RECURSE OBJECTS *.o) |
|||
|
|||
# Use relative paths to generate shorter command line |
|||
GET_FILENAME_COMPONENT(CURRENT_ABS_DIR . ABSOLUTE) |
|||
FOREACH(OBJ ${OBJECTS}) |
|||
FILE(RELATIVE_PATH REL ${CURRENT_ABS_DIR} ${OBJ}) |
|||
LIST(APPEND REL_OBJECTS ${REL}) |
|||
ENDFOREACH() |
|||
|
|||
EXECUTE_PROCESS( |
|||
COMMAND ${DTRACE} ${DTRACE_FLAGS} -o ${OUTFILE} -G -s ${DFILE} ${REL_OBJECTS} |
|||
) |
|||
|
|||
@ -0,0 +1,69 @@ |
|||
# 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 (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}) |
|||
STRING(REPLACE "$(OutDir)" "\${CMAKE_INSTALL_CONFIG_NAME}" pdb_location ${pdb_location}) |
|||
STRING(REPLACE "$(ConfigurationName)" "\${CMAKE_INSTALL_CONFIG_NAME}" pdb_location ${pdb_location}) |
|||
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) |
|||
# For Xcode, replace project config with install config |
|||
STRING(REPLACE "$(CONFIGURATION)" "\${CMAKE_INSTALL_CONFIG_NAME}" output ${output}) |
|||
INSTALL(FILES ${output} DESTINATION ${destination}) |
|||
ENDIF() |
|||
ENDMACRO() |
|||
|
|||
@ -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 |
|||
|
|||
# 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(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) |
|||
|
|||
|
|||
# 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) |
|||
|
|||
# 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") |
|||
@ -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}) |
|||
@ -0,0 +1,128 @@ |
|||
# 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 |
|||
|
|||
# Merge static libraries. |
|||
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}) |
|||
|
|||
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. |
|||
TARGET_LINK_LIBRARIES(${TARGET} ${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}) |
|||
ELSE() |
|||
# This is a shared library our static lib depends on. |
|||
TARGET_LINK_LIBRARIES(${TARGET} ${LIB}) |
|||
ENDIF() |
|||
ENDIF() |
|||
ENDFOREACH() |
|||
|
|||
# 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( |
|||
${CMAKE_SOURCE_DIR}/cmake/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() |
|||
|
|||
# Convert static library to shared |
|||
MACRO(STATIC_TO_SHARED STATIC_LIB SHARED_LIB EXPORTS_FILE) |
|||
IF(NOT MSVC) |
|||
MESSAGE(FATAL_ERROR |
|||
"Cannot convert static ${STATIC_LIB} to shared ${TARGET} library." |
|||
) |
|||
ENDIF() |
|||
|
|||
# Need one source file. |
|||
SET(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${SHARED_LIB}_dummy.c) |
|||
ADD_CUSTOM_COMMAND( |
|||
OUTPUT ${SOURCE_FILE} |
|||
COMMAND ${CMAKE_COMMAND} -E touch ${SOURCE_FILE} |
|||
) |
|||
|
|||
ADD_LIBRARY(${SHARED_LIB} SHARED ${SOURCE_FILE} ${EXPORTS_FILE}) |
|||
TARGET_LINK_LIBRARIES(${SHARED_LIB} ${STATIC_LIB}) |
|||
ENDMACRO() |
|||
|
|||
MACRO(SET_TARGET_SOURCEDIR TARGET) |
|||
SET(${TARGET}_SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "source directory for a target") |
|||
ENDMACRO() |
|||
|
|||
# Handy macro to use when source projects maybe used somewhere else |
|||
# For example, embedded or client library may recompile mysys sources |
|||
# In such cases, using absolute names in ADD_LIBRARY has the advantage that |
|||
# GET_TARGET_PROPERTY(xxx SOURCES) also returns absolute names, so there is |
|||
# no need to know the base directory of a target. |
|||
MACRO(USE_ABSOLUTE_FILENAMES FILELIST) |
|||
# Use absolute file paths for sources |
|||
# It helps when building embedded where we need to |
|||
# sources files for the plugin to recompile. |
|||
SET(RESOLVED_PATHS) |
|||
FOREACH(FILE ${${FILELIST}}) |
|||
GET_FILENAME_COMPONENT(ABSOLUTE_PATH ${FILE} ABSOLUTE) |
|||
LIST(APPEND RESOLVED_PATHS ${ABSOLUTE_PATH}) |
|||
ENDFOREACH() |
|||
SET(${FILELIST} ${RESOLVED_PATHS}) |
|||
ENDMACRO() |
|||
@ -0,0 +1,142 @@ |
|||
# 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) |
|||
FILE(STRINGS configure.in str REGEX "AC_INIT\\(") |
|||
STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][^ \\]]+" VERSION_STRING "${str}") |
|||
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}) |
|||
|
|||
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") |
|||
ENDIF() |
|||
IF(NOT MYSQL_UNIX_ADDR) |
|||
SET(MYSQL_UNIX_ADDR "/tmp/mysql.sock") |
|||
ENDIF() |
|||
IF(NOT COMPILATION_COMMENT) |
|||
SET(COMPILATION_COMMENT "Source distribution") |
|||
ENDIF() |
|||
|
|||
|
|||
|
|||
# Use meaningful package name for the binary package |
|||
IF(NOT CPACK_PACKAGE_FILE_NAME) |
|||
IF( NOT SYSTEM_NAME_AND_PROCESSOR) |
|||
IF(WIN32) |
|||
# CMake does not set CMAKE_SYSTEM_PROCESSOR correctly on Win64 |
|||
# (uses x86). Besides, we try to be compatible with existing naming |
|||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8) |
|||
SET(SYSTEM_NAME_AND_PROCESSOR "winx64") |
|||
ELSE() |
|||
SET(SYSTEM_NAME_AND_PROCESSOR "win32") |
|||
ENDIF() |
|||
ELSE() |
|||
IF(NOT PLATFORM) |
|||
SET(PLATFORM ${CMAKE_SYSTEM_NAME}) |
|||
ENDIF() |
|||
IF(NOT MACHINE) |
|||
SET(MACHINE ${CMAKE_SYSTEM_PROCESSOR}) |
|||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT ${MACHINE} MATCHES "ia64") |
|||
# On almost every 64 bit machine (except IA64) it is possible |
|||
# to build 32 bit packages. Add -64bit suffix to differentiate |
|||
# between 32 and 64 bit packages. |
|||
SET(MACHINE ${MACHINE}-64bit) |
|||
ENDIF() |
|||
ENDIF() |
|||
SET(SYSTEM_NAME_AND_PROCESSOR "${PLATFORM}-${MACHINE}") |
|||
ENDIF() |
|||
ENDIF() |
|||
|
|||
SET(package_name "mysql-${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(CPACK_PACKAGE_FILE_NAME ${package_name}) |
|||
ENDIF() |
|||
|
|||
IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME) |
|||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mysql-${VERSION}") |
|||
ENDIF() |
|||
SET(CPACK_PACKAGE_VENDOR "Sun Microsystems") |
|||
SET(CPACK_SOURCE_GENERATOR "TGZ") |
|||
SET(CPACK_SOURCE_IGNORE_FILES |
|||
\\\\.bzr/ |
|||
\\\\.bzr-mysql |
|||
.bzrignore |
|||
CMakeCache.txt |
|||
/CMakeFiles/ |
|||
/_CPack_Packages/ |
|||
$.gz |
|||
$.zip |
|||
) |
|||
@ -0,0 +1,171 @@ |
|||
# 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 |
|||
|
|||
# Creates a project to build plugin either as static or shared library |
|||
# Parameters: |
|||
# plugin - storage engine name. |
|||
# variable BUILD_TYPE should be set to "STATIC" or "DYNAMIC" |
|||
# Remarks: |
|||
# ${PLUGIN}_SOURCES variable containing source files to produce the |
|||
# library must set before calling this macro |
|||
|
|||
MACRO(MYSQL_PLUGIN plugin) |
|||
# Add common include directories |
|||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include |
|||
${CMAKE_SOURCE_DIR}/sql |
|||
${CMAKE_SOURCE_DIR}/regex |
|||
${SSL_INCLUDE_DIRS} |
|||
${ZLIB_INCLUDE_DIR}) |
|||
|
|||
STRING(TOUPPER ${plugin} plugin) |
|||
STRING(TOLOWER ${plugin} target) |
|||
|
|||
IF(NOT ${plugin}_PLUGIN_STATIC AND NOT ${plugin}_PLUGIN_DYNAMIC) |
|||
MESSAGE(FATAL_ERROR |
|||
"Neither ${plugin}_PLUGIN_STATIC nor ${plugin}_PLUGIN_DYNAMIC is defined. |
|||
Please set at least one of these variables to the name of the output |
|||
library in CMakeLists.txt prior to calling MYSQL_PLUGIN" |
|||
) |
|||
ENDIF() |
|||
|
|||
IF(WITH_PLUGIN_${plugin}) |
|||
SET(WITH_${plugin} 1) |
|||
ENDIF() |
|||
|
|||
IF(WITH_${plugin}_STORAGE_ENGINE OR WITH_{$plugin} OR WITH_ALL |
|||
OR WITH_MAX AND NOT WITHOUT_${plugin}_STORAGE_ENGINE AND NOT |
|||
WITHOUT_${plugin}) |
|||
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(${plugin}_PLUGIN_MANDATORY) |
|||
SET(WITH_${plugin} 1) |
|||
ENDIF() |
|||
|
|||
IF(${plugin} MATCHES NDBCLUSTER AND WITH_MAX_NO_NDB) |
|||
SET(WITH_${plugin} 0) |
|||
SET(WITH_${plugin}_STORAGE_ENGINE 0) |
|||
SET(WITHOUT_${plugin} 1) |
|||
SET(WITHOUT_${plugin}_STORAGE_ENGINE 0) |
|||
ENDIF() |
|||
|
|||
IF(STORAGE_ENGINE) |
|||
SET(with_var "WITH_${plugin}_STORAGE_ENGINE" ) |
|||
ELSE() |
|||
SET(with_var "WITH_${plugin}") |
|||
ENDIF() |
|||
|
|||
|
|||
USE_ABSOLUTE_FILENAMES(${plugin}_SOURCES) |
|||
|
|||
IF (WITH_${plugin} AND ${plugin}_PLUGIN_STATIC) |
|||
ADD_DEFINITIONS(-DMYSQL_SERVER) |
|||
#Create static library. |
|||
ADD_LIBRARY(${target} ${${plugin}_SOURCES}) |
|||
DTRACE_INSTRUMENT(${target}) |
|||
ADD_DEPENDENCIES(${target} GenError) |
|||
IF(${plugin}_LIBS) |
|||
TARGET_LINK_LIBRARIES(${target} ${${plugin}_LIBS}) |
|||
ENDIF() |
|||
SET_TARGET_PROPERTIES(${target} PROPERTIES |
|||
OUTPUT_NAME "${${plugin}_PLUGIN_STATIC}") |
|||
# Update mysqld dependencies |
|||
SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS} |
|||
${target} PARENT_SCOPE) |
|||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${target}_plugin" |
|||
PARENT_SCOPE) |
|||
SET(${with_var} ON CACHE BOOL "Link ${plugin} statically to the server" |
|||
FORCE) |
|||
ELSEIF(NOT WITHOUT_${plugin} AND ${plugin}_PLUGIN_DYNAMIC |
|||
AND NOT WITHOUT_DYNAMIC_PLUGINS) |
|||
|
|||
# Create a shared module. |
|||
ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN) |
|||
ADD_LIBRARY(${target} MODULE ${${plugin}_SOURCES}) |
|||
IF(${plugin}_LIBS) |
|||
TARGET_LINK_LIBRARIES(${target} ${${plugin}_LIBS}) |
|||
ENDIF() |
|||
DTRACE_INSTRUMENT(${target}) |
|||
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "") |
|||
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) |
|||
ENDIF() |
|||
|
|||
ADD_DEPENDENCIES(${target} GenError) |
|||
|
|||
IF(${plugin}_PLUGIN_DYNAMIC) |
|||
SET_TARGET_PROPERTIES(${target} PROPERTIES |
|||
OUTPUT_NAME "${${plugin}_PLUGIN_DYNAMIC}") |
|||
ENDIF() |
|||
|
|||
# Update cache "WITH" variable for plugins that support static linking |
|||
IF(${plugin}_PLUGIN_STATIC) |
|||
SET(${with_var} OFF CACHE BOOL "Link ${plugin} statically to the server" |
|||
FORCE) |
|||
ENDIF() |
|||
|
|||
# Install dynamic library |
|||
SET(INSTALL_LOCATION lib/plugin) |
|||
INSTALL(TARGETS ${target} DESTINATION ${INSTALL_LOCATION}) |
|||
INSTALL_DEBUG_SYMBOLS(${target}) |
|||
ELSE() |
|||
IF(STORAGE_ENGINE) |
|||
SET(without_var "WITHOUT_${plugin}_STORAGE_ENGINE") |
|||
ELSE() |
|||
SET(without_var "WITHOUT_${plugin}") |
|||
ENDIF() |
|||
SET(${without_var} ON CACHE BOOL "Link ${plugin} statically to the server" |
|||
FORCE) |
|||
MARK_AS_ADVANCED(${without_var}) |
|||
ENDIF() |
|||
ENDMACRO() |
|||
|
|||
MACRO (MYSQL_STORAGE_ENGINE engine) |
|||
SET(STORAGE_ENGINE 1) |
|||
MYSQL_PLUGIN(${engine}) |
|||
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() |
|||
# Special handling for partition(not really pluggable) |
|||
IF(NOT WITHOUT_PARTITION_STORAGE_ENGINE) |
|||
SET (WITH_PARTITION_STORAGE_ENGINE 1) |
|||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin") |
|||
ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE) |
|||
ADD_DEFINITIONS(${STORAGE_ENGINE_DEFS}) |
|||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in |
|||
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc) |
|||
ENDMACRO() |
|||
@ -0,0 +1,197 @@ |
|||
# 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(SET_WITH_BUNDLED_READLINE option) |
|||
IF(option) |
|||
SET(not_option OFF) |
|||
ELSE() |
|||
SET(not_option ON) |
|||
ENDIF() |
|||
SET(WITH_READLINE ${option} CACHE BOOL "Use bundled readline") |
|||
SET(WITH_LIBEDIT ${not_option} CACHE BOOL "Use bundled libedit") |
|||
ENDMACRO() |
|||
|
|||
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) |
|||
INCLUDE (FindCurses) |
|||
MARK_AS_ADVANCED(CURSES_CURSES_H_PATH CURSES_FORM_LIBRARY CURSES_HAVE_CURSES_H) |
|||
IF(NOT CURSES_FOUND) |
|||
MESSAGE(FATAL_ERROR "curses library not found") |
|||
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() |
|||
ENDMACRO() |
|||
|
|||
MACRO (MYSQL_USE_BUNDLED_READLINE) |
|||
SET_WITH_BUNDLED_READLINE(ON) |
|||
SET(USE_NEW_READLINE_INTERFACE 1) |
|||
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_WITH_BUNDLED_READLINE(OFF) |
|||
SET(USE_LIBEDIT_INTERFACE 1 CACHE INTERNAL "") |
|||
SET(HAVE_HIST_ENTRY 1 CACHE INTERNAL "") |
|||
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(SYSTEM_READLINE_INCLUDE_DIR readline/readline.h ) |
|||
FIND_LIBRARY(SYSTEM_READLINE_LIBRARY NAMES ${name}) |
|||
MARK_AS_ADVANCED(SYSTEM_READLINE_INCLUDE_DIR SYSTEM_READLINE_LIBRARY) |
|||
|
|||
INCLUDE(CheckCXXSourceCompiles) |
|||
SET(CMAKE_REQUIRES_LIBRARIES ${SYSTEM_READLINE_LIBRARY}) |
|||
|
|||
IF(SYSTEM_READLINE_LIBRARY AND SYSTEM_READLINE_INCLUDE_DIR) |
|||
SET(SYSTEM_READLINE_FOUND 1) |
|||
SET(CMAKE_REQUIRED_LIBRARIES ${SYSTEM_READLINE_LIBRARY}) |
|||
CHECK_CXX_SOURCE_COMPILES(" |
|||
#include <stdio.h> |
|||
#include <readline/readline.h> |
|||
int main(int argc, char **argv) |
|||
{ |
|||
HIST_ENTRY entry; |
|||
return 0; |
|||
}" |
|||
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); |
|||
}" |
|||
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; |
|||
}" |
|||
USE_NEW_READLINE_INTERFACE) |
|||
|
|||
IF(USE_LIBEDIT_INTERFACE OR USE_NEW_READLINE_INTERFACE) |
|||
SET(READLINE_LIBRARY ${SYSTEM_READLINE_LIBRARY}) |
|||
SET(READLINE_INCLUDE_DIR ${SYSTEM_READLINE_INCLUDE_DIR}) |
|||
SET(READLINE_FOUND 1) |
|||
ENDIF() |
|||
ENDIF() |
|||
ENDMACRO() |
|||
|
|||
MACRO (MYSQL_CHECK_READLINE) |
|||
IF (NOT WIN32) |
|||
MYSQL_CHECK_MULTIBYTE() |
|||
OPTION(WITH_READLINE "Use bundled readline" OFF) |
|||
IF(NOT CYGWIN) |
|||
# Bundled libedit does not compile on cygwin |
|||
OPTION(WITH_LIBEDIT "Use bundled libedit" ON) |
|||
ELSE() |
|||
OPTION(WITH_LIBEDIT "Use bundled libedit" OFF) |
|||
ENDIF() |
|||
|
|||
IF(WITH_READLINE) |
|||
MYSQL_USE_BUNDLED_READLINE() |
|||
ELSEIF(WITH_LIBEDIT) |
|||
MYSQL_USE_BUNDLED_LIBEDIT() |
|||
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() |
|||
|
|||
@ -0,0 +1,88 @@ |
|||
# 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}) |
|||
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS |
|||
${CMAKE_CXX_FLAGS}) |
|||
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() |
|||
@ -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); |
|||
} |
|||
@ -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() |
|||
@ -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) |
|||
CHECK_INCLUDE_FILES(term.h HAVE_TERM_H) |
|||
|
|||
SET(CMAKE_REQUIRED_LIBRARIES ${CURSES_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_SOURCE_DIR}/makelist @ONLY) |
|||
|
|||
|
|||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include |
|||
${CURSES_INCLUDE_PATH} |
|||
} |
|||
) |
|||
|
|||
SET(ASRC vi.c emacs.c common.c) |
|||
SET(AHDR vi.h emacs.h common.h) |
|||
|
|||
|
|||
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 help.c fcns.c filecomplete.c |
|||
${AHDR} |
|||
) |
|||
|
|||
include(CheckFunctionExists) |
|||
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_SOURCES ${LIBEDIT_SOURCES} np/vis.c) |
|||
ENDIF() |
|||
|
|||
|
|||
CHECK_FUNCTION_EXISTS(strunvis HAVE_STRUNVIS) |
|||
IF(NOT HAVE_STRUNVIS) |
|||
SET(LIBEDIT_SOURCES ${LIBEDIT_SOURCES} np/unvis.c) |
|||
ENDIF() |
|||
|
|||
CHECK_FUNCTION_EXISTS(strlcpy HAVE_STRLCPY) |
|||
IF(NOT HAVE_STRLCPY) |
|||
SET(LIBEDIT_SOURCES ${LIBEDIT_SOURCES} np/strlcpy.c) |
|||
ENDIF() |
|||
|
|||
|
|||
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT) |
|||
IF(NOT HAVE_STRLCAT) |
|||
SET(LIBEDIT_SOURCES ${LIBEDIT_SOURCES} np/strlcat.c) |
|||
ENDIF() |
|||
|
|||
|
|||
CHECK_FUNCTION_EXISTS(fgetln HAVE_FGETLN) |
|||
IF(NOT HAVE_FGETLN) |
|||
SET(LIBEDIT_SOURCES ${LIBEDIT_SOURCES} np/fgetln.c) |
|||
ENDIF() |
|||
|
|||
|
|||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/vi.h |
|||
COMMAND sh ./makelist -h vi.c > vi.h |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS vi.c) |
|||
|
|||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/emacs.h |
|||
COMMAND sh ./makelist -h emacs.c > emacs.h |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS emacs.c) |
|||
|
|||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/common.h |
|||
COMMAND sh ./makelist -h common.c > common.h |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS common.c) |
|||
|
|||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/help.c |
|||
COMMAND sh ./makelist -bc ${ASRC} > help.c |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS ${ASRC} |
|||
) |
|||
|
|||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/help.h |
|||
COMMAND sh ./makelist -bh ${ASRC} > help.h |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS ${ASRC} |
|||
) |
|||
|
|||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/fcns.h |
|||
COMMAND sh ./makelist -fh ${AHDR} > fcns.h |
|||
VERBATIM |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS ${AHDR} |
|||
) |
|||
|
|||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/fcns.c |
|||
COMMAND sh ./makelist -fc ${AHDR} > fcns.c |
|||
VERBATIM |
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|||
DEPENDS ${AHDR} |
|||
) |
|||
|
|||
|
|||
ADD_CUSTOM_TARGET( |
|||
GenLibeditSource |
|||
DEPENDS |
|||
${CMAKE_CURRENT_SOURCE_DIR}/vi.h |
|||
${CMAKE_CURRENT_SOURCE_DIR}/emacs.h |
|||
${CMAKE_CURRENT_SOURCE_DIR}/common.h |
|||
${CMAKE_CURRENT_SOURCE_DIR}/help.c |
|||
${CMAKE_CURRENT_SOURCE_DIR}/help.h |
|||
${CMAKE_CURRENT_SOURCE_DIR}/fcns.c |
|||
${CMAKE_CURRENT_SOURCE_DIR}/fcns.h |
|||
) |
|||
|
|||
ADD_LIBRARY(edit ${LIBEDIT_SOURCES}) |
|||
ADD_DEPENDENCIES(edit GenLibeditSource) |
|||
TARGET_LINK_LIBRARIES(edit ${CURSES_LIBRARY}) |
|||
|
|||
@ -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}) |
|||
@ -0,0 +1,618 @@ |
|||
/* 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 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_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_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 |
|||
|
|||
#cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@ |
|||
#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 @SIZEOF_LONG@ |
|||
#if SIZEOF_LONG |
|||
# define HAVE_LONG 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 |
|||
|
|||
#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@ |
|||
#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 |
|||
|
|||
#cmakedefine WORDS_BIGENDIAN 1 |
|||
|
|||
/* 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 _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@ |
|||
|
|||
|
|||
|
|||
/* |
|||
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 |
|||
|
|||
#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 |
|||
|
|||
/* |
|||
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@" |
|||
|
|||
#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 |
|||
1335
configure.cmake
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,61 @@ |
|||
# 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 |
|||
) |
|||
|
|||
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 include) |
|||
INSTALL(DIRECTORY mysql/ DESTINATION include |
|||
FILES_MATCHING PATTERN "*.h") |
|||
|
|||
|
|||
@ -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 man/man1) |
|||
ENDIF() |
|||
IF(MAN8_FILES) |
|||
INSTALL(FILES ${MAN8_FILES} DESTINATION man/man8) |
|||
ENDIF() |
|||
@ -0,0 +1,110 @@ |
|||
# 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 mysql-test |
|||
PATTERN "var/" EXCLUDE |
|||
PATTERN "lib/My/SafeProcess" EXCLUDE |
|||
PATTERN "CPack" EXCLUDE |
|||
PATTERN "CMake" EXCLUDE |
|||
PATTERN "mtr.out" EXCLUDE |
|||
PATTERN ".cvsignore" 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=$(OutDir)) |
|||
ELSEIF(CMAKE_GENERATOR MATCHES "Xcode") |
|||
SET(SETCONFIG_COMMAND export MTR_VS_CONFIG=$(CONFIGURATION)) |
|||
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() |
|||
|
|||
ADD_CUSTOM_TARGET(test-bt |
|||
COMMAND ${SETCONFIG_COMMAND} |
|||
COMMAND ${SETOS_COMMAND} |
|||
COMMAND ${SET_ENV} MTR_BUILD_THREAD=auto |
|||
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} |
|||
) |
|||
|
|||
|
|||
@ -0,0 +1,5 @@ |
|||
#!/usr/bin/perl |
|||
# Call mtr in out-of-source build |
|||
$ENV{MTR_BINDIR} = "@CMAKE_BINARY_DIR@"; |
|||
chdir("@CMAKE_SOURCE_DIR@/mysql-test"); |
|||
exit(system($^X, "@CMAKE_SOURCE_DIR@/mysql-test/mysql-test-run.pl", @ARGV) >> 8); |
|||
@ -0,0 +1,18 @@ |
|||
# 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(DAEMON_EXAMPLE_PLUGIN_DYNAMIC daemon_example) |
|||
SET(DAEMON_EXAMPLE_SOURCES daemon_example.cc) |
|||
MYSQL_PLUGIN(DAEMON_EXAMPLE) |
|||
@ -0,0 +1,18 @@ |
|||
# 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(FTEXAMPLE_PLUGIN_DYNAMIC mypluglib) |
|||
SET(FTEXAMPLE_SOURCES plugin_example.c) |
|||
MYSQL_PLUGIN(FTEXAMPLE) |
|||
@ -0,0 +1,51 @@ |
|||
# 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 sql-bench files |
|||
FILE(GLOB all_files |
|||
${CMAKE_SOURCE_DIR}/sql-bench/* |
|||
${CMAKE_SOURCE_DIR}/sql-bench/Data/ATIS/* |
|||
${CMAKE_SOURCE_DIR}/sql-bench/Data/Wisconsin/* |
|||
${CMAKE_SOURCE_DIR}/sql-bench/Comments/* |
|||
${CMAKE_SOURCE_DIR}/sql-bench/limits/* |
|||
) |
|||
|
|||
GET_FILENAME_COMPONENT(basedir ${CMAKE_SOURCE_DIR} ABSOLUTE) |
|||
FOREACH(file ${all_files}) |
|||
IF(NOT IS_DIRECTORY ${file} AND NOT ${file} MATCHES "Make" ) |
|||
FILE(RELATIVE_PATH relpath ${basedir} ${file}) |
|||
SET(target_relpath ${relpath}) |
|||
GET_FILENAME_COMPONENT(ext ${file} EXT) |
|||
GET_FILENAME_COMPONENT(dir ${relpath} PATH) |
|||
IF(ext MATCHES ".sh$") |
|||
# Those are perl files actually |
|||
STRING(REPLACE ".sh" "" target_relpath ${target_relpath} ) |
|||
IF(WIN32) |
|||
IF(NOT ext MATCHES ".pl") |
|||
SET(target_relpath "${target_relpath}.pl") |
|||
ENDIF() |
|||
ENDIF() |
|||
ENDIF() |
|||
SET(target "${CMAKE_BINARY_DIR}/${target_relpath}") |
|||
CONFIGURE_FILE(${file} ${target} COPYONLY) |
|||
IF (ext MATCHES ".bat") |
|||
IF(WIN32) |
|||
INSTALL(FILES ${target} DESTINATION ${dir}) |
|||
ENDIF() |
|||
ELSE() |
|||
INSTALL(FILES ${target} DESTINATION ${dir}) |
|||
ENDIF() |
|||
ENDIF() |
|||
ENDFOREACH() |
|||
@ -0,0 +1,52 @@ |
|||
# 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 (dirs |
|||
danish |
|||
german |
|||
slovak |
|||
dutch |
|||
greek |
|||
norwegian |
|||
spanish |
|||
english |
|||
hungarian |
|||
norwegian-ny |
|||
swedish |
|||
italian |
|||
polish |
|||
ukrainian |
|||
japanese |
|||
portuguese |
|||
romanian |
|||
estonian |
|||
korean |
|||
russian |
|||
czech |
|||
french |
|||
serbian |
|||
) |
|||
|
|||
SET(files |
|||
errmsg-utf8.txt |
|||
) |
|||
|
|||
FOREACH (dir ${dirs}) |
|||
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir} |
|||
DESTINATION share) |
|||
ENDFOREACH() |
|||
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION share) |
|||
|
|||
INSTALL(FILES ${files} DESTINATION share) |
|||
@ -1,44 +0,0 @@ |
|||
# MYSQL_STORAGE_ENGINE Macro creates a project to build storage engine |
|||
# library. |
|||
# |
|||
# Parameters: |
|||
# engine - storage engine name. |
|||
# variable ENGINE_BUILD_TYPE should be set to "STATIC" or "DYNAMIC" |
|||
# Remarks: |
|||
# ${engine}_SOURCES variable containing source files to produce the library must set before |
|||
# calling this macro |
|||
# ${engine}_LIBS variable containing extra libraries to link with may be set |
|||
|
|||
|
|||
MACRO(MYSQL_STORAGE_ENGINE engine) |
|||
IF(NOT SOURCE_SUBLIBS) |
|||
# Add common include directories |
|||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib |
|||
${CMAKE_SOURCE_DIR}/sql |
|||
${CMAKE_SOURCE_DIR}/regex |
|||
${CMAKE_SOURCE_DIR}/extra/yassl/include) |
|||
STRING(TOUPPER ${engine} engine) |
|||
STRING(TOLOWER ${engine} libname) |
|||
IF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC") |
|||
ADD_DEFINITIONS(-DWITH_${engine}_STORAGE_ENGINE -DMYSQL_SERVER) |
|||
#Create static library. The name of the library is <storage_engine>.lib |
|||
ADD_LIBRARY(${libname} ${${engine}_SOURCES}) |
|||
ADD_DEPENDENCIES(${libname} GenError) |
|||
IF(${engine}_LIBS) |
|||
TARGET_LINK_LIBRARIES(${libname} ${${engine}_LIBS}) |
|||
ENDIF(${engine}_LIBS) |
|||
MESSAGE("build ${engine} as static library") |
|||
ELSEIF(${ENGINE_BUILD_TYPE} STREQUAL "DYNAMIC") |
|||
ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN) |
|||
#Create a DLL.The name of the dll is ha_<storage_engine>.dll |
|||
#The dll is linked to the mysqld executable |
|||
SET(dyn_libname ha_${libname}) |
|||
ADD_LIBRARY(${dyn_libname} SHARED ${${engine}_SOURCES}) |
|||
TARGET_LINK_LIBRARIES (${dyn_libname} mysqlservices mysqld) |
|||
IF(${engine}_LIBS) |
|||
TARGET_LINK_LIBRARIES(${dyn_libname} ${${engine}_LIBS}) |
|||
ENDIF(${engine}_LIBS) |
|||
MESSAGE("build ${engine} as DLL") |
|||
ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC") |
|||
ENDIF(NOT SOURCE_SUBLIBS) |
|||
ENDMACRO(MYSQL_STORAGE_ENGINE) |
|||
@ -0,0 +1,61 @@ |
|||
# 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(WIN32) |
|||
SET(localstatedir "C:\\mysql\\data") |
|||
SET(install_destination .) |
|||
SET(ini_file_extension "ini") |
|||
ELSE() |
|||
SET(localstatedir "/usr/local/mysql/data") |
|||
SET(prefix "/usr/local") |
|||
SET(libexedir "/usr/local/mysql/bin") |
|||
SET(bindir "/usr/local/mysql/bin" ) |
|||
SET(sbindir "/usr/local/mysql/bin") |
|||
SET(datadir "/usr/local/mysql/data") |
|||
SET(CC ${CMAKE_C_COMPILER}) |
|||
SET(CXX ${CMAKE_CXX_COMPILER}) |
|||
SET(CFLAGS ${CMAKE_C_COMPILE_FLAGS}) |
|||
SET(CXXFLAGS ${CMAKE_COMPILE_CXX_FLAGS}) |
|||
SET(MYSQLD_USER "mysql") |
|||
SET(install_destination "support-files") |
|||
SET(ini_file_extension "cnf") |
|||
ENDIF() |
|||
|
|||
FOREACH(inifile my-huge my-innodb-heavy-4G my-large my-medium my-small) |
|||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${inifile}.cnf.sh |
|||
${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} @ONLY) |
|||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} DESTINATION ${install_destination}) |
|||
|
|||
ENDFOREACH() |
|||
|
|||
IF(UNIX) |
|||
FILE(GLOB ndb_ini_files ${CMAKE_CURRENT_SOURCE_DIR}/*.ini) |
|||
INSTALL(FILES ${ndb_ini_files} DESTINATION ${install_destination}) |
|||
|
|||
FOREACH(script mysql.server mysqld_multi.server mysql-log-rotate) |
|||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh |
|||
${CMAKE_CURRENT_BINARY_DIR}/${script} @ONLY ) |
|||
|
|||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${script} DESTINATION support-files |
|||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |
|||
ENDFOREACH() |
|||
INSTALL(FILES magic DESTINATION support-files) |
|||
INSTALL(FILES mysql.m4 DESTINATION share/aclocal) |
|||
CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY) |
|||
CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY) |
|||
CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.${VERSION}.spec @ONLY) |
|||
CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY) |
|||
ENDIF() |
|||
|
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue