]> granicus.if.org Git - pgbouncer/commitdiff
Fix reporting of adns implementation in configure
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 18 Sep 2019 07:56:37 +0000 (09:56 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 18 Sep 2019 07:56:37 +0000 (09:56 +0200)
This was slightly broken by 748c83e5d8b05448725ce8a69213ed620a53d431
in the sense that configure would report both, say, c-ares and evdns
as "yes" without indication which one would actually be used.  Clean
that logic up a bit and report the actually used implementation at the
end of configure in a clearer way.  Also improve the documentation in
README.md around this.

Also clean up the build matrix in .travis.yml and remove a redundant
configuration.

.travis.yml
README.md
configure.ac

index cdd5bcb882ea7198555a937ad10c8771d583e283..607b348f35dbf6b62eeceb0f9f879cc57aaa64ac 100644 (file)
@@ -29,10 +29,9 @@ env:
   matrix:
     - configure_args=''
     - configure_args='' PGVERSION=9.5
-    - configure_args='--disable-evdns --without-cares --without-udns'
-    - configure_args='--enable-evdns  --without-cares --without-udns'
-    - configure_args='--disable-evdns --with-cares    --without-udns'
-    - configure_args='--disable-evdns --without-cares --with-udns'
+    - configure_args='--with-cares'
+    - configure_args='--with-udns'
+    - configure_args='--disable-evdns'
     - configure_args='--with-pam'
     - configure_args='--with-openssl'
     - configure_args='--without-openssl'
index f5be06d064248a09f059f28385e5d38bec895957..7739eaa73a1d48df1c965ad8cfd364940f94eab0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -37,25 +37,35 @@ separate build instructions below.
 DNS lookup support
 ------------------
 
-Starting from PgBouncer 1.4, it does hostname lookups at connect
-time instead just once at config load time.  This requires proper
-async DNS implementation.  Following list shows supported backends
-and their probing order:
+PgBouncer does host name lookups at connect time instead of just once
+at configuration load time.  This requires an asynchronous DNS
+implementation.  The following table shows supported backends and
+their probing order:
 
 | backend                    | parallel | EDNS0 (1) | /etc/hosts | SOA lookup (2) | note                                  |
 |----------------------------|----------|-----------|------------|----------------|---------------------------------------|
-| c-ares                     | yes      | yes       | yes        | yes            | ipv6+CNAME buggy in <=1.10            |
-| udns                       | yes      | yes       | no         | yes            | ipv4-only                             |
+| c-ares                     | yes      | yes       | yes        | yes            | IPv6+CNAME buggy in <=1.10            |
+| udns                       | yes      | yes       | no         | yes            | IPv4 only                             |
 | evdns, libevent 2.x        | yes      | no        | yes        | no             | does not check /etc/hosts updates     |
-| getaddrinfo_a, glibc 2.9+  | yes      | yes (3)   | yes        | no             | N/A on non-linux                      |
+| getaddrinfo_a, glibc 2.9+  | yes      | yes (3)   | yes        | no             | N/A on non-glibc                      |
 | getaddrinfo, libc          | no       | yes (3)   | yes        | no             | N/A on Windows, requires pthreads     |
 
-1. EDNS0 is required to have more than 8 addresses behind one hostname.
-2. SOA lookup is needed to re-check hostnames on zone serial change
-3. To enable EDNS0, add `options edns0` to /etc/resolv.conf
+1. EDNS0 is required to have more than 8 addresses behind one host name.
+2. SOA lookup is needed to re-check host names on zone serial change.
+3. To enable EDNS0, add `options edns0` to `/etc/resolv.conf`.
 
-`./configure` also has flags `--enable-evdns` and `--disable-evdns` which
-turn off automatic probing and force use of either `evdns` or `getaddrinfo_a()`.
+c-ares is the most fully-featured implementation and is recommended
+for most uses and binary packaging (if a sufficiently new version is
+available).  libevent's built-in evdns is also suitable for many uses,
+with the listed restrictions.  The other backends are mostly legacy
+options at this point and don't receive much testing anymore.
+
+By default, c-ares is used if it can be found.  Its use can be forced
+with `configure --with-cares` or disabled with `--without-cares`.  If
+c-ares is not used (not found or disabled), then specify `--with-udns`
+to pick udns, else libevent is used.  Specify `--disable-evdns` to
+disable the use of libevent's evdns and fall back to a libc-based
+implementation.
 
 PAM authorization
 -----------------
@@ -84,9 +94,8 @@ Additional packages required: autoconf, automake, libtool, pandoc
 Building on Windows
 -------------------
 
-At the moment, the only build environment tested is MinGW/MSYS.
-Cygwin and Visual $ANYTHING are untested.  Libevent 2.x is required
-for DNS hostname lookup.
+The only supported build environment on Windows is MinGW.  Cygwin and
+Visual $ANYTHING are not supported.
 
 To build on MinGW, do the usual:
 
index 30d38114e07d5070b87d6458c9d8ce62d3a4eaa8..d361c36a5605e59495ff08a7991f3d0b79bd2849 100644 (file)
@@ -83,9 +83,9 @@ AC_ARG_WITH(pam,
 ##
 
 # make sure all vars are set
-use_cares=auto
+use_cares=no
 use_udns=no
-use_evdns=yes
+use_evdns=no
 
 dnl Find c-ares
 AC_MSG_CHECKING([whether to use c-ares for DNS lookups])
@@ -104,7 +104,7 @@ AC_ARG_WITH(cares,
       CARES_CFLAGS="-I$withval/include"
       CARES_LIBS="-L$withval/lib -lcares"
     fi
-  ], [])
+  ], [use_cares=auto])
 AC_MSG_RESULT([$use_cares])
 
 if test "$use_cares" = "auto"; then
@@ -122,7 +122,8 @@ if test "$use_cares" = "yes"; then
   AC_CHECK_FUNCS(ares_parse_soa_reply)
   LIBS="$tmp_LIBS"
   CFLAGS="$tmp_CFLAGS"
-else
+
+else # !cares
 
 dnl Find libudns
 AC_MSG_CHECKING([whether to use libudns])
@@ -160,8 +161,8 @@ if test "$use_udns" = "yes"; then
 else # !udns
 
 dnl Allow user to override the decision
-AC_ARG_ENABLE(evdns, AC_HELP_STRING([--enable-evdns],[Use libevent for DNS lookups (default on libevent 2.x)]),
-              [use_evdns=$enableval])
+AC_ARG_ENABLE(evdns, AC_HELP_STRING([--disable-evdns], [do not use libevent for DNS lookups]),
+              [use_evdns=$enableval], [use_evdns=yes])
 AC_MSG_CHECKING([whether to use libevent for DNS lookups])
 if test "$use_evdns" = "yes"; then
   AC_DEFINE(USE_EVDNS, 1, [Use libevent for DNS lookups.])
@@ -197,10 +198,19 @@ test -f Makefile || {
 }
 
 echo ""
-echo "Results"
-echo "  c-ares = $use_cares"
-echo "  evdns = $use_evdns"
-echo "  udns = $use_udns"
-echo "  tls = $tls_support"
-echo "  PAM = $pam_support"
+echo "Results:"
+dnl Note: Report here should match selection in src/dnslookup.c
+if test "$use_cares" = "yes"; then
+  echo "  adns = c-ares"
+elif test "$use_udns" = "yes"; then
+  echo "  adns = udns"
+elif test "$use_evdns" = "yes"; then
+  echo "  adns = evdns2"
+elif test "$ac_cv_usual_glibc_gaia" = "yes"; then
+  echo "  adns = libc"
+else
+  echo "  adns = compat"
+fi
+echo "  pam  = $pam_support"
+echo "  tls  = $tls_support"
 echo ""