Spec-Zone .ru
спецификации, руководства, описания, API

2.9.4. MySQL Source-Configuration Options

The CMake program provides a great deal of control over how you configure a MySQL source distribution. Typically, you do this using options on the CMake command line. For information about options supported by CMake, run either of these commands in the top-level source directory:

shell> cmake . -LHshell> ccmake .

You can also affect CMake using certain environment variables. See Section 2.12, "Environment Variables".

The following table shows the available CMake options. In the Default column, PREFIX stands for the value of the CMAKE_INSTALL_PREFIX option, which specifies the installation base directory. This value is used as the parent location for several of the installation subdirectories.

Table 2.13. MySQL Source-Configuration Option Reference(CMake)

Formats Description Default Introduced Removed
BUILD_CONFIG Use same build options as official releases
CMAKE_BUILD_TYPE Type of build to produce RelWithDebInfo
CMAKE_INSTALL_PREFIX Installation base directory /usr/local/mysql
COMPILATION_COMMENT Comment about compilation environment
CPACK_MONOLITHIC_INSTALL Whether package build produces single file OFF
DEFAULT_CHARSET The default server character set latin1
DEFAULT_COLLATION The default server collation latin1_swedish_ci
ENABLE_DEBUG_SYNC Whether to enable Debug Sync support ON
ENABLE_DOWNLOADS Whether to download optional files OFF
ENABLE_DTRACE Whether to include DTrace support
ENABLE_GCOV Whether to include gcov support
ENABLE_GPROF Enable gprof (optimized Linux builds only) OFF
ENABLED_LOCAL_INFILE Whether to enable LOCAL for LOAD DATA INFILE OFF
ENABLED_PROFILING Whether to enable query profiling code ON
IGNORE_AIO_CHECK With -DBUILD_CONFIG=mysql_release, ignore libaio check OFF
INSTALL_BINDIR User executables directory PREFIX/bin
INSTALL_DOCDIR Documentation directory PREFIX/docs
INSTALL_DOCREADMEDIR README file directory PREFIX
INSTALL_INCLUDEDIR Header file directory PREFIX/include
INSTALL_INFODIR Info file directory PREFIX/docs
INSTALL_LAYOUT Select predefined installation layout STANDALONE
INSTALL_LIBDIR Library file directory PREFIX/lib
INSTALL_MANDIR Manual page directory PREFIX/man
INSTALL_MYSQLSHAREDIR Shared data directory PREFIX/share
INSTALL_MYSQLTESTDIR mysql-test directory PREFIX/mysql-test
INSTALL_PLUGINDIR Plugin directory PREFIX/lib/plugin
INSTALL_SBINDIR Server executable directory PREFIX/bin
INSTALL_SCRIPTDIR Scripts directory PREFIX/scripts
INSTALL_SHAREDIR aclocal/mysql.m4 installation directory PREFIX/share
INSTALL_SQLBENCHDIR sql-bench directory PREFIX
INSTALL_SUPPORTFILESDIR Extra support files directory PREFIX/support-files
MAX_INDEXES Maximum indexes per table 64 5.7.1
MYSQL_DATADIR Data directory
MYSQL_MAINTAINER_MODE Whether to enable MySQL maintainer-specific development environment OFF
MYSQL_PROJECT_NAME Windows/Mac OS X project name 3306
MYSQL_TCP_PORT TCP/IP port number 3306
MYSQL_UNIX_ADDR Unix socket file /tmp/mysql.sock
ODBC_INCLUDES ODBC includes directory
ODBC_LIB_DIR ODBC library directory
OPTIMIZER_TRACE Whether to support optimizer tracing
SYSCONFDIR Option file directory
WITH_DEBUG Whether to include debugging support OFF
WITH_DEFAULT_COMPILER_OPTIONS Whether to use default compiler options ON
WITH_DEFAULT_FEATURE_SET Whether to use default feature set ON
WITH_EDITLINE Which libedit/editline library to use bundled 5.7.2
WITH_EMBEDDED_SERVER Whether to build embedded server OFF
WITH_xxx_STORAGE_ENGINE Compile storage engine xxx statically into server
WITH_EXTRA_CHARSETS Which extra character sets to include all
WITH_INNODB_MEMCACHED Whether to generate memcached shared libraries. OFF
WITH_LIBWRAP Whether to include libwrap (TCP wrappers) support OFF
WITH_SSL Type of SSL support no
WITH_UNIXODBC Enable unixODBC support OFF
WITH_ZLIB Type of zlib support system
WITHOUT_xxx_STORAGE_ENGINE Exclude storage engine xxx from build

The following sections provide more information about CMake options.

For boolean options, the value may be specified as 1 or ON to enable the option, or as 0 or OFF to disable the option.

Many options configure compile-time defaults that can be overridden at server startup. For example, the CMAKE_INSTALL_PREFIX, MYSQL_TCP_PORT, and MYSQL_UNIX_ADDR options that configure the default installation base directory location, TCP/IP port number, and Unix socket file can be changed at server startup with the --basedir, --port, and --socket options for mysqld. Where applicable, configuration option descriptions indicate the corresponding mysqld startup option.

General Options

Installation Layout Options

The CMAKE_INSTALL_PREFIX option indicates the base installation directory. Other options with names of the form INSTALL_xxx that indicate component locations are interpreted relative to the prefix and their values are relative pathnames. Their values should not include the prefix.

Storage Engine Options

Storage engines are built as plugins. You can build a plugin as a static module (compiled into the server) or a dynamic module (built as a dynamic library that must be installed into the server using the INSTALL PLUGIN statement or the --plugin-load option before it can be used). Some plugins might not support static or dynamic building.

The MyISAM, MERGE, MEMORY, and CSV engines are mandatory (always compiled into the server) and need not be installed explicitly.

To compile a storage engine statically into the server, use -DWITH_engine_STORAGE_ENGINE=1. Some permissible engine values are ARCHIVE, BLACKHOLE, EXAMPLE, FEDERATED, INNOBASE (InnoDB), PARTITION (partitioning support), and PERFSCHEMA (Performance Schema). Examples:

-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_ARCHIVE_STORAGE_ENGINE=1-DWITH_BLACKHOLE_STORAGE_ENGINE=1-DWITH_PERFSCHEMA_STORAGE_ENGINE=1

To exclude a storage engine from the build, use -DWITHOUT_engine_STORAGE_ENGINE=1. Examples:

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1-DWITHOUT_FEDERATED_STORAGE_ENGINE=1-DWITHOUT_PARTITION_STORAGE_ENGINE=1

If neither -DWITH_engine_STORAGE_ENGINE nor -DWITHOUT_engine_STORAGE_ENGINE are specified for a given storage engine, the engine is built as a shared module, or excluded if it cannot be built as a shared module.

Feature Options

Compiler Flags

To specify compiler flags, set the CFLAGS and CXXFLAGS environment variables before running CMake. Example:

shell> CFLAGS=-DHAVE_EMBEDDED_PRIVILEGE_CONTROLshell> CXXFLAGS=-DHAVE_EMBEDDED_PRIVILEGE_CONTROLshell> export CFLAGS CXXFLAGSshell> cmake
        [options]

The following flags control configuration features: