~sergei.glushchenko/+junk/page-scan-hack

« back to all changes in this revision

Viewing changes to utils/build.sh

merge parallel compression branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
    cd $top_dir
110
110
}
111
111
 
 
112
function build_libarchive()
 
113
{
 
114
        echo "Building libarchive"
 
115
        cd $top_dir/src/libarchive
 
116
        
 
117
        cmake  . \
 
118
            -DENABLE_CPIO=OFF \
 
119
            -DENABLE_OPENSSL=OFF \
 
120
            -DENABLE_TAR=OFF \
 
121
            -DENABLE_TEST=OFF
 
122
        $MAKE_CMD || exit -1
 
123
}
 
124
 
112
125
function build_xtrabackup()
113
126
{
 
127
    build_libarchive
114
128
    echo "Building XtraBackup"
115
 
    mkdir $build_dir
116
 
    cp $top_dir/Makefile $top_dir/xtrabackup.c $top_dir/xb_regex.h $build_dir
117
129
 
118
130
    # Read XTRABACKUP_VERSION from the VERSION file
119
131
    . $top_dir/VERSION
120
132
 
121
 
    cd $build_dir
122
 
    $MAKE_CMD $xtrabackup_target XTRABACKUP_VERSION=$XTRABACKUP_VERSION
 
133
    cd $top_dir/src
 
134
    if [ "`uname -s`" = "Linux" ]
 
135
    then
 
136
        export LIBS="$LIBS -lrt"
 
137
    fi
 
138
    $MAKE_CMD MYSQL_ROOT_DIR=$server_dir clean
 
139
    $MAKE_CMD MYSQL_ROOT_DIR=$server_dir XTRABACKUP_VERSION=$XTRABACKUP_VERSION $xtrabackup_target
123
140
    cd $top_dir
124
141
}
125
142
 
126
 
function build_tar4ibd()
127
 
{
128
 
    echo "Building tar4ibd"
129
 
    unpack_and_patch libtar-1.2.11.tar.gz tar4ibd_libtar-1.2.11.patch
130
 
    cd libtar-1.2.11
131
 
    ./configure
132
 
    $MAKE_CMD
133
 
    cd $top_dir
134
 
}
135
143
 
136
144
################################################################################
137
 
# Do all steps to build the server, xtrabackup and tar4ibd
 
145
# Do all steps to build the server, xtrabackup and xbstream
138
146
# Expects the following variables to be set before calling:
139
147
#   mysql_version       version string (e.g. "5.1.53")
140
148
#   server_patch        name of the patch to apply to server source before
150
158
    server_dir=$top_dir/mysql-$mysql_version_short
151
159
    server_tarball=mysql-$mysql_version.tar.gz
152
160
    innodb_dir=$server_dir/storage/$innodb_name
153
 
    build_dir=$innodb_dir/xtrabackup
154
161
 
155
162
    echo "Downloading sources"
156
 
    auto_download $server_tarball libtar-1.2.11.tar.gz
 
163
    auto_download $server_tarball
157
164
 
158
165
    test -d $server_dir && rm -r $server_dir
159
166
 
164
171
    build_server
165
172
 
166
173
    build_xtrabackup
167
 
 
168
 
    build_tar4ibd
169
174
}
170
175
 
171
 
if ! test -f xtrabackup.c
 
176
if ! test -f src/xtrabackup.c
172
177
then
173
178
        echo "`basename $0` must be run from the directory with XtraBackup sources"
174
179
        usage
177
182
type=$1
178
183
top_dir=`pwd`
179
184
 
 
185
 
180
186
case "$type" in
181
187
"innodb51_builtin" | "5.1")
182
188
        mysql_version=$MYSQL_51_VERSION
228
234
        server_dir=$top_dir/Percona-Server
229
235
        branch_dir=percona-server-5.1-xtrabackup
230
236
        innodb_dir=$server_dir/storage/innodb_plugin
231
 
        build_dir=$innodb_dir/xtrabackup
232
237
        xtrabackup_target=xtradb
233
238
        configure_cmd="./configure --enable-local-infile \
234
239
            --enable-thread-safe-client \
244
249
 
245
250
        echo "Downloading sources"
246
251
        
247
 
        auto_download libtar-1.2.11.tar.gz
248
 
 
249
252
        # Get Percona Server
250
253
        if [ -d $branch_dir ]
251
254
        then
277
280
 
278
281
        build_xtrabackup
279
282
 
280
 
        build_tar4ibd
281
283
        ;;
282
284
"xtradb55"|"galera55")
283
285
        server_dir=$top_dir/Percona-Server-5.5
284
286
        branch_dir=percona-server-5.5-xtrabackup
285
287
        innodb_dir=$server_dir/storage/innobase
286
 
        build_dir=$innodb_dir/xtrabackup
287
288
        xtrabackup_target=xtradb55
288
289
        # We need to build with partitioning due to MySQL bug #58632
289
290
        configure_cmd="cmake . \
301
302
 
302
303
        echo "Downloading sources"
303
304
        
304
 
        auto_download libtar-1.2.11.tar.gz
305
 
 
306
305
        # Get Percona Server
307
306
        if [ -d $branch_dir ]
308
307
        then
335
334
 
336
335
        build_xtrabackup
337
336
 
338
 
        build_tar4ibd
339
337
        ;;
340
338
*)
341
339
        usage