365
365
AC_CHECK_PROGS(GROUPADD, groupadd addgroup)
366
366
AC_CHECK_PROGS(USERADD, useradd adduser)
368
# Not critical since the generated file is distributed
369
AC_CHECK_PROGS(YACC, ['bison -y -p DRIZZLE'])
368
dnl Needed for ltmain
371
dnl Not critical since the generated file is distributed
370
373
if test -z "$YACC" && test -d ".bzr"
372
375
AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
549
565
# Check for libuuid
550
566
#--------------------------------------------------------------------
552
AC_CHECK_HEADERS(uuid/uuid.h)
553
if test "x$ac_cv_header_uuid_uuid_h" = "xno"
555
AC_MSG_ERROR([Couldn't find uuid/uuid.h. Try installing libuuid development packages])
557
AC_CHECK_LIB(uuid, uuid_generate)
568
SEARCH_FOR_LIB(uuid, uuid_generate, uuid/uuid.h,
569
AC_MSG_ERROR([libuuid is required for Drizzle]))
559
572
#--------------------------------------------------------------------
560
573
# Check for libevent
561
574
#--------------------------------------------------------------------
563
AC_ARG_WITH(libevent,
564
[AS_HELP_STRING([--with-libevent@<:@=DIR@:>@],
565
[Use libevent in DIR])],
566
[ with_libevent=$withval ],
567
[ with_libevent=yes ])
569
if test "$with_libevent" = "yes"
571
AC_CHECK_HEADERS(event.h)
572
if test "x$ac_cv_header_event_h" != "xyes"
574
AC_MSG_ERROR([Couldn't find event.h. Try installing libevent development packages])
578
AC_CHECK_LIB(event, event_loop, [], [AC_MSG_ERROR(could not find libevent)])
579
LIBEVENT_LIBS="${LIBS}"
580
LIBS="${my_save_LIBS}"
583
AC_MSG_CHECKING(for libevent in $withval)
584
if test -f $withval/event.h -a -f $withval/libevent.a; then
586
if cd $withval; then withval=`pwd`; cd $owd; fi
587
LIBEVENT_CPPFLAGS="-I$withval"
588
LIBEVENT_LIBS="-L$withval -levent"
589
elif test -f $withval/include/event.h -a -f $withval/lib/libevent.a; then
591
if cd $withval; then withval=`pwd`; cd $owd; fi
592
LIBEVENT_CPPFLAGS="-I$withval/include"
593
LIBEVENT_LIBS="-L$withval/lib -levent"
595
AC_MSG_ERROR([event.h or libevent.a not found in $withval])
599
AC_SUBST(LIBEVENT_CPPFLAGS)
600
AC_SUBST(LIBEVENT_LIBS)
602
AC_CACHE_CHECK([for bufferevent in libevent], ac_libevent_works, [
576
SEARCH_FOR_LIB(event, event_loop, event.h,
577
AC_MSG_ERROR([libevent is required for Drizzle]))
580
AC_CACHE_CHECK([for bufferevent in libevent], ac_cv_libevent_works, [
603
581
save_CPPFLAGS="$CPPFLAGS"
604
582
save_LIBS="$LIBS"
605
CPPFLAGS="$LIBEVENT_CPPFLAGS"
606
LIBS="$LIBEVENT_LIBS"
583
CPPFLAGS="$EVENT_CPPFLAGS"
608
586
#include <sys/types.h>
609
587
#include <sys/time.h>
611
589
#include <event.h>],[
612
590
struct bufferevent bev;
613
591
bufferevent_settimeout(&bev, 1, 1);
614
], ac_libevent_works=yes, [
615
AC_ERROR([you need to install a more recent version of libevent,
592
], ac_cv_libevent_works=yes, [
593
AC_MSG_ERROR([you need to install a more recent version of libevent,
616
594
check http://www.monkey.org/~provos/libevent/])
652
630
#--------------------------------------------------------------------
656
AC_CHECK_HEADERS(zlib.h)
657
if test "x$ac_cv_header_zlib_h" != "xyes"
659
AC_MSG_ERROR([Couldn't find zlib.h. Try installing zlib development packages])
661
AC_CHECK_LIB(z, crc32, [], [AC_MSG_ERROR(could not find libz)])
632
SEARCH_FOR_LIB(z, crc32, zlib.h,
633
AC_MSG_ERROR([libz is required for Drizzle]))
667
636
#--------------------------------------------------------------------