-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathacinclude.m4
91 lines (80 loc) · 2.29 KB
/
acinclude.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
80
81
82
83
84
85
86
87
88
89
90
91
dnl Copyright (C) 2002 Ben Goodwin
dnl This file is part of the nss-mysql library.
dnl
dnl The nss-mysql library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU General Public License as published
dnl by the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl The nss-mysql library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with the nss-mysql library; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
dnl $Id$
AC_DEFUN([FIND_MYSQL],[
baselist="$with_mysql \
/usr \
/usr/local \
/usr/local/mysql \
/opt/local \
/opt/local/mysql"
AC_MSG_CHECKING([for MySQL headers])
for f in $baselist; do
if test -f "$f/include/mysql/mysql.h"
then
MYSQL_INC_DIR="$f/include/mysql"
break
fi
if test -f "$f/include/mysql.h"
then
MYSQL_INC_DIR="$f/include"
break
fi
done
if test -n "$MYSQL_INC_DIR"
then
AC_MSG_RESULT([$MYSQL_INC_DIR])
CPPFLAGS="-I $MYSQL_INC_DIR $CPPFLAGS"
else
AC_MSG_ERROR([Cannot locate MySQL headers. Try using --with-mysql=DIR])
fi
AC_MSG_CHECKING([for MySQL libraries])
dnl Check for share first, then static, such that static
dnl will take precedence
for f in $baselist; do
if test -f "$f/lib/libmysqlclient.so"
then
MYSQL_LIB_DIR="$f/lib"
break
fi
if test -f "$f/lib/x86_64-linux-gnu/libmysqlclient.so"
then
MYSQL_LIB_DIR="$f/lib/mysql"
break
fi
done
for f in $baselist; do
if test -f "$f/lib/libmysqlclient.a"
then
MYSQL_LIB_DIR="$f/lib"
break
fi
if test -f "$f/lib/x86_64-linux-gnu/libmysqlclient.a"
then
MYSQL_LIB_DIR="$f/lib/mysql"
break
fi
done
if test -n "$MYSQL_LIB_DIR"
then
AC_MSG_RESULT([$MYSQL_LIB_DIR])
LDFLAGS="-L$MYSQL_LIB_DIR $LDFLAGS"
else
AC_MSG_ERROR([Cannot locate MySQL libraries. Try using --with-mysql=DIR])
fi
])