diff options
author | Pavel Grunt <pgrunt@redhat.com> | 2015-12-16 18:18:57 +0100 |
---|---|---|
committer | Pavel Grunt <pgrunt@redhat.com> | 2015-12-18 13:57:58 +0100 |
commit | c3f2d217af40fa1da2cb42c69ca4a89fd8e7ef03 (patch) | |
tree | 3a452ef5f57749dbdf249d2c1b2f995746e468a3 | |
parent | a78da942a7e9022025c70c60f9944585f29fce2e (diff) | |
download | spice-common-c3f2d217af40fa1da2cb42c69ca4a89fd8e7ef03.tar.gz spice-common-c3f2d217af40fa1da2cb42c69ca4a89fd8e7ef03.tar.xz spice-common-c3f2d217af40fa1da2cb42c69ca4a89fd8e7ef03.zip |
m4: Add macro for --with-sasl
It is not used by spice-common, but both server and client can use it.
Compared to current checks in spice-gtk and spice server this macro only
supports libsasl2.
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
-rw-r--r-- | m4/spice-deps.m4 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4 index f854eb1..d533c81 100644 --- a/m4/spice-deps.m4 +++ b/m4/spice-deps.m4 @@ -269,3 +269,30 @@ AS_IF([test "x$1" != x], [missing_gstreamer_elements="no"]) ]) ]) + +# SPICE_CHECK_SASL +# ---------------- +# Adds a --with-sasl switch to allow using SASL for authentication. +# Checks whether the required library is available. If it is present, +# it will return the flags to use in SASL_CFLAGS and SASL_LIBS variables, +# and it will define a have_sasl configure variable and a HAVE_SASL preprocessor +# symbol. +# ---------------- +AC_DEFUN([SPICE_CHECK_SASL], [ + AC_ARG_WITH([sasl], + [AS_HELP_STRING([--with-sasl=@<:@yes/no/auto@:>@], + [use cyrus SASL for authentication @<:@default=auto@:>@])], + [], + [with_sasl="auto"]) + + have_sasl=no + if test "x$with_sasl" != "xno"; then + PKG_CHECK_MODULES([SASL], [libsasl2], [have_sasl=yes],[have_sasl=no]) + if test "x$have_sasl" = "xno" && test "x$with_sasl" = "xyes"; then + AC_MSG_ERROR([Cyrus SASL support requested but libsasl2 could not be found]) + fi + if test "x$have_sasl" = "xyes"; then + AC_DEFINE([HAVE_SASL], 1, [whether Cyrus SASL is available for authentication]) + fi + fi +]) |