522
517
PROTO_PATH="${withval}/bin:$PATH"
525
AC_CHECK_TOOL([PROTOC],[protoc],[no],[$PROTO_PATH])
520
AC_PATH_PROG([PROTOC],[protoc],[no],[$PROTO_PATH])
526
521
if test "x$PROTOC" = "xno"
528
523
AC_MSG_ERROR([Couldn't find protoc. Try installing Google Protocol Buffer.])
609
604
AC_CHECK_LIB(pthread, pthread_create, [], [AC_MSG_ERROR(could not find libpthread)])
611
606
#--------------------------------------------------------------------
607
# Check for tcmalloc/mtmalloc
613
608
#--------------------------------------------------------------------
615
610
AC_ARG_ENABLE([tcmalloc],
618
613
[ac_enable_tcmalloc="$enableval"],
619
614
[ac_enable_tcmalloc="no"])
621
if test "x$ac_enable_tcmalloc" = "xyes"
616
if test "x$ac_enable_tcmalloc" != "xno"
623
618
AC_CHECK_LIB(tcmalloc,malloc,[],[])
621
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
623
AC_CHECK_LIB(mtmalloc,malloc,[],[])
626
626
#--------------------------------------------------------------------
628
628
#--------------------------------------------------------------------
630
630
SEARCH_FOR_LIB(z, crc32, zlib.h,
631
631
AC_MSG_ERROR([libz is required for Drizzle]))
633
#--------------------------------------------------------------------
634
# Check for libncurses
635
#--------------------------------------------------------------------
638
SEARCH_FOR_LIB(ncurses, tgetent, ncurses/ncurses.h, AC_MSG_ERROR(Couldn't find ncurses))
634
640
#--------------------------------------------------------------------
635
641
# Check for libreadline or compatible (libedit on Mac OS X)
636
642
#--------------------------------------------------------------------
638
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
639
if test "x$ac_cv_header_readline_readline_h" != "xyes"
641
AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
645
SEARCH_FOR_LIB(readline, rl_initialize, readline/readline.h,
646
AC_MSG_ERROR([libreadline is required for Drizzle]),
649
save_CPPFLAGS="$CPPFLAGS"
650
CPPFLAGS="$CPPFLAGS $READLINE_CPPFLAGS"
651
AC_CHECK_HEADERS(readline/history.h)
643
652
AC_CHECK_TYPES([HIST_ENTRY], [], [], [AC_INCLUDES_DEFAULT[
644
653
#ifdef HAVE_READLINE_HISTORY_H
645
654
#include <readline/history.h>
656
665
DRIZZLE_CHECK_NEW_RL_INTERFACE
660
AC_CHECK_LIB(readline, rl_initialize, [],
661
[AC_CHECK_LIB(ncurses, tgetent, [], [AC_MSG_ERROR(Couldn't find ncurses)])
662
AC_SEARCH_LIBS(rl_initialize, readline, [],
663
[AC_MSG_ERROR(Couldn't find libreadline.)])])
664
READLINE_LIBS="$LIBS"
666
AC_SUBST(READLINE_LIBS)
666
CPPFLAGS="$save_CPPFLAGS"
669
669
#--------------------------------------------------------------------
670
670
# Check for libpcre
671
671
#--------------------------------------------------------------------
674
673
AC_PATH_PROG(PKG_CONFIG, pkg-config, AC_MSG_ERROR([pkg-config wasn't found.]))
675
PKG_CHECK_MODULES(PCRE, [libpcrecpp >= 3], [found_pcre="yes"],[found_pcre="no"])
674
PKG_CHECK_MODULES(PCRE, [libpcre >= 3], [found_pcre="yes"],[found_pcre="no"])
677
676
if test "$found_pcre" = "no"
679
dnl Only check the header here, because autoconf can't handle
680
dnl checking for C++ methods without C linkages
681
AC_CHECK_HEADERS(pcrecpp.h)
682
if test "x$ac_cv_header_pcrecpp_h" != "xyes"
684
AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
686
# Found headers, now see if we can link
687
AC_MSG_CHECKING(for libpcrecpp)
688
save_LDFLAGS="$LDFLAGS"
689
LDFLAGS="-lpcrecpp -lpcre"
693
[pcrecpp::RE_Options opt;],
695
[AC_MSG_ERROR([Couldn't link libpcrecpp])])
698
LDFLAGS="$save_LDFLAGS"
678
SEARCH_FOR_LIB(pcre, pcre_compile, pcre.h,
679
AC_MSG_ERROR([libpcre is required for Drizzle]))
681
AM_CONDITIONAL([HAVE_PCRE],[test "$ac_cv_have_pcre" = "yes"])
703
682
AC_SUBST(PCRE_LIBS)
704
683
AC_SUBST(PCRE_CFLAGS)