# cat file.txt
1
2
3
4
5
6
# sed '/^\s*$/d' file.txt #删除空行
1
2
3
4
5
6
查看编译安装的mysql5.5之后版本,编译时cmake 所使用的参数
# cd /usr/local/mysql5.5/docs
# vim INFO_BIN (其中 Pointer size: 8 一行之后的内容就是所要的参数,需要注意的是,这里的参数的书写格式并不是在执行 cmake 命令时参数的标准格式 ,使用的时候要去掉 :BOOL或 PATH: 等字符)
-
===== Information about the build process: =====
-
Build was run at 2014-09-13 23:14:29 on host 'rhel5-8-1.breeze.com'
-
-
Build was done on Linux-2.6.18-308.el5 using i686
-
Build was done using cmake 3.0.2
-
-
===== Compiler flags used (from the 'sql/' subdirectory): =====
-
# compile C with /usr/bin/cc
-
# compile CXX with /usr/bin/c++
-
C_DEFINES = -DHAVE_CONFIG_H -DHAVE_EVENT_SCHEDULER -DMYSQL_SERVER
-
CXX_DEFINES = -DHAVE_CONFIG_H -DHAVE_EVENT_SCHEDULER -DMYSQL_SERVER
-
-
Pointer size: 4
-
-
===== Feature flags used: =====
-
-- Cache values
-
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-
CMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql5.5
-
COMMUNITY_BUILD:BOOL=ON
-
ENABLED_PROFILING:BOOL=ON
-
ENABLE_DEBUG_SYNC:BOOL=ON
-
ENABLE_GCOV:BOOL=OFF
-
INSTALL_LAYOUT:STRING=STANDALONE
-
MYSQL_DATADIR:PATH=/usr/local/mysql5.5/var
-
MYSQL_MAINTAINER_MODE:BOOL=OFF
-
TMPDIR:PATH=P_tmpdir
-
WITH_ARCHIVE_STORAGE_ENGINE:BOOL=OFF
-
WITH_ASAN:BOOL=OFF
-
WITH_BLACKHOLE_STORAGE_ENGINE:BOOL=OFF
-
WITH_DEBUG:BOOL=OFF
-
WITH_EMBEDDED_SERVER:BOOL=OFF
-
WITH_EXTRA_CHARSETS:STRING=all
-
WITH_FEDERATED_STORAGE_ENGINE:BOOL=OFF
-
WITH_INNOBASE_STORAGE_ENGINE:BOOL=ON
-
WITH_LIBEDIT:BOOL=ON
-
WITH_LIBWRAP:BOOL=OFF
-
WITH_PARTITION_STORAGE_ENGINE:BOOL=ON
-
WITH_PERFSCHEMA_STORAGE_ENGINE:BOOL=ON
-
WITH_PIC:BOOL=OFF
-
WITH_READLINE:BOOL=OFF
-
WITH_SSL:STRING=no
-
WITH_UNIT_TESTS:BOOL=ON
-
WITH_VALGRIND:BOOL=OFF
-
WITH_ZLIB:STRING=system
-
-
===== EOF =====
复制编译参数到build-config文件,因为sed是按行处理文本的,每次只读入一行到内部模式空间内。
因此要删除换行符,需要用sed的N命令全部读入(append方式)所有内容后再用s命令全局替换换行符为空。
-
[root@localhost mysql]# sed 's/^/-D/g' build-config
-
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-
-DCOMMUNITY_BUILD=ON
-
-DENABLED_PROFILING=ON
-
-DENABLE_DEBUG_SYNC=ON
-
-DENABLE_GCOV=OFF
-
-DEVENT_LIBRARY=EVENT_LIBRARY-NOTFOUND
-
-DGROFF=/usr/bin/groff
-
-DINSTALL_LAYOUT=STANDALONE
-
-DMYSQL_DATADIR=/var/lib/mysql
-
-DNOT_FOR_DISTRIBUTION=OFF
-
-DNROFF=/usr/bin/nroff
-
-DUSE_ARIA_FOR_TMP_TABLES=ON
-
-DWITH_ARCHIVE_STORAGE_ENGINE=OFF
-
-DWITH_ARIA_STORAGE_ENGINE=ON
-
-DWITH_BLACKHOLE_STORAGE_ENGINE=ON
-
-DWITH_EMBEDDED_SERVER=OFF
-
-DWITH_EXTRA_CHARSETS=all
-
-DWITH_FEDERATEDX_STORAGE_ENGINE=OFF
-
-DWITH_FEEDBACK=OFF
-
-DWITH_LIBWRAP=OFF
-
-DWITH_PARTITION_STORAGE_ENGINE=ON
-
-DWITH_PERFSCHEMA_STORAGE_ENGINE=ON
-
-DWITH_PIC=OFF
-
-DWITH_QUERY_CACHE_INFO=OFF
-
-DWITH_READLINE=1
-
-DWITH_SAFEMALLOC=AUTO
-
-DWITH_SPHINX_STORAGE_ENGINE=OFF
-
-
[root@localhost mysql]# sed -n 'N;N;N;N;s/\n/ /g;p' build-config
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DCOMMUNITY_BUILD=ON -DENABLED_PROFILING=ON -DENABLE_DEBUG_SYNC=ON -DENABLE_GCOV=OFF
-DEVENT_LIBRARY=EVENT_LIBRARY-NOTFOUND -DGROFF=/usr/bin/groff -DINSTALL_LAYOUT=STANDALONE -DMYSQL_DATADIR=/var/lib/mysql -DNOT_FOR_DISTRIBUTION=OFF
-DNROFF=/usr/bin/nroff -DUSE_ARIA_FOR_TMP_TABLES=ON -DWITH_ARCHIVE_STORAGE_ENGINE=OFF -DWITH_ARIA_STORAGE_ENGINE=ON -DWITH_BLACKHOLE_STORAGE_ENGINE=ON
-DWITH_EMBEDDED_SERVER=OFF -DWITH_EXTRA_CHARSETS=all -DWITH_FEDERATEDX_STORAGE_ENGINE=OFF -DWITH_FEEDBACK=OFF -DWITH_LIBWRAP=OFF
-DWITH_PARTITION_STORAGE_ENGINE=ON -DWITH_PERFSCHEMA_STORAGE_ENGINE=ON -DWITH_PIC=OFF -DWITH_QUERY_CACHE_INFO=OFF -DWITH_READLINE=1
-
用sed做还得考虑要读入多少行的问题,所以这里其实用awk做会更简单。
就上面这个例子:
-
awk -v RS="" '{gsub("\n"," ");print}' build-config
设置记录分隔符()为空,即将所有文件内容看作一条记录(默认是一行一条记录)。
用awk的内置函数gsub全局替换换行符为空格,之后print打印即可。
mysqlnd是什么
http://lylgxy0704wht.blog.163.com/blog/static/57048039201541534414179/
cmake报错,补充安装依赖包
-
yum install -y gcc gcc-c++
-
yum install -y ncurses-devel.x86_64
-
yum install -y cmake.x86_64
-
yum install -y libaio.x86_64
-
yum install -y bison.x86_64
-
yum install -y gcc-c++.x86_64
阅读(3494) | 评论(0) | 转发(0) |