summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac51
1 files changed, 47 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 26d0a76..bb25c33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,19 +13,57 @@ AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile rexmpp.pc Doxyfile])
AC_PROG_CC
AM_PROG_AR
-LT_INIT
# Checks for libraries and related parameters.
-PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
+AC_ARG_WITH([rust],
+ AS_HELP_STRING([--with-rust],
+ [use available Rust implementations of modules]))
+AC_ARG_WITH([expat],
+ AS_HELP_STRING([--with-expat], [use libexpat instead of libxml2]))
+
+AS_IF([test "x$with_rust" == "xyes"],
+ [AC_PATH_PROG([RUSTC], [rustc], [notfound])
+ AS_IF([test "x$RUSTC" == "xnotfound"], [AC_MSG_ERROR([rustc is required])])
+ AC_PATH_PROG([CARGO], [cargo], [notfound])
+ AS_IF([test "x$CARGO" == "xnotfound"], [AC_MSG_ERROR([cargo is required])])
+ AC_DEFINE([USE_RUST], [1], [Use Rust sources over C ones])],
+ [AS_IF([test "x$with_expat" == "xyes"],
+ [PKG_CHECK_MODULES([EXPAT], [expat],
+ [AC_DEFINE([USE_EXPAT], [1], [Use libexpat])])],
+ [PKG_CHECK_MODULES([LIBXML2], [libxml-2.0],
+ [AC_DEFINE([USE_LIBXML2], [1], [Use libxml2])])])])
+AM_CONDITIONAL([USE_RUST], [test "x$with_rust" == "xyes"])
+
+LT_INIT
+
+
+# Cryptographic libraries, for hashing
+
+AC_ARG_WITH([gcrypt],
+ AS_HELP_STRING([--without-gcrypt], [do not use gcrypt]))
+AC_ARG_WITH([nettle],
+ AS_HELP_STRING([--without-nettle], [do not use nettle]))
+
+AS_IF([test "x$with_gcrypt" != "xno"],
+ [AM_PATH_LIBGCRYPT([],
+ [AC_DEFINE([HAVE_GCRYPT], [1], [Libgcrypt is available])])])
+
+AS_IF([test "x$with_gcrypt" == "xno" -a "x$with_nettle" != "xno"],
+ [PKG_CHECK_MODULES([NETTLE], [nettle],
+ [AC_DEFINE([HAVE_NETTLE], [1], [Libnettle is available])])])
+
+AS_IF([test "x$with_gcrypt" == "xno" -a "x$with_nettle" == "xno"],
+ [PKG_CHECK_MODULES([OPENSSL], [openssl],
+ [AC_DEFINE([HAVE_OPENSSL], [1], [OpenSSL is available])])])
-AM_PATH_LIBGCRYPT
# libnice (+ glib) and libsrtp for media calls, optional
AC_ARG_ENABLE([calls], AS_HELP_STRING([--disable-calls],
[build without Jingle media call support]))
-
+AC_ARG_WITH([opus],
+ AS_HELP_STRING([--without-opus], [Do not use libopus]))
AS_IF([test "x$enable_calls" != "xno"],
[PKG_CHECK_MODULES([NICE], [nice],
[AC_DEFINE([HAVE_NICE], [1], [libnice is available])])
@@ -33,6 +71,11 @@ AS_IF([test "x$enable_calls" != "xno"],
[AC_DEFINE([HAVE_GLIB], [1], [glib is available])])
PKG_CHECK_MODULES([SRTP], [libsrtp2],
[AC_DEFINE([HAVE_SRTP], [1], [libsrtp2 is available])])
+ PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0],
+ [AC_DEFINE([HAVE_PORTAUDIO], [1], [portaudio-2.0 is available])])
+ AS_IF([test "x$with_opus" != "xno"],
+ PKG_CHECK_MODULES([OPUS], [opus],
+ [AC_DEFINE([HAVE_OPUS], [1], [libopus is available])]))
AC_DEFINE([ENABLE_CALLS], [1], [Jingle ICE-UDP DTLS-SRTP calls are enabled])])
# GSASL, optional