forked from BOINC/boinc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkc_mysql.m4
79 lines (72 loc) · 1.91 KB
/
kc_mysql.m4
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
dnl $Id$
AC_DEFUN([AC_CHECK_MYSQL],[
AC_ARG_VAR([MYSQL_CONFIG], [mysql_config program])
if test -z "$MYSQL_CONFIG"; then
AC_PATH_PROG(MYSQL_CONFIG,mysql_config,,[$PATH:/usr/local/mysql/bin])
fi
# THIS SMALL CHANGE TO THE STANDARD .M4 FILE SIMPLY SETS A VARIABLE IF
# MYSQL IS NOT TEHRE.
if test -z "$MYSQL_CONFIG"; then
no_mysql=yes
else
AC_MSG_CHECKING(mysql libraries)
MYSQL_LIBS=`${MYSQL_CONFIG} --libs`
# This is so silly, but Apple actually has a bug in their
# mysql_config script (same bug in their curl-config, too).
# Fixed in 10.4, but we need to correct this for 10.3...
case "${host}" in
powerpc-apple-darwin7*)
MYSQL_LIBS=`echo $MYSQL_LIBS | sed -e 's|-arch i386||g'`
;;
esac
AC_MSG_RESULT($MYSQL_LIBS)
AC_MSG_CHECKING(mysql includes)
MYSQL_CFLAGS=`${MYSQL_CONFIG} --cflags`
# Same bug...
case "${host}" in
powerpc-apple-darwin7*)
MYSQL_CFLAGS=`echo $MYSQL_CFLAGS | sed -e 's|-arch i386||g'`
;;
esac
# on solaris the mysql CFLAGS and LIBS can be messed up because of the
# compiler used in the default installs. So we need to fix them.
case "${host}" in
sparc-sun-solaris*)
old_mysql_cflags="${MYSQL_CFLAGS}"
MYSQL_CFLAGS=
for flag in $old_mysql_cflags ; do
case "${flag}" in
-x*)
echo > /dev/null
;;
-mt)
MYSQL_CFLAGS="${MYSQL_CFLAGS} ${PTHREAD_CFLAGS}"
;;
*)
MYSQL_CFLAGS="${MYSQL_CFLAGS} ${flag}"
;;
esac
done
old_mysql_libs="${MYSQL_LIBS}"
MYSQL_LIBS=
for flag in $old_mysql_libs ; do
case "${flag}" in
-x*)
echo > /dev/null
;;
-mt)
MYSQL_LIBS="${MYSQL_LIBS} ${PTHREAD_LIBS}"
;;
*)
MYSQL_LIBS="${MYSQL_LIBS} ${flag}"
;;
esac
done
;;
esac
AC_MSG_RESULT($MYSQL_CFLAGS)
no_mysql=no
fi
AC_SUBST(MYSQL_LIBS)
AC_SUBST(MYSQL_CFLAGS)
])