-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile-pxc
57 lines (46 loc) · 2.55 KB
/
Makefile-pxc
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
MYSQL_VERSION=5.6.22
PERCONA_SERVER_VERSION=rel72.0
PERCONA_XTRADB_CLUSTER ?=Percona-XtraDB-Cluster-$(MYSQL_VERSION)-$(PERCONA_SERVER_VERSION)
PERCONA_XTRADB_CLUSTER_SHORT_1 ?=Percona-XtraDB-Cluster-$(MYSQL_VERSION)
PERCONA_XTRADB_CLUSTER_SHORT_2 ?=Percona-XtraDB-Cluster
DEBUG_DIR ?= $(PERCONA_XTRADB_CLUSTER)-debug
RELEASE_DIR ?= $(PERCONA_XTRADB_CLUSTER)-release
SERIES ?=series
CFLAGS ?=-fPIC -Wall -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing
CXXFLAGS ?=-fno-exceptions -fPIC -Wall -Wno-unused-parameter -fno-implicit-templates -fno-exceptions -fno-rtti -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing
CFLAGS_RELEASE=$(CFLAGS) -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1
CXXFLAGS_RELEASE=$(CXXFLAGS) -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1
CMAKE=CC=gcc CXX=g++ cmake $(ADDITIONAL)
ADDITIONAL ?=
CONFIGURE=CFLAGS="-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2" CXXFLAGS="-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2" LIBS=-lrt ./configure --prefix=/usr/local/$(PERCONA_XTRADB_CLUSTER)-$(MYSQL_VERSION) --with-plugin-innobase --with-plugin-partition
REV = $(shell bzr revno)
all: maatkit-udf
@echo ""
@echo "Percona XtraDB Cluster source code is ready"
@echo "Now define variables as show below"
@echo ""
@echo export CFLAGS="-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2"
@echo export CXXFLAGS="-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2"
@echo export LIBS=-lrt
@echo ""
@echo "and run cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF && make all install"
@echo ""
maatkit-udf:
cd UDF && autoreconf --install
configure: all
(bash BUILD/autorun.sh; $(CONFIGURE))
cmake: cmake_release cmake_debug
cmake_release:
rm -rf $(RELEASE_DIR)
(mkdir -p $(RELEASE_DIR); cd $(RELEASE_DIR); CFLAGS="$(CFLAGS_RELEASE)" CXXFLAGS="$(CXXFLAGS_RELEASE)" $(CMAKE) -G "Unix Makefiles" ../$(PERCONA_XTRADB_CLUSTER))
cmake_debug:
rm -rf $(DEBUG_DIR)
(mkdir -p $(DEBUG_DIR); cd $(DEBUG_DIR); CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" $(CMAKE) -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DWITH_DEBUG=ON -DMYSQL_MAINTAINER_MODE=OFF ../$(PERCONA_XTRADB_CLUSTER))
binary:
(CFLAGS="$(CFLAGS_RELEASE)" CXXFLAGS="$(CXXFLAGS_RELEASE)" ${CMAKE} . -DBUILD_CONFIG=mysql_release \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX="/usr/local/$(PERCONA_XTRADB_CLUSTER)-$(MYSQL_VERSION)-$(REV)" \
-DFEATURE_SET="community" \
-DWITH_EMBEDDED_SERVER=OFF \
-DCOMPILATION_COMMENT="Percona-XtraDB-Cluster" \
-DMYSQL_SERVER_SUFFIX="-$(REV)" )