]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
glib dependency fixes.
authorRoger Wolff <R.E.Wolff@BitWizard.nl>
Fri, 5 Jul 2013 09:40:02 +0000 (11:40 +0200)
committerRoger Wolff <R.E.Wolff@BitWizard.nl>
Fri, 5 Jul 2013 09:40:02 +0000 (11:40 +0200)
configure.ac
mtr.c
report.c

index 97f1372390d219cdc4ebfb8e33988b25e0b8516d..d50c2535481c27508385569b26abc2203e86f3ab 100644 (file)
@@ -42,25 +42,22 @@ AC_ARG_WITH(gtk,
 [  --without-gtk           Do not try to use GTK+ at all],
 WANTS_GTK=$withval, WANTS_GTK=yes)
 
-AC_ARG_WITH(glib,
-[  --without-glib          Do not try to use glib at all],
-WANTS_GLIB=$withval, WANTS_GLIB=yes)
-
 AC_ARG_WITH([ipinfo],
 [  --without-ipinfo        Do not try to use ipinfo lookup at all],
-[case "${withval}" in
-  yes) ipinfo=true ;;
-  no)  ipinfo=false ;;
-  *) AC_MSG_ERROR([bad value ${withval} for --with-ipinfo]) ;;
-esac],[ipinfo=true])
-AM_CONDITIONAL([IPINFO], [test x$ipinfo = xtrue])
-if test "x$ipinfo" = "xfalse"; then
-       AC_DEFINE([NO_IPINFO], [1], [Define to disable ipinfo lookup])
-fi
+[ipinfo="${withval}"], [ipinfo=yes])
+AM_CONDITIONAL([IPINFO], [test x$ipinfo = xyes])
 
 AC_ARG_ENABLE(ipv6,
 [  --disable-ipv6          Do not enable IPv6],
 WANTS_IPV6=$enableval, WANTS_IPV6=yes)
+
+m4_ifndef([AM_PATH_GTK_2_0], [m4_defun([AM_PATH_GTK_2_0], [AC_MSG_ERROR([
+  Could not locate the gtk2 automake macros, these are usually located in
+    .../share/aclocal/gtk-2.0.m4
+  Before running bootstrap try setting the environment variable
+    ACLOCAL_PATH="/own/dir"
+  or configure --without-gtk.
+])])])
    
 if test "x$WANTS_GTK" = "xyes"; then
         AM_PATH_GTK_2_0(2.6.0, CFLAGS="$CFLAGS $GTK_CFLAGS"
@@ -71,11 +68,10 @@ if test "x$WANTS_GTK" = "xyes"; then
 else
        AC_DEFINE(NO_GTK)
        GTK_OBJ=""
-       if test "x$WANTS_GLIB" = "xyes"; then
-               PKG_CHECK_MODULES([GLIB], [glib-2.0])
-       else
-               AC_DEFINE(NO_GLIB, 1, [Define if you don't have the glib libraries available.])
-       fi
+fi
+
+if test "x$ipinfo" = "xno"; then
+       AC_DEFINE([NO_IPINFO], [1], [Define to disable ipinfo lookup])
 fi
 
 AC_CHECK_FUNC(socket, , 
diff --git a/mtr.c b/mtr.c
index fd4705d0ce72df376bdc68487545e2a0f3bc3c53..833de3936dd9a3bb9f6ef455e18f5622663c43b6 100644 (file)
--- a/mtr.c
+++ b/mtr.c
@@ -465,6 +465,11 @@ void parse_arg (int argc, char **argv)
     case 'z':
       ipinfo_no = 0;
       break;
+#else
+    case 'y':
+    case 'z':
+      fprintf( stderr, "IPINFO not enabled.\n" );
+      break;
 #endif
     }
   }
index e9071c1ca5715e9230fe47d3d9b966595dc9b401..cf049c541848e39a1816876d6b2f3b16536a4363 100644 (file)
--- a/report.c
+++ b/report.c
@@ -340,6 +340,7 @@ void csv_close(time_t now)
     snprint_addr(name, sizeof(name), addr);
 
     int last = net_last(at);
+#ifndef NO_IPINFO
     if(!ipinfo_no) {
       char* fmtinfo = fmt_ipinfo(addr);
       if (fmtinfo != NULL) fmtinfo = trim(fmtinfo);
@@ -349,6 +350,7 @@ void csv_close(time_t now)
       printf("MTR.%s;%lld;%s;%s;%d;%s;%d", MTR_VERSION, (long long)now, "OK", Hostname,
              at+1, name, last);
     }
+#endif
 
     for( i=0; i<MAXFLD; i++ ) {
       j = fld_index[fld_active[j]];