2014-06-27 12:53:32 -04:00
|
|
|
AC_INIT([r3], 1.3.3)
|
2014-05-17 03:50:22 -04:00
|
|
|
AC_PREREQ([2.64])
|
2014-06-01 17:48:27 -04:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
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-09-27 03:49:12 -04:00
|
|
|
AM_SILENT_RULES([yes])
|
2014-06-04 02:43:09 -04:00
|
|
|
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
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-06-12 04:55:44 -04:00
|
|
|
AC_PROG_CXX
|
2014-06-01 04:39:32 -04:00
|
|
|
AC_PROG_INSTALL
|
2015-11-17 08:31:33 -05:00
|
|
|
AC_HEADER_STDBOOL
|
2014-05-16 19:14:09 -04:00
|
|
|
|
2014-06-04 02:43:09 -04:00
|
|
|
# older debian
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
|
2014-05-16 19:17:44 -04:00
|
|
|
AC_CHECK_HEADERS([stdlib.h string.h sys/time.h])
|
|
|
|
|
|
|
|
# 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-16 18:37:45 -04:00
|
|
|
PKG_PROG_PKG_CONFIG
|
2014-05-17 22:13:51 -04:00
|
|
|
|
|
|
|
|
2014-06-01 08:14:56 -04:00
|
|
|
|
2014-06-01 18:14:23 -04:00
|
|
|
AC_ARG_ENABLE([gcov],
|
|
|
|
[AS_HELP_STRING([--enable-gcov],
|
|
|
|
[use Gcov to test the test suite])],
|
|
|
|
[],
|
|
|
|
[enable_gcov=no])
|
|
|
|
AM_CONDITIONAL([COND_GCOV],[test '!' "$enable_gcov" = no])
|
|
|
|
|
2014-06-01 08:14:56 -04:00
|
|
|
|
2014-05-17 23:03:01 -04:00
|
|
|
|
2014-05-21 09:59:46 -04:00
|
|
|
AC_ARG_WITH([malloc],
|
|
|
|
AS_HELP_STRING([--without-malloc], [Use the default malloc]))
|
|
|
|
|
2014-05-21 11:24:30 -04:00
|
|
|
AS_IF([test "x$with_malloc" == "xjemalloc"],
|
2014-05-21 09:59:46 -04:00
|
|
|
[AC_CHECK_HEADERS([jemalloc/jemalloc.h], [
|
|
|
|
found_jemalloc=yes; break
|
|
|
|
])])
|
|
|
|
|
2014-05-21 23:54:01 -04:00
|
|
|
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(USE_JEMALLOC, test "x$found_jemalloc" = "xyes")
|
|
|
|
# AC_DEFINE(USE_JEMALLOC, test "x$found_jemalloc" = "xyes" , "use jemalloc")
|
|
|
|
|
2014-05-17 22:13:51 -04:00
|
|
|
|
2014-05-24 03:30:17 -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-24 03:41:02 -04:00
|
|
|
|
|
|
|
|
2014-06-01 08:14:56 -04:00
|
|
|
AC_ARG_ENABLE(debug,AS_HELP_STRING([--enable-debug],[enable debug]))
|
|
|
|
if test "x$enable_debug" = "xyes"; then
|
2014-07-04 06:25:22 -04:00
|
|
|
AC_DEFINE(DEBUG, 1, "debug")
|
2014-06-01 08:14:56 -04:00
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(ENABLE_DEBUG, test "x$enable_debug" = "xyes")
|
|
|
|
|
2014-06-01 06:06:12 -04:00
|
|
|
|
|
|
|
|
2014-06-01 08:14:56 -04:00
|
|
|
AC_ARG_ENABLE(graphviz, AS_HELP_STRING([--enable-graphviz],[enable graphviz support]))
|
|
|
|
if test "x$enable_graphviz" = "xyes" ; then
|
|
|
|
PKG_CHECK_MODULES(GVC_DEPS, [libgvc])
|
|
|
|
AC_SUBST(GVC_DEPS_CFLAGS)
|
|
|
|
AC_SUBST(GVC_DEPS_LIBS)
|
|
|
|
AC_DEFINE(ENABLE_GRAPHVIZ, 1, "whether graphviz is enable")
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(ENABLE_GRAPHVIZ, test "x$enable_graphviz" = "xyes")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(json, AS_HELP_STRING([--enable-json],[enable json encoder]))
|
|
|
|
if test "x$enable_json" = "xyes"; then
|
2014-06-01 13:21:02 -04:00
|
|
|
PKG_CHECK_MODULES(JSONC, [json-c])
|
|
|
|
AC_SUBST(JSONC_CFLAGS)
|
|
|
|
AC_SUBST(JSONC_LIBS)
|
2014-06-01 08:14:56 -04:00
|
|
|
AC_DEFINE(ENABLE_JSON, 1, [enable json])
|
2014-06-01 06:06:12 -04:00
|
|
|
fi
|
2014-06-01 08:14:56 -04:00
|
|
|
AM_CONDITIONAL(ENABLE_JSON, test "x$enable_json" = "xyes")
|
2014-06-01 06:06:12 -04:00
|
|
|
|
|
|
|
|
2014-05-24 04:26:47 -04:00
|
|
|
# This does not work because configure does not look into /opt/local/include...
|
|
|
|
# AC_CHECK_HEADERS([check.h],[ enable_check=yes ],[ enable_check=unset ])
|
2014-06-01 17:23:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(check,
|
|
|
|
AS_HELP_STRING([--enable-check],
|
|
|
|
[enable unit testing]),
|
|
|
|
, enable_check=unset)
|
2016-03-11 23:39:58 -05:00
|
|
|
|
2014-06-01 17:23:00 -04:00
|
|
|
if test "x$enable_check" != "xunset" ; then
|
|
|
|
PKG_CHECK_MODULES(CHECK,[check >= 0.9.4],:,[
|
|
|
|
ifdef([AM_PATH_CHECK],
|
2016-03-11 23:39:58 -05:00
|
|
|
[AM_PATH_CHECK(,[have_check="yes"])],
|
|
|
|
AC_MSG_WARN([Check not found; cannot run unit tests!]) [have_check="no"]
|
|
|
|
)]
|
2014-06-01 17:23:00 -04:00
|
|
|
])
|
2014-05-24 03:41:02 -04:00
|
|
|
fi
|
2016-03-11 23:39:58 -05:00
|
|
|
AM_CONDITIONAL(ENABLE_CHECK, test "x$enable_check" = "xyes")
|
2014-05-24 03:41:02 -04:00
|
|
|
|
2014-05-16 23:35:45 -04:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
r3.pc
|
|
|
|
Makefile
|
2014-06-01 06:06:12 -04:00
|
|
|
3rdparty/Makefile
|
2014-05-16 23:35:45 -04:00
|
|
|
src/Makefile
|
|
|
|
tests/Makefile
|
2014-06-03 10:41:39 -04:00
|
|
|
examples/Makefile
|
2014-05-16 23:35:45 -04:00
|
|
|
])
|
2014-05-16 18:37:45 -04:00
|
|
|
AC_OUTPUT
|