2004-06-24 21:10:31 +00:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
2007-06-25 15:47:28 +00:00
|
|
|
AC_PREREQ(2.59)
|
|
|
|
AC_INIT([Stasis],[0.1],[sears@cs.berkeley.edu])
|
|
|
|
AM_INIT_AUTOMAKE() #hello,0.1)
|
|
|
|
#AM_INIT_AUTOMAKE([subdir-objects]) # @todo use subdir-objects once transition to libtool is done.
|
2004-06-24 21:10:31 +00:00
|
|
|
AC_CONFIG_SRCDIR([config.h.in])
|
|
|
|
AC_CONFIG_HEADER([config.h])
|
|
|
|
|
2009-07-30 22:46:56 +00:00
|
|
|
AC_DEFINE([_GNU_SOURCE], [], [Use gnu extensions (needed for sync_data_range)])
|
|
|
|
|
2004-06-24 21:10:31 +00:00
|
|
|
# Checks for programs.
|
2007-04-21 05:56:35 +00:00
|
|
|
#AC_PROG_CXX
|
2004-06-24 21:10:31 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CPP
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
## Need AC_PROG_LIBTOOL
|
|
|
|
AC_PROG_LIBTOOL
|
2007-03-20 00:24:16 +00:00
|
|
|
AC_PROG_AWK
|
2005-03-02 05:46:29 +00:00
|
|
|
AC_PROG_RANLIB
|
2008-09-28 07:35:20 +00:00
|
|
|
AC_PROG_YACC
|
|
|
|
AC_PROG_LEX
|
2004-06-24 21:10:31 +00:00
|
|
|
# Checks for libraries.
|
|
|
|
|
2007-05-30 23:48:36 +00:00
|
|
|
# For SWIG & Python
|
|
|
|
# AC_PROG_LIBTOOL
|
|
|
|
AM_PATH_PYTHON(2.3)
|
|
|
|
AC_PROG_SWIG(1.3)
|
|
|
|
SWIG_ENABLE_CXX
|
|
|
|
SWIG_PYTHON
|
|
|
|
AM_CONDITIONAL(HAVE_SWIG, test x"$have_swig" = "xyes")
|
|
|
|
|
2004-06-28 21:10:10 +00:00
|
|
|
## alas, it won't link if this is put in here.. instead, it's linked in manually in the test directory...
|
|
|
|
|
|
|
|
#AC_ARG_ENABLE(efence,
|
|
|
|
#[ --enable-efence Use electric fence (www.perens.com)],
|
|
|
|
#[case "$enableval" in \
|
|
|
|
# yes) efence=yes ;; \
|
|
|
|
# no) efence=no;; \
|
|
|
|
# *) efence=no;; \
|
|
|
|
#esac], [efence=no])
|
|
|
|
#
|
|
|
|
#dnl Check for efence
|
|
|
|
#if test $efence = yes; then
|
|
|
|
#AC_CHECK_LIB(efence,memalign)
|
|
|
|
#fi
|
|
|
|
|
2005-03-12 22:11:18 +00:00
|
|
|
|
2005-01-20 22:55:54 +00:00
|
|
|
# Linux has a broken O_DIRECT flag, but we allow people to override it from
|
|
|
|
# the command line.
|
|
|
|
test_host_prw=yes
|
|
|
|
AC_CACHE_CHECK([for open/O_DIRECT], db_cv_open_o_direct, [
|
2007-06-25 15:47:28 +00:00
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
2005-01-20 22:55:54 +00:00
|
|
|
#include <sys/types.h>
|
2007-06-25 15:47:28 +00:00
|
|
|
#include <fcntl.h>]], [[
|
2005-01-20 22:55:54 +00:00
|
|
|
open("a", O_RDONLY | O_DIRECT, 0);
|
2007-06-25 15:47:28 +00:00
|
|
|
]])],[db_cv_open_o_direct=yes; test_host_prw=no],[db_cv_open_o_direct=no])])
|
2005-01-20 22:55:54 +00:00
|
|
|
if test "$test_host_prw" = "no" -a "$db_cv_open_o_direct" = "yes"; then
|
|
|
|
case "$host_os" in
|
|
|
|
linux*)
|
2009-07-30 22:46:56 +00:00
|
|
|
# odirect probably works in linux now...
|
|
|
|
# db_cv_open_o_direct=no;
|
|
|
|
# AC_MSG_WARN(
|
|
|
|
# [O_DIRECT interface ignored on $host_os-$host_vendor.]);;
|
2005-01-20 22:55:54 +00:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
if test "$db_cv_open_o_direct" = "yes"; then
|
|
|
|
AC_DEFINE(HAVE_O_DIRECT)
|
|
|
|
AH_TEMPLATE(HAVE_O_DIRECT, [Define to 1 if you have the O_DIRECT flag.])
|
|
|
|
fi
|
|
|
|
|
2009-04-14 21:55:47 +00:00
|
|
|
#AC_CHECK_LIB([check], [suite_create])
|
|
|
|
#AC_CHECK_LIB([check], [suite_create],
|
|
|
|
# have_libcheck=yes,
|
|
|
|
# have_libcheck=no)
|
2007-03-20 00:24:16 +00:00
|
|
|
#
|
|
|
|
#if test x$have_libcheck = xyes ; then
|
2009-04-14 21:55:47 +00:00
|
|
|
#AM_CONDITIONAL(HAVE_LIBCHECK, true)
|
|
|
|
#else
|
|
|
|
#AM_CONDITIONAL(HAVE_LIBCHECK, false)
|
|
|
|
#AC_MSG_WARN([Check not found; cannot run unit tests!])
|
2007-03-20 00:24:16 +00:00
|
|
|
#fi
|
|
|
|
|
2004-07-06 01:22:18 +00:00
|
|
|
AC_CHECK_LIB([m], [sqrt])
|
|
|
|
AC_CHECK_LIB([pthread], [pthread_create])
|
2006-11-09 23:00:50 +00:00
|
|
|
|
2006-11-10 11:18:50 +00:00
|
|
|
|
|
|
|
AC_ARG_ENABLE([network],
|
2007-06-25 15:47:28 +00:00
|
|
|
AS_HELP_STRING(--disable-network,Disable old networking code),
|
2006-11-09 23:00:50 +00:00
|
|
|
if test x$enableval = xno ; then
|
2006-11-10 11:18:50 +00:00
|
|
|
echo "Networking disabled; not checking for confuse";
|
|
|
|
have_libconfuse=no
|
2006-11-09 23:00:50 +00:00
|
|
|
else
|
2006-11-10 11:18:50 +00:00
|
|
|
AC_CHECK_LIB([confuse], [cfg_set_validate_func],
|
|
|
|
have_libconfuse=yes, have_libconfuse=no)
|
2006-11-09 23:00:50 +00:00
|
|
|
fi,
|
2006-11-10 11:18:50 +00:00
|
|
|
AC_CHECK_LIB([confuse], [cfg_set_validate_func],
|
|
|
|
have_libconfuse=yes, have_libconfuse=no)
|
2006-11-09 23:00:50 +00:00
|
|
|
)
|
|
|
|
|
2006-11-10 11:18:50 +00:00
|
|
|
AM_CONDITIONAL(HAVE_LIBCONFUSE, test x$have_libconfuse = xyes)
|
2006-11-09 23:00:50 +00:00
|
|
|
|
|
|
|
AC_ARG_ENABLE([pobj],
|
2007-06-25 15:47:28 +00:00
|
|
|
AS_HELP_STRING(--disable-pobj,Don't build pobj),
|
2006-11-09 23:00:50 +00:00
|
|
|
AM_CONDITIONAL(BUILD_POBJ, test x$enableval = xyes),
|
2006-11-10 11:18:50 +00:00
|
|
|
AM_CONDITIONAL(BUILD_POBJ, true)
|
2006-11-09 23:00:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([benchmarks],
|
2007-06-25 15:47:28 +00:00
|
|
|
AS_HELP_STRING(--disable-benchmarks,Don't build benchmarks),
|
2006-11-10 11:18:50 +00:00
|
|
|
if test x$enableval = xyes ; then
|
|
|
|
build_benchmarks=yes
|
|
|
|
else
|
|
|
|
build_benchmarks=no
|
|
|
|
fi,
|
|
|
|
build_benchmarks=yes
|
2006-11-09 23:00:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
AC_CONFIG_DB
|
|
|
|
|
2006-11-11 00:39:41 +00:00
|
|
|
AM_CONDITIONAL(DB_ENABLED, test $DB_ENABLED = 1)
|
|
|
|
|
2006-11-10 11:18:50 +00:00
|
|
|
if test x$build_benchmarks = xyes ; then
|
|
|
|
if test $DB_ENABLED = 0; then
|
|
|
|
AC_MSG_WARN([Could not find Berkeley DB; some benchmarks will not be built])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(BUILD_BENCHMARKS, true)
|
|
|
|
else
|
|
|
|
AM_CONDITIONAL(BUILD_BENCHMARKS, false)
|
|
|
|
fi
|
|
|
|
|
2006-11-11 00:39:41 +00:00
|
|
|
|
2006-11-09 23:00:50 +00:00
|
|
|
AC_CHECK_LIB([intl], [bindtextdomain])
|
|
|
|
AC_CHECK_LIB([c], [bindtextdomain])
|
|
|
|
|
2004-06-24 21:10:31 +00:00
|
|
|
# Checks for header files.
|
|
|
|
AC_HEADER_DIRENT
|
2007-03-20 00:24:16 +00:00
|
|
|
AC_FUNC_ALLOCA
|
2004-06-24 21:10:31 +00:00
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_HEADER_SYS_WAIT
|
2007-03-20 00:24:16 +00:00
|
|
|
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h memory.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h errno.h])
|
2004-06-24 21:10:31 +00:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
2007-03-20 00:24:16 +00:00
|
|
|
AC_C_INLINE
|
2007-06-25 15:47:28 +00:00
|
|
|
#AC_TYPE_INT64_T
|
|
|
|
#AC_TYPE_UINT64_T
|
2007-03-20 00:24:16 +00:00
|
|
|
AC_TYPE_OFF_T
|
2004-06-24 21:10:31 +00:00
|
|
|
AC_TYPE_PID_T
|
|
|
|
AC_TYPE_SIZE_T
|
2007-06-25 15:47:28 +00:00
|
|
|
#AC_TYPE_SSIZE_T
|
2004-06-24 21:10:31 +00:00
|
|
|
AC_HEADER_TIME
|
2004-12-30 23:07:47 +00:00
|
|
|
AC_STRUCT_TM
|
2004-06-24 21:10:31 +00:00
|
|
|
|
2006-11-09 23:00:50 +00:00
|
|
|
#enable largefile support.
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
2004-06-24 21:10:31 +00:00
|
|
|
# Checks for library functions.
|
2004-12-30 23:07:47 +00:00
|
|
|
AC_FUNC_ERROR_AT_LINE
|
2008-05-21 21:15:11 +00:00
|
|
|
## Assume we have these, and that they work.
|
|
|
|
## (otherwise, bad stuff happens sometimes)
|
|
|
|
#AC_FUNC_MALLOC
|
|
|
|
#AC_FUNC_REALLOC
|
|
|
|
|
2004-06-24 21:10:31 +00:00
|
|
|
AC_FUNC_MEMCMP
|
|
|
|
AC_FUNC_STAT
|
2007-03-20 00:24:16 +00:00
|
|
|
AC_FUNC_VPRINTF
|
2007-11-11 23:22:21 +00:00
|
|
|
AC_CHECK_FUNCS([bzero fdatasync floor ftruncate getcwd gettimeofday inet_ntoa localtime_r memmove memset mkdir posix_memalign pow powl socket sqrt strchr strdup strerror strrchr strstr strtol strtoul sync_file_range tcase_set_timeout])
|
2004-06-24 21:10:31 +00:00
|
|
|
|
2005-03-12 22:11:18 +00:00
|
|
|
#AC_CONFIG_LIBMYSQLD
|
|
|
|
|
|
|
|
|
2004-06-24 21:10:31 +00:00
|
|
|
AC_CONFIG_FILES([Makefile
|
2004-12-30 23:07:47 +00:00
|
|
|
benchmarks/Makefile
|
|
|
|
benchmarks/berkeleyDB/Makefile
|
2004-06-24 21:10:31 +00:00
|
|
|
libdfa/Makefile
|
2007-06-11 21:36:57 +00:00
|
|
|
stasis/Makefile
|
2004-06-24 21:10:31 +00:00
|
|
|
src/2pc/Makefile
|
|
|
|
src/Makefile
|
|
|
|
src/apps/Makefile
|
|
|
|
src/apps/cht/Makefile
|
2006-06-15 22:30:08 +00:00
|
|
|
src/apps/readOnlyHash/Makefile
|
2004-06-24 21:10:31 +00:00
|
|
|
src/apps/cyrus/Makefile
|
2008-03-02 23:43:38 +00:00
|
|
|
src/apps/referential/Makefile
|
2004-06-24 21:10:31 +00:00
|
|
|
src/libdfa/Makefile
|
2007-06-11 21:36:57 +00:00
|
|
|
src/stasis/Makefile
|
2004-12-30 23:07:47 +00:00
|
|
|
src/pobj/Makefile
|
2004-06-24 21:10:31 +00:00
|
|
|
src/timing/Makefile
|
|
|
|
test/2pc/Makefile
|
|
|
|
test/Makefile
|
|
|
|
test/cht/Makefile
|
|
|
|
test/dfa/Makefile
|
|
|
|
test/lladd-old/Makefile
|
2007-06-11 21:36:57 +00:00
|
|
|
test/stasis/Makefile
|
2004-06-24 21:10:31 +00:00
|
|
|
test/messages/Makefile
|
2004-07-06 01:22:18 +00:00
|
|
|
test/monotree/Makefile
|
2004-12-30 23:07:47 +00:00
|
|
|
test/pobj/Makefile
|
2004-10-18 18:24:54 +00:00
|
|
|
utilities/Makefile
|
2007-05-30 23:48:36 +00:00
|
|
|
utilities/swig/Makefile
|
2007-05-25 18:21:09 +00:00
|
|
|
examples/Makefile
|
2004-10-18 18:24:54 +00:00
|
|
|
])
|
2004-06-24 21:10:31 +00:00
|
|
|
AC_OUTPUT
|