summaryrefslogtreecommitdiffstats
path: root/recipes-support
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-01-03 11:44:38 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2011-01-03 12:02:34 +0100
commitef3de09a6bec187e1b6b8db46c55a237ba226a2c (patch)
tree5f843e4bfe14f8334eeb2bc1be7eeb348d49b0b6 /recipes-support
parent156f6d3dc264c26f743a4359e4d40181a79ba038 (diff)
downloadmeta-openembedded-ef3de09a6bec187e1b6b8db46c55a237ba226a2c.tar.gz
mysql5: import from OE
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes-support')
-rw-r--r--recipes-support/mysql/files/autofoo.patch319
-rw-r--r--recipes-support/mysql/files/configure-ps-cache-check.patch27
-rw-r--r--recipes-support/mysql/files/fix_host_path.patch37
-rw-r--r--recipes-support/mysql/files/my.cnf21
-rw-r--r--recipes-support/mysql/files/mysqld.sh24
-rw-r--r--recipes-support/mysql/mysql5-native_5.1.40.bb24
-rw-r--r--recipes-support/mysql/mysql5/Makefile.am.patch19
-rw-r--r--recipes-support/mysql/mysql5/configure-ps-cache-check.patch27
-rw-r--r--recipes-support/mysql/mysql5/configure.in.patch54
-rw-r--r--recipes-support/mysql/mysql5/fix-abi-check-gcc45.patch77
-rw-r--r--recipes-support/mysql/mysql5/fix_host_path.patch37
-rw-r--r--recipes-support/mysql/mysql5/misc.m4.patch13
-rw-r--r--recipes-support/mysql/mysql5/my.cnf21
-rw-r--r--recipes-support/mysql/mysql5/mysqld.sh24
-rw-r--r--recipes-support/mysql/mysql5/plug.in.patch40
-rw-r--r--recipes-support/mysql/mysql5_5.1.40.bb6
-rw-r--r--recipes-support/mysql/mysql5_5.1.40.inc170
17 files changed, 940 insertions, 0 deletions
diff --git a/recipes-support/mysql/files/autofoo.patch b/recipes-support/mysql/files/autofoo.patch
new file mode 100644
index 000000000..669393a23
--- /dev/null
+++ b/recipes-support/mysql/files/autofoo.patch
@@ -0,0 +1,319 @@
1diff -aurp mysql-4.1.22.old/acinclude.m4 mysql-4.1.22/acinclude.m4
2--- mysql-4.1.22.old/acinclude.m4 2008-09-18 13:00:13.000000000 -0500
3+++ mysql-4.1.22/acinclude.m4 2008-09-18 12:58:41.000000000 -0500
4@@ -1,5 +1,88 @@
5 # Local macros for automake & autoconf
6
7+AH_TEMPLATE([SPRINTF_RETURNS_INT], [sprintf returns an int])
8+AH_TEMPLATE([SPRINTF_RETURNS_PTR], [sprintf returns a char *])
9+AH_TEMPLATE([SPRINTF_RETURNS_GARBAGE], [sprintf returns something unknown to us])
10+
11+AC_DEFUN([MYSQL_SPRINTF_RET], [
12+ AC_CACHE_CHECK([return type of sprintf],
13+ [mysql_cv_func_sprintf_ret], [
14+ old_CFLAGS="$CFLAGS"
15+ CFLAGS="$CFLAGS -Werror"
16+ AC_COMPILE_IFELSE([
17+#include <stdio.h>
18+int sprintf(char *str, const char *format, ...);
19+ ], [mysql_cv_func_sprintf_ret=int],
20+ AC_COMPILE_IFELSE([
21+#include <stdio.h>
22+char * sprintf(char *str, const char *format, ...);
23+ ], [mysql_cv_func_sprintf_ret=ptr],
24+ [mysql_cv_func_sprintf_ret=unknown])
25+ )
26+ CFLAGS="$old_CFLAGS"
27+ ])
28+ if test x"$mysql_cv_func_sprintf_ret" = "xint"; then
29+ AC_DEFINE([SPRINTF_RETURNS_INT], [1])
30+ elif test x"$mysql_cv_func_sprintf_ret" = "xptr"; then
31+ AC_DEFINE([SPRINTF_RETURNS_PTR], [1])
32+ else
33+ AC_DEFINE([SPRINTF_RETURNS_GARBAGE], [1])
34+ fi
35+])
36+
37+# _MYSQL_FUNC_ATOMIC_ADD
38+# ----------------------
39+# Check for Linux specific atomic_add function
40+AC_DEFUN([_MYSQL_FUNC_ATOMIC_ADD],
41+[AC_CACHE_CHECK([for atomic_add], [mysql_cv_func_atomic_add],
42+[AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <asm/atomic.h>]],
43+ [
44+int main()
45+{
46+ atomic_t v;
47+
48+ atomic_set(&v, 23);
49+ atomic_add(5, &v);
50+ return atomic_read(&v) == 28 ? 0 : -1;
51+}
52+ ])],
53+ [mysql_cv_func_atomic_add=yes],
54+ [mysql_cv_func_atomic_add=no])])
55+ if test x"$mysql_func_atomic_add" = "xyes"; then
56+ AC_DEFINE([HAVE_ATOMIC_ADD], [1])
57+ fi[]dnl
58+])# _MYSQL_FUNC_ATOMIC_ADD
59+
60+# _MYSQL_FUNC_ATOMIC_SUB
61+# ----------------------
62+# Check for Linux specific atomic_sub function
63+AC_DEFUN([_MYSQL_FUNC_ATOMIC_SUB],
64+[AC_CACHE_CHECK([for atomic_sub], [mysql_cv_func_atomic_sub],
65+[AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <asm/atomic.h>]],
66+ [
67+int main()
68+{
69+ atomic_t v;
70+
71+ atomic_set(&v, 23);
72+ atomic_sub(5, &v);
73+ return atomic_read(&v) == 18 ? 0 : -1;
74+}
75+ ])],
76+ [mysql_cv_func_atomic_sub=yes],
77+ [mysql_cv_func_atomic_sub=no])])
78+ if test x"$mysql_func_atomic_sub" = "xyes"; then
79+ AC_DEFINE([HAVE_ATOMIC_SUB], [1])
80+ fi[]dnl
81+])# _MYSQL_FUNC_ATOMIC_SUB
82+
83+# MYSQL_FUNCS_ATOMIC
84+# ------------------
85+# Check for Linux specific atomic add and sub functions
86+AC_DEFUN([MYSQL_FUNCS_ATOMIC], [
87+ AC_REQUIRE([_MYSQL_FUNC_ATOMIC_ADD])dnl
88+ AC_REQUIRE([_MYSQL_FUNC_ATOMIC_SUB])dnl
89+])# MYSQL_FUNCS_ATOMIC
90
91 AC_DEFUN([MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY], [
92 AC_CACHE_CHECK([HIST_ENTRY is declared in readline/readline.h], mysql_cv_hist_entry_declared,
93@@ -344,7 +427,7 @@ dnl ------------------------------------
94 AC_DEFUN([MYSQL_CHECK_ULONG],
95 [AC_MSG_CHECKING(for type ulong)
96 AC_CACHE_VAL(ac_cv_ulong,
97-[AC_TRY_RUN([#include <stdio.h>
98+[AC_TRY_LINK([#include <stdio.h>
99 #include <sys/types.h>
100 main()
101 {
102@@ -362,7 +445,7 @@ fi
103 AC_DEFUN([MYSQL_CHECK_UCHAR],
104 [AC_MSG_CHECKING(for type uchar)
105 AC_CACHE_VAL(ac_cv_uchar,
106-[AC_TRY_RUN([#include <stdio.h>
107+[AC_TRY_LINK([#include <stdio.h>
108 #include <sys/types.h>
109 main()
110 {
111@@ -380,7 +463,7 @@ fi
112 AC_DEFUN([MYSQL_CHECK_UINT],
113 [AC_MSG_CHECKING(for type uint)
114 AC_CACHE_VAL(ac_cv_uint,
115-[AC_TRY_RUN([#include <stdio.h>
116+[AC_TRY_LINK([#include <stdio.h>
117 #include <sys/types.h>
118 main()
119 {
120@@ -399,7 +482,7 @@ fi
121 AC_DEFUN([MYSQL_CHECK_IN_ADDR_T],
122 [AC_MSG_CHECKING(for type in_addr_t)
123 AC_CACHE_VAL(ac_cv_in_addr_t,
124-[AC_TRY_RUN([#include <stdio.h>
125+[AC_TRY_LINK([#include <stdio.h>
126 #include <sys/types.h>
127 #include <sys/socket.h>
128 #include <netinet/in.h>
129@@ -460,7 +543,7 @@ fi
130 AC_DEFUN([MYSQL_CHECK_FP_EXCEPT],
131 [AC_MSG_CHECKING(for type fp_except)
132 AC_CACHE_VAL(ac_cv_fp_except,
133-[AC_TRY_RUN([#include <stdio.h>
134+[AC_TRY_LINK([#include <stdio.h>
135 #include <sys/types.h>
136 #include <ieeefp.h>
137 main()
138diff -aurp mysql-4.1.22.old/configure.in mysql-4.1.22/configure.in
139--- mysql-4.1.22.old/configure.in 2008-09-18 13:00:14.000000000 -0500
140+++ mysql-4.1.22/configure.in 2008-09-18 12:54:00.000000000 -0500
141@@ -236,8 +236,6 @@ then
142 else
143 AC_PATH_PROG(AS, as, as)
144 fi
145-# Still need ranlib for readline; local static use only so no libtool.
146-AC_PROG_RANLIB
147 # We use libtool
148 #AC_LIBTOOL_WIN32_DLL
149 AC_PROG_LIBTOOL
150@@ -258,44 +256,7 @@ AC_PROG_YACC
151 AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
152 AC_CHECK_PROG(DVIS, tex, manual.dvi)
153
154-AC_MSG_CHECKING("return type of sprintf")
155-
156-#check the return type of sprintf
157-case $SYSTEM_TYPE in
158- *netware*)
159- AC_DEFINE(SPRINTF_RETURNS_INT, [1]) AC_MSG_RESULT("int")
160- ;;
161- *)
162-AC_TRY_RUN([
163- int main()
164- {
165- char* s = "hello";
166- char buf[6];
167- if((int)sprintf(buf, s) == strlen(s))
168- return 0;
169-
170- return -1;
171- }
172- ],
173- [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
174- AC_MSG_RESULT("int")],
175- [AC_TRY_RUN([
176- int main()
177- {
178- char* s = "hello";
179- char buf[6];
180- if((char*)sprintf(buf,s) == buf + strlen(s))
181- return 0;
182- return -1;
183- } ],
184- [AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
185- AC_MSG_RESULT("ptr")],
186- [AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
187- AC_MSG_RESULT("garbage")])
188- ])
189- ;;
190-esac
191-
192+MYSQL_SPRINTF_RET
193
194 # option, cache_name, variable,
195 # code to execute if yes, code to exectute if fail
196@@ -878,47 +839,7 @@ struct request_info *req;
197 AC_SUBST(WRAPLIBS)
198
199 if test "$TARGET_LINUX" = "true"; then
200- AC_MSG_CHECKING([for atomic operations])
201-
202- AC_LANG_SAVE
203- AC_LANG_CPLUSPLUS
204-
205- atom_ops=
206- AC_TRY_RUN([
207-#include <asm/atomic.h>
208-int main()
209-{
210- atomic_t v;
211-
212- atomic_set(&v, 23);
213- atomic_add(5, &v);
214- return atomic_read(&v) == 28 ? 0 : -1;
215-}
216- ],
217- [AC_DEFINE([HAVE_ATOMIC_ADD], [1],
218- [atomic_add() from <asm/atomic.h> (Linux only)])
219- atom_ops="${atom_ops}atomic_add "],
220- )
221- AC_TRY_RUN([
222-#include <asm/atomic.h>
223-int main()
224-{
225- atomic_t v;
226-
227- atomic_set(&v, 23);
228- atomic_sub(5, &v);
229- return atomic_read(&v) == 18 ? 0 : -1;
230-}
231- ],
232- [AC_DEFINE([HAVE_ATOMIC_SUB], [1],
233- [atomic_sub() from <asm/atomic.h> (Linux only)])
234- atom_ops="${atom_ops}atomic_sub "],
235- )
236-
237- if test -z "$atom_ops"; then atom_ops="no"; fi
238- AC_MSG_RESULT($atom_ops)
239-
240- AC_LANG_RESTORE
241+ MYSQL_FUNC_ATOMIC
242
243 AC_ARG_WITH(pstack,
244 [ --with-pstack Use the pstack backtrace library],
245@@ -971,13 +892,13 @@ fi
246 # Later in this script LIBS will be augmented with a threads library.
247 NON_THREADED_LIBS="$LIBS"
248
249-AC_MSG_CHECKING([for int8])
250+AC_CACHE_CHECK([for int8], [mysql_cv_type_int8], [
251 case $SYSTEM_TYPE in
252 *netware)
253 AC_MSG_RESULT([no])
254 ;;
255 *)
256-AC_TRY_RUN([
257+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
258 #ifdef HAVE_STDLIB_H
259 #include <stdlib.h>
260 #endif
261@@ -988,22 +909,21 @@ AC_TRY_RUN([
262
263 #ifdef HAVE_SYS_TYPES_H
264 #include <sys/types.h>
265-#endif
266-
267+#endif]], [
268 int main()
269 {
270 int8 i;
271 return 0;
272-}
273-],
274-[AC_DEFINE([HAVE_INT_8_16_32], [1],
275- [whether int8, int16 and int32 types exist])
276-AC_MSG_RESULT([yes])],
277-[AC_MSG_RESULT([no])]
278-)
279+}])], [mysql_cv_type_int8=yes], [mysql_cv_type_int8=no])
280 ;;
281 esac
282
283+if test x"$mysql_cv_type_int8" = "xyes"; then
284+ AC_DEFINE([HAVE_INT_8_16_32], [1],
285+ [whether int8, int16 and int32 types exist])
286+fi
287+])
288+
289 #
290 # Some system specific hacks
291 #
292@@ -1814,7 +1734,7 @@ then
293 AC_MSG_ERROR("MySQL needs a long long type.")
294 fi
295 # off_t is not a builtin type
296-MYSQL_CHECK_SIZEOF(off_t, 4)
297+AC_CHECK_SIZEOF(off_t, 4)
298 if test "$ac_cv_sizeof_off_t" -eq 0
299 then
300 AC_MSG_ERROR("MySQL needs a off_t type.")
301diff -aurp mysql-4.1.22.old/innobase/configure.in mysql-4.1.22/innobase/configure.in
302--- mysql-4.1.22.old/innobase/configure.in 2008-09-18 13:00:14.000000000 -0500
303+++ mysql-4.1.22/innobase/configure.in 2008-09-18 12:55:39.000000000 -0500
304@@ -3,6 +3,7 @@ AC_INIT
305 AC_CANONICAL_SYSTEM
306 AM_MAINTAINER_MODE
307 AM_CONFIG_HEADER(ib_config.h)
308+AC_CONFIG_AUX_DIR([..])
309 AM_INIT_AUTOMAKE(ib, 0.90)
310
311 # This is need before AC_PROG_CC
312@@ -32,7 +33,6 @@ CFLAGS="$CFLAGS "
313 CXXFLAGS="$CXXFLAGS "
314
315 AC_PROG_CC
316-AC_PROG_RANLIB
317 AC_PROG_INSTALL
318 AC_PROG_LIBTOOL
319 AC_CHECK_HEADERS(aio.h sched.h)
diff --git a/recipes-support/mysql/files/configure-ps-cache-check.patch b/recipes-support/mysql/files/configure-ps-cache-check.patch
new file mode 100644
index 000000000..3b5b3fd06
--- /dev/null
+++ b/recipes-support/mysql/files/configure-ps-cache-check.patch
@@ -0,0 +1,27 @@
1Index: mysql-4.1.22/configure.in
2===================================================================
3--- mysql-4.1.22.orig/configure.in 2009-01-28 16:33:28.000000000 +0000
4+++ mysql-4.1.22/configure.in 2009-01-28 16:43:26.000000000 +0000
5@@ -471,8 +471,8 @@
6
7 # Lock for PS
8 AC_PATH_PROG(PS, ps, ps)
9-AC_MSG_CHECKING("how to check if pid exists")
10-PS=$ac_cv_path_PS
11+AC_CACHE_CHECK([how to check if pid exists], [ac_cv_FIND_PROC],
12+[
13 # Linux style
14 if $PS p $$ 2> /dev/null | grep $0 > /dev/null
15 then
16@@ -511,8 +511,9 @@
17 AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
18 esac
19 fi
20-AC_SUBST(FIND_PROC)
21-AC_MSG_RESULT("$FIND_PROC")
22+ac_cv_FIND_PROC="$FIND_PROC"
23+])
24+AC_SUBST([FIND_PROC], [$ac_cv_FIND_PROC])
25
26 # Check if a pid is valid
27 AC_PATH_PROG(KILL, kill, kill)
diff --git a/recipes-support/mysql/files/fix_host_path.patch b/recipes-support/mysql/files/fix_host_path.patch
new file mode 100644
index 000000000..4f69cd519
--- /dev/null
+++ b/recipes-support/mysql/files/fix_host_path.patch
@@ -0,0 +1,37 @@
1--- mysql-4.1.22/configure.in.old 2008-09-18 20:11:15.000000000 -0500
2+++ mysql-4.1.22/configure.in 2008-09-18 20:12:28.000000000 -0500
3@@ -456,9 +456,9 @@ else
4 fi
5 fi
6
7-AC_SUBST(HOSTNAME)
8-AC_SUBST(PERL)
9-AC_SUBST(PERL5)
10+AC_SUBST(HOSTNAME,/bin/hostname)
11+AC_SUBST(PERL,$(bindir)/perl)
12+AC_SUBST(PERL5,$(bindir)/perl)
13
14 # for build ndb docs
15
16@@ -516,16 +516,17 @@ AC_MSG_RESULT("$FIND_PROC")
17
18 # Check if a pid is valid
19 AC_PATH_PROG(KILL, kill, kill)
20+AC_SUBST(KILL,/bin/kill)
21 AC_MSG_CHECKING("for kill switches")
22-if $ac_cv_path_KILL -0 $$
23+if $KILL -0 $$
24 then
25- CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
26+ CHECK_PID="$KILL -0 \$\$PID > /dev/null 2> /dev/null"
27 elif kill -s 0 $$
28 then
29- CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
30+ CHECK_PID="$KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
31 else
32 AC_MSG_WARN([kill -0 to check for pid seems to fail])
33- CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
34+ CHECK_PID="$KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
35 fi
36 AC_SUBST(CHECK_PID)
37 AC_MSG_RESULT("$CHECK_PID")
diff --git a/recipes-support/mysql/files/my.cnf b/recipes-support/mysql/files/my.cnf
new file mode 100644
index 000000000..85560ebf5
--- /dev/null
+++ b/recipes-support/mysql/files/my.cnf
@@ -0,0 +1,21 @@
1[client]
2#password = password
3port = 3306
4socket = /tmp/mysql.sock
5
6[mysqld_safe]
7err-log = /var/log/mysql.err
8
9[mysqld]
10user = mysql
11port = 3306
12socket = /tmp/mysql.sock
13pid-file = /var/lib/mysql/mysqld.pid
14log-error = /var/log/mysqld.err
15basedir = /usr
16datadir = /var/mysql
17skip-locking
18skip-innodb
19skip-networking
20bind-address = localhost
21
diff --git a/recipes-support/mysql/files/mysqld.sh b/recipes-support/mysql/files/mysqld.sh
new file mode 100644
index 000000000..479ebdb25
--- /dev/null
+++ b/recipes-support/mysql/files/mysqld.sh
@@ -0,0 +1,24 @@
1# MySQL init script
2
3. /etc/default/rcS
4
5case "$1" in
6 start)
7 /usr/bin/mysqld_safe &
8 ;;
9 stop)
10 if test -f /var/lib/mysql/mysqld.pid ; then
11 PID=`cat /var/lib/mysql/mysqld.pid`
12 kill $PID
13 fi
14 ;;
15 restart)
16 $0 stop
17 $0 start
18 ;;
19 *)
20 echo "Usage: /etc/init.d/mysqld {start|stop|restart}"
21 ;;
22esac
23
24exit 0
diff --git a/recipes-support/mysql/mysql5-native_5.1.40.bb b/recipes-support/mysql/mysql5-native_5.1.40.bb
new file mode 100644
index 000000000..40d07ec88
--- /dev/null
+++ b/recipes-support/mysql/mysql5-native_5.1.40.bb
@@ -0,0 +1,24 @@
1require mysql5_${PV}.inc
2inherit native
3PR ="r2"
4
5SRC_URI = "http://downloads.mysql.com/archives/mysql-5.1/mysql-${PV}.tar.gz \
6 file://fix-abi-check-gcc45.patch"
7
8RDEPENDS_${PN} = ""
9PACKAGES = ""
10DEPENDS = "ncurses-native"
11EXTRA_OEMAKE = ""
12EXTRA_OECONF = " --with-embedded-server "
13
14do_install() {
15 install -d ${D}${bindir}
16 install -m 0755 sql/gen_lex_hash ${D}${bindir}/
17}
18
19NATIVE_INSTALL_WORKS = "1"
20
21PSTAGING_DISABLED = "1"
22
23SRC_URI[md5sum] = "32e7373c16271606007374396e6742ad"
24SRC_URI[sha256sum] = "2b0737b84e7b42c9e54c9658d23bfaee1189cd5955f26b10bdb862761d0f0432"
diff --git a/recipes-support/mysql/mysql5/Makefile.am.patch b/recipes-support/mysql/mysql5/Makefile.am.patch
new file mode 100644
index 000000000..33fd17acd
--- /dev/null
+++ b/recipes-support/mysql/mysql5/Makefile.am.patch
@@ -0,0 +1,19 @@
1Index: mysql-5.1.40/sql/Makefile.am
2===================================================================
3--- mysql-5.1.40.orig/sql/Makefile.am
4+++ mysql-5.1.40/sql/Makefile.am
5@@ -174,10 +174,10 @@ link_sources:
6 # This generates lex_hash.h
7 # NOTE Built sources should depend on their sources not the tool
8 # this avoid the rebuild of the built files in a source dist
9-lex_hash.h: gen_lex_hash.cc lex.h
10- $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
11- ./gen_lex_hash$(EXEEXT) > $@-t
12- $(MV) $@-t $@
13+GEN_LEX_HASH = ./gen_lex_hash$(EXEEXT)
14+
15+lex_hash.h: gen_lex_hash$(EXEEXT)
16+ $(GEN_LEX_HASH) > $@
17
18 # For testing of udf_example.so
19 udf_example_la_SOURCES= udf_example.c
diff --git a/recipes-support/mysql/mysql5/configure-ps-cache-check.patch b/recipes-support/mysql/mysql5/configure-ps-cache-check.patch
new file mode 100644
index 000000000..3b5b3fd06
--- /dev/null
+++ b/recipes-support/mysql/mysql5/configure-ps-cache-check.patch
@@ -0,0 +1,27 @@
1Index: mysql-4.1.22/configure.in
2===================================================================
3--- mysql-4.1.22.orig/configure.in 2009-01-28 16:33:28.000000000 +0000
4+++ mysql-4.1.22/configure.in 2009-01-28 16:43:26.000000000 +0000
5@@ -471,8 +471,8 @@
6
7 # Lock for PS
8 AC_PATH_PROG(PS, ps, ps)
9-AC_MSG_CHECKING("how to check if pid exists")
10-PS=$ac_cv_path_PS
11+AC_CACHE_CHECK([how to check if pid exists], [ac_cv_FIND_PROC],
12+[
13 # Linux style
14 if $PS p $$ 2> /dev/null | grep $0 > /dev/null
15 then
16@@ -511,8 +511,9 @@
17 AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
18 esac
19 fi
20-AC_SUBST(FIND_PROC)
21-AC_MSG_RESULT("$FIND_PROC")
22+ac_cv_FIND_PROC="$FIND_PROC"
23+])
24+AC_SUBST([FIND_PROC], [$ac_cv_FIND_PROC])
25
26 # Check if a pid is valid
27 AC_PATH_PROG(KILL, kill, kill)
diff --git a/recipes-support/mysql/mysql5/configure.in.patch b/recipes-support/mysql/mysql5/configure.in.patch
new file mode 100644
index 000000000..3edc5f3c2
--- /dev/null
+++ b/recipes-support/mysql/mysql5/configure.in.patch
@@ -0,0 +1,54 @@
1Index: mysql-5.1.40/configure.in
2===================================================================
3--- mysql-5.1.40.orig/configure.in
4+++ mysql-5.1.40/configure.in
5@@ -226,8 +226,6 @@ else
6 AC_PATH_PROG(AS, as, as)
7 fi
8
9-# Still need ranlib for readline; local static use only so no libtool.
10-AC_PROG_RANLIB
11 # We use libtool
12 #AC_LIBTOOL_WIN32_DLL
13 AC_PROG_LIBTOOL
14@@ -255,39 +253,7 @@ AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL
15 AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
16 AC_CHECK_PROG(DVIS, tex, manual.dvi)
17
18-#check the return type of sprintf
19-AC_MSG_CHECKING("return type of sprintf")
20-AC_TRY_RUN([
21- int main()
22- {
23- char* s = "hello";
24- char buf[6];
25- if((int)sprintf(buf, s) == strlen(s))
26- return 0;
27-
28- return -1;
29- }
30- ],
31- [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
32- AC_MSG_RESULT("int")],
33- [AC_TRY_RUN([
34- int main()
35- {
36- char* s = "hello";
37- char buf[6];
38- if((char*)sprintf(buf,s) == buf + strlen(s))
39- return 0;
40- return -1;
41- } ],
42- [AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
43- AC_MSG_RESULT("ptr")],
44- [AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
45- AC_MSG_RESULT("garbage")]
46- )],
47- # Cross compile, assume POSIX
48- [AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
49- AC_MSG_RESULT("int (we assume)")]
50-)
51+MYSQL_SPRINTF_RET
52
53 AC_PATH_PROG(uname_prog, uname, no)
54
diff --git a/recipes-support/mysql/mysql5/fix-abi-check-gcc45.patch b/recipes-support/mysql/mysql5/fix-abi-check-gcc45.patch
new file mode 100644
index 000000000..58812c1f1
--- /dev/null
+++ b/recipes-support/mysql/mysql5/fix-abi-check-gcc45.patch
@@ -0,0 +1,77 @@
1From: Date: July 20 2010 7:44pm
2Subject: bzr commit into mysql-5.1-bugteam branch (davi:3493) Bug#52514
3List-Archive: http://lists.mysql.com/commits/113968
4X-Bug: 52514
5MIME-Version: 1.0
6Content-Type: multipart/mixed; boundary="===============9147207462624717749=="
7
8--===============9147207462624717749==
9MIME-Version: 1.0
10Content-Type: text/plain; charset="us-ascii"
11Content-Transfer-Encoding: 7bit
12Content-Disposition: inline
13
14# At a local mysql-5.1-bugteam repository of davi
15
16 3493 Davi Arnaut 2010-07-20
17 Bug#52514: mysql 5.1 do_abi_check does not compile w/ gcc4.5
18 due to GCC preprocessor change
19
20 The problem is that newer GCC versions treats missing headers
21 as fatal errors. The solution is to use a guard macro to prevent
22 the inclusion of system headers when checking the ABI with the
23 C Preprocessor.
24
25 Reference: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15638
26 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44836
27 @ Makefile.am
28 Define guard macro.
29 @ configure.in
30 Remove workaround.
31 @ include/mysql.h
32 Guard the header inclusion.
33 @ include/mysql.h.pp
34 Header is not included anymore.
35
36 modified:
37 Makefile.am
38 configure.in
39 include/mysql.h
40 include/mysql.h.pp
41=== modified file 'Makefile.am'
42Index: mysql-5.1.40/Makefile.am
43===================================================================
44--- mysql-5.1.40.orig/Makefile.am 2009-10-07 01:46:13.000000000 +0800
45+++ mysql-5.1.40/Makefile.am 2010-08-17 20:07:24.843148001 +0800
46@@ -312,7 +312,7 @@
47 do_abi_check:
48 set -ex; \
49 for file in $(abi_headers); do \
50- @CC@ -E -nostdinc -dI \
51+ @CC@ -E -nostdinc -dI -DMYSQL_ABI_CHECK \
52 -I$(top_srcdir)/include \
53 -I$(top_srcdir)/include/mysql \
54 -I$(top_srcdir)/sql \
55Index: mysql-5.1.40/include/mysql.h
56===================================================================
57--- mysql-5.1.40.orig/include/mysql.h 2009-10-07 01:46:50.000000000 +0800
58+++ mysql-5.1.40/include/mysql.h 2010-08-17 20:07:24.843148001 +0800
59@@ -44,7 +44,9 @@
60 #endif
61
62 #ifndef _global_h /* If not standard header */
63+#ifndef MYSQL_ABI_CHECK
64 #include <sys/types.h>
65+#endif
66 #ifdef __LCC__
67 #include <winsock2.h> /* For windows */
68 #endif
69Index: mysql-5.1.40/include/mysql.h.pp
70===================================================================
71--- mysql-5.1.40.orig/include/mysql.h.pp 2009-10-07 01:46:50.000000000 +0800
72+++ mysql-5.1.40/include/mysql.h.pp 2010-08-17 20:07:24.843148001 +0800
73@@ -1,4 +1,3 @@
74-#include <sys/types.h>
75 typedef char my_bool;
76 typedef int my_socket;
77 #include "mysql_version.h"
diff --git a/recipes-support/mysql/mysql5/fix_host_path.patch b/recipes-support/mysql/mysql5/fix_host_path.patch
new file mode 100644
index 000000000..4f69cd519
--- /dev/null
+++ b/recipes-support/mysql/mysql5/fix_host_path.patch
@@ -0,0 +1,37 @@
1--- mysql-4.1.22/configure.in.old 2008-09-18 20:11:15.000000000 -0500
2+++ mysql-4.1.22/configure.in 2008-09-18 20:12:28.000000000 -0500
3@@ -456,9 +456,9 @@ else
4 fi
5 fi
6
7-AC_SUBST(HOSTNAME)
8-AC_SUBST(PERL)
9-AC_SUBST(PERL5)
10+AC_SUBST(HOSTNAME,/bin/hostname)
11+AC_SUBST(PERL,$(bindir)/perl)
12+AC_SUBST(PERL5,$(bindir)/perl)
13
14 # for build ndb docs
15
16@@ -516,16 +516,17 @@ AC_MSG_RESULT("$FIND_PROC")
17
18 # Check if a pid is valid
19 AC_PATH_PROG(KILL, kill, kill)
20+AC_SUBST(KILL,/bin/kill)
21 AC_MSG_CHECKING("for kill switches")
22-if $ac_cv_path_KILL -0 $$
23+if $KILL -0 $$
24 then
25- CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
26+ CHECK_PID="$KILL -0 \$\$PID > /dev/null 2> /dev/null"
27 elif kill -s 0 $$
28 then
29- CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
30+ CHECK_PID="$KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
31 else
32 AC_MSG_WARN([kill -0 to check for pid seems to fail])
33- CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
34+ CHECK_PID="$KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
35 fi
36 AC_SUBST(CHECK_PID)
37 AC_MSG_RESULT("$CHECK_PID")
diff --git a/recipes-support/mysql/mysql5/misc.m4.patch b/recipes-support/mysql/mysql5/misc.m4.patch
new file mode 100644
index 000000000..7b0acff21
--- /dev/null
+++ b/recipes-support/mysql/mysql5/misc.m4.patch
@@ -0,0 +1,13 @@
1Index: mysql-5.1.40/config/ac-macros/misc.m4
2===================================================================
3--- mysql-5.1.40.orig/config/ac-macros/misc.m4
4+++ mysql-5.1.40/config/ac-macros/misc.m4
5@@ -476,7 +476,7 @@ AC_DEFUN([MYSQL_STACK_DIRECTION],
6 {
7 exit (find_stack_direction() < 0);
8 }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
9- ac_cv_c_stack_direction=)])
10+ ac_cv_c_stack_direction=0)])
11 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
12 ])dnl
13
diff --git a/recipes-support/mysql/mysql5/my.cnf b/recipes-support/mysql/mysql5/my.cnf
new file mode 100644
index 000000000..7f557e425
--- /dev/null
+++ b/recipes-support/mysql/mysql5/my.cnf
@@ -0,0 +1,21 @@
1[client]
2#password = password
3port = 3306
4socket = /tmp/mysql.sock
5
6[mysqld_safe]
7err-log = /var/log/mysql.err
8
9[mysqld]
10user = mysql
11port = 3306
12socket = /tmp/mysql.sock
13pid-file = /var/lib/mysql/mysqld.pid
14log-error = /var/log/mysqld.err
15basedir = /usr
16datadir = /var/mysql
17skip-locking
18loose-skip-innodb
19skip-networking
20bind-address = localhost
21
diff --git a/recipes-support/mysql/mysql5/mysqld.sh b/recipes-support/mysql/mysql5/mysqld.sh
new file mode 100644
index 000000000..479ebdb25
--- /dev/null
+++ b/recipes-support/mysql/mysql5/mysqld.sh
@@ -0,0 +1,24 @@
1# MySQL init script
2
3. /etc/default/rcS
4
5case "$1" in
6 start)
7 /usr/bin/mysqld_safe &
8 ;;
9 stop)
10 if test -f /var/lib/mysql/mysqld.pid ; then
11 PID=`cat /var/lib/mysql/mysqld.pid`
12 kill $PID
13 fi
14 ;;
15 restart)
16 $0 stop
17 $0 start
18 ;;
19 *)
20 echo "Usage: /etc/init.d/mysqld {start|stop|restart}"
21 ;;
22esac
23
24exit 0
diff --git a/recipes-support/mysql/mysql5/plug.in.patch b/recipes-support/mysql/mysql5/plug.in.patch
new file mode 100644
index 000000000..70c39fa7a
--- /dev/null
+++ b/recipes-support/mysql/mysql5/plug.in.patch
@@ -0,0 +1,40 @@
1Index: mysql-5.1.40/storage/innodb_plugin/plug.in
2===================================================================
3--- mysql-5.1.40.orig/storage/innodb_plugin/plug.in
4+++ mysql-5.1.40/storage/innodb_plugin/plug.in
5@@ -63,35 +63,6 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
6 ;;
7 esac
8 AC_SUBST(INNODB_DYNAMIC_CFLAGS)
9- AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
10- AC_TRY_RUN(
11- [
12- #include <pthread.h>
13- #include <string.h>
14-
15- int main(int argc, char** argv) {
16- pthread_t x1;
17- pthread_t x2;
18- pthread_t x3;
19-
20- memset(&x1, 0x0, sizeof(x1));
21- memset(&x2, 0x0, sizeof(x2));
22- memset(&x3, 0x0, sizeof(x3));
23-
24- __sync_bool_compare_and_swap(&x1, x2, x3);
25-
26- return(0);
27- }
28- ],
29- [
30- AC_DEFINE([HAVE_ATOMIC_PTHREAD_T], [1],
31- [pthread_t can be used by GCC atomic builtins])
32- AC_MSG_RESULT(yes)
33- ],
34- [
35- AC_MSG_RESULT(no)
36- ]
37- )
38
39 # Try using solaris atomics on SunOS if GCC atomics are not available
40 AC_CHECK_DECLS(
diff --git a/recipes-support/mysql/mysql5_5.1.40.bb b/recipes-support/mysql/mysql5_5.1.40.bb
new file mode 100644
index 000000000..5229312dc
--- /dev/null
+++ b/recipes-support/mysql/mysql5_5.1.40.bb
@@ -0,0 +1,6 @@
1require ${PN}_${PV}.inc
2
3DEPENDS += mysql5-native
4
5SRC_URI[md5sum] = "32e7373c16271606007374396e6742ad"
6SRC_URI[sha256sum] = "2b0737b84e7b42c9e54c9658d23bfaee1189cd5955f26b10bdb862761d0f0432"
diff --git a/recipes-support/mysql/mysql5_5.1.40.inc b/recipes-support/mysql/mysql5_5.1.40.inc
new file mode 100644
index 000000000..d7c1b7261
--- /dev/null
+++ b/recipes-support/mysql/mysql5_5.1.40.inc
@@ -0,0 +1,170 @@
1DESCRIPTION = "The MySQL Open Source Database System"
2HOMEPAGE = "http://www.mysql.com/"
3SECTION = "libs"
4LICENSE = "GPL"
5DEPENDS = "ncurses"
6PR = "r5"
7
8SRC_URI = "http://downloads.mysql.com/archives/mysql-5.1/mysql-${PV}.tar.gz \
9 file://configure.in.patch \
10 file://plug.in.patch \
11 file://misc.m4.patch \
12 file://Makefile.am.patch \
13 file://fix_host_path.patch \
14 file://configure-ps-cache-check.patch \
15 file://fix-abi-check-gcc45.patch \
16 file://my.cnf \
17 file://mysqld.sh"
18
19S = "${WORKDIR}/mysql-${PV}"
20
21BINCONFIG_GLOB = "mysql_config"
22
23inherit autotools binconfig update-rc.d
24
25INITSCRIPT_PACKAGES = "${PN}-server"
26INITSCRIPT_NAME = "mysqld"
27INITSCRIPT_PARAMS = "start 45 S . stop 45 0 6 1 ."
28
29export ac_cv_path_PS=/bin/ps
30export ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null"
31PARALLEL_MAKE = " "
32EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
33EXTRA_OECONF = " --with-atomic-ops=up --with-embedded-server --prefix=/usr --sysconfdir=/etc/mysql --localstatedir=/var/mysql --disable-dependency-tracking --without-raid --without-debug --with-low-memory --without-query-cache --without-man --without-docs --without-innodb "
34
35do_configure_append() {
36 sed -i /comp_err/d ${S}/sql/share/Makefile
37}
38
39SYSROOT_PREPROCESS_FUNCS += "mysql5_sysroot_preprocess"
40
41# We need to append this so it runs *after* binconfig's preprocess function
42mysql5_sysroot_preprocess () {
43 sed -i -es,^pkgincludedir=\'/usr/include/mysql\',pkgincludedir=\'${STAGING_INCDIR}\', ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/mysql_config
44 sed -i -es,^pkglibdir=\'/usr/lib/mysql\',pkglibdir=\'${STAGING_LIBDIR}\', ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/mysql_config
45}
46
47do_install() {
48 oe_runmake 'DESTDIR=${D}' install
49 mv -f ${D}${libdir}/mysql/* ${D}${libdir}
50 rmdir ${D}${libdir}/mysql
51
52 install -d ${D}/etc/init.d
53 install -m 0644 ${WORKDIR}/my.cnf ${D}/etc/
54 install -m 0755 ${WORKDIR}/mysqld.sh ${D}/etc/init.d/mysqld
55}
56
57pkg_postinst_mysql5-server () {
58 if [ "x$D" != "x" ]; then
59 exit 1
60 fi
61
62 grep mysql /etc/passwd || adduser --disabled-password --home=/var/mysql --ingroup nogroup mysql
63
64 #Install the database
65 test -d /usr/bin || mkdir -p /usr/bin
66 test -e /usr/bin/hostname || ln -s /bin/hostname /usr/bin/hostname
67 mkdir /var/lib/mysql
68 chown mysql.nogroup /var/lib/mysql
69
70 mysql_install_db
71
72}
73
74pkg_postrm_mysql5-server () {
75 grep mysql /etc/passwd && deluser mysql
76}
77
78PACKAGES = "${PN}-dbg ${PN} \
79libmysqlclient-r libmysqlclient-r-dev libmysqlclient-r-dbg \
80libmysqlclient libmysqlclient-dev libmysqlclient-dbg \
81${PN}-client ${PN}-server ${PN}-leftovers"
82CONFFILES_${PN}-server += "${sysconfdir}/my.cnf"
83
84FILES_${PN} = " "
85RDEPENDS_${PN} = "${PN}-client ${PN}-server"
86ALLOW_EMPTY_${PN} = "1"
87
88FILES_libmysqlclient = "${libdir}/libmysqlclient.so.*"
89FILES_libmysqlclient-dev = " \
90${includedir}/mysql/ \
91${libdir}/lib* \
92${libdir}/plugin/* \
93${sysconfdir}/aclocal \
94${bindir}/mysql_config"
95FILES_libmysqlclient-dbg = "${libdir}/plugin/.debug/ \
96/usr/mysql-test/lib/My/SafeProcess/.debug/my_safe_process"
97
98FILES_libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*"
99FILES_libmysqlclient-r-dev = "${libdir}/libmysqlclient_r.*"
100FILES_libmysqlclient-r-dbg = "${libdir}/plugin/.debuglibmysqlclient_r.so.*"
101
102FILES_${PN}-client = "\
103${bindir}/myisam_ftdump \
104${bindir}/mysql \
105${bindir}/mysql_client_test \
106${bindir}/mysql_client_test_embedded \
107${bindir}/mysql_find_rows \
108${bindir}/mysql_fix_extensions \
109${bindir}/mysql_waitpid \
110${bindir}/mysqlaccess \
111${bindir}/mysqladmin \
112${bindir}/mysqlbug \
113${bindir}/mysqlcheck \
114${bindir}/mysqldump \
115${bindir}/mysqldumpslow \
116${bindir}/mysqlimport \
117${bindir}/mysqlshow \
118${bindir}/mysqlslap \
119${bindir}/mysqltest_embedded \
120${libexecdir}/mysqlmanager"
121
122FILES_${PN}-server = "\
123${bindir}/comp_err \
124${bindir}/isamchk \
125${bindir}/isamlog \
126${bindir}/msql2mysql \
127${bindir}/my_print_defaults \
128${bindir}/myisamchk \
129${bindir}/myisamlog \
130${bindir}/myisampack \
131${bindir}/mysql_convert_table_format \
132${bindir}/mysql_fix_privilege_tables \
133${bindir}/mysql_install_db \
134${bindir}/mysql_secure_installation \
135${bindir}/mysql_setpermission \
136${bindir}/mysql_tzinfo_to_sql \
137${bindir}/mysql_upgrade \
138${bindir}/mysql_zap \
139${bindir}/mysqlbinlog \
140${bindir}/mysqld_multi \
141${bindir}/mysqld_safe \
142${bindir}/mysqlhotcopy \
143${bindir}/mysqltest \
144${bindir}/ndb_delete_all \
145${bindir}/ndb_desc \
146${bindir}/ndb_drop_index \
147${bindir}/ndb_drop_table \
148${bindir}/ndb_mgm \
149${bindir}/ndb_restore \
150${bindir}/ndb_select_all \
151${bindir}/ndb_select_count \
152${bindir}/ndb_show_tables \
153${bindir}/ndb_waiter \
154${bindir}/pack_isam \
155${bindir}/perror \
156${bindir}/replace \
157${bindir}/resolve_stack_dump \
158${bindir}/resolveip \
159${libexecdir}/mysqld \
160${sbindir}/mysqld \
161${sbindir}/ndb_cpcd \
162${sbindir}/ndbd \
163${sbindir}/ndb_mgmd \
164${datadir}/mysql/ \
165${localstatedir}/mysql/ \
166${sysconfdir}/init.d \
167${sysconfdir}/my.cnf"
168
169DESCRIPTION_${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}"
170FILES_${PN}-leftovers = "/"