注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

伟博

我的地盘听我的

 
 
 

日志

 
 

CMAKE安装MySQL的配置参数说明  

2011-08-23 17:09:17|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Autotools to CMake Transition Guide


Autotools to CMake Transition Guide

Contents

[hide]

[edit] Introduction

This page shows some common autotools configuration options and how they map to CMake equivalents. It supplements the CMake page that describes how to build MySQL with CMake.

[edit] Command Invocation Syntax

The following table shows some common configure invocation syntax and the equivalent CMake commands. The "." should be replaced with the path to the top-level directory of the source tree if that directory is not your current working directory.


configure Command CMake Command
./configure cmake .
./configure --help cmake . -LH or ccmake .


To clean out old object files and cached information before reconfiguring and rebuilding:

Autotools:

make clean rm config.cache 

CMake (Unix):

make clean rm CMakeCache.txt 

CMake (Windows):

devenv MySQL.sln /clean del CMakeCache.txt 

[edit] Installation Layout Options

These options control where to install various MySQL components.

In the following table, the CMAKE_INSTALL_PREFIX value is the installation base directory. Many other CMake layout options are interpreted relative to the prefix and their values are relative pathnames. Their values should not include the prefix.


Parameter configure Option CMake Option CMake Notes
Installation base directory --prefix=/usr -DCMAKE_INSTALL_PREFIX=/usr
mysqld directory --libexecdir=/usr/sbin -DINSTALL_SBINDIR=sbin interpreted relative to prefix
Data directory --localstatedir=/var/lib/mysql -DMYSQL_DATADIR=/var/lib/mysql
Config directory (for my.cnf) --sysconfdir=/etc/mysql -DSYSCONFDIR=/etc/mysql
Plugin directory --with-plugindir=/usr/lib64/mysql/plugin -DINSTALL_PLUGINDIR=lib64/mysql/plugin interpreted relative to prefix
Man page directory --mandir=/usr/share/man -DINSTALL_MANDIR=share/man interpreted relative to prefix
Shared-data directory --sharedstatedir=/usr/share/mysql -DINSTALL_SHAREDIR=share this is where aclocal/mysql.m4 should be installed
Library installation directory --libdir=/usr/lib64/mysql -DINSTALL_LIBDIR=lib64/mysql interpreted relative to prefix
Header installation directory --includedir=/usr/include/mysql -DINSTALL_INCLUDEDIR=include/mysql interpreted relative to prefix
Info doc directory --infodir=/usr/share/info -DINSTALL_INFODIR=share/info interpreted relative to prefix

[edit] Storage Engine Options

Storage engines are plugins, so the options that control plugin building specify which storage engines to build.

The --with-plugins configure option accepts two constructs that have no direct equivalent in CMake:

  • --with-plugins accepts a comma-separated list of engine names
  • --with-plugins accepts a "group name" value that is shorthand for a set of engines

With CMake, engines are controlled with individual options.

Suppose that the configure option is:

--with-plugins=csv,myisam,myisammrg,heap,innobase,archive,blackhole

This builds the named engines as static plugins that are compiled into the server and need not be installed explicitly.

To convert this for CMake, omit these engine names because they are mandatory (always compiled in):

csv myisam myisammrg heap

Then use these options to enable the InnoDB, ARCHIVE, and BLACKHOLE engines:

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

You can also use ON rather than 1 as the option value.

If you used --without-plugin-<engine> in configure to exclude a storage engine from the build, use -DWITHOUT_<ENGINE>_STORAGE_ENGINE in CMake.

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. A shared module must be installed using the INSTALL PLUGIN statement or the --plugin-load option before it can be used.

For additional information about CMake options for plugins, see the Plugin support page of the Internals manual.

[edit] Library Options

These options shown in the following table indicate which libraries to use.


Parameter configure Option CMake Option CMake Notes
readline library --with-readline -DWITH_READLINE=1
SSL library --with-ssl=/usr -DWITH_SSL=system
zlib library --with-zlib-dir=/usr -DWITH_ZLIB=system
libwrap library --without-libwrap -DWITH_LIBWRAP=0


[edit] Miscellaneous Options

Most of the previous MySQL build options are supported. The normal mapping between old and new is uppercase, remove leading dashes, replace dash with underscore.

Examples:

 --with-debug => WITH_DEBUG=1  --with-embedded-server => WITH_EMBEDDED_SERVER 
Parameter configure Option CMake Option CMake Notes
TCP/IP port number --with-tcp-port-=3306 -DMYSQL_TCP_PORT=3306
UNIX socket file --with-unix-socket-path=/tmp/mysqld.sock -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock
Enable LOCAL for LOAD DATA --enable-local-infile -DENABLED_LOCAL_INFILE=1
Extra charsets --with-extra-charsets=all -DEXTRA_CHARSETS=all default is "all"
Default charset --with-charset=utf8 -DDEFAULT_CHARSET=utf8
Default collation --with-collation=utf8_general_ci -DDEFAULT_COLLATION=utf8_general_ci
Build the server --with-server none
Build the embedded server --with-embedded-server -DWITH_EMBEDDED_SERVER=1
libmysqld privilege control --with-embedded-privilege-control none always enabled?
Install the documentation --without-docs none
Big tables --with-big-tables, --without-big-tables none tables are big by default
mysqld user --with-mysqld-user=mysql -DMYSQL_USER=mysql mysql is the default
Debugging --without-debug -DWITH_DEBUG=0 default is debugging disabled
GIS support --with-geometry none always enabled?
Community features --enable-community-features none always enabled
Profiling --disable-profiling -DENABLE_PROFILING=0 enabled by default
pstack --without-pstack none pstack is removed
Assembler string functions --enable-assembler none
Build type --build=x86_64-pc-linux-gnu no equivalent unneeded?
Cross-compile host --host=x86_64-pc-linux-gnu no equivalent unneeded?
Client flag --with-client-ldflags=-lstdc++ none unneeded
Client flag --enable-thread-safe-client none unneeded, clients are always thread safe
Comment --with-comment='string' -DWITH_COMMENT='string'
Shared/static binaries --enable-shared --enable-static none there is only DISABLE_SHARED
Memory use --with-low-memory none unneeded

[edit] Debugging the Configuration Process

Configuration with autotools produces config.log and config.status files.

Configuration with CMake produces files under the CMakeFiles directory : CMakeFiles/CMakeError.log and CMakeFiles/CMakeOutput.log

[edit] Interface to Third-Party Tools

Previously, third-party tools that need to determine the MySQL version from the MySQL source read the configure.in file in the top-level source directory. For example, the AC_INIT line for 5.5.7-rc looked like this:

AC_INIT([MySQL Server], [5.5.7-rc], [], [mysql]) 

Such tools now can read the VERSION file. For example, if the version is 5.5.8, the file looks like this:

MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 MYSQL_VERSION_PATCH=8 MYSQL_VERSION_EXTRA= 

If the source is not for a General Availablility (GA) release, the MYSQL_VERSION_EXTRA value will be nonempty. For example, the value for a Release Candidate release would look like this:

MYSQL_VERSION_EXTRA=rc 

To construct a five-digit number from the version components, use this formula:

MYSQL_VERSION_MAJOR*10000 + MYSQL_VERSION_MINOR*100 + MYSQL_VERSION_PATCH 

Retrieved from "http://forge.mysql.com/wiki/Autotools_to_CMake_Transition_Guide"

This page has been accessed 7,959 times. This page was last modified 20:51, 14 December 2010.

 
Find
  评论这张
 
阅读(137)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018