2003-08-15 00:50:58 +00:00
|
|
|
|
|
|
|
dnl $Id$
|
|
|
|
|
|
|
|
AC_DEFUN([AC_CHECK_MYSQL],[
|
|
|
|
AC_ARG_VAR([MYSQL_CONFIG], [mysql_config program])
|
2004-06-29 08:51:54 +00:00
|
|
|
|
2003-08-15 00:50:58 +00:00
|
|
|
if test -z "$MYSQL_CONFIG"; then
|
2004-06-29 08:51:54 +00:00
|
|
|
AC_PATH_PROG(MYSQL_CONFIG,mysql_config,,[$PATH:/usr/local/mysql/bin])
|
2003-08-15 00:50:58 +00:00
|
|
|
fi
|
2004-06-29 08:51:54 +00:00
|
|
|
|
2004-11-26 17:45:13 +00:00
|
|
|
# THIS SMALL CHANGE TO THE STANDARD .M4 FILE SIMPLY SETS A VARIABLE IF
|
|
|
|
# MYSQL IS NOT TEHRE.
|
2004-06-29 08:51:54 +00:00
|
|
|
if test -z "$MYSQL_CONFIG"; then
|
2004-11-26 17:45:13 +00:00
|
|
|
no_mysql=yes
|
2003-08-15 00:50:58 +00:00
|
|
|
else
|
|
|
|
AC_MSG_CHECKING(mysql libraries)
|
|
|
|
MYSQL_LIBS=`${MYSQL_CONFIG} --libs`
|
2006-01-27 19:02:13 +00:00
|
|
|
|
|
|
|
# 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
|
2003-08-15 00:50:58 +00:00
|
|
|
AC_MSG_RESULT($MYSQL_LIBS)
|
|
|
|
AC_MSG_CHECKING(mysql includes)
|
|
|
|
MYSQL_CFLAGS=`${MYSQL_CONFIG} --cflags`
|
2006-01-27 19:02:13 +00:00
|
|
|
# Same bug...
|
|
|
|
case "${host}" in
|
|
|
|
powerpc-apple-darwin7*)
|
|
|
|
MYSQL_CFLAGS=`echo $MYSQL_CFLAGS | sed -e 's|-arch i386||g'`
|
|
|
|
;;
|
|
|
|
esac
|
2023-05-05 18:05:20 +00:00
|
|
|
# on solaris the mysql CFLAGS and LIBS can be messed up because of the
|
2008-04-01 21:44:12 +00:00
|
|
|
# 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
|
2023-05-05 18:05:20 +00:00
|
|
|
case "${flag}" in
|
|
|
|
-x*)
|
2008-04-01 21:44:12 +00:00
|
|
|
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
|
2023-05-05 18:05:20 +00:00
|
|
|
case "${flag}" in
|
|
|
|
-x*)
|
2008-04-01 21:44:12 +00:00
|
|
|
echo > /dev/null
|
|
|
|
;;
|
|
|
|
-mt)
|
|
|
|
MYSQL_LIBS="${MYSQL_LIBS} ${PTHREAD_LIBS}"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
MYSQL_LIBS="${MYSQL_LIBS} ${flag}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2003-08-15 00:50:58 +00:00
|
|
|
AC_MSG_RESULT($MYSQL_CFLAGS)
|
2004-11-26 17:45:13 +00:00
|
|
|
no_mysql=no
|
2003-08-15 00:50:58 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(MYSQL_LIBS)
|
|
|
|
AC_SUBST(MYSQL_CFLAGS)
|
2004-06-29 08:51:54 +00:00
|
|
|
|
2003-08-15 00:50:58 +00:00
|
|
|
])
|