Merge remote-tracking branch 'origin/patches-2.0'

This commit is contained in:
Nick Mathewson 2011-05-06 11:06:11 -04:00
commit 6b23518d85
3 changed files with 54 additions and 18 deletions

View File

@ -189,7 +189,7 @@ libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS)
if OPENSSL if OPENSSL
libevent_openssl_la_SOURCES = bufferevent_openssl.c libevent_openssl_la_SOURCES = bufferevent_openssl.c
libevent_openssl_la_LIBADD = $(MAYBE_CORE) -lssl -lcrypto libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS)
libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS) libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS)
endif endif

View File

@ -95,6 +95,19 @@ AC_SEARCH_LIBS([inet_aton], [resolv])
AC_SEARCH_LIBS([clock_gettime], [rt]) AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([sendfile], [sendfile]) AC_SEARCH_LIBS([sendfile], [sendfile])
dnl - check if the macro WIN32 is defined on this compiler.
dnl - (this is how we check for a windows version of GCC)
AC_MSG_CHECKING(for WIN32)
AC_TRY_COMPILE(,
[
#ifndef WIN32
die horribly
#endif
],
bwin32=true; AC_MSG_RESULT(yes),
bwin32=false; AC_MSG_RESULT(no),
)
AC_CHECK_HEADERS([zlib.h]) AC_CHECK_HEADERS([zlib.h])
if test "x$ac_cv_header_zlib_h" = "xyes"; then if test "x$ac_cv_header_zlib_h" = "xyes"; then
@ -114,6 +127,18 @@ fi
AM_CONDITIONAL(ZLIB_REGRESS, [test "$have_zlib" = "yes"]) AM_CONDITIONAL(ZLIB_REGRESS, [test "$have_zlib" = "yes"])
dnl See if we have openssl. This doesn't go in LIBS either. dnl See if we have openssl. This doesn't go in LIBS either.
if test "$bwin32" = true; then
EV_LIB_WS32=-lws2_32
EV_LIB_GDI=-lgdi32
else
EV_LIB_WS32=
EV_LIB_GDI=
fi
AC_SUBST(EV_LIB_WS32)
AC_SUBST(EV_LIB_GDI)
AC_CHECK_HEADERS([openssl/bio.h])
if test "$enable_openssl" = "yes"; then if test "$enable_openssl" = "yes"; then
save_LIBS="$LIBS" save_LIBS="$LIBS"
LIBS="" LIBS=""
@ -121,8 +146,11 @@ OPENSSL_LIBS=""
have_openssl=no have_openssl=no
AC_SEARCH_LIBS([SSL_new], [ssl], AC_SEARCH_LIBS([SSL_new], [ssl],
[have_openssl=yes [have_openssl=yes
OPENSSL_LIBS="$LIBS" OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32"
AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl])]) AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl])],
[have_openssl=no
AC_DEFINE(HAVE_OPENSSL, 0, [Define if the system lacks openssl])],
[-lcrypto $EV_LIB_GDI $EV_LIB_WS32])
LIBS="$save_LIBS" LIBS="$save_LIBS"
AC_SUBST(OPENSSL_LIBS) AC_SUBST(OPENSSL_LIBS)
fi fi
@ -213,19 +241,6 @@ if test "x$ac_cv_header_sys_sysctl_h" = "xyes"; then
) )
fi fi
dnl - check if the macro WIN32 is defined on this compiler.
dnl - (this is how we check for a windows version of GCC)
AC_MSG_CHECKING(for WIN32)
AC_TRY_COMPILE(,
[
#ifndef WIN32
die horribly
#endif
],
bwin32=true; AC_MSG_RESULT(yes),
bwin32=false; AC_MSG_RESULT(no),
)
AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue) AM_CONDITIONAL(BUILD_WIN32, test x$bwin32 = xtrue)
if test x$bwin32 = xtrue; then if test x$bwin32 = xtrue; then

View File

@ -46,7 +46,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <zlib.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
@ -58,6 +57,28 @@
#include "regress.h" #include "regress.h"
/* zlib 1.2.4 and 1.2.5 do some "clever" things with macros. Instead of
saying "(defined(FOO) ? FOO : 0)" they like to say "FOO-0", on the theory
that nobody will care if the compile outputs a no-such-identifier warning.
Sorry, but we like -Werror over here, so I guess we need to define these.
I hope that zlib 1.2.6 doesn't break these too.
*/
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE 0
#endif
#ifndef _LFS64_LARGEFILE
#define _LFS64_LARGEFILE 0
#endif
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 0
#endif
#ifndef off64_t
#define off64_t ev_int64_t
#endif
#include <zlib.h>
static int infilter_calls; static int infilter_calls;
static int outfilter_calls; static int outfilter_calls;
static int readcb_finished; static int readcb_finished;