367
367
AC_SUBST(LD_VERSION_SCRIPT)
370
echo "CFLAGS = $CFLAGS"
371
echo "CPPFLAGS = $CPPFLAGS"
369
373
#--------------------------------------------------------------------
370
374
# Check for Google Proto Buffers
371
375
#--------------------------------------------------------------------
373
377
AC_LANG_PUSH([C++])
374
SEARCH_FOR_LIB(protobuf, printf, google/protobuf/message.h,
375
AC_MSG_ERROR([protobuf is required for Drizzle]))
378
AC_LIB_HAVE_LINKFLAGS(protobuf,,
379
[#include <google/protobuf/descriptor.h>
380
#if GOOGLE_PROTOBUF_VERSION < 2000002
381
# error Your version of Protobuf is too old
384
[google::protobuf::FileDescriptor* file;])
385
AS_IF([test x$ac_cv_libprotobuf = xno],
386
AC_MSG_ERROR([protobuf is required for Drizzle]))
377
AC_PATH_PROG([PROTOC],[protoc],[no],[$PROTOBUF_PATH])
388
AC_PATH_PROG([PROTOC],[protoc],[no],[$LIBPROTOBUF_PREFIX/bin:$PATH])
378
389
if test "x$PROTOC" = "xno"
380
391
AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
386
397
# Check for libuuid
387
398
#--------------------------------------------------------------------
389
dnl Do this by hand instead of with SEARCH_FOR_LIB, because uuid is weird.
400
dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
401
dnl not be a lib is weird.
390
403
AC_CHECK_HEADERS(uuid/uuid.h)
391
404
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
398
411
# Check for libevent
399
412
#--------------------------------------------------------------------
401
SEARCH_FOR_LIB(event, event_loop, event.h,
402
AC_MSG_ERROR([libevent is required for Drizzle]))
405
AC_CACHE_CHECK([for bufferevent in libevent], ac_cv_libevent_works, [
406
save_CPPFLAGS="$CPPFLAGS"
408
CPPFLAGS="$EVENT_CFLAGS"
414
AC_LIB_HAVE_LINKFLAGS(event,,
411
416
#include <sys/types.h>
412
417
#include <sys/time.h>
413
418
#include <stdlib.h>
414
#include <event.h>],[
415
struct bufferevent bev;
416
bufferevent_settimeout(&bev, 1, 1);
417
], ac_cv_libevent_works=yes, [
418
AC_MSG_ERROR([you need to install a more recent version of libevent,
419
check http://www.monkey.org/~provos/libevent/])
421
struct bufferevent bev;
422
bufferevent_settimeout(&bev, 1, 1);
424
event_loop(EVLOOP_ONCE);
426
AS_IF([test x$ac_cv_libevent = xno],
427
AC_MSG_ERROR([A recent libevent is required for Drizzle. Check http://www.monkey.org/~provos/libevent ]))
422
CPPFLAGS="$save_CPPFLAGS"
427
431
#--------------------------------------------------------------------
428
432
# Check for libpthread
429
433
#--------------------------------------------------------------------
431
AC_CHECK_HEADERS(pthread.h)
432
if test "x$ac_cv_header_pthread_h" != "xyes"
434
AC_MSG_ERROR([Couldn't find pthread.h.])
436
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
435
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
436
LIBS="$PTHREAD_LIBS $LIBS"
437
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
438
440
#--------------------------------------------------------------------
439
441
# Check for tcmalloc/mtmalloc
455
457
AC_CHECK_LIB(mtmalloc,malloc,[],[])
458
461
#--------------------------------------------------------------------
460
463
#--------------------------------------------------------------------
462
SEARCH_FOR_LIB(z, crc32, zlib.h,
463
AC_MSG_ERROR([libz is required for Drizzle]))
465
AC_LIB_HAVE_LINKFLAGS(z,,
470
AS_IF([test x$ac_cv_libz = xno],
471
AC_MSG_ERROR([libz is required for Drizzle]))
465
473
#--------------------------------------------------------------------
466
474
# Check for libreadline or compatible (libedit on Mac OS X)