From fcb6cba42ffcf9ac0df2b77de28f021154c746b4 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Thu, 26 Jun 2008 14:51:03 +0000 Subject: [PATCH] require libevent >= 1.3b --- NEWS | 3 +++ README | 6 ++++-- configure.ac | 14 ++++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 2e46ee3..de3262d 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,9 @@ 2008-07-xx - PgBouncer 1.2 - "Universal Shredder" + PgBouncer 1.2 now requires libevent version 1.3b or newer. + Older libevent versions crash with new restart code. + = Features = * Command line option (-u) and config parameter (user=) to support user diff --git a/README b/README index dae150e..db96046 100644 --- a/README +++ b/README @@ -10,8 +10,10 @@ Source: http://pgfoundry.org/projects/pgbouncer Building --------- -PgBouncer uses libevent for low-level socket handling. When this is -installed just run: +PgBouncer uses libevent for low-level socket handling. +Libevent needs to be at least version 1.3b. + +When this is installed just run: $ ./configure --prefix=/usr/local --with-libevent=/prefix $ make diff --git a/configure.ac b/configure.ac index c168acd..738240e 100644 --- a/configure.ac +++ b/configure.ac @@ -115,7 +115,7 @@ AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(hstrerror, resolv) dnl Find libevent -AC_MSG_CHECKING([for libevent 1.2+]) +AC_MSG_CHECKING([for libevent]) AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=prefix],[Specify where libevent is installed]), [ test "$withval" = "no" && AC_MSG_ERROR("cannot work without libevent") @@ -134,7 +134,17 @@ AC_LINK_IFELSE([ event_base_free(NULL); } ], [AC_MSG_RESULT([found])], -[AC_MSG_ERROR([not found])]) +[AC_MSG_ERROR([not found, cannot proceed])]) + +dnl libevent < 1.3b crashes on event_base_free() +dnl no good way to check libevent version. use hack: +dnl evhttp.h defines HTTP_SERVUNAVAIL only since 1.3b +AC_MSG_CHECKING([whether libevent version >= 1.3b]) +AC_EGREP_CPP([HTTP_SERVUNAVAIL], +[#include + HTTP_SERVUNAVAIL ], +[AC_MSG_ERROR([no, cannot proceed])], +[AC_MSG_RESULT([yes])]) # autoconf does not want to find 'install', if not using automake... INSTALL=install -- 2.40.0