-if test "x$with_libcurl" = "xyes"
-then
- with_curl_libs=`$with_curl_config --libs 2>/dev/null`
- curl_config_status=$?
-
- if test $curl_config_status -ne 0
- then
- with_libcurl="no ($with_curl_config failed)"
- else
- AC_CHECK_LIB(curl, curl_easy_init,
- [with_libcurl="yes"],
- [with_libcurl="no (symbol 'curl_easy_init' not found)"],
- [$with_curl_libs])
- AC_CHECK_DECL(CURLOPT_USERNAME,
- [have_curlopt_username="yes"],
- [have_curlopt_username="no"],
- [[#include <curl/curl.h>]])
- AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
- [have_curlopt_timeout="yes"],
- [have_curlopt_timeout="no"],
- [[#include <curl/curl.h>]])
- fi
-fi
-if test "x$with_libcurl" = "xyes"
-then
- SAVE_CPPFLAGS="$CPPFLAGS"
- SAVE_LDFLAGS="$LDFLAGS"
- CPPFLAGS="$CPPFLAGS $with_curl_cflags"
- LDFLAGS="$LDFLAGS $with_curl_libs"
- AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
- [c_cv_have_curlinfo_appconnect_time],
- AC_LINK_IFELSE([AC_LANG_PROGRAM(
-[[
-#include <curl/curl.h>
-]],
-[[
-int val = CURLINFO_APPCONNECT_TIME;
-return val;
-]]
- )],
- [c_cv_have_curlinfo_appconnect_time="yes"],
- [c_cv_have_curlinfo_appconnect_time="no"]
- )
- )
- CPPFLAGS="$SAVE_CPPFLAGS"
- LDFLAGS="$SAVE_LDFLAGS"
-fi
-AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
-if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"
-then
- AC_DEFINE(HAVE_CURLINFO_APPCONNECT_TIME, 1, [Define if curl.h defines CURLINFO_APPCONNECT_TIME.])
+
+if test "x$with_libcurl" = "xyes"; then
+ with_curl_libs=`$with_curl_config --libs 2>/dev/null`
+ curl_config_status=$?
+
+ if test $curl_config_status -ne 0; then
+ with_libcurl="no ($with_curl_config failed)"
+ else
+ AC_CHECK_LIB([curl], [curl_easy_init],
+ [with_libcurl="yes"],
+ [with_libcurl="no (symbol 'curl_easy_init' not found)"],
+ [$with_curl_libs]
+ )
+
+ AC_CHECK_DECL([CURLOPT_USERNAME],
+ [have_curlopt_username="yes"],
+ [have_curlopt_username="no"],
+ [[#include <curl/curl.h>]]
+ )
+
+ AC_CHECK_DECL(CURLOPT_TIMEOUT_MS,
+ [have_curlopt_timeout="yes"],
+ [have_curlopt_timeout="no"],
+ [[#include <curl/curl.h>]]
+ )
+ fi
+fi
+
+if test "x$with_libcurl" = "xyes"; then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ SAVE_LDFLAGS="$LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_curl_cflags"
+ LDFLAGS="$LDFLAGS $with_curl_libs"
+ AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
+ [c_cv_have_curlinfo_appconnect_time],
+ [
+ AC_LINK_IFELSE(
+ [
+ AC_LANG_PROGRAM(
+ [[#include <curl/curl.h>]],
+ [[
+ int val = CURLINFO_APPCONNECT_TIME;
+ return val;
+ ]]
+ )
+ ],
+ [c_cv_have_curlinfo_appconnect_time="yes"],
+ [c_cv_have_curlinfo_appconnect_time="no"]
+ )
+ ]
+ )
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+fi
+
+if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"; then
+ AC_DEFINE([HAVE_CURLINFO_APPCONNECT_TIME], [1],
+ [Define if curl.h defines CURLINFO_APPCONNECT_TIME.]
+ )
+fi
+
+if test "x$with_libcurl" = "xyes"; then
+ BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
+ BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
+
+ if test "x$have_curlopt_username" = "xyes"; then
+ AC_DEFINE([HAVE_CURLOPT_USERNAME], [1],
+ [Define if libcurl supports CURLOPT_USERNAME option.]
+ )
+ fi
+
+ if test "x$have_curlopt_timeout" = "xyes"; then
+ AC_DEFINE([HAVE_CURLOPT_TIMEOUT_MS], [1],
+ [Define if libcurl supports CURLOPT_TIMEOUT_MS option.]
+ )
+ fi
+fi
+
+AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
+AC_SUBST(BUILD_WITH_LIBCURL_LIBS)
+# }}}
+
+# --with-libdbi {{{
+AC_ARG_WITH([libdbi],
+ [AS_HELP_STRING([--with-libdbi@<:@=PREFIX@:>@], [Path to libdbi.])],
+ [
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"; then
+ with_libdbi_cppflags="-I$withval/include"
+ with_libdbi_ldflags="-L$withval/lib"
+ with_libdbi="yes"
+ else
+ with_libdbi="$withval"
+ fi
+ ],
+ [with_libdbi="yes"]
+)
+
+if test "x$with_libdbi" = "xyes"; then
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $with_libdbi_cppflags"
+
+ AC_CHECK_HEADERS([dbi/dbi.h],
+ [with_libdbi="yes"],
+ [with_libdbi="no (dbi/dbi.h not found)"]
+ )
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+fi
+
+if test "x$with_libdbi" = "xyes"; then
+ SAVE_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
+
+ AC_CHECK_LIB([dbi], [dbi_initialize],
+ [with_libdbi="yes"],
+ [with_libdbi="no (Symbol 'dbi_initialize' not found)"]
+ )
+
+ LDFLAGS="$SAVE_LDFLAGS"
+fi
+
+BUILD_WITH_LIBDBI_CPPFLAGS="$with_libdbi_cppflags"
+BUILD_WITH_LIBDBI_LDFLAGS="$with_libdbi_ldflags"
+BUILD_WITH_LIBDBI_LIBS="-ldbi"
+AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
+AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
+AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
+# }}}
+
+# --with-libdpdk {{{
+AC_ARG_VAR([LIBDPDK_CPPFLAGS], [Preprocessor flags for libdpdk])
+AC_ARG_VAR([LIBDPDK_CFLAGS], [Compiler flags for libdpdk])
+AC_ARG_VAR([LIBDPDK_LDFLAGS], [Linker flags for libdpdk])
+AC_ARG_VAR([LIBDPDK_LIBS], [Libraries to link for libdpdk])
+
+AC_ARG_WITH([libdpdk],
+ [AS_HELP_STRING([--without-libdpdk], [Disable libdpdk.])],
+ [with_libdpdk="$withval"],
+ [with_libdpdk="yes"]
+)
+
+if test "x$with_libdpdk" != "xno"; then
+ PKG_CHECK_MODULES([DPDK], [libdpdk], [],
+ [AC_MSG_NOTICE([no DPDK pkg-config, using defaults])])
+ if test "x$LIBDPDK_CPPFLAGS" = "x"; then
+ LIBDPDK_CPPFLAGS="-I/usr/include/dpdk"
+ fi
+ if test "x$LIBDPDK_CFLAGS" = "x"; then
+ LIBDPDK_CFLAGS="$DPDK_CFLAGS"
+ LIBDPDK_CPPFLAGS="$LIBDPDK_CPPFLAGS $DPDK_CFLAGS"
+ fi
+ if test "x$LIBDPDK_LIBS" = "x"; then
+ if test "x$DPDK_LIBS" != "x"; then
+ LIBDPDK_LIBS="$DPDK_LIBS"
+ else
+ LIBDPDK_LIBS="-ldpdk"
+ fi
+ fi
+ SAVE_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$LIBDPDK_CPPFLAGS $CPPFLAGS"
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$LIBDPDK_CFLAGS $CFLAGS"
+ AC_CHECK_HEADERS([rte_config.h],
+ [
+ with_libdpdk="yes"
+ AC_PREPROC_IFELSE(
+ [
+ AC_LANG_SOURCE(
+ [[
+ #include <rte_version.h>
+ #if RTE_VERSION < RTE_VERSION_NUM(16,7,0,0)
+ #error "required DPDK >= 16.07"
+ #endif
+ ]]
+ )
+ ],
+ [dpdk_keepalive="yes"],
+ [dpdk_keepalive="no (DPDK version < 16.07)"]
+ )
+ ],
+ [with_libdpdk="no (rte_config.h not found)"]
+ )
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ CFLAGS="$SAVE_CFLAGS"