0
|
1 |
#
|
|
2 |
#
|
|
3 |
# CDDL HEADER START
|
|
4 |
#
|
|
5 |
# The contents of this file are subject to the terms of the
|
|
6 |
# Common Development and Distribution License (the "License").
|
|
7 |
# You may not use this file except in compliance with the License.
|
|
8 |
#
|
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
10 |
# or http://www.opensolaris.org/os/licensing.
|
|
11 |
# See the License for the specific language governing permissions
|
|
12 |
# and limitations under the License.
|
|
13 |
#
|
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each
|
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
16 |
# If applicable, add the following below this CDDL HEADER, with the
|
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
19 |
#
|
|
20 |
# CDDL HEADER END
|
|
21 |
#
|
6
|
22 |
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
0
|
23 |
# Use is subject to license terms.
|
6
|
24 |
#ident "@(#)Makefile.sfw 1.5 10/01/06 SMI"
|
0
|
25 |
|
|
26 |
|
6
|
27 |
MYSQL_VERSION=5.1.37
|
|
28 |
MYSQL_DIR=mysql-$(MYSQL_VERSION)
|
|
29 |
MYSQL_DIR_64=mysql-$(MYSQL_VERSION)_64
|
0
|
30 |
PREFIX=/usr/mysql/5.1
|
|
31 |
CONFDIR=/etc/mysql/5.1
|
|
32 |
DATA_PREFIX=/var/mysql/5.1
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
all : build32 build64
|
|
37 |
|
|
38 |
install : install32 install64
|
|
39 |
|
|
40 |
test: test32 test64
|
|
41 |
|
|
42 |
include ../Makefile.cmd
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
# C++ common flags
|
|
47 |
|
6
|
48 |
CXXCOMMONFLAGS= -DDBUG_OFF -DBIG_TABLES -DHAVE_RWLOCK_T -KPIC -DPIC -xO4 -xmaxopt=4 \
|
0
|
49 |
-xprefetch=auto -xprefetch_level=3 -mt -fns=no -fsimple=1 -xbuiltin=%all \
|
|
50 |
-xlibmil -xlibmopt -norunpath
|
|
51 |
|
|
52 |
# C++ 64 bit flags
|
|
53 |
CXX64FLAGS= $(CXXCOMMONFLAGS) -features=no%except -m64
|
|
54 |
|
|
55 |
# C++ 32 bit flags
|
|
56 |
CXX32FLAGS= $(CXXCOMMONFLAGS)
|
|
57 |
|
|
58 |
# C common compiler flags
|
|
59 |
COMMONCFLAGS= -xO4 -xstrconst -xprefetch=auto -xprefetch_level=3 -mt\
|
|
60 |
-fns=no -fsimple=1 -xbuiltin=%all -xlibmil -xlibmopt -xnorunpath
|
|
61 |
|
|
62 |
# common ENV for both 32 & 64bit compilation
|
|
63 |
ENVCOMMONLINE=MAKE=$(GMAKE) \
|
|
64 |
PATH=$(SFW_PATH) \
|
|
65 |
DESTDIR=$(ROOT) \
|
|
66 |
INSTALL_ROOT=$(ROOT) \
|
|
67 |
INSTALL=/usr/ucb/install \
|
|
68 |
CC=$(CC) \
|
|
69 |
CXX="$(CCC) -norunpath"
|
|
70 |
|
|
71 |
#ENV for 32 bit compilation only
|
|
72 |
ENVLINE32 = $(ENVCOMMONLINE) \
|
|
73 |
LDFLAGS="-L$(SPRO_VROOT)/lib -lCrun -lrt"\
|
|
74 |
CFLAGS="$(COMMONCFLAGS)"\
|
|
75 |
CXXFLAGS="$(CXX32FLAGS)"
|
|
76 |
|
|
77 |
#ENV for 64 bit compilation only
|
|
78 |
ENVLINE64= $(ENVCOMMONLINE) \
|
|
79 |
LD="$(LD) -64" \
|
|
80 |
LDFLAGS="-lrt" \
|
|
81 |
CFLAGS="$(COMMONCFLAGS) -m64" \
|
|
82 |
CXXFLAGS="$(CXX64FLAGS) -m64"
|
|
83 |
|
|
84 |
#These COMMON_CONFIG_OPTIONS are common for both 32 and 64-bit
|
|
85 |
COMMON_CONFIG_OPTIONS= \
|
|
86 |
--prefix=$(PREFIX) \
|
|
87 |
--localstatedir=$(DATA_PREFIX)/data \
|
|
88 |
--datadir=$(PREFIX)/share \
|
|
89 |
--sbindir=$(PREFIX)sbin \
|
|
90 |
--sharedstatedir=$(PREFIX)/com \
|
|
91 |
--includedir=$(PREFIX)/include \
|
|
92 |
--oldincludedir=$(PREFIX)/include \
|
|
93 |
--infodir=$(PREFIX)/docs \
|
|
94 |
--mandir=$(PREFIX)/man \
|
|
95 |
--sysconfdir=$(CONFDIR) \
|
|
96 |
--enable-thread-safe-client \
|
|
97 |
--with-mysqld-libs=-lmtmalloc \
|
|
98 |
--with-named-curses=-lcurses \
|
|
99 |
--with-client-ldflags=-static \
|
|
100 |
--with-mysql-ldflags=-static \
|
|
101 |
--with-pic \
|
|
102 |
--with-big-tables \
|
|
103 |
--with-ssl \
|
|
104 |
--with-readline \
|
|
105 |
--with-extra-charsets=complex \
|
6
|
106 |
--with-plugins=archive,blackhole,csv,myisam,example,federated,innobase,myisammrg \
|
0
|
107 |
--enable-local-infile
|
|
108 |
|
|
109 |
|
|
110 |
#----Main MySQL Targets -----
|
|
111 |
|
|
112 |
build32:$(MYSQL_DIR)/config.status
|
|
113 |
( cd $(MYSQL_DIR); env - $(ENVLINE32) $(GMAKE) all )
|
|
114 |
|
|
115 |
build64:$(MYSQL_DIR_64)/config.status
|
|
116 |
( cd $(MYSQL_DIR_64); env - $(ENVLINE64) $(GMAKE) all )
|
|
117 |
|
|
118 |
test32:build32
|
|
119 |
(cd $(MYSQL_DIR); env - $(ENVLINE32) $(GMAKE) test)
|
|
120 |
|
|
121 |
test64:build64
|
|
122 |
(cd $(MYSQL_DIR_64); env - $(ENVLINE64) $(GMAKE) test)
|
|
123 |
|
|
124 |
|
|
125 |
install32:build32
|
|
126 |
(cd $(MYSQL_DIR); \
|
|
127 |
env - $(ENVLINE32) $(GMAKE) install)
|
|
128 |
ksh93 ./install-mysql
|
|
129 |
|
|
130 |
|
|
131 |
install64:build64
|
|
132 |
(cd $(MYSQL_DIR_64); \
|
|
133 |
env - $(ENVLINE64) $(GMAKE) install)
|
|
134 |
MACH64=$(MACH64) ksh93 ./install-mysql-64
|
|
135 |
|
|
136 |
|
|
137 |
$(MYSQL_DIR)/config.status: $(MYSQL_DIR)/configure
|
|
138 |
(cd $(MYSQL_DIR); env - $(ENVLINE32) /bin/ksh ./configure \
|
|
139 |
$(COMMON_CONFIG_OPTIONS) \
|
|
140 |
--libexecdir=$(PREFIX)/bin \
|
|
141 |
--bindir=$(PREFIX)/bin \
|
|
142 |
--libdir=$(PREFIX)/lib \
|
|
143 |
--enable-dtrace DTRACEFLAGS='-32')
|
|
144 |
|
|
145 |
|
|
146 |
|
|
147 |
$(MYSQL_DIR_64)/config.status: $(MYSQL_DIR_64)/configure
|
|
148 |
(cd $(MYSQL_DIR_64); env - $(ENVLINE64) /bin/ksh ./configure \
|
|
149 |
$(COMMON_CONFIG_OPTIONS) \
|
|
150 |
--libexecdir=$(PREFIX)/bin/$(MACH64) \
|
|
151 |
--bindir=$(PREFIX)/bin/$(MACH64) \
|
|
152 |
--libdir=$(PREFIX)/lib/$(MACH64) \
|
|
153 |
--enable-dtrace DTRACEFLAGS='-64')
|
|
154 |
|
|
155 |
|
|
156 |
|
6
|
157 |
$(MYSQL_DIR)/configure: $(MYSQL_DIR).tar.gz
|
|
158 |
/usr/bin/gzip -dc $(MYSQL_DIR).tar.gz | \
|
|
159 |
$(GTAR) xpf - --no-same-owner
|
|
160 |
(cd $(MYSQL_DIR); gpatch -p1 < ../patches/mysql-5.1.37-dtrace.sunpatch)
|
0
|
161 |
gpatch $(MYSQL_DIR)/storage/innobase/include/univ.i -i patches/inline.patch
|
|
162 |
gpatch $(MYSQL_DIR)/scripts/mysql_config.sh -i patches/mysql_config.patch
|
|
163 |
gpatch $(MYSQL_DIR)/mysql-test/Makefile.in -i patches/ksh-hang.patch
|
6
|
164 |
gpatch $(MYSQL_DIR)/configure -i patches/configure.patch
|
|
165 |
gpatch $(MYSQL_DIR)/sql/sql_select.cc -i patches/xO4_optimization.patch
|
|
166 |
(cd $(MYSQL_DIR); touch configure.in config/ac-macros/*; sleep 5; touch aclocal.m4 config.h.in; sleep 5;\
|
|
167 |
touch configure ; find . -name Makefile.in | xargs touch)
|
0
|
168 |
find $(MYSQL_DIR) -type d -exec /usr/bin/chmod 755 "{}" \;
|
|
169 |
find $(MYSQL_DIR) -type f -exec /usr/bin/chmod ugo+r "{}" \;
|
|
170 |
find $(MYSQL_DIR) -name "dtrace_providers" -exec rm {} \;
|
|
171 |
|
|
172 |
|
|
173 |
|
6
|
174 |
$(MYSQL_DIR_64)/configure: $(MYSQL_DIR).tar.gz
|
|
175 |
mkdir -p tmp; cp $(MYSQL_DIR).tar.gz tmp
|
|
176 |
cd tmp; /usr/bin/gzip -dc $(MYSQL_DIR).tar.gz | tar xopf -
|
0
|
177 |
mv tmp/$(MYSQL_DIR) $(MYSQL_DIR_64); rm -rf tmp
|
6
|
178 |
(cd $(MYSQL_DIR_64); gpatch -p1 < ../patches/mysql-5.1.37-dtrace.sunpatch)
|
0
|
179 |
gpatch $(MYSQL_DIR_64)/storage/innobase/include/univ.i -i patches/inline.patch
|
|
180 |
gpatch $(MYSQL_DIR_64)/scripts/mysql_config.sh -i patches/mysql_config.patch
|
|
181 |
gpatch $(MYSQL_DIR_64)/mysql-test/Makefile.in -i patches/ksh-hang.patch
|
6
|
182 |
gpatch $(MYSQL_DIR_64)/configure -i patches/configure.patch
|
|
183 |
gpatch $(MYSQL_DIR_64)/sql/sql_select.cc -i patches/xO4_optimization.patch
|
|
184 |
(cd $(MYSQL_DIR_64); touch configure.in config/ac-macros/*; sleep 5; touch aclocal.m4 config.h.in; sleep 5;\
|
|
185 |
touch configure ; find . -name Makefile.in | xargs touch)
|
0
|
186 |
find $(MYSQL_DIR_64) -type d -exec /usr/bin/chmod 755 "{}" \;
|
|
187 |
find $(MYSQL_DIR_64) -type f -exec /usr/bin/chmod ugo+r "{}" \;
|
|
188 |
find $(MYSQL_DIR_64) -name "dtrace_providers" -exec rm {} \;
|
|
189 |
|
|
190 |
|
|
191 |
|
|
192 |
|
|
193 |
clean: clean32 clean64
|
|
194 |
|
|
195 |
clean32:
|
|
196 |
-rm -rf $(MYSQL_DIR)
|
|
197 |
|
|
198 |
clean64:
|
|
199 |
-rm -rf $(MYSQL_DIR_64)
|
|
200 |
#---------------------------------------------end of MySQL Targets
|
|
201 |
|
|
202 |
|
|
203 |
|
|
204 |
include ../Makefile.targ
|
|
205 |
|
|
206 |
FRC:
|