]> granicus.if.org Git - pgbouncer/commitdiff
Remove use of libusual event module
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 11 Sep 2019 08:20:27 +0000 (10:20 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 11 Sep 2019 11:48:38 +0000 (13:48 +0200)
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
README.md
config.mak.in
configure.ac
include/bouncer.h
test/Makefile
test/asynctest.c
test/hba_test.c

index 05f095e66c316d55d1f6cb2fcdeb4e941e510c7c..b72a51c66f4e5975e982115fde1335464ab49851 100644 (file)
--- 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
index cde2e88557ff2af93fbe8b2d3d9707204efb20ca..f5be06d064248a09f059f28385e5d38bec895957 100644 (file)
--- 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
 
index 5cd9e5f457d7efb31e9bebf5e5cf2739b456d356..460d19480f9972d362046c168f7890e09aae9f66 100644 (file)
@@ -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@
index f049fdcec1501ac7834b97c500345963a2f3e198..30d38114e07d5070b87d6458c9d8ce62d3a4eaa8 100644 (file)
@@ -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
index f2ed5a7be244ea1b80364b1fb93d2c770c397d31..7603cb5c5cb87fe91b0d93760976e958afc2dd7e 100644 (file)
 #include <usual/socket.h>
 #include <usual/safeio.h>
 #include <usual/mbuf.h>
-#include <usual/event.h>
 #include <usual/strpool.h>
 
+#include <event.h>
+
 #define FULLVER   PACKAGE_NAME " version " PACKAGE_VERSION
 
 /* each state corresponds to a list */
index b4082985a006804f3fe7fdecd2d0e6bdf1c62b1d..fecb08b939ea3b77d33a0d9ed951268cedf77100 100644 (file)
@@ -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
 
index fd7f1984e353401625a837df0f204eebf97b986b..da689377a6d1467ae8e0e8ae5e331a5715906b9f 100644 (file)
@@ -11,7 +11,6 @@
 #undef main
 #endif
 
-#include <usual/event.h>
 #include <usual/logging.h>
 #include <usual/getopt.h>
 #include <usual/logging.h>
@@ -20,6 +19,7 @@
 #include <usual/time.h>
 #include <usual/string.h>
 
+#include <event.h>
 #include <libpq-fe.h>
 
 static char *simple_query = "select 1";
index 75663cbb5703979f21e797ec4fb4def04bd3c0fc..bcb56e9b3ac826f3d6696e0529be9404fd8a5aa6 100644 (file)
@@ -8,7 +8,8 @@
 #include <usual/mbuf.h>
 #include <usual/socket.h>
 #include <usual/err.h>
-#include <usual/event.h>
+
+#include <event.h>
 
 int cf_tcp_keepcnt;
 int cf_tcp_keepintvl;