AC_PREREQ(2.63)
AC_INIT(stx-cbtreedb, 0.7.0)
AC_CONFIG_SRCDIR(include/stx-cbtreedb.h)
AC_CONFIG_AUX_DIR(acscripts)
AM_INIT_AUTOMAKE
AC_ARG_ENABLE(optimize,
AS_HELP_STRING([--enable-optimize],
[Build with full optimization @<:@default=no@:>@]),
[ case "${enableval}" in
yes)
CFLAGS="$CFLAGS -O3 -fomit-frame-pointer";
CXXFLAGS="$CXXFLAGS -O3 -fomit-frame-pointer";
;;
no) ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-optimize) ;;
esac ],
[ optimize=false ])
if test "$CFLAGS" == ""; then
CFLAGS="-g"
fi
if test "$CXXFLAGS" == ""; then
CXXFLAGS="-g"
fi
AC_PROG_CXX
AC_PROG_CC
AC_PROG_RANLIB
AC_LANG([C++])
AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_FUNCS([memset strerror])
AC_ARG_ENABLE(gcov,
AS_HELP_STRING([--enable-gcov],
[enable test coverage with gcov @<:@default=no@:>@]),
[case "${enableval}" in
yes) gcov=true ;;
no) gcov=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-gcov]) ;;
esac],
[gcov=false])
AM_CONDITIONAL(GCOV, test x"$gcov" = "xtrue")
if test x"$gcov" = "xtrue"; then
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
fi
AC_CONFIG_FILES([Makefile
testsuite/Makefile
tools/Makefile])
AC_OUTPUT