From 1b80eec40910d61d30a30e4d9fd44aaafd58d9a0 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 11 Sep 2019 10:20:27 +0200 Subject: [PATCH] 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. --- Makefile | 6 +++--- README.md | 2 +- config.mak.in | 3 +++ configure.ac | 2 +- include/bouncer.h | 3 ++- test/Makefile | 7 ++++--- test/asynctest.c | 2 +- test/hba_test.c | 3 ++- 8 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 05f095e..b72a51c 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ pgbouncer_SOURCES = \ include/common/unicode_norm.h \ include/common/unicode_norm_table.h -pgbouncer_CPPFLAGS = -Iinclude $(CARES_CFLAGS) $(TLS_CPPFLAGS) +pgbouncer_CPPFLAGS = -Iinclude $(CARES_CFLAGS) $(LIBEVENT_CFLAGS) $(TLS_CPPFLAGS) # include libusual sources directly AM_FEATURES = libusual @@ -93,7 +93,7 @@ LIBUSUAL_DIST = $(filter-out %/config.h, $(sort $(wildcard \ lib/find_modules.sh ))) pgbouncer_LDFLAGS := $(TLS_LDFLAGS) -pgbouncer_LDADD := $(CARES_LIBS) $(TLS_LIBS) $(LIBS) +pgbouncer_LDADD := $(CARES_LIBS) $(LIBEVENT_LIBS) $(TLS_LIBS) $(LIBS) LIBS := # @@ -148,7 +148,7 @@ zip: configure clean && ../configure --host=$(w32arch) --disable-debug \ --without-openssl \ --without-cares \ - --with-libevent=/opt/apps/win32 --enable-evdns \ + --enable-evdns \ && make \ && $(w32arch)-strip pgbouncer.exe pgbevent.dll \ && zip pgbouncer.zip pgbouncer.exe pgbevent.dll doc/*.html diff --git a/README.md b/README.md index cde2e88..f5be06d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ PgBouncer depends on few things to get compiled: When dependencies are installed just run: - $ ./configure --prefix=/usr/local --with-libevent=libevent-prefix + $ ./configure --prefix=/usr/local $ make $ make install diff --git a/config.mak.in b/config.mak.in index 5cd9e5f..460d194 100644 --- a/config.mak.in +++ b/config.mak.in @@ -55,6 +55,9 @@ nosub_top_builddir ?= @top_builddir@ CARES_CFLAGS = @CARES_CFLAGS@ CARES_LIBS = @CARES_LIBS@ +LIBEVENT_CFLAGS = @LIBEVENT_CFLAGS@ +LIBEVENT_LIBS = @LIBEVENT_LIBS@ + TLS_CPPFLAGS = @TLS_CPPFLAGS@ TLS_LDFLAGS = @TLS_LDFLAGS@ TLS_LIBS = @TLS_LIBS@ diff --git a/configure.ac b/configure.ac index f049fdc..30d3811 100644 --- a/configure.ac +++ b/configure.ac @@ -54,7 +54,7 @@ AC_SEARCH_LIBS(hstrerror, resolv) AC_CHECK_FUNCS(lstat) dnl Find libevent -AC_USUAL_LIBEVENT +PKG_CHECK_MODULES(LIBEVENT, libevent) dnl Check for PAM authorization support pam_support=no diff --git a/include/bouncer.h b/include/bouncer.h index f2ed5a7..7603cb5 100644 --- a/include/bouncer.h +++ b/include/bouncer.h @@ -34,9 +34,10 @@ #include #include #include -#include #include +#include + #define FULLVER PACKAGE_NAME " version " PACKAGE_VERSION /* each state corresponds to a list */ diff --git a/test/Makefile b/test/Makefile index b408298..fecb08b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -13,15 +13,16 @@ EXTRA_DIST = conntest.sh ctest6000.ini ctest7000.ini run-conntest.sh \ test.ini test.sh stress.py userlist.txt noinst_PROGRAMS = hba_test -hba_test_CPPFLAGS = -I../include +hba_test_CPPFLAGS = -I../include $(LIBEVENT_CFLAGS) +hba_test_LDADD = $(LIBEVENT_LIBS) hba_test_CFLAGS = -O0 hba_test_SOURCES = hba_test.c ../src/hba.c ../src/util.c hba_test_EMBED_LIBUSUAL = 1 EXTRA_PROGRAMS = asynctest -asynctest_CPPFLAGS = -I../include $(PG_CPPFLAGS) +asynctest_CPPFLAGS = -I../include $(PG_CPPFLAGS) $(LIBEVENT_CFLAGS) asynctest_LDFLAGS = $(PG_LDFLAGS) -asynctest_LDADD = $(PG_LIBS) +asynctest_LDADD = $(PG_LIBS) $(LIBEVENT_LIBS) asynctest_SOURCES = asynctest.c asynctest_EMBED_LIBUSUAL = 1 diff --git a/test/asynctest.c b/test/asynctest.c index fd7f198..da68937 100644 --- a/test/asynctest.c +++ b/test/asynctest.c @@ -11,7 +11,6 @@ #undef main #endif -#include #include #include #include @@ -20,6 +19,7 @@ #include #include +#include #include static char *simple_query = "select 1"; diff --git a/test/hba_test.c b/test/hba_test.c index 75663cb..bcb56e9 100644 --- a/test/hba_test.c +++ b/test/hba_test.c @@ -8,7 +8,8 @@ #include #include #include -#include + +#include int cf_tcp_keepcnt; int cf_tcp_keepintvl; -- 2.50.1