Merge lp:~qu1j0t3/maria/solaris10-port into lp:~maria-captains/maria/5.1-converting
- solaris10-port
- Merge into 5.1-converting
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~qu1j0t3/maria/solaris10-port |
Merge into: | lp:~maria-captains/maria/5.1-converting |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~qu1j0t3/maria/solaris10-port |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kristian Nielsen | Approve | ||
Paul McCullagh | Approve | ||
Review via email: mp+6165@code.launchpad.net |
Commit message
Changes to PBXT for Solaris portability. Rehash BUILD/ scripts for Solaris 10 on amd64.
Description of the change
Toby Thain (qu1j0t3) wrote : | # |
Toby Thain (qu1j0t3) wrote : | # |
Clarification: please review revision 2701, I am not sure if this request was jumping the gun on the push. (Bzr/LP n00b here)
Paul McCullagh (paul-mccullagh) wrote : | # |
I have checked the changes to the following file:
storage/
storage/
storage/
These are OK for merge.
Other changes involve modifications to solaris specific build scripts.
Seem OK to me.
Kristian Nielsen (knielsen) wrote : | # |
Approved, according to comments on maria-developers@
Kristian Nielsen (knielsen) wrote : | # |
Toby Thain <email address hidden> writes:
> You have been requested to review the proposed merge of lp:~qu1j0t3/maria/solaris10-port into lp:maria.
>
> Attention: knielsen
>
> I've got initial build scripts working on Solaris 10/amd64. The available targets are:
>
> BUILD/compile-
> BUILD/compile-
>
> These are now more in line with the generic build scripts, with a few portability overrides.
>
> --with-libevent is forced for all Solaris builds, for now.
>
> SPARC will come later, after these changes are approved.
This has now been pushed into lp:maria, thanks!
- Kristian.
Preview Diff
1 | === modified file 'BUILD/compile-solaris-amd64' |
2 | --- BUILD/compile-solaris-amd64 2007-04-12 11:20:38 +0000 |
3 | +++ BUILD/compile-solaris-amd64 2009-05-04 14:36:55 +0000 |
4 | @@ -1,55 +1,34 @@ |
5 | -#!/usr/bin/bash |
6 | - |
7 | -function _find_mysql_root () ( |
8 | - while [ "x$PWD" != "x/" ]; do |
9 | - # Check if some directories are present |
10 | - if [ -d BUILD -a -d sql -a -d mysys ]; then |
11 | - echo "$PWD" |
12 | - return 0 |
13 | - fi |
14 | - cd .. |
15 | - done |
16 | - return 1 |
17 | -) |
18 | - |
19 | -make -k clean || true |
20 | -/bin/rm -f */.deps/*.P config.cache |
21 | - |
22 | +#!/bin/sh |
23 | + |
24 | +# Pre-requisites for Solaris 10: |
25 | +# |
26 | +# setup: |
27 | +# ln -s `which perl` /usr/local/bin |
28 | +# your $PATH needs to include (in this order): |
29 | +# /usr/local/bin:/usr/sfw/bin:/usr/ccs/bin |
30 | +# |
31 | +# packages from http://sunfreeware.com/indexintel10.html : |
32 | +# automake-1.10.2-sol10-x86-local.gz |
33 | +# autoconf-2.63-sol10-x86-local.gz |
34 | +# m4-1.4.12-sol10-x86-local.gz |
35 | +# libsigsegv-2.6-sol10-x86-local.gz |
36 | +# libtool-1.5.24-sol10-x86-local.gz |
37 | +# ( how to install these packages: |
38 | + # wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/automake-1.10.2-sol10-x86-local.gz |
39 | + # gunzip automake-1.10.2-sol10-x86-local.gz |
40 | + # pkgadd -d automake-1.10.2-sol10-x86-local |
41 | +# ) |
42 | + |
43 | +# |
44 | +# if using --with-libevent, install that library from |
45 | +# http://www.monkey.org/~provos/libevent/ |
46 | + |
47 | path=`dirname $0` |
48 | -. "$path/autorun.sh" |
49 | - |
50 | -warning_flags="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused" |
51 | -compiler_flags="-g -O3 -fno-omit-frame-pointer" |
52 | - |
53 | -export CC CXX CFLAGS CXXFLAGS LDFLAGS LIBS |
54 | -CC="gcc" |
55 | -CXX="gcc" |
56 | -CFLAGS="$warning_flags $compiler_flags" |
57 | -CXXFLAGS="" |
58 | -LDFLAGS="-O3 -g -static-libgcc" |
59 | -LIBS=-lmtmalloc |
60 | -root=$(_find_mysql_root) |
61 | - |
62 | -$root/configure \ |
63 | - --prefix=/usr/local/mysql \ |
64 | - --localstatedir=/usr/local/mysql/data \ |
65 | - --libexecdir=/usr/local/mysql/bin \ |
66 | - --with-extra-charsets=complex \ |
67 | - --enable-thread-safe-client \ |
68 | - --enable-local-infile \ |
69 | - --with-zlib-dir=bundled \ |
70 | - --with-big-tables \ |
71 | - --with-readline \ |
72 | - --with-archive-storage-engine \ |
73 | - --with-named-curses=-lcurses \ |
74 | - --with-big-tables \ |
75 | - --with-innodb \ |
76 | - --with-berkeley-db \ |
77 | - --with-example-storage-engine \ |
78 | - --with-blackhole-storage-engine \ |
79 | - --with-ndbcluster \ |
80 | - --with-federated-storage-engine \ |
81 | - --with-csv-storage-engine \ |
82 | - --with-ssl \ |
83 | - --with-embedded-server \ |
84 | - --disable-shared |
85 | +. "$path/SETUP.sh" |
86 | +extra_flags="$amd64_cflags -D__sun -m64 -mtune=athlon64" |
87 | +extra_configs="$amd64_configs $max_configs --with-libevent" |
88 | + |
89 | +LDFLAGS="-lmtmalloc -static-libgcc" |
90 | +export LDFLAGS |
91 | + |
92 | +. "$path/FINISH.sh" |
93 | |
94 | === modified file 'BUILD/compile-solaris-amd64-debug' (properties changed: -x to +x) |
95 | --- BUILD/compile-solaris-amd64-debug 2007-11-10 10:03:07 +0000 |
96 | +++ BUILD/compile-solaris-amd64-debug 2009-05-04 14:36:55 +0000 |
97 | @@ -1,10 +1,11 @@ |
98 | -#! /bin/sh |
99 | +#!/bin/sh |
100 | + |
101 | path=`dirname $0` |
102 | . "$path/SETUP.sh" |
103 | -amd64_cflags="-m64 -mtune=athlon64" |
104 | -extra_flags="$amd64_cflags $debug_cflags $max_cflags" |
105 | -c_warnings="$c_warnings $debug_extra_warnings" |
106 | -cxx_warnings="$cxx_warnings $debug_extra_warnings" |
107 | -extra_configs="$amd64_configs $debug_configs $max_configs --enable-thread-safe-client" |
108 | +extra_flags="$amd64_cflags -D__sun -m64 $debug_cflags" |
109 | +extra_configs="$amd64_configs $debug_configs $max_configs --with-libevent" |
110 | + |
111 | +LDFLAGS="-lmtmalloc -static-libgcc" |
112 | +export LDFLAGS |
113 | |
114 | . "$path/FINISH.sh" |
115 | |
116 | === modified file 'BUILD/compile-solaris-amd64-forte' |
117 | --- BUILD/compile-solaris-amd64-forte 2008-09-30 20:57:48 +0000 |
118 | +++ BUILD/compile-solaris-amd64-forte 2009-05-04 14:36:55 +0000 |
119 | @@ -1,53 +1,33 @@ |
120 | -#! /bin/sh |
121 | - |
122 | -gmake -k clean || true |
123 | -/bin/rm -f */.deps/*.P config.cache |
124 | - |
125 | +#!/bin/sh |
126 | + |
127 | +# See file compile-solaris-amd64 for basic pre-requisites. |
128 | + |
129 | +# This build uses the Sun Studio compilers (cc, CC). |
130 | +# http://developers.sun.com/sunstudio/downloads/index.jsp |
131 | +# Note that you may want to apply current patches, as the downloaded version |
132 | +# is typically out of date. Download the PKG version if you intend to patch! |
133 | + |
134 | +# After installing, add /opt/SUNWspro/bin to your $PATH |
135 | + |
136 | + |
137 | path=`dirname $0` |
138 | -. "$path/autorun.sh" |
139 | - |
140 | -# For "optimal" code for this computer add -fast to EXTRA |
141 | -# To compile 64 bit, add -m64 to EXTRA_64_BIT |
142 | - |
143 | -EXTRA_64_BIT="-m64" |
144 | -EXTRA="-fast" |
145 | - |
146 | -# |
147 | -# The following should not need to be touched |
148 | -# |
149 | - |
150 | -export CC CXX CFLAGS CXXFLAGS LIBS |
151 | -STD="-g -mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT" |
152 | -ASFLAGS="$EXTRA_64_BIT" |
153 | -CC=cc-5.0 |
154 | -CFLAGS="-Xa -xstrconst $STD" |
155 | +. "$path/SETUP.sh" |
156 | + |
157 | +#extra_flags="-m64 -mt -D_FORTEC_ -D__sun -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3" |
158 | +extra_flags="-m64 -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3" |
159 | +extra_configs="$max_configs --with-libevent" |
160 | + |
161 | +export AM_MAKEFLAGS warnings c_warnings cxx_warnings base_cxxflags |
162 | +AM_MAKEFLAGS="" |
163 | +warnings="" |
164 | +c_warnings="" |
165 | +cxx_warnings="" |
166 | +base_cxxflags="-noex" |
167 | + |
168 | +export CC CXX CFLAGS CXXFLAGS LDFLAGS |
169 | +CC=cc |
170 | +CFLAGS="-xstrconst" |
171 | CXX=CC |
172 | -CXXFLAGS="-noex $STD" |
173 | -LIBS=-lmtmalloc |
174 | -./configure \ |
175 | - --prefix=/usr/local/mysql \ |
176 | - --localstatedir=/usr/local/mysql/data \ |
177 | - --libexecdir=/usr/local/mysql/bin \ |
178 | - --with-extra-charsets=complex \ |
179 | - --enable-thread-safe-client \ |
180 | - --enable-local-infile \ |
181 | - --with-zlib-dir=bundled \ |
182 | - --with-big-tables \ |
183 | - --with-readline \ |
184 | - --with-archive-storage-engine \ |
185 | - --with-named-curses=-lcurses \ |
186 | - --with-big-tables \ |
187 | - --with-innodb \ |
188 | - --with-example-storage-engine \ |
189 | - --with-blackhole-storage-engine \ |
190 | - --with-federated-storage-engine \ |
191 | - --with-csv-storage-engine \ |
192 | - --with-ssl \ |
193 | - --enable-assembler |
194 | - |
195 | -# Not including: |
196 | -# --with-ndbcluster |
197 | -# --with-berkeley-db |
198 | - |
199 | -gmake -j4 |
200 | -test $? = 0 && make test |
201 | +LDFLAGS="-lmtmalloc" |
202 | + |
203 | +. "$path/FINISH.sh" |
204 | |
205 | === modified file 'BUILD/compile-solaris-amd64-forte-debug' (properties changed: -x to +x) |
206 | --- BUILD/compile-solaris-amd64-forte-debug 2008-09-30 20:57:48 +0000 |
207 | +++ BUILD/compile-solaris-amd64-forte-debug 2009-05-04 14:36:55 +0000 |
208 | @@ -1,54 +1,29 @@ |
209 | -#! /bin/sh |
210 | +#!/bin/sh |
211 | |
212 | -gmake -k clean || true |
213 | -/bin/rm -f */.deps/*.P config.cache |
214 | - |
215 | path=`dirname $0` |
216 | -. "$path/autorun.sh" |
217 | - |
218 | -# To compile 64 bit, add -m64 to EXTRA_64_BIT |
219 | -EXTRA_64_BIT="-m64" |
220 | - |
221 | -# For "optimal" code for this computer add -fast to EXTRA. Note that |
222 | -# this causes problem with debugging the program since -fast implies |
223 | -# -xO5. |
224 | -EXTRA="" |
225 | - |
226 | -# |
227 | -# The following should not need to be touched |
228 | -# |
229 | - |
230 | -export CC CXX CFLAGS CXXFLAGS |
231 | -STD="-g -mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT $debug_cflags" |
232 | -ASFLAGS="$EXTRA_64_BIT" |
233 | -CC=cc-5.0 |
234 | -CFLAGS="-Xa -xstrconst $STD" |
235 | +. "$path/SETUP.sh" |
236 | + |
237 | +# take only #define options - the others are gcc specific |
238 | +DEFS="" |
239 | +for F in $debug_cflags ; do |
240 | + expr "$F" : "^-D" && DEFS="$DEFS $F" |
241 | +done |
242 | +debug_cflags="-O0 -g $DEFS" |
243 | + |
244 | +extra_flags="-m64 -mt -D_FORTEC_ -xlibmopt -fns=no $debug_cflags" |
245 | +extra_configs="$max_configs --with-libevent $debug_configs" |
246 | + |
247 | +export AM_MAKEFLAGS warnings c_warnings cxx_warnings base_cxxflags debug_cflags |
248 | +AM_MAKEFLAGS="" |
249 | +warnings="" |
250 | +c_warnings="" |
251 | +cxx_warnings="" |
252 | +base_cxxflags="-noex" |
253 | + |
254 | +export CC CXX CFLAGS CXXFLAGS LDFLAGS |
255 | +CC=cc |
256 | +CFLAGS="-xstrconst" |
257 | CXX=CC |
258 | -CXXFLAGS="-noex $STD" |
259 | -./configure \ |
260 | - --prefix=/usr/local/mysql \ |
261 | - --localstatedir=/usr/local/mysql/data \ |
262 | - --libexecdir=/usr/local/mysql/bin \ |
263 | - --with-extra-charsets=complex \ |
264 | - --enable-thread-safe-client \ |
265 | - --enable-local-infile \ |
266 | - --with-zlib-dir=bundled \ |
267 | - --with-big-tables \ |
268 | - --with-readline \ |
269 | - --with-archive-storage-engine \ |
270 | - --with-named-curses=-lcurses \ |
271 | - --with-big-tables \ |
272 | - --with-innodb \ |
273 | - --with-example-storage-engine \ |
274 | - --with-blackhole-storage-engine \ |
275 | - --with-federated-storage-engine \ |
276 | - --with-csv-storage-engine \ |
277 | - --with-ssl \ |
278 | - --with-debug \ |
279 | - --enable-assembler |
280 | - |
281 | -# Not including: |
282 | -# --with-ndbcluster |
283 | -# --with-berkeley-db |
284 | - |
285 | -gmake -j4 |
286 | +LDFLAGS="-lmtmalloc" |
287 | + |
288 | +. "$path/FINISH.sh" |
289 | |
290 | === modified file 'storage/innobase/include/univ.i' |
291 | --- storage/innobase/include/univ.i 2008-03-27 01:40:45 +0000 |
292 | +++ storage/innobase/include/univ.i 2009-05-04 14:36:55 +0000 |
293 | @@ -58,7 +58,7 @@ |
294 | /* We only try to do explicit inlining of functions with gcc and |
295 | Microsoft Visual C++ */ |
296 | |
297 | -# if !defined(__GNUC__) |
298 | +# if !defined(__GNUC__) && !defined(__SUNPRO_C) && !defined(UNIV_MUST_NOT_INLINE) |
299 | # undef UNIV_MUST_NOT_INLINE /* Remove compiler warning */ |
300 | # define UNIV_MUST_NOT_INLINE |
301 | # endif |
302 | |
303 | === modified file 'storage/pbxt/src/Makefile.am' |
304 | --- storage/pbxt/src/Makefile.am 2009-04-01 06:40:11 +0000 |
305 | +++ storage/pbxt/src/Makefile.am 2009-05-04 14:36:55 +0000 |
306 | @@ -46,7 +46,7 @@ |
307 | EXTRA_LIBRARIES = libpbxt.a |
308 | noinst_LIBRARIES = libpbxt.a |
309 | libpbxt_a_SOURCES = $(libpbxt_la_SOURCES) |
310 | -libpbxt_a_CXXFLAGS = $(AM_CXXFLAGS) -Wno-long-long |
311 | +libpbxt_a_CXXFLAGS = $(AM_CXXFLAGS) |
312 | libpbxt_a_CFLAGS = $(AM_CFLAGS) -std=c99 |
313 | |
314 | EXTRA_DIST = CMakeLists.txt |
315 | |
316 | === modified file 'storage/pbxt/src/lock_xt.h' |
317 | --- storage/pbxt/src/lock_xt.h 2009-04-02 10:03:14 +0000 |
318 | +++ storage/pbxt/src/lock_xt.h 2009-05-04 14:36:55 +0000 |
319 | @@ -208,9 +208,9 @@ |
320 | #elif defined(__GNUC__) |
321 | __sync_fetch_and_sub(mptr, 1); |
322 | #elif defined(XT_SPL_SOLARIS_LIB) |
323 | - val1 = atomic_dec_16_nv(mptr); |
324 | + atomic_dec_16_nv(mptr); |
325 | #else |
326 | - val1 = --(*mptr); |
327 | + --(*mptr); |
328 | #endif |
329 | } |
330 | |
331 | |
332 | === modified file 'storage/pbxt/src/pbms.h' |
333 | --- storage/pbxt/src/pbms.h 2009-03-26 12:18:01 +0000 |
334 | +++ storage/pbxt/src/pbms.h 2009-05-03 16:31:02 +0000 |
335 | @@ -782,21 +782,28 @@ |
336 | |
337 | void deleteTempFiles() |
338 | { |
339 | - struct dirent entry; |
340 | + struct dirent *entry; |
341 | struct dirent *result; |
342 | DIR *odir; |
343 | int err; |
344 | + size_t sz; |
345 | char temp_file[100]; |
346 | |
347 | +#ifdef XT_SOLARIS |
348 | + sz = sizeof(struct dirent) + pathconf("/tmp/", _PC_NAME_MAX); // Solaris, see readdir(3C) |
349 | +#else |
350 | + sz = sizeof(struct dirent); |
351 | +#endif |
352 | + entry = (struct dirent*)malloc(sz); |
353 | if (!(odir = opendir("/tmp/"))) |
354 | return; |
355 | - err = readdir_r(odir, &entry, &result); |
356 | + err = readdir_r(odir, entry, &result); |
357 | while (!err && result) { |
358 | const char **prefix = temp_prefix; |
359 | |
360 | while (*prefix) { |
361 | - if (startsWith(entry.d_name, *prefix)) { |
362 | - int pid = atoi(entry.d_name + strlen(*prefix)); |
363 | + if (startsWith(entry->d_name, *prefix)) { |
364 | + int pid = atoi(entry->d_name + strlen(*prefix)); |
365 | |
366 | /* If the process does not exist: */ |
367 | if (kill(pid, 0) == -1 && errno == ESRCH) { |
368 | @@ -807,9 +814,10 @@ |
369 | prefix++; |
370 | } |
371 | |
372 | - err = readdir_r(odir, &entry, &result); |
373 | + err = readdir_r(odir, entry, &result); |
374 | } |
375 | closedir(odir); |
376 | + free(entry); |
377 | } |
378 | }; |
379 | #endif // PBMS_API |
Attention: knielsen
I've got initial build scripts working on Solaris 10/amd64. The available targets are:
BUILD/compile- solaris- amd64 BUILD/compile- solaris- amd64-forte solaris- amd64-debug BUILD/compile- solaris- amd64-forte- debug
BUILD/compile-
These are now more in line with the generic build scripts, with a few portability overrides.
--with-libevent is forced for all Solaris builds, for now.
SPARC will come later, after these changes are approved.