Merge lp:~peter-pearse/ubuntu/natty/mysql-5.1/prop001 into lp:ubuntu/natty/mysql-5.1
- Natty (11.04)
- prop001
- Merge into natty
Proposed by
Peter Pearse
Status: | Needs review |
---|---|
Proposed branch: | lp:~peter-pearse/ubuntu/natty/mysql-5.1/prop001 |
Merge into: | lp:ubuntu/natty/mysql-5.1 |
Diff against target: |
459 lines (+370/-6) 4 files modified
debian/changelog (+6/-0) debian/patches/00list (+1/-0) debian/patches/60_cross.dpatch (+314/-0) debian/rules (+49/-6) |
To merge this branch: | bzr merge lp:~peter-pearse/ubuntu/natty/mysql-5.1/prop001 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Langasek | Needs Fixing | ||
Review via email: mp+48815@code.launchpad.net |
Commit message
Description of the change
Patch debian/rules to
* Build a complete host build for crosses - partial build would take longer to get correct
* Pass directory for gen_lex_hash tool down to makes, allowing host binary to be used in crosses
* Pass correct tools to configure
Added a code patch to
* Patch Makefile.am to use passed gen_lex_hash directory
* Patch storage/
* Patch configure contain the resulting automake geneerated code.
To post a comment you must log in.
Unmerged revisions
- 25. By Peter Pearse
-
Patch for cross building
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2011-02-02 11:46:14 +0000 | |||
3 | +++ debian/changelog 2011-02-07 17:39:12 +0000 | |||
4 | @@ -1,3 +1,9 @@ | |||
5 | 1 | mysql-5.1 (5.1.54-1ubuntu5) maverick; urgency=low | ||
6 | 2 | |||
7 | 3 | * Patch for cross building | ||
8 | 4 | |||
9 | 5 | -- Peter Pearse <peter.pearse@linaro.org> Mon, 07 Feb 2011 17:29:54 +0000 | ||
10 | 6 | |||
11 | 1 | mysql-5.1 (5.1.54-1ubuntu4) natty; urgency=low | 7 | mysql-5.1 (5.1.54-1ubuntu4) natty; urgency=low |
12 | 2 | 8 | ||
13 | 3 | [Clint Byrum] | 9 | [Clint Byrum] |
14 | 4 | 10 | ||
15 | === modified file 'debian/patches/00list' | |||
16 | --- debian/patches/00list 2011-01-26 09:19:25 +0000 | |||
17 | +++ debian/patches/00list 2011-02-07 17:39:12 +0000 | |||
18 | @@ -6,3 +6,4 @@ | |||
19 | 6 | 41_scripts__mysql_install_db.sh__no_test.dpatch | 6 | 41_scripts__mysql_install_db.sh__no_test.dpatch |
20 | 7 | 44_scripts__mysql_config__libs.dpatch | 7 | 44_scripts__mysql_config__libs.dpatch |
21 | 8 | 50_mysql-test__db_test.dpatch | 8 | 50_mysql-test__db_test.dpatch |
22 | 9 | 60_cross.dpatch | ||
23 | 9 | 10 | ||
24 | === added file 'debian/patches/60_cross.dpatch' | |||
25 | --- debian/patches/60_cross.dpatch 1970-01-01 00:00:00 +0000 | |||
26 | +++ debian/patches/60_cross.dpatch 2011-02-07 17:39:12 +0000 | |||
27 | @@ -0,0 +1,314 @@ | |||
28 | 1 | #! /bin/sh /usr/share/dpatch/dpatch-run | ||
29 | 2 | ## 60_cross.dpatch.dpatch by Peter Pearse <peter.pearse@linaro.org> | ||
30 | 3 | ## | ||
31 | 4 | ## All lines beginning with `## DP:' are a description of the patch. | ||
32 | 5 | ## DP: Patch for cross building | ||
33 | 6 | |||
34 | 7 | @DPATCH@ | ||
35 | 8 | |||
36 | 9 | diff -Nru mysql/60_cross.dpatch mysql_patched/60_cross.dpatch | ||
37 | 10 | --- mysql/60_cross.dpatch 1970-01-01 00:00:00.000000000 +0000 | ||
38 | 11 | +++ mysql_patched/60_cross.dpatch 2011-02-07 13:01:30.000000000 +0000 | ||
39 | 12 | @@ -0,0 +1,8 @@ | ||
40 | 13 | +#! /bin/sh /usr/share/dpatch/dpatch-run | ||
41 | 14 | +## 60_cross.dpatch.dpatch by Peter Pearse <peter.pearse@linaro.org> | ||
42 | 15 | +## | ||
43 | 16 | +## All lines beginning with `## DP:' are a description of the patch. | ||
44 | 17 | +## DP: Pass tool location down for cross builds | ||
45 | 18 | + | ||
46 | 19 | +@DPATCH@ | ||
47 | 20 | + | ||
48 | 21 | diff -Nru mysql/configure mysql_patched/configure | ||
49 | 22 | --- mysql/configure 2011-02-07 11:21:50.000000000 +0000 | ||
50 | 23 | +++ mysql_patched/configure 2011-02-07 16:34:52.000000000 +0000 | ||
51 | 24 | @@ -47649,9 +47649,33 @@ | ||
52 | 25 | ;; | ||
53 | 26 | esac | ||
54 | 27 | |||
55 | 28 | - | ||
56 | 29 | { $as_echo "$as_me:$LINENO: checking whether GCC atomic builtins are available" >&5 | ||
57 | 30 | $as_echo_n "checking whether GCC atomic builtins are available... " >&6; } | ||
58 | 31 | + | ||
59 | 32 | +# Allow cache work round for cross compiling | ||
60 | 33 | +# storage/innodb_plugin/plug.in has been edited, | ||
61 | 34 | +# but configure.ac not available | ||
62 | 35 | +if test "${ac_cv_HAVE_IB_GCC_ATOMIC_BUILTINS+set}" = set; then | ||
63 | 36 | + $as_echo_n "(cached) " >&6 | ||
64 | 37 | + | ||
65 | 38 | + if test "x$ac_cv_HAVE_IB_GCC_ATOMIC_BUILTINS" = xyes; then | ||
66 | 39 | + | ||
67 | 40 | +cat >>confdefs.h <<\_ACEOF | ||
68 | 41 | +#define HAVE_IB_GCC_ATOMIC_BUILTINS 1 | ||
69 | 42 | +_ACEOF | ||
70 | 43 | + | ||
71 | 44 | + { $as_echo "$as_me:$LINENO: result: yes" >&5 | ||
72 | 45 | + $as_echo "yes" >&6; } | ||
73 | 46 | + | ||
74 | 47 | + else | ||
75 | 48 | + | ||
76 | 49 | + { $as_echo "$as_me:$LINENO: result: no" >&5 | ||
77 | 50 | + $as_echo "no" >&6; } | ||
78 | 51 | + | ||
79 | 52 | + fi | ||
80 | 53 | + | ||
81 | 54 | +else | ||
82 | 55 | + | ||
83 | 56 | # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not | ||
84 | 57 | if test "$cross_compiling" = yes; then | ||
85 | 58 | { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 | ||
86 | 59 | @@ -47754,10 +47778,34 @@ | ||
87 | 60 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext | ||
88 | 61 | fi | ||
89 | 62 | |||
90 | 63 | - | ||
91 | 64 | +fi | ||
92 | 65 | |||
93 | 66 | { $as_echo "$as_me:$LINENO: checking whether pthread_t can be used by GCC atomic builtins" >&5 | ||
94 | 67 | $as_echo_n "checking whether pthread_t can be used by GCC atomic builtins... " >&6; } | ||
95 | 68 | +# Allow cache work round for cross compiling | ||
96 | 69 | +# storage/innodb_plugin/plug.in has been edited, | ||
97 | 70 | +# but configure.ac not available | ||
98 | 71 | +if test "${ac_cv_HAVE_IB_ATOMIC_PTHREAD_T_GCC+set}" = set; then | ||
99 | 72 | + $as_echo_n "(cached) " >&6 | ||
100 | 73 | + | ||
101 | 74 | + if test "x$ac_cv_HAVE_IB_ATOMIC_PTHREAD_T_GCC" = xyes; then | ||
102 | 75 | + | ||
103 | 76 | +cat >>confdefs.h <<\_ACEOF | ||
104 | 77 | +#define HAVE_IB_ATOMIC_PTHREAD_T_GCC 1 | ||
105 | 78 | +_ACEOF | ||
106 | 79 | + | ||
107 | 80 | + { $as_echo "$as_me:$LINENO: result: yes" >&5 | ||
108 | 81 | + $as_echo "yes" >&6; } | ||
109 | 82 | + | ||
110 | 83 | + else | ||
111 | 84 | + | ||
112 | 85 | + { $as_echo "$as_me:$LINENO: result: no" >&5 | ||
113 | 86 | + $as_echo "no" >&6; } | ||
114 | 87 | + | ||
115 | 88 | + fi | ||
116 | 89 | + | ||
117 | 90 | +else | ||
118 | 91 | + | ||
119 | 92 | # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not | ||
120 | 93 | if test "$cross_compiling" = yes; then | ||
121 | 94 | { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 | ||
122 | 95 | @@ -47840,13 +47888,37 @@ | ||
123 | 96 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext | ||
124 | 97 | fi | ||
125 | 98 | |||
126 | 99 | - | ||
127 | 100 | +fi | ||
128 | 101 | |||
129 | 102 | { $as_echo "$as_me:$LINENO: checking whether Solaris libc atomic functions are available" >&5 | ||
130 | 103 | $as_echo_n "checking whether Solaris libc atomic functions are available... " >&6; } | ||
131 | 104 | - # either define HAVE_IB_SOLARIS_ATOMICS or not | ||
132 | 105 | |||
133 | 106 | +# Allow cache work round for cross compiling | ||
134 | 107 | +# storage/innodb_plugin/plug.in has been edited, | ||
135 | 108 | +# but configure.ac not available | ||
136 | 109 | +if test "${ac_cv_HAVE_IB_SOLARIS_ATOMICS+set}" = set; then | ||
137 | 110 | + $as_echo_n "(cached) " >&6 | ||
138 | 111 | |||
139 | 112 | + if test "x$ac_cv_HAVE_IB_SOLARIS_ATOMICS" = xyes; then | ||
140 | 113 | + | ||
141 | 114 | +cat >>confdefs.h <<\_ACEOF | ||
142 | 115 | +#define HAVE_IB_SOLARIS_ATOMICS 1 | ||
143 | 116 | +_ACEOF | ||
144 | 117 | + | ||
145 | 118 | + { $as_echo "$as_me:$LINENO: result: yes" >&5 | ||
146 | 119 | + $as_echo "yes" >&6; } | ||
147 | 120 | + | ||
148 | 121 | + else | ||
149 | 122 | + | ||
150 | 123 | + { $as_echo "$as_me:$LINENO: result: no" >&5 | ||
151 | 124 | + $as_echo "no" >&6; } | ||
152 | 125 | + | ||
153 | 126 | + fi | ||
154 | 127 | + | ||
155 | 128 | +else | ||
156 | 129 | + | ||
157 | 130 | + | ||
158 | 131 | + # either define HAVE_IB_SOLARIS_ATOMICS or not | ||
159 | 132 | |||
160 | 133 | |||
161 | 134 | |||
162 | 135 | @@ -48055,7 +48127,7 @@ | ||
163 | 136 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext | ||
164 | 137 | fi | ||
165 | 138 | |||
166 | 139 | - | ||
167 | 140 | +fi | ||
168 | 141 | |||
169 | 142 | # this is needed to know which one of atomic_cas_32() or atomic_cas_64() | ||
170 | 143 | # to use in the source | ||
171 | 144 | @@ -48423,11 +48495,33 @@ | ||
172 | 145 | #define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t | ||
173 | 146 | _ACEOF | ||
174 | 147 | |||
175 | 148 | - | ||
176 | 149 | - | ||
177 | 150 | # Check for x86 PAUSE instruction | ||
178 | 151 | { $as_echo "$as_me:$LINENO: checking for x86 PAUSE instruction" >&5 | ||
179 | 152 | $as_echo_n "checking for x86 PAUSE instruction... " >&6; } | ||
180 | 153 | +# Allow cache work round for cross compiling | ||
181 | 154 | +# storage/innodb_plugin/plug.in has been edited, | ||
182 | 155 | +# but configure.ac not available | ||
183 | 156 | +if test "${ac_cv_HAVE_IB_PAUSE_INSTRUCTION+set}" = set; then | ||
184 | 157 | + $as_echo_n "(cached) " >&6 | ||
185 | 158 | + | ||
186 | 159 | + if test "x$ac_cv_HAVE_IB_PAUSE_INSTRUCTION" = xyes; then | ||
187 | 160 | + | ||
188 | 161 | +cat >>confdefs.h <<\_ACEOF | ||
189 | 162 | +#define HAVE_IB_PAUSE_INSTRUCTION 1 | ||
190 | 163 | +_ACEOF | ||
191 | 164 | + | ||
192 | 165 | + { $as_echo "$as_me:$LINENO: result: yes" >&5 | ||
193 | 166 | + $as_echo "yes" >&6; } | ||
194 | 167 | + | ||
195 | 168 | + else | ||
196 | 169 | + | ||
197 | 170 | + { $as_echo "$as_me:$LINENO: result: no" >&5 | ||
198 | 171 | + $as_echo "no" >&6; } | ||
199 | 172 | + | ||
200 | 173 | + fi | ||
201 | 174 | + | ||
202 | 175 | +else | ||
203 | 176 | + | ||
204 | 177 | # We have to actually try running the test program, because of a bug | ||
205 | 178 | # in Solaris on x86_64, where it wrongly reports that PAUSE is not | ||
206 | 179 | # supported when trying to run an application. See | ||
207 | 180 | @@ -48500,7 +48594,7 @@ | ||
208 | 181 | rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext | ||
209 | 182 | fi | ||
210 | 183 | |||
211 | 184 | - | ||
212 | 185 | +fi | ||
213 | 186 | |||
214 | 187 | |||
215 | 188 | fi | ||
216 | 189 | diff -Nru mysql/sql/Makefile.am mysql_patched/sql/Makefile.am | ||
217 | 190 | --- mysql/sql/Makefile.am 2011-02-07 11:21:53.000000000 +0000 | ||
218 | 191 | +++ mysql_patched/sql/Makefile.am 2011-02-07 11:30:26.000000000 +0000 | ||
219 | 192 | @@ -173,9 +173,11 @@ | ||
220 | 193 | # This generates lex_hash.h | ||
221 | 194 | # NOTE Built sources should depend on their sources not the tool | ||
222 | 195 | # this avoid the rebuild of the built files in a source dist | ||
223 | 196 | +# GEN_LEX_HASH_DIR may be used to locate host binary during cross builds | ||
224 | 197 | +GEN_LEX_HASH_DIR=. | ||
225 | 198 | lex_hash.h: gen_lex_hash.cc lex.h | ||
226 | 199 | $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) | ||
227 | 200 | - ./gen_lex_hash$(EXEEXT) > $@-t | ||
228 | 201 | + $(GEN_LEX_HASH_DIR)/gen_lex_hash$(EXEEXT) > $@-t | ||
229 | 202 | $(MV) $@-t $@ | ||
230 | 203 | |||
231 | 204 | # For testing of udf_example.so | ||
232 | 205 | diff -Nru mysql/sql/Makefile.in mysql_patched/sql/Makefile.in | ||
233 | 206 | --- mysql/sql/Makefile.in 2011-02-07 11:21:53.000000000 +0000 | ||
234 | 207 | +++ mysql_patched/sql/Makefile.in 2011-02-07 11:36:05.000000000 +0000 | ||
235 | 208 | @@ -1303,9 +1303,11 @@ | ||
236 | 209 | # This generates lex_hash.h | ||
237 | 210 | # NOTE Built sources should depend on their sources not the tool | ||
238 | 211 | # this avoid the rebuild of the built files in a source dist | ||
239 | 212 | +# GEN_LEX_HASH_DIR may be used to locate host binary during cross builds | ||
240 | 213 | +GEN_LEX_HASH_DIR = . | ||
241 | 214 | lex_hash.h: gen_lex_hash.cc lex.h | ||
242 | 215 | $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT) | ||
243 | 216 | - ./gen_lex_hash$(EXEEXT) > $@-t | ||
244 | 217 | + $(GEN_LEX_HASH_DIR)/gen_lex_hash$(EXEEXT) > $@-t | ||
245 | 218 | $(MV) $@-t $@ | ||
246 | 219 | |||
247 | 220 | # We might have some stuff not built in this build, but that we want to install | ||
248 | 221 | diff -Nru mysql/storage/innodb_plugin/plug.in mysql_patched/storage/innodb_plugin/plug.in | ||
249 | 222 | --- mysql/storage/innodb_plugin/plug.in 2011-02-07 11:21:53.000000000 +0000 | ||
250 | 223 | +++ mysql_patched/storage/innodb_plugin/plug.in 2011-02-07 13:11:42.000000000 +0000 | ||
251 | 224 | @@ -53,8 +53,8 @@ | ||
252 | 225 | esac | ||
253 | 226 | AC_SUBST(INNODB_DYNAMIC_CFLAGS) | ||
254 | 227 | |||
255 | 228 | - AC_MSG_CHECKING(whether GCC atomic builtins are available) | ||
256 | 229 | - # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not | ||
257 | 230 | + AC_CACHE_CHECK([whether GCC atomic builtins are available], | ||
258 | 231 | + [ac_cv_HAVE_IB_GCC_ATOMIC_BUILTINS],[ | ||
259 | 232 | AC_TRY_RUN( | ||
260 | 233 | [ | ||
261 | 234 | int main() | ||
262 | 235 | @@ -95,17 +95,23 @@ | ||
263 | 236 | } | ||
264 | 237 | ], | ||
265 | 238 | [ | ||
266 | 239 | - AC_DEFINE([HAVE_IB_GCC_ATOMIC_BUILTINS], [1], | ||
267 | 240 | - [GCC atomic builtins are available]) | ||
268 | 241 | + ac_cv_HAVE_IB_GCC_ATOMIC_BUILTINS=yes | ||
269 | 242 | AC_MSG_RESULT(yes) | ||
270 | 243 | ], | ||
271 | 244 | [ | ||
272 | 245 | + ac_cv_HAVE_IB_GCC_ATOMIC_BUILTINS=no | ||
273 | 246 | AC_MSG_RESULT(no) | ||
274 | 247 | ] | ||
275 | 248 | ) | ||
276 | 249 | + ]) | ||
277 | 250 | + | ||
278 | 251 | + if test x"$ac_cv_HAVE_IB_GCC_ATOMIC_BUILTINS" = "xyes" ; then | ||
279 | 252 | + AC_DEFINE([HAVE_IB_GCC_ATOMIC_BUILTINS], [1], | ||
280 | 253 | + [GCC atomic builtins are available]) | ||
281 | 254 | + fi | ||
282 | 255 | |||
283 | 256 | - AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins) | ||
284 | 257 | - # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not | ||
285 | 258 | + AC_CACHE_CHECK([whether pthread_t can be used by GCC atomic builtins], | ||
286 | 259 | + [ac_cv_HAVE_IB_ATOMIC_PTHREAD_T_GCC],[ | ||
287 | 260 | AC_TRY_RUN( | ||
288 | 261 | [ | ||
289 | 262 | #include <pthread.h> | ||
290 | 263 | @@ -126,17 +132,23 @@ | ||
291 | 264 | } | ||
292 | 265 | ], | ||
293 | 266 | [ | ||
294 | 267 | - AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_GCC], [1], | ||
295 | 268 | - [pthread_t can be used by GCC atomic builtins]) | ||
296 | 269 | + ac_cv_HAVE_IB_ATOMIC_PTHREAD_T_GCC=yes | ||
297 | 270 | AC_MSG_RESULT(yes) | ||
298 | 271 | ], | ||
299 | 272 | [ | ||
300 | 273 | + ac_cv_HAVE_IB_ATOMIC_PTHREAD_T_GCC=no | ||
301 | 274 | AC_MSG_RESULT(no) | ||
302 | 275 | ] | ||
303 | 276 | ) | ||
304 | 277 | + ]) | ||
305 | 278 | + | ||
306 | 279 | + if test x"$ac_cv_HAVE_IB_ATOMIC_PTHREAD_T_GCC" = "xyes" ; then | ||
307 | 280 | + AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_GCC], [1], | ||
308 | 281 | + [pthread_t can be used by GCC atomic builtins]) | ||
309 | 282 | + fi | ||
310 | 283 | |||
311 | 284 | - AC_MSG_CHECKING(whether Solaris libc atomic functions are available) | ||
312 | 285 | - # either define HAVE_IB_SOLARIS_ATOMICS or not | ||
313 | 286 | + AC_CACHE_CHECK([whether Solaris libc atomic functions are available], | ||
314 | 287 | + [ac_cv_HAVE_IB_SOLARIS_ATOMICS],[ | ||
315 | 288 | AC_CHECK_FUNCS(atomic_cas_ulong \ | ||
316 | 289 | atomic_cas_32 \ | ||
317 | 290 | atomic_cas_64 \ | ||
318 | 291 | @@ -189,13 +201,14 @@ | ||
319 | 292 | AC_MSG_RESULT(no) | ||
320 | 293 | ] | ||
321 | 294 | ) | ||
322 | 295 | + ]) | ||
323 | 296 | |||
324 | 297 | # this is needed to know which one of atomic_cas_32() or atomic_cas_64() | ||
325 | 298 | # to use in the source | ||
326 | 299 | AC_CHECK_SIZEOF([pthread_t], [], [#include <pthread.h>]) | ||
327 | 300 | |||
328 | 301 | - # Check for x86 PAUSE instruction | ||
329 | 302 | - AC_MSG_CHECKING(for x86 PAUSE instruction) | ||
330 | 303 | + AC_CACHE_CHECK([for x86 PAUSE instruction], | ||
331 | 304 | + [ac_cv_HAVE_IB_PAUSE_INSTRUCTION],[ | ||
332 | 305 | # We have to actually try running the test program, because of a bug | ||
333 | 306 | # in Solaris on x86_64, where it wrongly reports that PAUSE is not | ||
334 | 307 | # supported when trying to run an application. See | ||
335 | 308 | @@ -222,4 +235,6 @@ | ||
336 | 309 | ) | ||
337 | 310 | ]) | ||
338 | 311 | |||
339 | 312 | + ]) | ||
340 | 313 | + | ||
341 | 314 | # vim: set ft=config: | ||
342 | 0 | 315 | ||
343 | === modified file 'debian/rules' | |||
344 | --- debian/rules 2011-02-02 11:46:14 +0000 | |||
345 | +++ debian/rules 2011-02-07 17:39:12 +0000 | |||
346 | @@ -15,6 +15,16 @@ | |||
347 | 15 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | 15 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
348 | 16 | DEBVERSION = $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | sed 's/^.*-//' ) | 16 | DEBVERSION = $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | sed 's/^.*-//' ) |
349 | 17 | 17 | ||
350 | 18 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
351 | 19 | export MYSQL_BUILD_CC=$(DEB_HOST_GNU_TYPE)-gcc | ||
352 | 20 | export MYSQL_BUILD_CXX=$(DEB_HOST_GNU_TYPE)-g++ | ||
353 | 21 | DEB_BUILD_OPTIONS += nocheck | ||
354 | 22 | MAKE_ENV = GEN_LEX_HASH_DIR=../../$(BUILDDIR_HOST)/sql | ||
355 | 23 | |||
356 | 24 | else | ||
357 | 25 | MAKE_ENV = | ||
358 | 26 | endif | ||
359 | 27 | |||
360 | 18 | DEB_SOURCE_PACKAGE ?= $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':')) | 28 | DEB_SOURCE_PACKAGE ?= $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':')) |
361 | 19 | DEB_VERSION ?= $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') | 29 | DEB_VERSION ?= $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') |
362 | 20 | DEB_NOEPOCH_VERSION ?= $(shell echo $(DEB_VERSION) | cut -d: -f2-) | 30 | DEB_NOEPOCH_VERSION ?= $(shell echo $(DEB_VERSION) | cut -d: -f2-) |
363 | @@ -47,7 +57,12 @@ | |||
364 | 47 | 57 | ||
365 | 48 | BUILDDIR = builddir | 58 | BUILDDIR = builddir |
366 | 49 | BUILDDIR_PIC = builddir-pic | 59 | BUILDDIR_PIC = builddir-pic |
367 | 60 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
368 | 61 | BUILDDIR_HOST = builddir-host | ||
369 | 62 | builddir = $(if $(findstring -pic,$@),$(BUILDDIR_PIC),$(if $(findstring -host,$@),$(BUILDDIR_HOST),$(BUILDDIR))) | ||
370 | 63 | else | ||
371 | 50 | builddir = $(if $(findstring -pic,$@),$(BUILDDIR_PIC),$(BUILDDIR)) | 64 | builddir = $(if $(findstring -pic,$@),$(BUILDDIR_PIC),$(BUILDDIR)) |
372 | 65 | endif | ||
373 | 51 | 66 | ||
374 | 52 | # This causes seg11 crashes if LDAP is used for groups in /etc/nsswitch.conf | 67 | # This causes seg11 crashes if LDAP is used for groups in /etc/nsswitch.conf |
375 | 53 | # so it is disabled by default although, according to MySQL, it brings >10% | 68 | # so it is disabled by default although, according to MySQL, it brings >10% |
376 | @@ -62,7 +77,19 @@ | |||
377 | 62 | 77 | ||
378 | 63 | configure: patch configure-stamp | 78 | configure: patch configure-stamp |
379 | 64 | configure-pic: patch configure-stamp-pic | 79 | configure-pic: patch configure-stamp-pic |
380 | 80 | |||
381 | 81 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
382 | 82 | |||
383 | 83 | configure-host: patch configure-stamp-host | ||
384 | 84 | |||
385 | 85 | configure-stamp-host: HOST_TYPE=$(DEB_BUILD_GNU_TYPE) CC=gcc CXX=g++ | ||
386 | 86 | configure-stamp: HOST_TYPE=$(DEB_HOST_GNU_TYPE) CC=$(DEB_HOST_GNU_TYPE)-gcc CXX=$(DEB_HOST_GNU_TYPE)-g++ | ||
387 | 87 | configure-stamp-pic: HOST_TYPE=$(DEB_HOST_GNU_TYPE) CC=$(DEB_HOST_GNU_TYPE)-gcc CXX=$(DEB_HOST_GNU_TYPE)-g++ | ||
388 | 88 | |||
389 | 89 | configure-stamp-host configure-stamp configure-stamp-pic: | ||
390 | 90 | else | ||
391 | 65 | configure-stamp configure-stamp-pic: | 91 | configure-stamp configure-stamp-pic: |
392 | 92 | endif | ||
393 | 66 | @echo "RULES.$@" | 93 | @echo "RULES.$@" |
394 | 67 | dh_testdir | 94 | dh_testdir |
395 | 68 | 95 | ||
396 | @@ -78,7 +105,7 @@ | |||
397 | 78 | CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O3 -DBIG_JOINS=1 -felide-constructors -fno-exceptions -fno-rtti ${FORCE_FPIC_CFLAGS} -fno-strict-aliasing"} \ | 105 | CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O3 -DBIG_JOINS=1 -felide-constructors -fno-exceptions -fno-rtti ${FORCE_FPIC_CFLAGS} -fno-strict-aliasing"} \ |
398 | 79 | ../configure \ | 106 | ../configure \ |
399 | 80 | --build=${DEB_BUILD_GNU_TYPE} \ | 107 | --build=${DEB_BUILD_GNU_TYPE} \ |
401 | 81 | --host=${DEB_HOST_GNU_TYPE} \ | 108 | --host=${HOST_TYPE} \ |
402 | 82 | \ | 109 | \ |
403 | 83 | --prefix=/usr \ | 110 | --prefix=/usr \ |
404 | 84 | --exec-prefix=/usr \ | 111 | --exec-prefix=/usr \ |
405 | @@ -123,9 +150,23 @@ | |||
406 | 123 | 150 | ||
407 | 124 | touch $@ | 151 | touch $@ |
408 | 125 | 152 | ||
410 | 126 | 153 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | |
411 | 154 | build: build-stamp-host build-stamp build-stamp-pic | ||
412 | 155 | |||
413 | 156 | build-stamp-host: configure-host | ||
414 | 157 | @echo "RULES.$@" | ||
415 | 158 | dh_testdir | ||
416 | 159 | [ -f $(EXPORTED_SOURCE_TARBALL) ] || tar -zcf $(EXPORTED_SOURCE_TARBALL) \ | ||
417 | 160 | --exclude=debian . \ | ||
418 | 161 | --transform="s,^\./,mysql-5.1/," | ||
419 | 162 | |||
420 | 163 | cd $(builddir) && $(MAKE) $(MAKE_J) $(MAKE_ENV) | ||
421 | 164 | |||
422 | 165 | @touch $@ | ||
423 | 166 | |||
424 | 167 | else | ||
425 | 127 | build: build-stamp build-stamp-pic | 168 | build: build-stamp build-stamp-pic |
427 | 128 | 169 | endif | |
428 | 129 | build-stamp: configure | 170 | build-stamp: configure |
429 | 130 | @echo "RULES.$@" | 171 | @echo "RULES.$@" |
430 | 131 | dh_testdir | 172 | dh_testdir |
431 | @@ -133,7 +174,7 @@ | |||
432 | 133 | --exclude=debian . \ | 174 | --exclude=debian . \ |
433 | 134 | --transform="s,^\./,mysql-5.1/," | 175 | --transform="s,^\./,mysql-5.1/," |
434 | 135 | 176 | ||
436 | 136 | cd $(builddir) && $(MAKE) $(MAKE_J) | 177 | cd $(builddir) && $(MAKE) $(MAKE_J) $(MAKE_ENV) |
437 | 137 | 178 | ||
438 | 138 | ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),) | 179 | ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),) |
439 | 139 | # Don't know why the following is necessary... | 180 | # Don't know why the following is necessary... |
440 | @@ -150,7 +191,7 @@ | |||
441 | 150 | 191 | ||
442 | 151 | touch build-stamp | 192 | touch build-stamp |
443 | 152 | 193 | ||
445 | 153 | MAKE_PIC = cd $(builddir) && $(MAKE) $(MAKE_J) | 194 | MAKE_PIC = cd $(builddir) && $(MAKE) $(MAKE_J) $(MAKE_ENV) |
446 | 154 | 195 | ||
447 | 155 | build-stamp-pic: configure-pic | 196 | build-stamp-pic: configure-pic |
448 | 156 | @echo "RULES.$@" | 197 | @echo "RULES.$@" |
449 | @@ -187,7 +228,9 @@ | |||
450 | 187 | [ ! -d mysql-test/var ] || rm -rf mysql-test/var | 228 | [ ! -d mysql-test/var ] || rm -rf mysql-test/var |
451 | 188 | 229 | ||
452 | 189 | rm -rf $(BUILDDIR) $(BUILDDIR_PIC) | 230 | rm -rf $(BUILDDIR) $(BUILDDIR_PIC) |
454 | 190 | 231 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | |
455 | 232 | rm -fr $(BUILDDIR_HOST) | ||
456 | 233 | endif | ||
457 | 191 | debconf-updatepo | 234 | debconf-updatepo |
458 | 192 | rm -f $(EXPORTED_SOURCE_TARBALL) | 235 | rm -f $(EXPORTED_SOURCE_TARBALL) |
459 | 193 | dh_clean -v | 236 | dh_clean -v |
Since gen_lex_hash is not installed in any package and is only used at build time, I think this should be fixed in the upstream rules to accept HOST_CC instead of rebuilding the entire package another time.