~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

Merged build changes from Antony.

Show diffs side-by-side

added added

removed removed

Lines of Context:
296
296
# Check for libevent
297
297
#--------------------------------------------------------------------
298
298
 
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 ])
 
305
 
 
306
if test "$withval" = "yes"
301
307
then
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"
 
310
    then
 
311
      AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
 
312
    fi
 
313
    my_save_LIBS="$LIBS"
 
314
    LIBS=""
 
315
    AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
 
316
    LIBEVENT_LIBS="${LIBS}"
 
317
    LIBS="${my_save_LIBS}"
 
318
    LIBEVENT_CFLAGS=""
 
319
else
 
320
    AC_MSG_RESULT($withval)
 
321
    if test -f $withval/event.h -a -f $withval/libevent.a; then
 
322
       owd=`pwd`
 
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
 
327
       owd=`pwd`
 
328
       if cd $withval; then withval=`pwd`; cd $owd; fi
 
329
       LIBEVENT_CFLAGS="-I$withval/include"
 
330
       LIBEVENT_LIBS="-L$withval/lib -levent"
 
331
    else
 
332
       AC_ERROR(event.h or libevent.a not found in $withval)
 
333
    fi
303
334
fi
304
 
my_save_LIBS="$LIBS"
305
 
LIBS=""
306
 
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
307
 
LIBEVENT_LIBS="${LIBS}"
308
 
LIBS="${my_save_LIBS}"
 
335
 
 
336
AC_SUBST(LIBEVENT_CFLAGS)
309
337
AC_SUBST(LIBEVENT_LIBS)
310
338
 
 
339
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
 
340
  save_CFLAGS="$CFLAGS"
 
341
  save_LIBS="$LIBS"
 
342
  CFLAGS="$LIBEVENT_CFLAGS"
 
343
  LIBS="$LIBEVENT_LIBS"
 
344
  AC_TRY_LINK([
 
345
#include <sys/types.h>
 
346
#include <sys/time.h>
 
347
#include <stdlib.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/])
 
354
  ])
 
355
 
 
356
  CFLAGS="$save_CFLAGS"
 
357
  LIBS="$save_LIBS"
 
358
])
 
359
 
 
360
 
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"])
331
381
 
332
 
if test "x$ac_warn_strict_aliasing" = "xyes"
 
382
if test "x$ac_enable_tcmalloc" = "xyes"
333
383
then
334
384
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
335
385
fi
355
405
# Check for libreadline or compatible (libedit on Mac OS X)
356
406
#--------------------------------------------------------------------
357
407
 
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"
360
410
then
361
411
  AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
362
412
fi
 
413
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
 
414
#ifdef HAVE_READLINE_HISTORY_H
 
415
#include <readline/history.h>
 
416
#endif
 
417
#include <readline/readline.h>
 
418
]])
 
419
AC_CHECK_DECLS([completion_matches], [], [], [AC_INCLUDES_DEFAULT[
 
420
#ifdef HAVE_READLINE_HISTORY_H
 
421
#include <readline/history.h>
 
422
#endif
 
423
#include <readline/readline.h>
 
424
]])
363
425
 
364
426
MYSQL_CHECK_NEW_RL_INTERFACE
365
427
 
373
435
LIBS="$my_save_LIBS"
374
436
AC_SUBST(READLINE_LIBS)
375
437
 
376
 
 
377
438
#--------------------------------------------------------------------
378
439
# Check for libpcre
379
440
#--------------------------------------------------------------------
390
451
  else
391
452
    found_pcre="yes"
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`"
394
456
  fi
395
457
  ])
396
458
if test "x$found_pcre" != "xyes"
892
954
 
893
955
MYSQL_PTHREAD_YIELD
894
956
 
895
 
######################################################################
896
 
# For readline/libedit (We simply move the mimimum amount of stuff from
897
 
# the readline/libedit configure.in here)
898
957
 
899
958
dnl Checks for header files.
900
959
AC_CHECK_HEADERS(malloc.h sys/cdefs.h)