1 dnl Copyright (C) 2002 Ben Goodwin
2 dnl This file is part of the nss-mysql library.
4 dnl The nss-mysql library is free software; you can redistribute it and/or
5 dnl modify it under the terms of the GNU General Public License as published
6 dnl by the Free Software Foundation; either version 2 of the License, or
7 dnl (at your option) any later version.
9 dnl The nss-mysql library is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with the nss-mysql library; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 dnl $Id: acinclude.m4,v 1.10 2004/04/10 03:55:37 cinergi Exp $
20 AC_DEFUN([FIND_MYSQL],[
22 baselist="$with_mysql \
29 AC_MSG_CHECKING([for MySQL headers])
30 for f in $baselist; do
31 if test -f "$f/include/mysql/mysql.h"
33 MYSQL_INC_DIR="$f/include/mysql"
37 if test -f "$f/include/mysql.h"
39 MYSQL_INC_DIR="$f/include"
44 if test -n "$MYSQL_INC_DIR"
46 AC_MSG_RESULT([$MYSQL_INC_DIR])
47 CPPFLAGS="-I $MYSQL_INC_DIR $CPPFLAGS"
49 AC_MSG_ERROR([Cannot locate MySQL headers. Try using --with-mysql=DIR])
52 AC_MSG_CHECKING([for MySQL libraries])
53 dnl Check for share first, then static, such that static
54 dnl will take precedence
55 for f in $baselist; do
56 if test -f "$f/lib/libmysqlclient.so"
58 MYSQL_LIB_DIR="$f/lib"
62 if test -f "$f/lib/mysql/libmysqlclient.so"
64 MYSQL_LIB_DIR="$f/lib/mysql"
69 for f in $baselist; do
70 if test -f "$f/lib/libmysqlclient.a"
72 MYSQL_LIB_DIR="$f/lib"
76 if test -f "$f/lib/mysql/libmysqlclient.a"
78 MYSQL_LIB_DIR="$f/lib/mysql"
83 if test -n "$MYSQL_LIB_DIR"
85 AC_MSG_RESULT([$MYSQL_LIB_DIR])
86 LDFLAGS="-L$MYSQL_LIB_DIR $LDFLAGS"
88 AC_MSG_ERROR([Cannot locate MySQL libraries. Try using --with-mysql=DIR])