2014-05-17 22:14:08 -04:00
|
|
|
AC_INIT([r3], 1.0.0)
|
2014-05-17 03:50:22 -04:00
|
|
|
AC_PREREQ([2.64])
|
2014-05-16 18:40:08 -04:00
|
|
|
AC_CONFIG_HEADERS(config.h)
|
2014-05-16 19:14:09 -04:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2014-05-17 03:50:22 -04:00
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
2014-05-16 18:37:45 -04:00
|
|
|
LT_INIT
|
|
|
|
AC_PROG_CC
|
2014-05-16 19:58:28 -04:00
|
|
|
AC_PROG_CC_STDC
|
2014-05-16 19:14:09 -04:00
|
|
|
|
2014-05-22 04:26:55 -04:00
|
|
|
AC_CHECK_HEADERS([stdlib.h string.h sys/time.h stdint.h])
|
2014-05-16 19:17:44 -04:00
|
|
|
|
2014-05-21 12:14:37 -04:00
|
|
|
PKG_CHECK_MODULES(CHECK,[check >= 0.9.4],:,[
|
|
|
|
ifdef([AM_PATH_CHECK],
|
|
|
|
[AM_PATH_CHECK(,[have_check="yes"])],
|
2014-05-16 19:14:09 -04:00
|
|
|
AC_MSG_WARN([Check not found; cannot run unit tests!])
|
2014-05-21 12:14:37 -04:00
|
|
|
[have_check="no"])]
|
|
|
|
])
|
2014-05-16 19:14:09 -04:00
|
|
|
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
|
|
|
|
|
2014-05-16 19:17:44 -04:00
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_INLINE
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_FUNC_REALLOC
|
|
|
|
AC_CHECK_FUNCS([gettimeofday memset strchr strdup strndup strstr])
|
|
|
|
|
2014-05-17 21:29:31 -04:00
|
|
|
|
|
|
|
|
2014-05-16 18:37:45 -04:00
|
|
|
PKG_PROG_PKG_CONFIG
|
2014-05-17 22:13:51 -04:00
|
|
|
|
2014-05-22 04:24:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AC_ARG_WITH([malloc], AS_HELP_STRING([--without-malloc], [Use the default malloc]))
|
|
|
|
|
|
|
|
AS_IF([test "x$with_malloc" == "xjemalloc"],
|
|
|
|
[AC_CHECK_HEADERS([jemalloc/jemalloc.h], [
|
|
|
|
found_jemalloc=yes; break
|
|
|
|
])])
|
|
|
|
|
|
|
|
if test "x$found_jemalloc" == "xyes" ; then
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([Checking jemalloc version])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <jemalloc/jemalloc.h>]],
|
|
|
|
[[
|
|
|
|
#ifdef JEMALLOC_VERSION_MAJOR > 2
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
return 1;
|
|
|
|
]])],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_DEFINE_UNQUOTED([USE_JEMALLOC], 1, [Define to 1 if you have the PATH_MAX macro.])
|
|
|
|
have_jemalloc=yes
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_DEFINE_UNQUOTED([USE_JEMALLOC], 0, [Define to 1 if you have the PATH_MAX macro.])
|
|
|
|
have_jemalloc=no
|
|
|
|
]
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(USE_JEMALLOC, test "x$have_jemalloc" = "xyes")
|
|
|
|
AM_CONDITIONAL(ENABLE_GRAPHVIZ, test "x$enable_graphviz" = "xyes")
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [enable debug]), [],[enable_debug=unset])
|
|
|
|
AM_CONDITIONAL(ENABLE_DEBUG, test "x$enable_debug" = "xyes")
|
|
|
|
|
|
|
|
|
2014-05-17 22:13:51 -04:00
|
|
|
AC_ARG_ENABLE(graphviz,
|
|
|
|
AS_HELP_STRING([--enable-graphviz],
|
|
|
|
[enable graphviz support]),
|
|
|
|
, enable_graphviz=unset)
|
|
|
|
if test "x$enable_graphviz" != "xunset" ; then
|
|
|
|
PKG_CHECK_MODULES(GVC_DEPS, [libgvc])
|
|
|
|
AC_SUBST(GVC_DEPS_CFLAGS)
|
|
|
|
AC_SUBST(GVC_DEPS_LIBS)
|
|
|
|
fi
|
2014-05-21 23:54:01 -04:00
|
|
|
AM_CONDITIONAL(ENABLE_GRAPHVIZ, test "x$enable_graphviz" = "xyes")
|
2014-05-20 11:48:35 -04:00
|
|
|
AC_DEFINE(ENABLE_GRAPHVIZ, test "x$enable_graphviz" = "xyes", "whether graphviz is enable")
|
2014-05-17 22:13:51 -04:00
|
|
|
|
|
|
|
|
2014-05-22 04:41:46 -04:00
|
|
|
AC_ARG_ENABLE(stats, AS_HELP_STRING([--enable-stats], [enable statistics]), [] ,[enable_stats=unset])
|
|
|
|
AC_DEFINE(ENABLE_STATS, test "x$enable_stats" = "xyes", "whether statistics is enable")
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-17 22:13:51 -04:00
|
|
|
|
2014-05-22 04:24:24 -04:00
|
|
|
PKG_CHECK_MODULES(DEPS, [libpcre])
|
2014-05-16 18:44:32 -04:00
|
|
|
AC_SUBST(DEPS_CFLAGS)
|
|
|
|
AC_SUBST(DEPS_LIBS)
|
2014-05-16 23:35:45 -04:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
r3.pc
|
|
|
|
Makefile
|
|
|
|
src/Makefile
|
|
|
|
tests/Makefile
|
|
|
|
])
|
2014-05-16 18:37:45 -04:00
|
|
|
AC_OUTPUT
|