aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2009-09-23 12:45:03 +0200
committerMartin Willi <martin@strongswan.org>2009-09-23 12:45:03 +0200
commit840743479a77359d841a20a04e6cb6d6d05eb264 (patch)
tree8c8b0e9aad94b7243fc825b0db978afd6b9e55ee
parent0406ed7a166e732f1b237ecf6198922825f027a7 (diff)
downloadstrongswan-840743479a77359d841a20a04e6cb6d6d05eb264.tar.bz2
strongswan-840743479a77359d841a20a04e6cb6d6d05eb264.tar.xz
Use mysql_config to query MySQL LIBS and CFLAGS
-rw-r--r--configure.in8
-rw-r--r--src/libstrongswan/plugins/mysql/Makefile.am4
-rw-r--r--src/libstrongswan/plugins/mysql/mysql_database.c2
3 files changed, 9 insertions, 5 deletions
diff --git a/configure.in b/configure.in
index 2b0f9a81b..8b4d6a428 100644
--- a/configure.in
+++ b/configure.in
@@ -445,8 +445,12 @@ dnl AC_CHECK_HEADER([ClearSilver/ClearSilver.h],,[AC_MSG_ERROR([ClearSilver head
fi
if test x$mysql = xtrue; then
- AC_HAVE_LIBRARY([mysqlclient_r],[LIBS="$LIBS"],[AC_MSG_ERROR([MySQL library mysqlclient_r not found])])
- AC_CHECK_HEADER([mysql/mysql.h],,[AC_MSG_ERROR([MySQL header mysql/mysql.h not found!])])
+ AC_PATH_PROG([MYSQLCONFIG], [mysql_config], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
+ if test x$MYSQLCONFIG = x; then
+ AC_MSG_ERROR([mysql_config not found!])
+ fi
+ AC_SUBST(MYSQLLIB, `$MYSQLCONFIG --libs_r`)
+ AC_SUBST(MYSQLCFLAG, `$MYSQLCONFIG --cflags`)
fi
if test x$sqlite = xtrue; then
diff --git a/src/libstrongswan/plugins/mysql/Makefile.am b/src/libstrongswan/plugins/mysql/Makefile.am
index 0daf7655b..c64481fd5 100644
--- a/src/libstrongswan/plugins/mysql/Makefile.am
+++ b/src/libstrongswan/plugins/mysql/Makefile.am
@@ -1,12 +1,12 @@
INCLUDES = -I$(top_srcdir)/src/libstrongswan
-AM_CFLAGS = -rdynamic
+AM_CFLAGS = -rdynamic $(MYSQLCFLAG)
plugin_LTLIBRARIES = libstrongswan-mysql.la
libstrongswan_mysql_la_SOURCES = mysql_plugin.h mysql_plugin.c \
mysql_database.h mysql_database.c
libstrongswan_mysql_la_LDFLAGS = -module -avoid-version
-libstrongswan_mysql_la_LIBADD = -lmysqlclient_r
+libstrongswan_mysql_la_LIBADD = $(MYSQLLIB)
diff --git a/src/libstrongswan/plugins/mysql/mysql_database.c b/src/libstrongswan/plugins/mysql/mysql_database.c
index 88f2b4aee..9775a8685 100644
--- a/src/libstrongswan/plugins/mysql/mysql_database.c
+++ b/src/libstrongswan/plugins/mysql/mysql_database.c
@@ -16,7 +16,7 @@
#define _GNU_SOURCE
#include <string.h>
#include <pthread.h>
-#include <mysql/mysql.h>
+#include <mysql.h>
#include "mysql_database.h"