Compile and install mysql (Ubuntu10 64-bit) http://www.cnblogs.com/2018/p/3482259.html this introduction gcc form compile and install mysql
Then we use clang to compile and check the specific effect.
Compile and install
After testing, we can solve the following problems:
V ABI_CHECK
N. This problem occurs after the configuration is complete.
V Clang
N or
Export CXX = clang ++
Export CC = clang
I first looked at it.
Clang vs calng ++
Http://stackoverflow.com/questions/14226840/c-11-threads-with-clang
You can compile and install the above process. The specific script is as follows:
If [-d mysql-5.6.15]; then
Echo "mysql
Else
Tar xzf mysql-5.6.15.tar.gz
Fi
# Cmake/abi_check.cmake ABI
# LINE30 SET (RUN_ABI_CHECK 0)
Cp-f abi_check.cmake mysql-5.6.15/cmake/abi_check.cmake
Mkdir-p build
Pushd build
If [-f CMakeCache.txt]; then
Make clean
Rm-f CMakeCache.txt
Fi
#
Export CXX = clang ++
Export CC = clang
#
Cmake ../mysql-5.6.15 \
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \
-DCMAKE_BUILD_TYPE = Release \
-DSYSCONFDIR =/etc \
-DINSTALL_SBINDIR =/usr/local/mysql/bin \
-DMYSQL_DATADIR =/usr/local/mysql/data \
-DMYSQL_UNIX_ADDR =/tmp/mysql. sock \
-DENABLED_LOCAL_INFILE = 1 \
-DMYSQL_TCP_PORT = 3306 \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DWITH_EMBEDDED_SERVER = 0 \
-DWITH_MYISAM_STORAGE_ENGINE = 1 \
-DWITH_INNOBASE_STORAGE_ENGINE = 1 \
-DWITH_PARTITION_STORAGE_ENGINE = 1 \
-DWITH_ARCHIVE_STORAGE_ENGINE = 0 \
-DWITH_BLACKHOLE_STORAGE_ENGINE = 0 \
-DWITH_MEMORY_STORAGE_ENGINE = 0 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE = 0 \
-DWITH_EXTRA_CHARSETS = none \
-DWITH_DEBUG = 0 \
-Dwith_1_= 1 \
#-DENABLE_DOWNLOADS = 0 \
# End of cmake
If [$? -Ne 0];
Then
Echo-e "\ e [1; 41 m cmake's config error! \ E [0 m"
Exit 1
Fi
Make
If [$? -Ne 0];
Then
Echo-e "\ e [1; 41 m cmake done! \ E [0 m"
Exit 1
Fi
Popd
Echo "The package is in build directory! "
References
Http://pan.baidu.com/s/1Cc7cr source/mysql5.6
Mysql_clang.sh my. cnf abi_check.cmake