Skip to content
This repository was archived by the owner on Nov 29, 2019. It is now read-only.

Commit 1b80eec

Browse files
committed
Remove use of libusual event module
We use libevent directly now and use pkg-config to look it up. The libusual event module was from a time when libevent was new and evolving, but now we don't need it anymore and can use libevent directly.
1 parent 6af258c commit 1b80eec

File tree

8 files changed

+17
-11
lines changed

8 files changed

+17
-11
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pgbouncer_SOURCES = \
5858
include/common/unicode_norm.h \
5959
include/common/unicode_norm_table.h
6060

61-
pgbouncer_CPPFLAGS = -Iinclude $(CARES_CFLAGS) $(TLS_CPPFLAGS)
61+
pgbouncer_CPPFLAGS = -Iinclude $(CARES_CFLAGS) $(LIBEVENT_CFLAGS) $(TLS_CPPFLAGS)
6262

6363
# include libusual sources directly
6464
AM_FEATURES = libusual
@@ -93,7 +93,7 @@ LIBUSUAL_DIST = $(filter-out %/config.h, $(sort $(wildcard \
9393
lib/find_modules.sh )))
9494

9595
pgbouncer_LDFLAGS := $(TLS_LDFLAGS)
96-
pgbouncer_LDADD := $(CARES_LIBS) $(TLS_LIBS) $(LIBS)
96+
pgbouncer_LDADD := $(CARES_LIBS) $(LIBEVENT_LIBS) $(TLS_LIBS) $(LIBS)
9797
LIBS :=
9898

9999
#
@@ -148,7 +148,7 @@ zip: configure clean
148148
&& ../configure --host=$(w32arch) --disable-debug \
149149
--without-openssl \
150150
--without-cares \
151-
--with-libevent=/opt/apps/win32 --enable-evdns \
151+
--enable-evdns \
152152
&& make \
153153
&& $(w32arch)-strip pgbouncer.exe pgbevent.dll \
154154
&& zip pgbouncer.zip pgbouncer.exe pgbevent.dll doc/*.html

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PgBouncer depends on few things to get compiled:
2727

2828
When dependencies are installed just run:
2929

30-
$ ./configure --prefix=/usr/local --with-libevent=libevent-prefix
30+
$ ./configure --prefix=/usr/local
3131
$ make
3232
$ make install
3333

config.mak.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ nosub_top_builddir ?= @top_builddir@
5555
CARES_CFLAGS = @CARES_CFLAGS@
5656
CARES_LIBS = @CARES_LIBS@
5757

58+
LIBEVENT_CFLAGS = @LIBEVENT_CFLAGS@
59+
LIBEVENT_LIBS = @LIBEVENT_LIBS@
60+
5861
TLS_CPPFLAGS = @TLS_CPPFLAGS@
5962
TLS_LDFLAGS = @TLS_LDFLAGS@
6063
TLS_LIBS = @TLS_LIBS@

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ AC_SEARCH_LIBS(hstrerror, resolv)
5454
AC_CHECK_FUNCS(lstat)
5555

5656
dnl Find libevent
57-
AC_USUAL_LIBEVENT
57+
PKG_CHECK_MODULES(LIBEVENT, libevent)
5858

5959
dnl Check for PAM authorization support
6060
pam_support=no

include/bouncer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@
3434
#include <usual/socket.h>
3535
#include <usual/safeio.h>
3636
#include <usual/mbuf.h>
37-
#include <usual/event.h>
3837
#include <usual/strpool.h>
3938

39+
#include <event.h>
40+
4041
#define FULLVER PACKAGE_NAME " version " PACKAGE_VERSION
4142

4243
/* each state corresponds to a list */

test/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ EXTRA_DIST = conntest.sh ctest6000.ini ctest7000.ini run-conntest.sh \
1313
test.ini test.sh stress.py userlist.txt
1414

1515
noinst_PROGRAMS = hba_test
16-
hba_test_CPPFLAGS = -I../include
16+
hba_test_CPPFLAGS = -I../include $(LIBEVENT_CFLAGS)
17+
hba_test_LDADD = $(LIBEVENT_LIBS)
1718
hba_test_CFLAGS = -O0
1819
hba_test_SOURCES = hba_test.c ../src/hba.c ../src/util.c
1920
hba_test_EMBED_LIBUSUAL = 1
2021

2122
EXTRA_PROGRAMS = asynctest
22-
asynctest_CPPFLAGS = -I../include $(PG_CPPFLAGS)
23+
asynctest_CPPFLAGS = -I../include $(PG_CPPFLAGS) $(LIBEVENT_CFLAGS)
2324
asynctest_LDFLAGS = $(PG_LDFLAGS)
24-
asynctest_LDADD = $(PG_LIBS)
25+
asynctest_LDADD = $(PG_LIBS) $(LIBEVENT_LIBS)
2526
asynctest_SOURCES = asynctest.c
2627
asynctest_EMBED_LIBUSUAL = 1
2728

test/asynctest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#undef main
1212
#endif
1313

14-
#include <usual/event.h>
1514
#include <usual/logging.h>
1615
#include <usual/getopt.h>
1716
#include <usual/logging.h>
@@ -20,6 +19,7 @@
2019
#include <usual/time.h>
2120
#include <usual/string.h>
2221

22+
#include <event.h>
2323
#include <libpq-fe.h>
2424

2525
static char *simple_query = "select 1";

test/hba_test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
#include <usual/mbuf.h>
99
#include <usual/socket.h>
1010
#include <usual/err.h>
11-
#include <usual/event.h>
11+
12+
#include <event.h>
1213

1314
int cf_tcp_keepcnt;
1415
int cf_tcp_keepintvl;

0 commit comments

Comments
 (0)