diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 52 |
1 files changed, 12 insertions, 40 deletions
diff --git a/configure.in b/configure.in index 81033a0..a53ef4f 100644 --- a/configure.in +++ b/configure.in | |||
@@ -241,46 +241,18 @@ fi | |||
241 | LIBS="$_SAVEDLIBS" | 241 | LIBS="$_SAVEDLIBS" |
242 | 242 | ||
243 | dnl Check for mysql libraries | 243 | dnl Check for mysql libraries |
244 | dnl Default is to search path for mysql_config | 244 | np_mysqlclient |
245 | AC_ARG_WITH(mysql, | 245 | if test $with_mysql = "no" ; then |
246 | ACX_HELP_STRING([--with-mysql=DIR], | 246 | AC_MSG_WARN([Skipping mysql plugin]) |
247 | [Compiles mysql plugins. Expects DIR/bin/mysql_config]), | 247 | AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).]) |
248 | with_mysql=$withval, | 248 | else |
249 | with_mysql=yes) | 249 | EXTRAS="$EXTRA check_mysql check_mysql_query" |
250 | if test $with_mysql != "no" ; then | 250 | MYSQLINCLUDE="$np_mysql_include" |
251 | if test -x $with_mysql/bin/mysql_config ; then | 251 | MYSQLLIBS="$np_mysql_libs" |
252 | MYSQLCONFIG="$with_mysql/bin/mysql_config" | 252 | MYSQLCFLAGS="$np_mysql_cflags" |
253 | else | 253 | AC_SUBST(MYSQLINCLUDE) |
254 | AC_PATH_PROG(MYSQLCONFIG, mysql_config) | 254 | AC_SUBST(MYSQLLIBS) |
255 | fi | 255 | AC_SUBST(MYSQLCFLAGS) |
256 | if test -z "$MYSQLCONFIG"; then | ||
257 | with_mysql="not found" | ||
258 | AC_MSG_WARN([Skipping mysql plugin]) | ||
259 | AC_MSG_WARN([install mysql client libs to compile this plugin (see REQUIREMENTS).]) | ||
260 | else | ||
261 | MYSQLINCLUDE=`$MYSQLCONFIG --include` | ||
262 | # Mysql 3 does not support --include. --cflags should be sufficient | ||
263 | if test $? -ne 0 ; then | ||
264 | MYSQLINCLUDE="" | ||
265 | TEMP_INCLUDE="-I$with_mysql/include" # Guessed location | ||
266 | else | ||
267 | TEMP_INCLUDE=$MYSQLINCLUDE | ||
268 | fi | ||
269 | MYSQLLIBS=`$MYSQLCONFIG --libs` | ||
270 | MYSQLCFLAGS=`$MYSQLCONFIG --cflags` | ||
271 | AC_SUBST(MYSQLINCLUDE) | ||
272 | AC_SUBST(MYSQLLIBS) | ||
273 | AC_SUBST(MYSQLCFLAGS) | ||
274 | dnl Test for mysqlclient. Some redhat systems have mysql_config, but no headers | ||
275 | _SAVEDCPPFLAGS=$CPPFLAGS | ||
276 | _SAVEDLDFLAGS="$LDFLAGS" | ||
277 | CPPFLAGS="$CPPFLAGS $TEMP_INCLUDE" | ||
278 | LDFLAGS="$LDFLAGS $MYSQLLIBS" | ||
279 | AC_CHECK_LIB([mysqlclient], [mysql_init], [with_mysql=$MYSQLCONFIG | ||
280 | EXTRAS="$EXTRA check_mysql check_mysql_query"], [with_mysql="not found"]) | ||
281 | CPPFLAGS=$_SAVEDCPPFLAGS | ||
282 | LDFLAGS=$_SAVEDLDFLAGS | ||
283 | fi | ||
284 | fi | 256 | fi |
285 | 257 | ||
286 | dnl Check for AF_INET6 support - unistd.h required for Darwin | 258 | dnl Check for AF_INET6 support - unistd.h required for Darwin |