summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-11-18 11:24:38 -0500
committerDavid Goulet <dgoulet@torproject.org>2020-12-08 09:14:49 -0500
commitc618c4f27986825df2026fb22b8ee222edd1afa1 (patch)
tree6acbb180234e26cf597a73e5dabb8398fec1e0cb /configure.ac
parent2f87b2ab75e29cbd9ee2989c5e7739234818e4d4 (diff)
downloadtor-c618c4f27986825df2026fb22b8ee222edd1afa1.tar.gz
tor-c618c4f27986825df2026fb22b8ee222edd1afa1.zip
configure: Fix the --enable-static-tor switch
The "-static" compile flag was set globally which means that all autoconf test were attempting to be built statically and lead to failures of detecting OpenSSL libraries and others. This commit adds this flag only to the "tor" binary build. There is also a fix on where to find libevent.a since it is using libtool, it is in .libs/. At this commit, there are still warnings being emitted that informs the user that the built binary must still be linked dynamically with glibc. Fixes #40111 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 3 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 6eb09db429..83f6ad1821 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,8 +129,9 @@ if test "$enable_static_tor" = "yes"; then
enable_static_libevent="yes";
enable_static_openssl="yes";
enable_static_zlib="yes";
- CFLAGS="$CFLAGS -static"
+ TOR_STATIC_LDFLAGS="-static"
fi
+AC_SUBST(TOR_STATIC_LDFLAGS)
if test "$enable_system_torrc" = "no"; then
AC_DEFINE(DISABLE_SYSTEM_TORRC, 1,
@@ -953,7 +954,7 @@ 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 $STATIC_LIBEVENT_FLAGS"
+ TOR_LIBEVENT_LIBS="$TOR_LIBDIR_libevent/.libs/libevent.a $STATIC_LIBEVENT_FLAGS"
fi
else
if test "x$ac_cv_header_event2_event_h" = "xyes"; then