Use mysql_config to query MySQL LIBS and CFLAGS
This commit is contained in:
+6
-2
@@ -445,8 +445,12 @@ dnl AC_CHECK_HEADER([ClearSilver/ClearSilver.h],,[AC_MSG_ERROR([ClearSilver head
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$mysql = xtrue; then
|
if test x$mysql = xtrue; then
|
||||||
AC_HAVE_LIBRARY([mysqlclient_r],[LIBS="$LIBS"],[AC_MSG_ERROR([MySQL library mysqlclient_r not found])])
|
AC_PATH_PROG([MYSQLCONFIG], [mysql_config], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
|
||||||
AC_CHECK_HEADER([mysql/mysql.h],,[AC_MSG_ERROR([MySQL header mysql/mysql.h not found!])])
|
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
|
fi
|
||||||
|
|
||||||
if test x$sqlite = xtrue; then
|
if test x$sqlite = xtrue; then
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
INCLUDES = -I$(top_srcdir)/src/libstrongswan
|
INCLUDES = -I$(top_srcdir)/src/libstrongswan
|
||||||
|
|
||||||
AM_CFLAGS = -rdynamic
|
AM_CFLAGS = -rdynamic $(MYSQLCFLAG)
|
||||||
|
|
||||||
plugin_LTLIBRARIES = libstrongswan-mysql.la
|
plugin_LTLIBRARIES = libstrongswan-mysql.la
|
||||||
|
|
||||||
libstrongswan_mysql_la_SOURCES = mysql_plugin.h mysql_plugin.c \
|
libstrongswan_mysql_la_SOURCES = mysql_plugin.h mysql_plugin.c \
|
||||||
mysql_database.h mysql_database.c
|
mysql_database.h mysql_database.c
|
||||||
libstrongswan_mysql_la_LDFLAGS = -module -avoid-version
|
libstrongswan_mysql_la_LDFLAGS = -module -avoid-version
|
||||||
libstrongswan_mysql_la_LIBADD = -lmysqlclient_r
|
libstrongswan_mysql_la_LIBADD = $(MYSQLLIB)
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <mysql/mysql.h>
|
#include <mysql.h>
|
||||||
|
|
||||||
#include "mysql_database.h"
|
#include "mysql_database.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user