openssl: Check and link against libeay32 instead of libcrypto on Windows
authorMartin Willi <martin@revosec.ch>
Fri, 25 Oct 2013 15:28:13 +0000 (17:28 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:02 +0000 (15:53 +0200)
Most Windows OpenSSL builds come with the crypto library named libeay32.

configure.ac
src/libstrongswan/plugins/openssl/Makefile.am

index 754b492..803c725 100644 (file)
@@ -733,9 +733,18 @@ AC_COMPILE_IFELSE(
                  # error WIN32 undefined
                  #endif
                ]])],
-       [AC_MSG_RESULT([yes]); windows=true ],
-       [AC_MSG_RESULT([no]); AC_SUBST(PLUGIN_CFLAGS, [-rdynamic])]
+       [
+               AC_MSG_RESULT([yes])
+               windows=true
+               openssl_lib=eay32
+       ],
+       [
+               AC_MSG_RESULT([no])
+               openssl_lib=crypto
+               AC_SUBST(PLUGIN_CFLAGS, [-rdynamic])
+       ]
 )
+AC_SUBST(OPENSSL_LIB, [-l$openssl_lib])
 AM_CONDITIONAL(USE_WINDOWS, [test "x$windows" = xtrue])
 
 if test x$printf_hooks = xvstr; then
@@ -918,7 +927,7 @@ if test x$sqlite = xtrue; then
 fi
 
 if test x$openssl = xtrue; then
-       AC_CHECK_LIB([crypto],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([OpenSSL crypto library not found])],[])
+       AC_CHECK_LIB([$openssl_lib],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([OpenSSL lib$openssl_lib not found])],[])
        AC_CHECK_HEADER([openssl/evp.h],,[AC_MSG_ERROR([OpenSSL header openssl/evp.h not found!])])
 fi
 
index a7ffefd..9287f78 100644 (file)
@@ -32,4 +32,4 @@ libstrongswan_openssl_la_SOURCES = \
        openssl_gcm.c openssl_gcm.h
 
 libstrongswan_openssl_la_LDFLAGS = -module -avoid-version
-libstrongswan_openssl_la_LIBADD  = -lcrypto
+libstrongswan_openssl_la_LIBADD  = $(OPENSSL_LIB)