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

[PATCH] modify configure.ac so OpenSolaris SASL can be used



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.

I've attached the patch.  Please let me know if you'd rather I do a hg
push from my repo.
-- 
Will Fiveash
diff -r f46b9ef31eff configure.ac
--- a/configure.ac      Fri Mar 05 13:28:16 2010 -0600
+++ b/configure.ac      Fri Mar 05 13:31:48 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
         ])