1 # =========================================================================
2 # AM_PATH_MYSQL : MySQL library
4 dnl AM_PATH_MYSQL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
5 dnl Test for MYSQL, and define MYSQL_CFLAGS and MYSQL_LIBS
7 AC_DEFUN(AM_PATH_MYSQL,
9 dnl Get the cflags and libraries from the mysql_config script
11 AC_ARG_WITH(mysql-prefix,[ --with-mysql-prefix=PFX Prefix where MYSQL is installed (optional)],
12 mysql_prefix="$withval", mysql_prefix="")
13 AC_ARG_WITH(mysql-exec-prefix,[ --with-mysql-exec-prefix=PFX Exec prefix where MYSQL is installed (optional)],
14 mysql_exec_prefix="$withval", mysql_exec_prefix="")
16 if test x$mysql_exec_prefix != x ; then
17 mysql_args="$mysql_args --exec-prefix=$mysql_exec_prefix"
18 if test x${MYSQL_CONFIG+set} != xset ; then
19 MYSQL_CONFIG=$mysql_exec_prefix/bin/mysql_config
22 if test x$mysql_prefix != x ; then
23 mysql_args="$mysql_args --prefix=$mysql_prefix"
24 if test x${MYSQL_CONFIG+set} != xset ; then
25 MYSQL_CONFIG=$mysql_prefix/bin/mysql_config
29 AC_REQUIRE([AC_CANONICAL_TARGET])
30 AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
31 AC_MSG_CHECKING(for MYSQL)
33 if test "$MYSQL_CONFIG" = "no" ; then
37 ifelse([$2], , :, [$2])
39 MYSQL_CFLAGS=`$MYSQL_CONFIG $mysqlconf_args --cflags | sed -e "s/'//g"`
40 MYSQL_LIBS=`$MYSQL_CONFIG $mysqlconf_args --libs | sed -e "s/'//g"`
42 ifelse([$1], , :, [$1])
44 AC_SUBST(MYSQL_CFLAGS)