Merge lp:~ignacio-nin/percona-server/5.5-debug-binary-builder into lp:percona-server/5.5

Proposed by Ignacio Nin
Status: Superseded
Proposed branch: lp:~ignacio-nin/percona-server/5.5-debug-binary-builder
Merge into: lp:percona-server/5.5
Diff against target: 104 lines (+27/-12)
1 file modified
build/build-binary.sh (+27/-12)
To merge this branch: bzr merge lp:~ignacio-nin/percona-server/5.5-debug-binary-builder
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Review via email: mp+126066@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stewart Smith (stewart) :
review: Approve
Revision history for this message
Ignacio Nin (ignacio-nin) wrote :
300. By Ignacio Nin

Merge changes from 5.1 for building out of source

301. By Ignacio Nin

Add a --debug flag to the binary builder

Add a --debug flag that will create a build with the debug-enabled
binaries. Also add -debug to the binary tarball and directory, as well
as the comment, in case it is a debug build.

Unmerged revisions

301. By Ignacio Nin

Add a --debug flag to the binary builder

Add a --debug flag that will create a build with the debug-enabled
binaries. Also add -debug to the binary tarball and directory, as well
as the comment, in case it is a debug build.

300. By Ignacio Nin

Merge changes from 5.1 for building out of source

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build/build-binary.sh'
2--- build/build-binary.sh 2012-09-18 05:14:49 +0000
3+++ build/build-binary.sh 2012-09-26 18:59:22 +0000
4@@ -16,6 +16,8 @@
5 TARGET="$(uname -m)"
6 TARGET_CFLAGS=''
7 QUIET='VERBOSE=1'
8+CMAKE_BUILD_TYPE='RelWithDebInfo'
9+DEBUG_COMMENT=''
10
11 # Some programs that may be overriden
12 TAR=${TAR:-tar}
13@@ -23,7 +25,7 @@
14 # Check if we have a functional getopt(1)
15 if ! getopt --test
16 then
17- go_out="$(getopt --options="iq" --longoptions=i686,quiet \
18+ go_out="$(getopt --options="iqd" --longoptions=i686,quiet,debug \
19 --name="$(basename "$0")" -- "$@")"
20 test $? -eq 0 || exit 1
21 eval set -- $go_out
22@@ -38,6 +40,11 @@
23 TARGET="i686"
24 TARGET_CFLAGS="-m32 -march=i686"
25 ;;
26+ -d | --debug )
27+ shift
28+ CMAKE_BUILD_TYPE='Debug'
29+ DEBUG_COMMENT='-debug'
30+ ;;
31 -q | --quiet )
32 shift
33 QUIET=''
34@@ -90,9 +97,9 @@
35 # Build information
36 REVISION="$(cd "$SOURCEDIR"; bzr log -r-1 | grep ^revno: | cut -d ' ' -f 2)"
37 PRODUCT_FULL="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION"
38-PRODUCT_FULL="$PRODUCT_FULL-$REVISION.$(uname -s).$TARGET"
39+PRODUCT_FULL="$PRODUCT_FULL-$REVISION$DEBUG_COMMENT.$(uname -s).$TARGET"
40 COMMENT="Percona Server with XtraDB (GPL), Release $PERCONA_SERVER_VERSION"
41-COMMENT="$COMMENT, Revision $REVISION"
42+COMMENT="$COMMENT, Revision $REVISION$DEBUG_COMMENT"
43
44 # Compilation flags
45 export CC=${CC:-gcc}
46@@ -102,19 +109,25 @@
47 export MAKE_JFLAG=-j4
48
49 # Create a temporary working directory
50-INSTALLDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d percona-build.XXXXXX)"
51-INSTALLDIR="$WORKDIR_ABS/$INSTALLDIR" # Make it absolute
52+TEMPDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d percona-build.XXXXXX)"
53+TEMPDIR="$WORKDIR_ABS/$TEMPDIR" # Make it absolute
54+EXPORTDIR="$TEMPDIR/source"
55+INSTALLDIR="$TEMPDIR/install"
56
57 # Build
58 (
59 cd "$SOURCEDIR"
60
61- # Execute clean and download mysql, apply patches
62- make clean all
63+ # Export a clean copy to the workdir
64+ bzr export "$EXPORTDIR/"
65+
66+ cd "$EXPORTDIR/"
67+ # Prepare source
68+ make all
69
70 cd "$PRODUCT"
71 cmake . -DBUILD_CONFIG=mysql_release \
72- -DCMAKE_BUILD_TYPE=RelWithDebInfo \
73+ -DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
74 -DWITH_EMBEDDED_SERVER=OFF \
75 -DFEATURE_SET=community \
76 -DCMAKE_INSTALL_PREFIX="/usr/local/$PRODUCT_FULL" \
77@@ -129,8 +142,9 @@
78 (
79 cd "storage/HandlerSocket-Plugin-for-MySQL"
80 ./autogen.sh
81- CXX=${HS_CXX:-g++} ./configure --with-mysql-source="$SOURCEDIR/$PRODUCT" \
82- --with-mysql-bindir="$SOURCEDIR/$PRODUCT/scripts" \
83+ CXX=${HS_CXX:-g++} ./configure \
84+ --with-mysql-source="$EXPORTDIR/$PRODUCT" \
85+ --with-mysql-bindir="$EXPORTDIR/$PRODUCT/scripts" \
86 --with-mysql-plugindir="/usr/local/$PRODUCT_FULL/lib/mysql/plugin" \
87 --libdir="/usr/local/$PRODUCT_FULL/lib/mysql/plugin" \
88 --prefix="/usr/local/$PRODUCT_FULL"
89@@ -142,7 +156,8 @@
90 # Build UDF
91 (
92 cd "UDF"
93- CXX=${UDF_CXX:-g++} ./configure --includedir="$SOURCEDIR/$PRODUCT/include" \
94+ CXX=${UDF_CXX:-g++} ./configure \
95+ --includedir="$EXPORTDIR/$PRODUCT/include" \
96 --libdir="/usr/local/$PRODUCT_FULL/mysql/plugin"
97 make
98 make DESTDIR="$INSTALLDIR" install
99@@ -161,5 +176,5 @@
100 )
101
102 # Clean up
103-rm -rf "$INSTALLDIR"
104+rm -rf "$TEMPDIR"
105

Subscribers

People subscribed via source and target branches