Commit b617450b authored by Rich Prohaska's avatar Rich Prohaska

release and debug build scripts for mysql

parent 543cff05
...@@ -208,11 +208,11 @@ function generate_cmake_cmd() { ...@@ -208,11 +208,11 @@ function generate_cmake_cmd() {
echo -n cmake .. $extra_flags -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=$cmake_build_type echo -n cmake .. $extra_flags -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=$cmake_build_type
if [ $system = linux ] ; then if [ $system = linux ] ; then
echo -n " " \ echo -n " " \
-DCMAKE_EXE_LINKER_FLAGS=\"-Wl,--whole-archive \$TOKUFRACTALTREE/lib/libjemalloc.a -Wl,-no-whole-archive\" -DTOKU_JEMALLOC_LIBRARY=\"-Wl,--whole-archive \$TOKUFRACTALTREE/lib/libjemalloc.a -Wl,-no-whole-archive\"
elif [ $system = darwin ] ; then elif [ $system = darwin ] ; then
echo -n " " \ echo -n " " \
-DWITH_SAFEMALLOC=OFF -DWITH_SSL=system \ -DWITH_SAFEMALLOC=OFF -DWITH_SSL=system \
-DCMAKE_EXE_LINKER_FLAGS=\"-Wl,-force_load -Wl,\$TOKUFRACTALTREE/lib/libjemalloc.a\" -DTOKU_JEMALLOC_LIBRARY=\"-Wl,-force_load -Wl,\$TOKUFRACTALTREE/lib/libjemalloc.a\"
else else
exit 1 exit 1
fi fi
...@@ -367,7 +367,7 @@ function generate_build_from_src() { ...@@ -367,7 +367,7 @@ function generate_build_from_src() {
echo 'sed -i -e"s/README/& %{src_dir}\/README-TOKUDB/" SPECS/$specfile' echo 'sed -i -e"s/README/& %{src_dir}\/README-TOKUDB/" SPECS/$specfile'
# add jemalloc to the linker flags # add jemalloc to the linker flags
echo 'sed -i -e"s/^\(.*-DMYSQL_SERVER_SUFFIX=.*\)$/& -DCMAKE_EXE_LINKER_FLAGS=\"-Wl,--whole-archive \$\{TOKUFRACTALTREE\}\/lib\/libjemalloc.a -Wl,-no-whole-archive\"/" SPECS/$specfile' echo 'sed -i -e"s/^\(.*-DMYSQL_SERVER_SUFFIX=.*\)$/& -DTOKU_JEMALLOC_LIBRARY=\"-Wl,--whole-archive \$\{TOKUFRACTALTREE\}\/lib\/libjemalloc.a -Wl,-no-whole-archive\"/" SPECS/$specfile'
# add the hot backup lib to the server package file list # add the hot backup lib to the server package file list
echo 'sed -i -e"s/%{_datadir}\/mysql\/$/&\n%attr(755, root, root) %{_libdir}\/libHotBackup*.so/" SPECS/$specfile' echo 'sed -i -e"s/%{_datadir}\/mysql\/$/&\n%attr(755, root, root) %{_libdir}\/libHotBackup*.so/" SPECS/$specfile'
...@@ -463,7 +463,7 @@ function build_mysql_src() { ...@@ -463,7 +463,7 @@ function build_mysql_src() {
# add README-TOKUDB # add README-TOKUDB
if [ ! -f $mysqlsrc/README-TOKUDB ] ; then if [ ! -f $mysqlsrc/README-TOKUDB ] ; then
cp ft-engine/README-TOKUDB $mysqlsrc cp ft-index/README-TOKUDB $mysqlsrc
fi fi
sed -i -e's/FILES README DESTINATION/FILES README README-TOKUDB DESTINATION/' $mysqlsrc/CMakeLists.txt sed -i -e's/FILES README DESTINATION/FILES README README-TOKUDB DESTINATION/' $mysqlsrc/CMakeLists.txt
......
#!/usr/bin/env bash
function usage() {
echo "generate a script that builds a debug mysql from subversion"
}
shopt -s compat31 2>/dev/null
while [ $# -ne 0 ] ; do
arg=$1; shift
if [[ $arg =~ --(.*)=(.*) ]] ; then
eval ${BASH_REMATCH[1]}=${BASH_REMATCH[2]};
else
usage; exit 1;
fi
done
echo '# setup environment variables'
echo builddir=\$PWD/mysql-build
echo installdir=\$PWD/mysql
echo mkdir \$builddir \$installdir
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo export TOKUFRACTALTREE=\$builddir/ft-index/install.debug
echo export TOKUFRACTALTREE_LIBNAME=tokudb
echo export TOKUPORTABILITY_LIBNAME=tokuportability
echo export TOKUDB_VERSION=0
echo '# checkout the fractal tree'
echo cd \$builddir
echo git clone git@github.com:Tokutek/jemalloc
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo git clone git@github.com:Tokutek/ft-index
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo '# build the fractal tree'
echo cd \$builddir/ft-index
echo mkdir build.debug
echo cd build.debug
echo CC=gcc47 CXX=g++47 cmake -DCMAKE_INSTALL_PREFIX=\$TOKUFRACTALTREE -D BUILD_TESTING=OFF -D CMAKE_BUILD_TYPE=Debug -D JEMALLOC_SOURCE_DIR=\$builddir/jemalloc ..
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo make install
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo '# checkout mysql'
echo cd \$builddir
echo git clone git@github.com:Tokutek/mysql
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo '# checkout the community backup'
echo cd \$builddir
echo git clone git@github.com:Tokutek/backup-community
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo '# checkout the tokudb handlerton'
echo cd \$builddir
echo git clone git@github.com:Tokutek/ft-engine
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo 'pushd mysql/storage; ln -s ../../ft-engine/storage/tokudb tokudb; popd'
echo 'pushd mysql; ln -s ../backup-community/backup toku_backup; popd'
echo '# build in the mysql directory'
echo cd \$builddir/mysql
echo export TOKUFRACTALTREE_LIBNAME=\${TOKUFRACTALTREE_LIBNAME}_static
echo export TOKUPORTABILITY_LIBNAME=\${TOKUPORTABILITY_LIBNAME}_static
echo mkdir build.debug
echo cd build.debug
echo CC=gcc47 CXX=g++47 cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=\$installdir ..
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo '# install'
echo make -j4 install
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo '# create a var directory so mysql does not complain'
echo 'cd $installdir'
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo mkdir var
echo 'if [ $? != 0 ] ; then exit 1; fi'
echo '# install the databases in msyql'
echo scripts/mysql_install_db --defaults-file=\$HOME/my.cnf
echo 'if [ $? != 0 ] ; then exit 1; fi'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment