From c618c4f27986825df2026fb22b8ee222edd1afa1 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Wed, 18 Nov 2020 11:24:38 -0500 Subject: 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 --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'configure.ac') 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 -- cgit v1.2.3-54-g00ecf