From 14299cef23826c8401f80e06e5791efd3508a958 Mon Sep 17 00:00:00 2001 From: Steven Murdoch Date: Sat, 10 Dec 2011 17:36:52 +0000 Subject: [PATCH] If asked to use a static OpenSSL, pass -static when building autoconf test Previously, autoconf would always try to build a dynamic executable, even if Tor would have OpenSSL linked in statically. The result is that if only a static OpenSSL library was available, ./configure would fail, even though it would be possible to build Tor. This fixes the problem on Windows, but fails on Linux because the right way to link OpenSSL statically is to explicitly link in libssl.a and libcrypto.a on the command line, rather than specifying -static. The latter always fails with the error "ld: library not found for -lcrt0.o" --- configure.in | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 84eaca6..3114c75 100644 --- a/configure.in +++ b/configure.in @@ -499,7 +499,12 @@ AC_ARG_WITH(ssl-dir, fi ]) -TOR_SEARCH_LIBRARY(openssl, $tryssldir, [-lssl -lcrypto $TOR_LIB_GDI], +STATIC_OPENSSL_FLAGS="" +if test "$enable_static_openssl" = "yes"; then + STATIC_OPENSSL_FLAGS="-static" +fi + +TOR_SEARCH_LIBRARY(openssl, $tryssldir, [$STATIC_OPENSSL_FLAGS -lssl -lcrypto $TOR_LIB_GDI], [#include ], [void RAND_add(const void *buf, int num, double entropy);], [RAND_add((void*)0,0,0); exit(0);], [], -- 1.7.0.2.msysgit.0