<<< Date Index >>>     <<< Thread Index >>>

[PATCH] OpenSolaris sasl fix for configure.ac



I've modified the configure.ac so that if the --with-sasl=/usr configure
option is provided on a OpenSolaris system the derived configure script
will first try looking for and linking -lsasl2 and if that isn't found
will try -lsasl which is the Solaris/OpenSolaris variant of the SASL
lib.  I've run mutt compiled with -lsasl on OpenSolaris and it appears
to work when sending to a mail server using SASL plain auth with SSL
protection.

# HG changeset patch
# User Will Fiveash <will.fiveash@xxxxxxxxxx>
# Date 1267817445 21600
# Branch HEAD
# Node ID 1283cc4e0a4128e5ecab6a3cb921610c40a9deb0
# Parent  f46b9ef31effb3169e23dc36f05ab264abbc861c
OpenSolaris sasl fix for configure.ac

diff -r f46b9ef31eff -r 1283cc4e0a41 configure.ac
--- a/configure.ac      Fri Mar 05 13:28:16 2010 -0600
+++ b/configure.ac      Fri Mar 05 13:30:45 2010 -0600
@@ -718,7 +718,7 @@
 
 AM_CONDITIONAL(USE_SSL, test x$need_ssl = xyes)
 
-AC_ARG_WITH(sasl, AC_HELP_STRING([--with-sasl@<:@=PFX@:>@], [Use Cyrus SASL 2 
network security library]),
+AC_ARG_WITH(sasl, AC_HELP_STRING([--with-sasl@<:@=PFX@:>@], [Use SASL network 
security library]),
         [      
         if test "$with_sasl" != "no"
         then
@@ -734,15 +734,18 @@
           fi
 
           saved_LIBS="$LIBS"
+          LIBS=
 
-          AC_CHECK_LIB(sasl2, sasl_client_init,,
-            AC_MSG_ERROR([could not find libsasl2]),)
+          sasl_libs="sasl2 sasl"
+          AC_SEARCH_LIBS(sasl_client_init, [$sasl_libs],,
+                  AC_MSG_ERROR([could not find sasl lib]),)
 
+          MUTTLIBS="$MUTTLIBS $LIBS"
           MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
-          MUTTLIBS="$MUTTLIBS -lsasl2"
           LIBS="$saved_LIBS"
+
           AC_DEFINE(USE_SASL,1,
-                  [ Define if want to use the Cyrus SASL library for POP/IMAP 
authentication. ])
+                  [ Define if want to use the SASL library for POP/IMAP 
authentication. ])
           need_sasl=yes
         fi
         ])