forked from Percona-QA/percona-qa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_mariadb_debug.sh
executable file
·28 lines (25 loc) · 1.13 KB
/
build_mariadb_debug.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Created by Roel Van de Paar, Percona LLC
if [ "${1}" == "" ]; then
echo "This script requires one option: a directory name prefix (used in the resulting target directory). For example 'MD'"
exit 1
fi
CURPATH=$(echo $PWD | sed 's|.*/||')
cd ..
rm -Rf ${CURPATH}_dbg
rm -f /tmp/5.7_debug_build
cp -R ${CURPATH} ${CURPATH}_dbg
cd ${CURPATH}_dbg
cmake . -DCMAKE_BUILD_TYPE=Debug -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_JEMALLOC=yes -DWITH_EMBEDDED_SERVER=OFF -DDEBUG_EXTNAME=OFF -DENABLE_DOWNLOADS=1 -DWITH_EMBEDDED_SERVER=OFF -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp | tee /tmp/5.7_debug_build
make | tee -a /tmp/5.7_debug_build
./scripts/make_binary_distribution | tee -a /tmp/5.7_debug_build
TAR_dbg=`ls -1 *.tar.gz | head -n1`
TAR_dbg_new=$(echo "${1}-${TAR_dbg}" | sed 's|.tar.gz|-debug.tar.gz|')
mv ${TAR_dbg} ../${TAR_dbg_new}
cd ..
tar -xf ${TAR_dbg_new}
DIR_dbg=$(echo "${TAR_dbg}" | sed 's|.tar.gz||')
DIR_dbg_new=$(echo "${TAR_dbg_new}" | sed 's|.tar.gz||')
mv ${DIR_dbg} ${DIR_dbg_new}
echo "mv ../${DIR_dbg_new} /sda" # The script will end still in $PWD, hence we will need ../ (output only)
rm -Rf ${CURPATH}_dbg