From 62bf68287df9470ca6fb9134831cd137c06e0c22 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 26 Jun 2018 13:43:09 +0200 Subject: [PATCH] fix postgres version check on Debian --- configure.ac | 31 ++++++++++++++++++++++++++++++- m4/ax_lib_postgresql.m4 | 4 ++-- src/util/dnsstub.c | 2 +- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 3d68ee9b0..fd1642839 100644 --- a/configure.ac +++ b/configure.ac @@ -206,6 +206,17 @@ rm -f /tmp/gnunet_test_cosks_ssh_garbage # iptables is a soft requirement to run tests AC_PATH_TARGET_TOOL(VAR_IPTABLES_BINARY, iptables, false) +if test x"$VAR_IPTABLES_BINARY" != x"false" +then + if test -x "/sbin/iptables" + then + VAR_IPTABLES_BINARY="/sbin/iptables" + elif test -x "/usr/sbin/iptables" + then + VAR_IPTABLES_BINARY="/usr/sbin/iptables" + fi +fi + if test x"$VAR_IPTABLES_BINARY" != x"false" then AC_DEFINE_UNQUOTED([IPTABLES], "$VAR_IPTABLES_BINARY", [Path to iptables]) @@ -213,8 +224,26 @@ else AC_MSG_WARN([warning: 'iptables' not found.]) fi +AC_PATH_TARGET_TOOL(VAR_IFCONFIG_BINARY, ifconfig, false) + AC_CHECK_PROG(VAR_IFCONFIG_BINARY, ifconfig, true, false) +if test x"$VAR_IFCONFIG_BINARY" != x"false" +then + if test -x "/sbin/ifconfig" + then + VAR_IFCONFIG_BINARY="/sbin/ifconfig" + elif test -x "/usr/sbin/ifconfig" + then + VAR_IFCONFIG_BINARY="/usr/sbin/ifconfig" + fi +fi +if test x"$VAR_IFCONFIG_BINARY" != x"false" +then +AC_DEFINE_UNQUOTED([IFCONFIG], "$VAR_IFCONFIG_BINARY", [Path to ifconfig]) +else AC_MSG_WARN([warning: 'ifconfig' not found.]) +fi + # miniupnpc / upnpc binary is a soft runtime requirement AC_PATH_TARGET_TOOL(VAR_UPNPC_BINARY, upnpc, false) @@ -930,7 +959,7 @@ postgres=false # even running the check for postgres breaks emscripten ... if test "$taler_only" != yes; then AX_LIB_POSTGRESQL([9.5]) - if test "$found_postgresql" = "yes"; then + if test "x$found_postgresql" = "xyes"; then CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS" AC_CHECK_HEADERS([libpq-fe.h], postgres=true) diff --git a/m4/ax_lib_postgresql.m4 b/m4/ax_lib_postgresql.m4 index d547383e4..11b6991f0 100644 --- a/m4/ax_lib_postgresql.m4 +++ b/m4/ax_lib_postgresql.m4 @@ -91,7 +91,7 @@ AC_DEFUN([AX_LIB_POSTGRESQL], POSTGRESQL_CPPFLAGS="-I`$PG_CONFIG --includedir`" POSTGRESQL_LDFLAGS="-L`$PG_CONFIG --libdir`" - POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'` + POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##' | awk '{print $1}'` AC_DEFINE([HAVE_POSTGRESQL], [1], [Define to 1 if PostgreSQL libraries are available]) @@ -113,7 +113,7 @@ AC_DEFUN([AX_LIB_POSTGRESQL], if test "$found_postgresql" = "yes" -a -n "$postgresql_version_req"; then - AC_MSG_CHECKING([if PostgreSQL version is >= $postgresql_version_req]) + AC_MSG_CHECKING([if PostgreSQL version $POSTGRESQL_VERSION is >= $postgresql_version_req]) dnl Decompose required version string of PostgreSQL dnl and calculate its number representation diff --git a/src/util/dnsstub.c b/src/util/dnsstub.c index 8b5b20f3c..5b84e6e63 100644 --- a/src/util/dnsstub.c +++ b/src/util/dnsstub.c @@ -354,7 +354,7 @@ do_dns_read (struct GNUNET_DNSSTUB_RequestSocket *rs, "Received DNS response from server we never asked (ignored)"); return GNUNET_NO; } - if (sizeof (struct GNUNET_TUN_DnsHeader) > r) + if (sizeof (struct GNUNET_TUN_DnsHeader) > (size_t) r) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Received DNS response that is too small (%u bytes)"), -- 2.25.1