296
296
# Check for libevent
297
297
#--------------------------------------------------------------------
299
AC_CHECK_HEADERS(event.h)
300
if test "x$ac_cv_header_event_h" != "xyes"
299
AC_MSG_CHECKING(for libevent)
300
AC_ARG_WITH(libevent,
301
[AS_HELP_STRING([--with-libevent],
302
[Use libevent build directory]),
303
[ with_libevent=$withval ],
304
[ with_libevent=yes ])
306
if test "$withval" = "yes"
302
AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
308
AC_CHECK_HEADERS(event.h)
309
if test "x$ac_cv_header_event_h" != "xyes"
311
AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
315
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
316
LIBEVENT_LIBS="${LIBS}"
317
LIBS="${my_save_LIBS}"
320
AC_MSG_RESULT($withval)
321
if test -f $withval/event.h -a -f $withval/libevent.a; then
323
if cd $withval; then withval=`pwd`; cd $owd; fi
324
LIBEVENT_CFLAGS="-I$withval"
325
LIBEVENT_LIBS="-L$withval -levent"
326
elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
328
if cd $withval; then withval=`pwd`; cd $owd; fi
329
LIBEVENT_CFLAGS="-I$withval/include"
330
LIBEVENT_LIBS="-L$withval/lib -levent"
332
AC_ERROR(event.h or libevent.a not found in $withval)
306
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
307
LIBEVENT_LIBS="${LIBS}"
308
LIBS="${my_save_LIBS}"
336
AC_SUBST(LIBEVENT_CFLAGS)
309
337
AC_SUBST(LIBEVENT_LIBS)
339
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
340
save_CFLAGS="$CFLAGS"
342
CFLAGS="$LIBEVENT_CFLAGS"
343
LIBS="$LIBEVENT_LIBS"
345
#include <sys/types.h>
346
#include <sys/time.h>
348
#include <event.h>],[
349
struct bufferevent bev;
350
bufferevent_settimeout(&bev, 1, 1);
351
], ac_libevent_works=yes, [
352
AC_ERROR([you need to install a more recent version of libevent,
353
check http://www.monkey.org/~provos/libevent/])
356
CFLAGS="$save_CFLAGS"
311
361
#--------------------------------------------------------------------
312
362
# Check for libpthread
313
363
#--------------------------------------------------------------------
326
376
AC_ARG_ENABLE([tcmalloc],
327
377
[AS_HELP_STRING([--enable-tcmalloc],
328
378
[Enable linking with tcmalloc @<:@default=off@:>@])],
329
[ac_warn_strict_aliasing="$enableval"],
330
[ac_warn_strict_aliasing="no"])
379
[ac_enable_tcmalloc="$enableval"],
380
[ac_enable_tcmalloc="no"])
332
if test "x$ac_warn_strict_aliasing" = "xyes"
382
if test "x$ac_enable_tcmalloc" = "xyes"
334
384
AC_CHECK_LIB(tcmalloc,malloc,[],[])
355
405
# Check for libreadline or compatible (libedit on Mac OS X)
356
406
#--------------------------------------------------------------------
358
AC_CHECK_HEADERS([readline/readline.h])
408
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
359
409
if test "x$ac_cv_header_readline_readline_h" != "xyes"
361
411
AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
413
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
414
#ifdef HAVE_READLINE_HISTORY_H
415
#include <readline/history.h>
417
#include <readline/readline.h>
419
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
420
#ifdef HAVE_READLINE_HISTORY_H
421
#include <readline/history.h>
423
#include <readline/readline.h>
364
426
MYSQL_CHECK_NEW_RL_INTERFACE
392
453
# We can't search for these well, but we sure do need them!
393
PCRE_LIBS="-lpcrecpp -lpcre"
454
PCRE_CFLAGS="`$PKG_CONFIG libpcrecpp --cflags`"
455
PCRE_LIBS="`$PKG_CONFIG libpcrecpp --libs`"
396
458
if test "x$found_pcre" != "xyes"
893
955
MYSQL_PTHREAD_YIELD
895
######################################################################
896
# For readline/libedit (We simply move the mimimum amount of stuff from
897
# the readline/libedit configure.in here)
899
958
dnl Checks for header files.
900
959
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)