Ticket #19450: 0001-Fix-19450-Rip-out-enable-bufferevents.patch

File 0001-Fix-19450-Rip-out-enable-bufferevents.patch, 3.3 KB (added by U+039b, 4 years ago)

Proposed patch

  • configure.ac

    From 7ecb70331e354ba0d69e053a1b73a27e3401db9c Mon Sep 17 00:00:00 2001
    From: U+039b <*@0x39b.fr>
    Date: Wed, 22 Jun 2016 19:45:23 +0200
    Subject: [PATCH] Fix #19450 Rip out --enable-bufferevents
    
    ---
     configure.ac | 58 +---------------------------------------------------------
     1 file changed, 1 insertion(+), 57 deletions(-)
    
    diff --git a/configure.ac b/configure.ac
    index 6d721a2..8926de8 100644
    a b AC_ARG_ENABLE(tor2web-mode, 
    169169    CFLAGS="$CFLAGS -D ENABLE_TOR2WEB_MODE=1"
    170170fi])
    171171
    172 AC_ARG_ENABLE(bufferevents,
    173      AS_HELP_STRING(--enable-bufferevents, [use Libevent's buffered IO]))
    174 
    175172AC_ARG_ENABLE(tool-name-check,
    176173     AS_HELP_STRING(--disable-tool-name-check, [check for sanely named toolchain when cross-compiling]))
    177174
    AC_CHECK_MEMBERS([struct event.min_heap_idx], , , 
    516513[#include <event.h>
    517514])
    518515
    519 AC_CHECK_HEADERS(event2/event.h event2/dns.h event2/bufferevent_ssl.h)
     516AC_CHECK_HEADERS(event2/event.h event2/dns.h)
    520517
    521518LIBS="$STATIC_LIBEVENT_FLAGS $TOR_LIB_WS32 $save_LIBS"
    522519
    LIBS="$save_LIBS" 
    549546LDFLAGS="$save_LDFLAGS"
    550547CPPFLAGS="$save_CPPFLAGS"
    551548
    552 dnl This isn't the best test for Libevent 2.0.3-alpha.  Once it's released,
    553 dnl we can do much better.
    554 if test "$enable_bufferevents" = "yes"; then
    555   if test "$ac_cv_header_event2_bufferevent_ssl_h" != "yes"; then
    556     AC_MSG_ERROR([You've asked for bufferevent support, but you're using a version of Libevent without SSL support.  This won't work.  We need Libevent 2.0.8-rc or later, and you don't seem to even have Libevent 2.0.3-alpha.])
    557   else
    558 
    559     CPPFLAGS="$CPPFLAGS $TOR_CPPFLAGS_libevent"
    560 
    561     # Check for the right version.  First see if version detection works.
    562     AC_MSG_CHECKING([whether we can detect the Libevent version])
    563     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
    564 #include <event2/event.h>
    565 #if !defined(LIBEVENT_VERSION_NUMBER) || LIBEVENT_VERSION_NUMBER < 10
    566 #error
    567 int x = y(zz);
    568 #else
    569 int x = 1;
    570 #endif
    571   ])], [event_version_number_works=yes; AC_MSG_RESULT([yes]) ],
    572      [event_version_number_works=no;  AC_MSG_RESULT([no])])
    573     if test "$event_version_number_works" != "yes"; then
    574       AC_MSG_WARN([Version detection on Libevent seems broken.  Your Libevent installation is probably screwed up or very old.])
    575     else
    576       AC_MSG_CHECKING([whether Libevent is new enough for bufferevents])
    577       AC_COMPILE_IFELSE([AC_LANG_SOURCE([
    578 #include <event2/event.h>
    579 #if !defined(LIBEVENT_VERSION_NUMBER) || LIBEVENT_VERSION_NUMBER < 0x02000d00
    580 #error
    581 int x = y(zz);
    582 #else
    583 int x = 1;
    584 #endif
    585    ])], [ AC_MSG_RESULT([yes]) ],
    586       [ AC_MSG_RESULT([no])
    587         AC_MSG_ERROR([Libevent does not seem new enough to support bufferevents.  We require 2.0.13-stable or later]) ] )
    588     fi
    589   fi
    590 fi
    591 
    592 LIBS="$save_LIBS"
    593 LDFLAGS="$save_LDFLAGS"
    594 CPPFLAGS="$save_CPPFLAGS"
    595 
    596 AM_CONDITIONAL(USE_BUFFEREVENTS, test "$enable_bufferevents" = "yes")
    597 if test "$enable_bufferevents" = "yes"; then
    598   AC_DEFINE(USE_BUFFEREVENTS, 1, [Defined if we're going to use Libevent's buffered IO API])
    599   if test "$enable_static_libevent" = "yes"; then
    600     TOR_LIBEVENT_LIBS="$TOR_LIBDIR_libevent/libevent_openssl.a $TOR_LIBEVENT_LIBS"
    601   else
    602     TOR_LIBEVENT_LIBS="-levent_openssl $TOR_LIBEVENT_LIBS"
    603   fi
    604 fi
    605549AC_SUBST(TOR_LIBEVENT_LIBS)
    606550
    607551dnl ------------------------------------------------------