Re: [PATCH spice-common v2] m4: Add macro for --with-sasl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/26/2015 09:53 AM, Pavel Grunt wrote:
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.
---
v2: - only supports libsasl2
     - PKG_CHECK_MODULES is used instead of AC_CHECK_LIB and AC_CHECK_HEADER
---

Hi Pavel,

Looks good to me.

Did you try converting spice-server and spice-gtk to use this macro?

Thanks,
    Uri.

  m4/spice-deps.m4 | 28 ++++++++++++++++++++++++++++
  1 file changed, 28 insertions(+)

diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4
index 6237a10..9dc7f1c 100644
--- a/m4/spice-deps.m4
+++ b/m4/spice-deps.m4
@@ -269,3 +269,31 @@ 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, a HAVE_SASL preprocessor
+# symbol and a HAVE_SASL conditional.
+# ----------------
+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
+    AM_CONDITIONAL([HAVE_SASL], [test "x$have_sasl" = "xyes"])
+])


_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]