Patch against 2.5.9 for OpenSSL in lib64, pkg-config

Jason Englander jasoneng3 at
Mon Jul 25 16:25:54 EDT 2016

If you have a source installed OpenSSL under /usr/local/ssl on a 64-bit 
system, you probably have /usr/local/ssl/lib64 instead of 

In order for Cyrus IMAP configure to find the libraries, even passing 
--with-openssl=/usr/local/ssl to configure, you would need to use 
LDFLAGS=-L/usr/local/ssl/lib64 and also add /usr/local/ssl/lib64 to LIBS 
in perl/imap/Makefile.PL and perl/sieve/managesieve/Makefile.PL

I am no autoconf guru by any means, but I made two changes to 
that enable (after 'autoreconf -f -i') you to use either 
--with-ssl=/usr/local/ssl and have that check both lib and lib64 under 
there, and also if you use --with-ssl with no path, for it to try 
pkg-config before system defaults (e.g. /usr/include and /usr/lib).

If you go the pkg-config way, as long as your PKG_CONFIG_PATH variable 
(possibly set in /etc/profile) includes /usr/local/ssl/lib64/pkgconfig or 
wherever yours is, it should work.  I believe they added support for it to 
OpenSSL > 0.9.6

So far only tested on one Slackware Linux machine with source Cyrus IMAP 
2.5.9 and source OpenSSL 1.0.2h

---   2016-07-21 22:01:21.000000000 -0400
+++        2016-07-25 14:25:55.432452824 -0400
@@ -984,10 +984,16 @@
      # default args or --with-openssl
-    # try to enable, search in default system directories
-    ssl_cppflags=
-    ssl_ldflags=
+    # Try pkg-config - OpenSSL >= 0.9.6 has openssl.pc
+    ssl_cppflags="$OPENSSL_CFLAGS"
+    ssl_ldflags="$OPENSSL_LIBS"
+    if test -n "$ssl_cppflags" -a -n "$ssl_ldflags"; then
+      with_ssl=yes
+    fi
+    #
+    # If pkg-config doesn't work, search in default system directories
      # --with-openssl=DIR
@@ -995,7 +1001,11 @@
      if test -d "$with_ssl"; then
-       CMU_ADD_LIBPATH_TO(${with_ssl}/lib, ssl_ldflags)
+       if test -d "${with_ssl}/lib64"; then
+           CMU_ADD_LIBPATH_TO(${with_ssl}/lib64, ssl_ldflags)
+       else
+           CMU_ADD_LIBPATH_TO(${with_ssl}/lib, ssl_ldflags)
+       fi
         AC_WARN([Disabling OpenSSL - no include files found])

More information about the Info-cyrus mailing list