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

[libvirt] [PATCH 08/29] Convert sasl check to use LIBVIRT_CHECK_LIB_FALLBACK



From: "Daniel P. Berrange" <berrange redhat com>

Signed-off-by: Daniel P. Berrange <berrange redhat com>
---
 configure.ac    | 62 ++-------------------------------------------------------
 m4/virt-sasl.m4 | 12 +++++++++++
 2 files changed, 14 insertions(+), 60 deletions(-)
 create mode 100644 m4/virt-sasl.m4

diff --git a/configure.ac b/configure.ac
index 94929ce..f173c63 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,6 +150,7 @@ LIBVIRT_COMPILE_WARNINGS
 
 LIBVIRT_CHECK_LIBATTR
 LIBVIRT_CHECK_SANLOCK
+LIBVIRT_CHECK_SASL
 LIBVIRT_CHECK_YAJL
 
 AC_MSG_CHECKING([for CPUID instruction])
@@ -1039,61 +1040,6 @@ AC_SUBST([GNUTLS_CFLAGS])
 AC_SUBST([GNUTLS_LIBS])
 
 
-dnl Cyrus SASL
-AC_ARG_WITH([sasl],
-  AC_HELP_STRING([--with-sasl], [use cyrus SASL for authentication @<:@default=check@:>@]),
-  [],
-  [with_sasl=check])
-
-SASL_CFLAGS=
-SASL_LIBS=
-if test "x$with_sasl" != "xno"; then
-  if test "x$with_sasl" != "xyes" && test "x$with_sasl" != "xcheck"; then
-    SASL_CFLAGS="-I$with_sasl"
-    SASL_LIBS="-L$with_sasl"
-  fi
-  fail=0
-  old_cflags="$CFLAGS"
-  old_libs="$LIBS"
-  CFLAGS="$CFLAGS $SASL_CFLAGS"
-  LIBS="$LIBS $SASL_LIBS"
-  AC_CHECK_HEADER([sasl/sasl.h],[],[
-    if test "x$with_sasl" = "xcheck" ; then
-        with_sasl=no
-    else
-        fail=1
-    fi])
-  if test "x$with_sasl" != "xno" ; then
-    AC_CHECK_LIB([sasl2], [sasl_client_init],[
-      SASL_LIBS="$SASL_LIBS -lsasl2"
-      with_sasl=yes
-    ],[
-      AC_CHECK_LIB([sasl], [sasl_client_init],[
-        SASL_LIBS="$SASL_LIBS -lsasl"
-        with_sasl=yes
-      ],[
-        if test "x$with_sasl" = "xcheck" ; then
-          with_sasl=no
-        else
-          fail=1
-        fi
-      ])
-    ])
-  fi
-  test $fail = 1 &&
-    AC_MSG_ERROR([You must install the Cyrus SASL development package in order to compile libvirt])
-  CFLAGS="$old_cflags"
-  LIBS="$old_libs"
-  if test "x$with_sasl" = "xyes" ; then
-    AC_DEFINE_UNQUOTED([WITH_SASL], 1,
-      [whether Cyrus SASL is available for authentication])
-  fi
-fi
-AM_CONDITIONAL([WITH_SASL], [test "x$with_sasl" = "xyes"])
-AC_SUBST([SASL_CFLAGS])
-AC_SUBST([SASL_LIBS])
-
-
 dnl DBus library
 DBUS_CFLAGS=
 DBUS_LIBS=
@@ -2957,6 +2903,7 @@ AC_MSG_NOTICE([Libraries])
 AC_MSG_NOTICE([])
 LIBVIRT_RESULT_LIBATTR
 LIBVIRT_RESULT_SANLOCK
+LIBVIRT_RESULT_SASL
 LIBVIRT_RESULT_YAJL
 AC_MSG_NOTICE([  libxml: $LIBXML_CFLAGS $LIBXML_LIBS])
 AC_MSG_NOTICE([  dlopen: $DLOPEN_LIBS])
@@ -2976,11 +2923,6 @@ else
 AC_MSG_NOTICE([ libssh2: no])
 fi
 AC_MSG_NOTICE([  gnutls: $GNUTLS_CFLAGS $GNUTLS_LIBS])
-if test "$with_sasl" != "no" ; then
-AC_MSG_NOTICE([    sasl: $SASL_CFLAGS $SASL_LIBS])
-else
-AC_MSG_NOTICE([    sasl: no])
-fi
 AC_MSG_NOTICE([firewalld: $with_firewalld])
 if test "$with_avahi" = "yes" ; then
 AC_MSG_NOTICE([   avahi: $AVAHI_CFLAGS $AVAHI_LIBS])
diff --git a/m4/virt-sasl.m4 b/m4/virt-sasl.m4
new file mode 100644
index 0000000..920c794
--- /dev/null
+++ b/m4/virt-sasl.m4
@@ -0,0 +1,12 @@
+dnl The libsasl2.so or libsasl.so library
+
+AC_DEFUN([LIBVIRT_CHECK_SASL],[
+  LIBVIRT_CHECK_LIB_FALLBACK([SASL], [SASL1], [sasl],
+                             [sasl2], [sasl],
+                             [sasl_client_init], [sasl_client_init],
+                             [sasl/sasl.h])
+])
+
+AC_DEFUN([LIBVIRT_RESULT_SASL],[
+  LIBVIRT_RESULT_LIB([SASL], [sasl])
+])
-- 
1.7.11.4


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