THRIFT-3555 'configure' script does not honor --with-openssl=<path> for libcrypto for BN_init
Client: Build
Patch: Nobuaki Sukegawa
This closes #805
diff --git a/configure.ac b/configure.ac
index 92dc58c..cca432c 100755
--- a/configure.ac
+++ b/configure.ac
@@ -571,21 +571,6 @@
AC_CHECK_LIB(rt, clock_gettime)
AC_CHECK_LIB(socket, setsockopt)
-if test "$have_cpp" = "yes" ; then
-# mingw toolchain used to build "Thrift Compiler for Windows"
-# does not support libcrypto, so we just check if we building the cpp library
-AC_CHECK_LIB(crypto,
- BN_init,
- [AC_CHECK_LIB(ssl,
- SSL_ctrl,
- [LIBS="-lssl -lcrypto $LIBS"],
- [AC_MSG_ERROR(["Error: libssl required"])],
- -lcrypto
- )],
- [AC_MSG_ERROR(["Error: libcrypto required."])]
-)
-fi
-
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am
index dac840a..6fd15d2 100755
--- a/lib/cpp/Makefile.am
+++ b/lib/cpp/Makefile.am
@@ -35,7 +35,8 @@
lib_LTLIBRARIES = libthrift.la
pkgconfig_DATA = thrift.pc
-libthrift_la_LDFLAGS = -release $(VERSION) $(BOOST_LDFLAGS) $(OPENSSL_LDFLAGS)
+libthrift_la_LDFLAGS = -release $(VERSION)
+libthrift_la_LIBADD = $(BOOST_LDFLAGS) $(OPENSSL_LDFLAGS) $(OPENSSL_LIBS)
## We only build the extra libraries if we have the dependencies,
## but we install all of the headers unconditionally.
@@ -58,7 +59,6 @@
AM_CXXFLAGS = -Wall -Wextra -pedantic
AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(OPENSSL_INCLUDES) -I$(srcdir)/src -D__STDC_LIMIT_MACROS
-AM_LDFLAGS = $(BOOST_LDFLAGS) $(OPENSSL_LDFLAGS)
# Define the source files for the module
diff --git a/lib/cpp/test/Makefile.am b/lib/cpp/test/Makefile.am
index 1895afc..5f3b117 100755
--- a/lib/cpp/test/Makefile.am
+++ b/lib/cpp/test/Makefile.am
@@ -326,7 +326,9 @@
OpenSSLManualInitTest_LDADD = \
$(top_builddir)/lib/cpp/libthrift.la \
- $(BOOST_TEST_LDADD)
+ $(BOOST_TEST_LDADD) \
+ $(OPENSSL_LDFLAGS) \
+ $(OPENSSL_LIBS)
#
# Common thrift code generation rules