fix configure options:

1. fix --enable-json
2. fix --enable-graphviz
This commit is contained in:
c9s 2014-06-01 20:14:56 +08:00
parent 8f9c2acc5c
commit c5501ab5f6

View file

@ -22,20 +22,9 @@ AC_CHECK_FUNCS([gettimeofday memset strchr strdup strndup strstr])
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
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
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debug]),
, enable_debug=unset)
AC_ARG_WITH([malloc], AC_ARG_WITH([malloc],
AS_HELP_STRING([--without-malloc], [Use the default malloc])) AS_HELP_STRING([--without-malloc], [Use the default malloc]))
@ -72,50 +61,52 @@ AM_CONDITIONAL(USE_JEMALLOC, test "x$have_jemalloc" = "xyes")
# AM_CONDITIONAL(USE_JEMALLOC, test "x$found_jemalloc" = "xyes") # AM_CONDITIONAL(USE_JEMALLOC, test "x$found_jemalloc" = "xyes")
# AC_DEFINE(USE_JEMALLOC, test "x$found_jemalloc" = "xyes" , "use jemalloc") # AC_DEFINE(USE_JEMALLOC, test "x$found_jemalloc" = "xyes" , "use jemalloc")
AM_CONDITIONAL(ENABLE_DEBUG, test "x$enable_debug" = "xyes")
AM_CONDITIONAL(ENABLE_JSON, test "x$enable_json" = "xyes")
AM_CONDITIONAL(ENABLE_GRAPHVIZ, test "x$enable_graphviz" = "xyes")
AC_DEFINE(ENABLE_GRAPHVIZ, test "x$enable_graphviz" = "xyes", "whether graphviz is enable")
AC_DEFINE(ENABLE_JSON, test "x$enable_json" = "xyes", "whether json is enable")
PKG_CHECK_MODULES(DEPS, [libpcre]) PKG_CHECK_MODULES(DEPS, [libpcre])
AC_SUBST(DEPS_CFLAGS) AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS) AC_SUBST(DEPS_LIBS)
AC_ARG_ENABLE(json, AC_ARG_ENABLE(debug,AS_HELP_STRING([--enable-debug],[enable debug]))
AS_HELP_STRING([--enable-json], if test "x$enable_debug" = "xyes"; then
[enable json encoder]), AC_DEFINE(ENABLE_DEBUG, 1, "debug")
, enable_json=unset)
if test "x$enable_json" != "xunset" ; then
PKG_CHECK_MODULES(JSONC, [json-c])
AC_SUBST(JSONC_CFLAGS)
AC_SUBST(JSONC_LIBS)
fi fi
AM_CONDITIONAL(ENABLE_DEBUG, test "x$enable_debug" = "xyes")
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
AC_DEFINE(ENABLE_JSON, 1, [enable json])
fi
AM_CONDITIONAL(ENABLE_JSON, test "x$enable_json" = "xyes")
# This does not work because configure does not look into /opt/local/include... # This does not work because configure does not look into /opt/local/include...
# AC_CHECK_HEADERS([check.h],[ enable_check=yes ],[ enable_check=unset ]) # AC_CHECK_HEADERS([check.h],[ enable_check=yes ],[ enable_check=unset ])
AC_ARG_ENABLE(check, AC_ARG_ENABLE(check, AS_HELP_STRING([--enable-check], [enable unit testing]))
AS_HELP_STRING([--enable-check], if test "$enable_check" = "xyes"; then
[enable unit testing]), PKG_CHECK_MODULES(CHECK,[check >= 0.9.4],:,[
, enable_check=unset)
if test "x$enable_check" != "xunset" ; then
# AM_PATH_CHECK
PKG_CHECK_MODULES(CHECK,[check >= 0.9.4],:,[
ifdef([AM_PATH_CHECK], ifdef([AM_PATH_CHECK],
[AM_PATH_CHECK(,[have_check="yes"])], [AM_PATH_CHECK(,[have_check="yes"])],
AC_MSG_WARN([Check not found; cannot run unit tests!]) AC_MSG_WARN([Check not found; cannot run unit tests!])
[have_check="no"])] [have_check="no"])]
]) ])
fi fi
AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes") AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")
AC_CONFIG_FILES([ AC_CONFIG_FILES([
r3.pc r3.pc
Makefile Makefile