aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-01-24 14:34:47 -0500
committerNick Mathewson <nickm@torproject.org>2010-01-24 14:34:47 -0500
commitb6038f4ac646b52f0819724b344adcf04bc2a440 (patch)
tree677f03b639a8ea591f0ee56cacceb2c1354409a4 /configure.in
parentca60a6ce3f4786626ac455ec1b798b2e8304635c (diff)
downloadtor-b6038f4ac646b52f0819724b344adcf04bc2a440.tar.gz
tor-b6038f4ac646b52f0819724b344adcf04bc2a440.zip
Add --enable-static-(openssl|libevent) options
These options only work when using --with-(openssl|libevent)-dir to explicitly pick a libevent or openssl location.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in28
1 files changed, 28 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 7e2dd034ed..92dc45fd68 100644
--- a/configure.in
+++ b/configure.in
@@ -42,6 +42,10 @@ AC_ARG_ENABLE(openbsd-malloc,
AS_HELP_STRING(--enable-openbsd-malloc, Use malloc code from openbsd. Linux only))
AC_ARG_ENABLE(instrument-downloads,
AS_HELP_STRING(--enable-instrument-downloads, Instrument downloads of directory resources etc.))
+AC_ARG_ENABLE(static-openssl,
+ AS_HELP_STRING(--enable-static-openssl, Link against a static openssl library. Requires --with-openssl-dir))
+AC_ARG_ENABLE(static-libevent,
+ AS_HELP_STRING(--enable-static-libevent, Link against a static libevent library. Requires --with-libevent-dir))
if test x$enable_buf_freelists != xno; then
AC_DEFINE(ENABLE_BUF_FREELISTS, 1,
@@ -281,6 +285,17 @@ LIBS="$save_LIBS"
LDFLAGS="$save_LDFLAGS"
CPPFLAGS="$save_CPPFLAGS"
+if test "$enable_static_libevent" = "yes"; then
+ if test "$tor_cv_library_libevent_dir" = "(system)"; then
+ AC_MSG_ERROR("You must specify an explicit --with-libevent-dir=x option when using --enable-static-libevent")
+ else
+ TOR_LIBEVENT_LIBS="$TOR_LIBDIR_libevent/libevent.a"
+ fi
+else
+ TOR_LIBEVENT_LIBS="-levent"
+fi
+AC_SUBST(TOR_LIBEVENT_LIBS)
+
dnl ------------------------------------------------------
dnl Where do you live, openssl? And how do we call you?
@@ -306,6 +321,19 @@ TOR_SEARCH_LIBRARY(openssl, $tryssldir, [-lssl -lcrypto $TOR_LIB_GDI],
dnl XXXX check for OPENSSL_VERSION_NUMBER == SSLeay()
+echo "tor_cv_library_openssl_dir is $tor_cv_library_openssl_dir"
+if test "$enable_static_openssl" = "yes"; then
+ if test "$tor_cv_library_openssl_dir" = "(system)"; then
+ AC_MSG_ERROR("You must specify an explicit --with-openssl-dir=x option when using --enable-static-openssl")
+ else
+ TOR_OPENSSL_LIBS="$TOR_LIBDIR_openssl/libcrypto.a $TOR_LIBDIR_openssl/libssl.a"
+ fi
+else
+ TOR_OPENSSL_LIBS="-lcrypto -lssl"
+fi
+echo "TOR_OPENSSL_LIBS=$TOR_OPENSSL_LIBS"
+AC_SUBST(TOR_OPENSSL_LIBS)
+
dnl ------------------------------------------------------
dnl Where do you live, zlib? And how do we call you?