[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-bugs] #26464 [- Select a component]: Static cross-compiling for Windows is broken



#26464: Static cross-compiling for Windows is broken
--------------------------------------+----------------------
     Reporter:  Hello71               |      Owner:  Hello71
         Type:  defect                |     Status:  assigned
     Priority:  Medium                |  Milestone:
    Component:  - Select a component  |    Version:
     Severity:  Normal                |   Keywords:
Actual Points:                        |  Parent ID:
       Points:                        |   Reviewer:
      Sponsor:                        |
--------------------------------------+----------------------
 two issues:

 1. TOR_OPENSSL_LIBS doesn't include $TOR_LIB_GDI $TOR_LIB_WS32.

 2. openssl checking doesn't include -lz.

 IMO, both should be fixed by using pkg-config. however, I don't feel like
 that much pain, so I just made this hacky patch:

 {{{
 diff --git a/configure.ac b/configure.ac
 index 30f8e63ec..15f4058da 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -672,15 +672,18 @@ if test "$bwin32" = "true"; then
    # think it's actually necessary.
    TOR_LIB_GDI=-lgdi32
    TOR_LIB_USERENV=-luserenv
 +  TOR_LIB_ZLIB=-lz
  else
    TOR_LIB_WS32=
    TOR_LIB_GDI=
    TOR_LIB_USERENV=
 +  TOR_LIB_ZLIB=
  fi
  AC_SUBST(TOR_LIB_WS32)
  AC_SUBST(TOR_LIB_GDI)
  AC_SUBST(TOR_LIB_IPHLPAPI)
  AC_SUBST(TOR_LIB_USERENV)
 +AC_SUBST(TOR_LIB_ZLIB)

  tor_libevent_pkg_redhat="libevent"
  tor_libevent_pkg_debian="libevent-dev"
 @@ -812,7 +815,7 @@ AC_ARG_WITH(ssl-dir,
    ])

  AC_MSG_NOTICE([Now, we'll look for OpenSSL >= 1.0.1])
 -TOR_SEARCH_LIBRARY(openssl, $tryssldir, [-lssl -lcrypto $TOR_LIB_GDI
 $TOR_LIB_WS32],
 +TOR_SEARCH_LIBRARY(openssl, $tryssldir, [-lssl -lcrypto $TOR_LIB_GDI
 $TOR_LIB_WS32 $TOR_LIB_ZLIB],
      [#include <openssl/ssl.h>
       char *getenv(const char *);],
      [struct ssl_cipher_st;
 @@ -833,10 +836,10 @@ 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/libssl.a
 $TOR_LIBDIR_openssl/libcrypto.a"
 +     TOR_OPENSSL_LIBS="$TOR_LIBDIR_openssl/libssl.a
 $TOR_LIBDIR_openssl/libcrypto.a $TOR_LIB_GDI $TOR_LIB_WS32 $TOR_LIB_ZLIB"
     fi
  else
 -     TOR_OPENSSL_LIBS="-lssl -lcrypto"
 +     TOR_OPENSSL_LIBS="-lssl -lcrypto $TOR_LIB_GDI $TOR_LIB_WS32
 $TOR_LIB_ZLIB"
  fi
  AC_SUBST(TOR_OPENSSL_LIBS)
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26464>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs