~gl-az/percona-xtrabackup/2.1-io-block-size

« back to all changes in this revision

Viewing changes to src/Makefile

  • Committer: Alexey Kopytov
  • Date: 2012-02-10 20:05:56 UTC
  • mto: (391.1.5 staging)
  • mto: This revision was merged to the branch mainline in revision 390.
  • Revision ID: akopytov@gmail.com-20120210200556-6kx41z8wwrqfucro
Rebase of the parallel compression patch on new trunk + post-review
fixes.

Implementation of parallel compression and streaming for XtraBackup.

This revision implements the following changes:

* InnoDB files are now streamed by the xtrabackup binary rather than
innobackupex. As a result, integrity is now verified by xtrabackup and
thus tar4ibd is no longer needed, so it was removed.

* xtrabackup binary now accepts the new '--stream' option which has
exactly the same semantics as the '--stream' option in
innobackupex: it tells xtrabackup to stream all files to the standard
output in the specified format rather than storing them locally.

* The xtrabackup binary can now do parallel compression using the
quicklz library. Two new options were added to xtrabackup to support
this feature:

- '--compress' tells xtrabackup to compress all output data, including
the transaction log file and meta data files, using the specified
compression algorithm. The only currently supported algorithm is
'quicklz'. The resulting files have the qpress archive format,
i.e. every *.qp file produced by xtrabackup is essentially a one-file
qpress archive and can be extracted and uncompressed by the qpress
file archiver (http://www.quicklz.com/).

- '--compress-threads' specifies the number of worker threads used by
xtrabackup for parallel data compression. This option defaults to 1.

Parallel compression ('--compress-threads') can be used together with
parallel file copying ('--parallel'). For example, '--parallel=4
--compress --compress-threads=2' will create 4 IO threads that will
read the data and pipe it to 2 compression threads.

* To support simultaneous compression and streaming, a new custom
streaming format called 'xbstream' was introduced to XtraBackup in
addition to the 'tar' format. That was required to overcome some
limitations of traditional archive formats such as 'tar', 'cpio' and
others that do not allow streaming dynamically generated files, for
example dynamically compressed files.  Other advantages of xbstream over
traditional streaming/archive formats include ability to stream multiple
files concurrently (so it is possible to use streaming in the xbstream
format together with the --parallel option) and more compact data
storage.

* To allow streaming and extracting files to/from the xbstream format
produced by xtrabackup, a new utility aptly called 'xbstream' was
added to the XtraBackup distribution. This utility has a tar-like
interface:

- with the '-x' option it extracts files from the stream read from its
standard input to the current directory unless specified otherwise
with the '-C' option.

- with the '-c' option it streams files specified on the command line
to its standard output.

The utility also tries to minimize its impact on the OS page cache by
using the appropriate posix_fadvise() calls when available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
# plugin - XtraBackup for MySQL versions 5.1.* with InnoDB plugin
10
10
# 5.5 - XtraBackup for MySQL versions 5.5.*     
11
11
 
12
 
LIBS = -lpthread
 
12
LIBS += -lpthread
13
13
DEFS = -DUNIV_LINUX -DMYSQL_SERVER
14
14
 
15
15
CFLAGS += -DXTRABACKUP_VERSION=\"$(XTRABACKUP_VERSION)\" -pedantic -Wall -Wundef -Wshadow  -fdiagnostics-show-option  -fno-strict-aliasing -Wno-strict-aliasing -Wextra -Wformat -Wno-format-nonliteral -Wno-format-security -Wno-long-long  -Wmissing-declarations  -Wno-redundant-decls --std=gnu99
16
16
 
 
17
ifneq ($(DEBUG),)
 
18
CFLAGS += -DXB_DEBUG=1
 
19
endif
 
20
 
17
21
TARGET=xtrabackup
18
22
PREFIX=/usr
19
23
BIN_DIR=$(PREFIX)/bin
20
24
 
 
25
COMMON_INC = -I. -I libarchive/libarchive -I quicklz
 
26
XTRABACKUPOBJS = xtrabackup.o stream.o local.o compress.o xbstream_write.o \
 
27
        quicklz/quicklz.o
 
28
XBSTREAMOBJS = xbstream.o xbstream_write.o xbstream_read.o
 
29
 
 
30
LIBARCHIVE_A = libarchive/libarchive/libarchive.a
 
31
 
21
32
default: xtradb
22
33
 
23
34
# XtraBackup for MySQL 5.1
24
 
5.1: INC = -I. -isystem.. -isystem./../include -isystem./../../include -isystem./../../../include
25
 
5.1: INNODBOBJS = ../libinnobase_a-btr0btr.o ../libinnobase_a-btr0cur.o ../libinnobase_a-btr0pcur.o \
26
 
        ../libinnobase_a-btr0sea.o ../libinnobase_a-buf0buf.o ../libinnobase_a-buf0flu.o \
27
 
        ../libinnobase_a-buf0lru.o ../libinnobase_a-buf0rea.o ../libinnobase_a-data0data.o \
28
 
        ../libinnobase_a-data0type.o ../libinnobase_a-dict0boot.o ../libinnobase_a-dict0crea.o \
29
 
        ../libinnobase_a-dict0dict.o ../libinnobase_a-dict0load.o ../libinnobase_a-dict0mem.o \
30
 
        ../libinnobase_a-dyn0dyn.o ../libinnobase_a-eval0eval.o ../libinnobase_a-eval0proc.o \
31
 
        ../libinnobase_a-fil0fil.o ../libinnobase_a-fsp0fsp.o ../libinnobase_a-fut0fut.o \
32
 
        ../libinnobase_a-fut0lst.o ../libinnobase_a-ha0ha.o ../libinnobase_a-hash0hash.o \
33
 
        ../libinnobase_a-ibuf0ibuf.o ../libinnobase_a-lock0iter.o ../libinnobase_a-lock0lock.o \
34
 
        ../libinnobase_a-log0log.o ../libinnobase_a-log0recv.o ../libinnobase_a-mach0data.o \
35
 
        ../libinnobase_a-mem0mem.o ../libinnobase_a-mem0pool.o ../libinnobase_a-mtr0log.o \
36
 
        ../libinnobase_a-mtr0mtr.o ../libinnobase_a-os0file.o ../libinnobase_a-os0proc.o \
37
 
        ../libinnobase_a-os0sync.o ../libinnobase_a-os0thread.o ../libinnobase_a-page0cur.o \
38
 
        ../libinnobase_a-page0page.o ../libinnobase_a-lexyy.o ../libinnobase_a-pars0grm.o \
39
 
        ../libinnobase_a-pars0opt.o ../libinnobase_a-pars0pars.o ../libinnobase_a-pars0sym.o \
40
 
        ../libinnobase_a-que0que.o ../libinnobase_a-read0read.o ../libinnobase_a-rem0cmp.o \
41
 
        ../libinnobase_a-rem0rec.o ../libinnobase_a-row0ins.o ../libinnobase_a-row0mysql.o \
42
 
        ../libinnobase_a-row0purge.o ../libinnobase_a-row0row.o ../libinnobase_a-row0sel.o \
43
 
        ../libinnobase_a-row0uins.o ../libinnobase_a-row0umod.o ../libinnobase_a-row0undo.o \
44
 
        ../libinnobase_a-row0upd.o ../libinnobase_a-row0vers.o ../libinnobase_a-srv0que.o \
45
 
        ../libinnobase_a-srv0srv.o ../libinnobase_a-srv0start.o ../libinnobase_a-sync0arr.o \
46
 
        ../libinnobase_a-sync0rw.o ../libinnobase_a-sync0sync.o ../libinnobase_a-thr0loc.o \
47
 
        ../libinnobase_a-trx0purge.o ../libinnobase_a-trx0rec.o ../libinnobase_a-trx0roll.o \
48
 
        ../libinnobase_a-trx0rseg.o ../libinnobase_a-trx0sys.o ../libinnobase_a-trx0trx.o \
49
 
        ../libinnobase_a-trx0undo.o ../libinnobase_a-usr0sess.o ../libinnobase_a-ut0byte.o \
50
 
        ../libinnobase_a-ut0dbg.o ../libinnobase_a-ut0list.o ../libinnobase_a-ut0mem.o \
51
 
        ../libinnobase_a-ut0rnd.o ../libinnobase_a-ut0ut.o ../libinnobase_a-ut0vec.o \
52
 
        ../libinnobase_a-ut0wqueue.o
53
 
5.1: MYSQLOBJS= ../../../mysys/libmysys.a ../../../strings/libmystrings.a ../../../dbug/libdbug.a
 
35
5.1: INC = $(COMMON_INC) $(addprefix -isystem$(MYSQL_ROOT_DIR)/, \
 
36
        include storage/innobase/include)
 
37
5.1: INNODBOBJS = $(addprefix $(MYSQL_ROOT_DIR)/storage/innobase/libinnobase_a-, \
 
38
        btr0btr.o btr0cur.o btr0pcur.o \
 
39
        btr0sea.o buf0buf.o buf0flu.o buf0lru.o buf0rea.o data0data.o \
 
40
        data0type.o dict0boot.o dict0crea.o dict0dict.o dict0load.o dict0mem.o \
 
41
        dyn0dyn.o eval0eval.o eval0proc.o fil0fil.o fsp0fsp.o fut0fut.o \
 
42
        fut0lst.o ha0ha.o hash0hash.o ibuf0ibuf.o lock0iter.o lock0lock.o \
 
43
        log0log.o log0recv.o mach0data.o mem0mem.o mem0pool.o mtr0log.o \
 
44
        mtr0mtr.o os0file.o os0proc.o os0sync.o os0thread.o page0cur.o \
 
45
        page0page.o lexyy.o pars0grm.o pars0opt.o pars0pars.o pars0sym.o \
 
46
        que0que.o read0read.o rem0cmp.o rem0rec.o row0ins.o row0mysql.o \
 
47
        row0purge.o row0row.o row0sel.o row0uins.o row0umod.o row0undo.o \
 
48
        row0upd.o row0vers.o srv0que.o srv0srv.o srv0start.o sync0arr.o \
 
49
        sync0rw.o sync0sync.o thr0loc.o trx0purge.o trx0rec.o trx0roll.o \
 
50
        trx0rseg.o trx0sys.o trx0trx.o trx0undo.o usr0sess.o ut0byte.o \
 
51
        ut0dbg.o ut0list.o ut0mem.o ut0rnd.o ut0ut.o ut0vec.o ut0wqueue.o)
 
52
5.1: MYSQLOBJS= $(addprefix $(MYSQL_ROOT_DIR)/, mysys/libmysys.a  \
 
53
        strings/libmystrings.a zlib/.libs/libzlt.a dbug/libdbug.a)
54
54
5.1: TARGET := xtrabackup_51
55
 
5.1: $(TARGET)
 
55
5.1: $(TARGET) xbstream
56
56
 
57
57
# XtraBackup for MySQL with InnoDB Plugin
58
 
plugin: INC = -I. -isystem.. -isystem./../include -isystem./../../include -isystem./../../../include
59
 
plugin: INNODBOBJS = ../ha_innodb_plugin_la-btr0btr.o ../ha_innodb_plugin_la-btr0cur.o ../ha_innodb_plugin_la-btr0pcur.o ../ha_innodb_plugin_la-btr0sea.o ../ha_innodb_plugin_la-buf0buddy.o ../ha_innodb_plugin_la-buf0buf.o ../ha_innodb_plugin_la-buf0flu.o ../ha_innodb_plugin_la-buf0lru.o ../ha_innodb_plugin_la-buf0rea.o ../ha_innodb_plugin_la-data0data.o ../ha_innodb_plugin_la-data0type.o ../ha_innodb_plugin_la-dict0boot.o ../ha_innodb_plugin_la-dict0crea.o ../ha_innodb_plugin_la-dict0dict.o ../ha_innodb_plugin_la-dict0load.o ../ha_innodb_plugin_la-dict0mem.o ../ha_innodb_plugin_la-dyn0dyn.o ../ha_innodb_plugin_la-eval0eval.o ../ha_innodb_plugin_la-eval0proc.o ../ha_innodb_plugin_la-fil0fil.o ../ha_innodb_plugin_la-fsp0fsp.o ../ha_innodb_plugin_la-fut0fut.o ../ha_innodb_plugin_la-fut0lst.o ../ha_innodb_plugin_la-ha0ha.o ../ha_innodb_plugin_la-ha0storage.o ../ha_innodb_plugin_la-hash0hash.o ../ha_innodb_plugin_la-ibuf0ibuf.o ../ha_innodb_plugin_la-lock0iter.o ../ha_innodb_plugin_la-lock0lock.o ../ha_innodb_plugin_la-log0log.o ../ha_innodb_plugin_la-log0recv.o ../ha_innodb_plugin_la-mach0data.o ../ha_innodb_plugin_la-mem0mem.o ../ha_innodb_plugin_la-mem0pool.o ../ha_innodb_plugin_la-mtr0log.o ../ha_innodb_plugin_la-mtr0mtr.o ../ha_innodb_plugin_la-os0file.o ../ha_innodb_plugin_la-os0proc.o ../ha_innodb_plugin_la-os0sync.o ../ha_innodb_plugin_la-os0thread.o ../ha_innodb_plugin_la-page0cur.o ../ha_innodb_plugin_la-page0page.o ../ha_innodb_plugin_la-page0zip.o ../ha_innodb_plugin_la-lexyy.o ../ha_innodb_plugin_la-pars0grm.o ../ha_innodb_plugin_la-pars0opt.o ../ha_innodb_plugin_la-pars0pars.o ../ha_innodb_plugin_la-pars0sym.o ../ha_innodb_plugin_la-que0que.o ../ha_innodb_plugin_la-read0read.o ../ha_innodb_plugin_la-rem0cmp.o ../ha_innodb_plugin_la-rem0rec.o ../ha_innodb_plugin_la-row0ext.o ../ha_innodb_plugin_la-row0ins.o ../ha_innodb_plugin_la-row0merge.o ../ha_innodb_plugin_la-row0mysql.o ../ha_innodb_plugin_la-row0purge.o ../ha_innodb_plugin_la-row0row.o ../ha_innodb_plugin_la-row0sel.o ../ha_innodb_plugin_la-row0uins.o ../ha_innodb_plugin_la-row0umod.o ../ha_innodb_plugin_la-row0undo.o ../ha_innodb_plugin_la-row0upd.o ../ha_innodb_plugin_la-row0vers.o ../ha_innodb_plugin_la-srv0que.o ../ha_innodb_plugin_la-srv0srv.o ../ha_innodb_plugin_la-srv0start.o ../ha_innodb_plugin_la-sync0arr.o ../ha_innodb_plugin_la-sync0rw.o ../ha_innodb_plugin_la-sync0sync.o ../ha_innodb_plugin_la-thr0loc.o ../ha_innodb_plugin_la-trx0purge.o ../ha_innodb_plugin_la-trx0rec.o ../ha_innodb_plugin_la-trx0roll.o ../ha_innodb_plugin_la-trx0rseg.o ../ha_innodb_plugin_la-trx0sys.o ../ha_innodb_plugin_la-trx0trx.o ../ha_innodb_plugin_la-trx0undo.o ../ha_innodb_plugin_la-usr0sess.o ../ha_innodb_plugin_la-ut0byte.o ../ha_innodb_plugin_la-ut0dbg.o ../ha_innodb_plugin_la-ut0list.o ../ha_innodb_plugin_la-ut0mem.o ../ha_innodb_plugin_la-ut0rnd.o ../ha_innodb_plugin_la-ut0ut.o ../ha_innodb_plugin_la-ut0vec.o ../ha_innodb_plugin_la-ut0wqueue.o ../ha_innodb_plugin_la-ut0rbt.o
 
58
plugin: INC = $(COMMON_INC) $(addprefix -I$(MYSQL_ROOT_DIR)/, \
 
59
        include storage/innodb_plugin/include)
 
60
plugin: INNODBOBJS = $(addprefix \
 
61
        $(MYSQL_ROOT_DIR)/storage/innodb_plugin/ha_innodb_plugin_la-, \
 
62
        btr0btr.o btr0cur.o btr0pcur.o btr0sea.o buf0buddy.o buf0buf.o \
 
63
        buf0flu.o buf0lru.o buf0rea.o data0data.o data0type.o dict0boot.o \
 
64
        dict0crea.o dict0dict.o dict0load.o dict0mem.o dyn0dyn.o eval0eval.o \
 
65
        eval0proc.o fil0fil.o fsp0fsp.o fut0fut.o fut0lst.o ha0ha.o \
 
66
        ha0storage.o hash0hash.o ibuf0ibuf.o lock0iter.o lock0lock.o log0log.o \
 
67
        log0recv.o mach0data.o mem0mem.o mem0pool.o mtr0log.o mtr0mtr.o \
 
68
        os0file.o os0proc.o os0sync.o os0thread.o page0cur.o page0page.o \
 
69
        page0zip.o lexyy.o pars0grm.o pars0opt.o pars0pars.o pars0sym.o \
 
70
        que0que.o read0read.o rem0cmp.o rem0rec.o row0ext.o row0ins.o \
 
71
        row0merge.o row0mysql.o row0purge.o row0row.o row0sel.o row0uins.o \
 
72
        row0umod.o row0undo.o row0upd.o row0vers.o srv0que.o srv0srv.o \
 
73
        srv0start.o sync0arr.o sync0rw.o sync0sync.o thr0loc.o trx0purge.o \
 
74
        trx0rec.o trx0roll.o trx0rseg.o trx0sys.o trx0trx.o trx0undo.o \
 
75
        usr0sess.o ut0byte.o ut0dbg.o ut0list.o ut0mem.o ut0rnd.o ut0ut.o \
 
76
        ut0vec.o ut0wqueue.o ut0rbt.o)
60
77
 
61
 
plugin: MYSQLOBJS= ../../../mysys/libmysys.a ../../../strings/libmystrings.a ../../../zlib/.libs/libzlt.a ../../../dbug/libdbug.a
 
78
plugin: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, mysys/libmysys.a \
 
79
        strings/libmystrings.a zlib/.libs/libzlt.a dbug/libdbug.a)
62
80
plugin: TARGET := xtrabackup_plugin
63
 
plugin: $(TARGET)
 
81
plugin: $(TARGET) xbstream
64
82
 
65
83
# XtraBackup for MySQL 5.5
66
 
5.5: INC = -I. -I.. -I./../include -I./../../include -I./../../../include
67
 
5.5: INNODBOBJS= ../libinnobase.a
68
 
 
69
 
5.5: MYSQLOBJS= ../../../mysys/libmysys.a ../../../strings/libstrings.a ../../../zlib/libzlib.a ../../../dbug/libdbug.a
 
84
5.5: INC = $(COMMON_INC) $(addprefix -isystem$(MYSQL_ROOT_DIR)/, \
 
85
        include storage/innobase/include)
 
86
5.5: INNODBOBJS = $(MYSQL_ROOT_DIR)/storage/innobase/libinnobase.a
 
87
 
 
88
ifeq "$(wildcard $(MYSQL_ROOT_DIR)/zlib/.libs/libzlt.a)" ""
 
89
xtradb55: LIBZ= -lz
 
90
else
 
91
xtradb55: LIBZ= $(MYSQL_ROOT_DIR)/zlib/.libs/libzlt.a
 
92
endif
 
93
 
 
94
5.5: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, \
 
95
        mysys/libmysys.a strings/libstrings.a zlib/libzlib.a dbug/libdbug.a)
70
96
ifeq ($(shell uname -s),Linux)
71
97
5.5: LIBS += -laio
72
98
endif
73
99
5.5: TARGET := xtrabackup_innodb55
74
100
# In CMake server builds it is important to build with exactly the same preprocessor flags
75
101
# as were used to build InnoDB
76
 
5.5: DEFS = $(shell grep C_DEFINES ../CMakeFiles/innobase.dir/flags.make | \
77
 
               sed -e 's/C_DEFINES = //')
78
 
5.5: $(TARGET)
 
102
5.5: DEFS = $(shell grep C_DEFINES \
 
103
        $(MYSQL_ROOT_DIR)/storage/innobase/CMakeFiles/innobase.dir/flags.make | \
 
104
        sed -e 's/C_DEFINES = //')
 
105
5.5: $(TARGET) xbstream
79
106
 
80
107
# XtraBackup for XtraDB 
81
 
xtradb: INC=-I. -isystem.. -isystem./../include -isystem./../../include -isystem./../../../include
82
 
xtradb: INNODBOBJS = ../libinnobase_a-btr0btr.o ../libinnobase_a-btr0cur.o ../libinnobase_a-btr0pcur.o \
83
 
        ../libinnobase_a-btr0sea.o ../libinnobase_a-buf0buddy.o ../libinnobase_a-buf0buf.o \
84
 
        ../libinnobase_a-buf0flu.o ../libinnobase_a-buf0lru.o ../libinnobase_a-buf0rea.o \
85
 
        ../libinnobase_a-data0data.o ../libinnobase_a-data0type.o ../libinnobase_a-dict0boot.o \
86
 
        ../libinnobase_a-dict0crea.o ../libinnobase_a-dict0dict.o ../libinnobase_a-dict0load.o \
87
 
        ../libinnobase_a-dict0mem.o ../libinnobase_a-dyn0dyn.o ../libinnobase_a-eval0eval.o \
88
 
        ../libinnobase_a-eval0proc.o ../libinnobase_a-fil0fil.o ../libinnobase_a-fsp0fsp.o \
89
 
        ../libinnobase_a-fut0fut.o ../libinnobase_a-fut0lst.o ../libinnobase_a-ha0ha.o \
90
 
        ../libinnobase_a-ha0storage.o ../libinnobase_a-hash0hash.o ../libinnobase_a-ibuf0ibuf.o \
91
 
        ../libinnobase_a-lock0iter.o ../libinnobase_a-lock0lock.o ../libinnobase_a-log0log.o \
92
 
        ../libinnobase_a-log0recv.o ../libinnobase_a-mach0data.o ../libinnobase_a-mem0mem.o \
93
 
        ../libinnobase_a-mem0pool.o ../libinnobase_a-mtr0log.o ../libinnobase_a-mtr0mtr.o \
94
 
        ../libinnobase_a-os0file.o ../libinnobase_a-os0proc.o ../libinnobase_a-os0sync.o \
95
 
        ../libinnobase_a-os0thread.o ../libinnobase_a-page0cur.o ../libinnobase_a-page0page.o \
96
 
        ../libinnobase_a-page0zip.o ../libinnobase_a-lexyy.o ../libinnobase_a-pars0grm.o \
97
 
        ../libinnobase_a-pars0opt.o ../libinnobase_a-pars0pars.o ../libinnobase_a-pars0sym.o \
98
 
        ../libinnobase_a-que0que.o ../libinnobase_a-read0read.o ../libinnobase_a-rem0cmp.o \
99
 
        ../libinnobase_a-rem0rec.o ../libinnobase_a-row0ext.o ../libinnobase_a-row0ins.o \
100
 
        ../libinnobase_a-row0merge.o ../libinnobase_a-row0mysql.o ../libinnobase_a-row0purge.o \
101
 
        ../libinnobase_a-row0row.o ../libinnobase_a-row0sel.o ../libinnobase_a-row0uins.o \
102
 
        ../libinnobase_a-row0umod.o ../libinnobase_a-row0undo.o ../libinnobase_a-row0upd.o \
103
 
        ../libinnobase_a-row0vers.o ../libinnobase_a-srv0que.o ../libinnobase_a-srv0srv.o \
104
 
        ../libinnobase_a-srv0start.o ../libinnobase_a-sync0arr.o ../libinnobase_a-sync0rw.o \
105
 
        ../libinnobase_a-sync0sync.o ../libinnobase_a-thr0loc.o ../libinnobase_a-trx0purge.o \
106
 
        ../libinnobase_a-trx0rec.o ../libinnobase_a-trx0roll.o ../libinnobase_a-trx0rseg.o \
107
 
        ../libinnobase_a-trx0sys.o ../libinnobase_a-trx0trx.o ../libinnobase_a-trx0undo.o \
108
 
        ../libinnobase_a-usr0sess.o ../libinnobase_a-ut0byte.o ../libinnobase_a-ut0dbg.o \
109
 
        ../libinnobase_a-ut0list.o ../libinnobase_a-ut0mem.o ../libinnobase_a-ut0rnd.o \
110
 
        ../libinnobase_a-ut0ut.o ../libinnobase_a-ut0vec.o ../libinnobase_a-ut0wqueue.o \
111
 
        ../libinnobase_a-ut0rbt.o
112
 
xtradb: MYSQLOBJS = ../../../mysys/libmysys.a ../../../strings/libmystrings.a ../../../zlib/.libs/libzlt.a ../../../dbug/libdbug.a
 
108
xtradb: INC = $(COMMON_INC) $(addprefix -isystem$(MYSQL_ROOT_DIR)/, \
 
109
        include storage/innodb_plugin/include)
 
110
xtradb: INNODBOBJS = $(addprefix \
 
111
        $(MYSQL_ROOT_DIR)/storage/innodb_plugin/libinnobase_a-, \
 
112
        btr0btr.o btr0cur.o btr0pcur.o \
 
113
        btr0sea.o buf0buddy.o buf0buf.o \
 
114
        buf0flu.o buf0lru.o buf0rea.o \
 
115
        data0data.o data0type.o dict0boot.o \
 
116
        dict0crea.o dict0dict.o dict0load.o \
 
117
        dict0mem.o dyn0dyn.o eval0eval.o \
 
118
        eval0proc.o fil0fil.o fsp0fsp.o \
 
119
        fut0fut.o fut0lst.o ha0ha.o \
 
120
        ha0storage.o hash0hash.o ibuf0ibuf.o \
 
121
        lock0iter.o lock0lock.o log0log.o \
 
122
        log0recv.o mach0data.o mem0mem.o \
 
123
        mem0pool.o mtr0log.o mtr0mtr.o \
 
124
        os0file.o os0proc.o os0sync.o \
 
125
        os0thread.o page0cur.o page0page.o \
 
126
        page0zip.o lexyy.o pars0grm.o \
 
127
        pars0opt.o pars0pars.o pars0sym.o \
 
128
        que0que.o read0read.o rem0cmp.o \
 
129
        rem0rec.o row0ext.o row0ins.o \
 
130
        row0merge.o row0mysql.o row0purge.o \
 
131
        row0row.o row0sel.o row0uins.o \
 
132
        row0umod.o row0undo.o row0upd.o \
 
133
        row0vers.o srv0que.o srv0srv.o \
 
134
        srv0start.o sync0arr.o sync0rw.o \
 
135
        sync0sync.o thr0loc.o trx0purge.o \
 
136
        trx0rec.o trx0roll.o trx0rseg.o \
 
137
        trx0sys.o trx0trx.o trx0undo.o \
 
138
        usr0sess.o ut0byte.o ut0dbg.o \
 
139
        ut0list.o ut0mem.o ut0rnd.o \
 
140
        ut0ut.o ut0vec.o ut0wqueue.o \
 
141
        ut0rbt.o)
 
142
xtradb: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, mysys/libmysys.a \
 
143
        strings/libmystrings.a zlib/.libs/libzlt.a dbug/libdbug.a)
113
144
xtradb: DEFS += -DXTRADB_BASED 
114
145
xtradb: TARGET := xtrabackup 
115
 
xtradb: $(TARGET)
 
146
xtradb: $(TARGET) xbstream
116
147
 
117
148
# XtraBackup for XtraDB 5.5
118
 
xtradb55: INC=-I. -isystem.. -isystem./../include -isystem./../../include -isystem./../../../include
119
 
xtradb55: INNODBOBJS = ../libinnobase.a
 
149
xtradb55: INC = $(COMMON_INC) $(addprefix -isystem$(MYSQL_ROOT_DIR)/, \
 
150
        include storage/innobase/include)
 
151
xtradb55: INNODBOBJS = $(MYSQL_ROOT_DIR)/storage/innobase/libinnobase.a
120
152
ifeq ($(shell uname -s),Linux)
121
153
xtradb55: LIBS += -laio
122
154
endif
123
 
ifeq "$(wildcard ../../../zlib/.libs/libzlt.a)" ""
 
155
 
 
156
ifeq "$(wildcard $(MYSQL_ROOT_DIR)/zlib/.libs/libzlt.a)" ""
124
157
xtradb55: LIBZ= -lz
125
158
else
126
 
xtradb55: LIBZ= ../../../zlib/.libs/libzlt.a
 
159
xtradb55: LIBZ= $(MYSQL_ROOT_DIR)/zlib/.libs/libzlt.a
127
160
endif
128
 
xtradb55: MYSQLOBJS = ../../../mysys/libmysys.a ../../../strings/libstrings.a $(LIBZ) ../../../dbug/libdbug.a
129
 
# In CMake server builds it is important to build with exactly the same preprocessor flags
130
 
# as were used to build InnoDB
131
 
xtradb55: DEFS = $(shell grep C_DEFINES ../CMakeFiles/innobase.dir/flags.make | \
132
 
               sed -e 's/C_DEFINES = //')
 
161
 
 
162
xtradb55: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, \
 
163
        mysys/libmysys.a strings/libstrings.a zlib/libzlib.a dbug/libdbug.a)
 
164
# In CMake server builds it is important to build with exactly the same 
 
165
# preprocessor flags as were used to build InnoDB
 
166
xtradb55: DEFS = $(shell grep C_DEFINES \
 
167
        $(MYSQL_ROOT_DIR)/storage/innobase/CMakeFiles/innobase.dir/flags.make | \
 
168
        sed -e 's/C_DEFINES = //')
133
169
xtradb55: DEFS += -DXTRADB_BASED -DXTRADB55
134
170
xtradb55: TARGET := xtrabackup_55
135
 
xtradb55: $(TARGET)
136
 
 
 
171
xtradb55: $(TARGET) xbstream
 
172
 
 
173
$(XTRABACKUPOBJS): %.o: %.c
 
174
        $(CC) $(CFLAGS) $(INC) $(DEFS) -c $< -o $@
 
175
 
 
176
xbstream.o xbstream_read.o: %.o: %.c
 
177
        $(CC) $(CFLAGS) $(INC) $(DEFS) -c $< -o $@
 
178
 
 
179
xbstream: $(XBSTREAMOBJS) $(MYSQLOBJS) local.o
 
180
        $(CC) $(CFLAGS) $^ $(INC) $(MYSQLOBJS) $(LIBS) -o $@
137
181
 
138
182
xtrabackup.o: xtrabackup.c xb_regex.h
139
 
        $(CC) $(CFLAGS) $(INC) $(DEFS) -c $*.c
140
183
 
141
 
$(TARGET): xtrabackup.o $(INNODBOBJS) $(MYSQLOBJS)
142
 
        $(CC)  $(CFLAGS)  xtrabackup.o $(INNODBOBJS) $(MYSQLOBJS) $(LIBS) -o $(TARGET)
 
184
$(TARGET): $(XTRABACKUPOBJS) $(INNODBOBJS) $(MYSQLOBJS) $(LIBARCHIVE_A)
 
185
        $(CC) $(CFLAGS) $(XTRABACKUPOBJS) $(INNODBOBJS) $(MYSQLOBJS) $(LIBS) \
 
186
        $(LIBARCHIVE_A) -o $(TARGET)
143
187
 
144
188
clean:
145
 
        rm -f *.o xtrabackup_* 
 
189
        rm -f $(XTRABACKUPOBJS) $(XBSTREAMOBJS) xtrabackup xtrabackup_*