Use mysql_config to query MySQL LIBS and CFLAGS
[strongswan.git] / configure.in
index 2b0f9a8..8b4d6a4 100644 (file)
@@ -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