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
|
--- nagios-plugins-1.4.2/configure.in 2005-09-19 23:51:19.000000000 +1000
+++ nagios-plugins-1.4.2.new/configure.in 2005-11-17 15:36:08.000000000 +1100
@@ -227,45 +227,27 @@
dnl Check for mysql libraries
_SAVEDLIBS="$LIBS"
_SAVEDCPPFLAGS="$CPPFLAGS"
-AC_ARG_WITH(mysql,
- ACX_HELP_STRING([--with-mysql=DIR],
- [sets path to mysql installation (assumes lib/mysql and include subdirs]),
- MYSQL=$withval,)
-if test -n "$MYSQL"; then
- MYSQLLIBDIR=$MYSQL/lib/mysql
- CPPFLAGS="-I$MYSQL/include"
- AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L$MYSQLLIBDIR ",,-L$MYSQLLIBDIR -lz)
- AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
-elif test -f /usr/lib/libmysqlclient.so; then
- AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
- AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
-elif test -f /usr/lib/libmysqlclient.a; then
- AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz",,-lz)
- AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient")
-elif test -f /usr/lib/mysql/libmysqlclient.so; then
- AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
- AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
-elif test -f /usr/lib/mysql/libmysqlclient.a; then
- AC_CHECK_LIB(mysqlclient,mysql_init,MYSQLLIBS="-lmysqlclient -lz" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql -lz)
- AC_CHECK_LIB(mysqlclient,mysql_close,MYSQLLIBS="-lmysqlclient" check_mysql_LDFLAGS="-L/usr/lib/mysql",,-L/usr/lib/mysql)
-fi
-if test "$ac_cv_lib_mysqlclient_mysql_init" = "yes" -o "$ac_cv_lib_mysqlclient_mysql_close" = "yes"; then
- AC_CHECK_HEADERS(mysql/mysql.h mysql/errmsg.h, MYSQLINCLUDE="-I$MYSQL/include" )
- if test "$ac_cv_header_mysql_mysql_h" = "yes" -a "$ac_cv_header_mysql_errmsg_h" = "yes"; then
- EXTRAS="$EXTRAS check_mysql"
- AC_SUBST(MYSQLINCLUDE)
- AC_SUBST(MYSQLLIBS)
- AC_SUBST(check_mysql_LDFLAGS)
- else
+
+AC_PATH_PROG(MYSQLCONFIG,mysql_config)
+
+if test -z "$MYSQLCONFIG"; then
AC_MSG_WARN([Skipping mysql plugin])
AC_MSG_WARN([install mysql client headers to compile this plugin (see REQUIREMENTS).])
- fi
-else
- AC_MSG_WARN([Skipping mysql plugin])
- AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).])
+else
+ MYSQLINCLUDE=`$MYSQLCONFIG --include`
+ MYSQLCFLAGS=`$MYSQLCONFIG --cflags`
+ MYSQLLIBS=`$MYSQLCONFIG --libs`
+ check_mysql_LDFLAGS="$MYSQLLIBS"
+ EXTRAS="$EXTRAS check_mysql"
+
+ AC_SUBST(MYSQLINCLUDE)
+ AC_SUBST(MYSQLLIBS)
+ AC_SUBST(MYSQLCFLAGS)
+ AC_SUBST(check_mysql_LDFLAGS)
fi
-CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLINCLUDE"
-LIBS="$_SAVEDLIBS"
+
+CPPFLAGS="$_SAVEDCPPFLAGS $MYSQLCFLAGS"
+LIBS="$_SAVEDLIBS"
AC_CHECK_HEADERS(unistd.h)
|