fix postgres version check on Debian
authorChristian Grothoff <christian@grothoff.org>
Tue, 26 Jun 2018 11:43:09 +0000 (13:43 +0200)
committerChristian Grothoff <christian@grothoff.org>
Tue, 26 Jun 2018 11:43:19 +0000 (13:43 +0200)
configure.ac
m4/ax_lib_postgresql.m4
src/util/dnsstub.c

index 3d68ee9b0c11dbd5f10c38acf05e2dab812e109c..fd1642839f26e74353e21180015ad67d3e3ad003 100644 (file)
@@ -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)
index d547383e48fd070b88140d4c3fbcc84a410ad086..11b6991f02ecba1ef04271c0e055c29fdf5dfa8f 100644 (file)
@@ -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
index 8b5b20f3c8b23f8f0d96f0c402bf7c9967e28f3a..5b84e6e63891f830401aad3736c827f70bc057b3 100644 (file)
@@ -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)"),