~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2008-11-26 16:31:46 UTC
  • mfrom: (612.2.10 devel)
  • Revision ID: brian@tangent.org-20081126163146-nptzh53wd333f620
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
301
301
DRIZZLE_CHECK_C_VERSION
302
302
DRIZZLE_CHECK_CXX_VERSION
303
303
 
304
 
AH_TOP([
305
 
#ifdef _FILE_OFFSET_BITS
306
 
# undef _FILE_OFFSET_BITS
307
 
#endif
308
 
])
309
304
AC_SYS_LARGEFILE
310
305
 
311
306
AC_PROG_AWK
522
517
  PROTO_PATH="${withval}/bin:$PATH"
523
518
fi 
524
519
 
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"
527
522
then
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)])
610
605
 
611
606
#--------------------------------------------------------------------
612
 
# Check for tcmalloc
 
607
# Check for tcmalloc/mtmalloc
613
608
#--------------------------------------------------------------------
614
609
 
615
610
AC_ARG_ENABLE([tcmalloc],
618
613
    [ac_enable_tcmalloc="$enableval"],
619
614
    [ac_enable_tcmalloc="no"])
620
615
 
621
 
if test "x$ac_enable_tcmalloc" = "xyes"
 
616
if test "x$ac_enable_tcmalloc" != "xno"
622
617
then
623
618
  AC_CHECK_LIB(tcmalloc,malloc,[],[])
624
619
fi
625
620
 
 
621
if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes"
 
622
then
 
623
  AC_CHECK_LIB(mtmalloc,malloc,[],[])
 
624
fi
 
625
 
626
626
#--------------------------------------------------------------------
627
627
# Check for libz
628
628
#--------------------------------------------------------------------
630
630
SEARCH_FOR_LIB(z, crc32, zlib.h, 
631
631
               AC_MSG_ERROR([libz is required for Drizzle]))
632
632
 
 
633
#--------------------------------------------------------------------
 
634
# Check for libncurses
 
635
#--------------------------------------------------------------------
 
636
 
 
637
 
 
638
SEARCH_FOR_LIB(ncurses, tgetent, ncurses/ncurses.h, AC_MSG_ERROR(Couldn't find ncurses)) 
633
639
 
634
640
#--------------------------------------------------------------------
635
641
# Check for libreadline or compatible (libedit on Mac OS X)
636
642
#--------------------------------------------------------------------
637
643
 
638
 
AC_CHECK_HEADERS(readline/history.h readline/readline.h)
639
 
if test "x$ac_cv_header_readline_readline_h" != "xyes"
640
 
then
641
 
  AC_MSG_ERROR([Couldn't find readline/readline.h. Try installing readline development packages.])
642
 
fi
 
644
 
 
645
SEARCH_FOR_LIB(readline, rl_initialize, readline/readline.h,
 
646
               AC_MSG_ERROR([libreadline is required for Drizzle]),
 
647
               [$NCURSES_LIBS]) 
 
648
 
 
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>
654
663
]])
655
664
 
656
665
DRIZZLE_CHECK_NEW_RL_INTERFACE
657
 
 
658
 
my_save_LIBS="$LIBS"
659
 
LIBS=""
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"
665
 
LIBS="$my_save_LIBS"
666
 
AC_SUBST(READLINE_LIBS)
 
666
CPPFLAGS="$save_CPPFLAGS"
667
667
 
668
668
 
669
669
#--------------------------------------------------------------------
670
670
# Check for libpcre
671
671
#--------------------------------------------------------------------
672
672
 
673
 
AC_LANG_PUSH([C++])
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"])
676
675
 
677
676
if test "$found_pcre" = "no"
678
677
then
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" 
683
 
  then
684
 
    AC_MSG_ERROR([Couldn't find pcrecpp.h. Try installing the development package associated with libpcre on your system.])
685
 
  else
686
 
    # Found headers, now see if we can link
687
 
    AC_MSG_CHECKING(for libpcrecpp)
688
 
    save_LDFLAGS="$LDFLAGS"
689
 
    LDFLAGS="-lpcrecpp -lpcre"
690
 
    AC_TRY_LINK([
691
 
#include <pcrecpp.h>
692
 
    ],
693
 
    [pcrecpp::RE_Options opt;],
694
 
    [found_pcre="yes"],
695
 
    [AC_MSG_ERROR([Couldn't link libpcrecpp])])
696
 
 
697
 
    PCRE_LIBS="$LDFLAGS"
698
 
    LDFLAGS="$save_LDFLAGS"
699
 
    AC_MSG_RESULT([yes])
700
 
  fi
 
678
  SEARCH_FOR_LIB(pcre, pcre_compile, pcre.h, 
 
679
                 AC_MSG_ERROR([libpcre is required for Drizzle]))
701
680
fi
702
 
AC_LANG_POP([])
 
681
AM_CONDITIONAL([HAVE_PCRE],[test "$ac_cv_have_pcre" = "yes"])
703
682
AC_SUBST(PCRE_LIBS)
704
683
AC_SUBST(PCRE_CFLAGS)
705
684