You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.8 KiB

  1. From 25a2456845b341066adb5f9fcc553dec12a751b7 Mon Sep 17 00:00:00 2001
  2. From: Roger Wolff <R.E.Wolff@BitWizard.nl>
  3. Date: Fri, 5 Jul 2013 11:40:02 +0200
  4. Subject: [PATCH] glib dependency fixes.
  5. ---
  6. configure.ac | 32 ++++++++++++++------------------
  7. mtr.c | 5 +++++
  8. report.c | 2 ++
  9. 3 files changed, 21 insertions(+), 18 deletions(-)
  10. --- a/configure.ac
  11. +++ b/configure.ac
  12. @@ -42,25 +42,22 @@ AC_ARG_WITH(gtk,
  13. [ --without-gtk Do not try to use GTK+ at all],
  14. WANTS_GTK=$withval, WANTS_GTK=yes)
  15. -AC_ARG_WITH(glib,
  16. -[ --without-glib Do not try to use glib at all],
  17. -WANTS_GLIB=$withval, WANTS_GLIB=yes)
  18. -
  19. AC_ARG_WITH([ipinfo],
  20. [ --without-ipinfo Do not try to use ipinfo lookup at all],
  21. -[case "${withval}" in
  22. - yes) ipinfo=true ;;
  23. - no) ipinfo=false ;;
  24. - *) AC_MSG_ERROR([bad value ${withval} for --with-ipinfo]) ;;
  25. -esac],[ipinfo=true])
  26. -AM_CONDITIONAL([IPINFO], [test x$ipinfo = xtrue])
  27. -if test "x$ipinfo" = "xfalse"; then
  28. - AC_DEFINE([NO_IPINFO], [1], [Define to disable ipinfo lookup])
  29. -fi
  30. +[ipinfo="${withval}"], [ipinfo=yes])
  31. +AM_CONDITIONAL([IPINFO], [test x$ipinfo = xyes])
  32. AC_ARG_ENABLE(ipv6,
  33. [ --disable-ipv6 Do not enable IPv6],
  34. WANTS_IPV6=$enableval, WANTS_IPV6=yes)
  35. +
  36. +m4_ifndef([AM_PATH_GTK_2_0], [m4_defun([AM_PATH_GTK_2_0], [AC_MSG_ERROR([
  37. + Could not locate the gtk2 automake macros, these are usually located in
  38. + .../share/aclocal/gtk-2.0.m4
  39. + Before running bootstrap try setting the environment variable
  40. + ACLOCAL_PATH="/own/dir"
  41. + or configure --without-gtk.
  42. +])])])
  43. if test "x$WANTS_GTK" = "xyes"; then
  44. AM_PATH_GTK_2_0(2.6.0, CFLAGS="$CFLAGS $GTK_CFLAGS"
  45. @@ -71,11 +68,10 @@ if test "x$WANTS_GTK" = "xyes"; then
  46. else
  47. AC_DEFINE(NO_GTK)
  48. GTK_OBJ=""
  49. - if test "x$WANTS_GLIB" = "xyes"; then
  50. - PKG_CHECK_MODULES([GLIB], [glib-2.0])
  51. - else
  52. - AC_DEFINE(NO_GLIB, 1, [Define if you don't have the glib libraries available.])
  53. - fi
  54. +fi
  55. +
  56. +if test "x$ipinfo" = "xno"; then
  57. + AC_DEFINE([NO_IPINFO], [1], [Define to disable ipinfo lookup])
  58. fi
  59. AC_CHECK_FUNC(socket, ,
  60. --- a/mtr.c
  61. +++ b/mtr.c
  62. @@ -464,6 +464,11 @@ void parse_arg (int argc, char **argv)
  63. case 'z':
  64. ipinfo_no = 0;
  65. break;
  66. +#else
  67. + case 'y':
  68. + case 'z':
  69. + fprintf( stderr, "IPINFO not enabled.\n" );
  70. + break;
  71. #endif
  72. }
  73. }
  74. --- a/report.c
  75. +++ b/report.c
  76. @@ -340,6 +340,7 @@ void csv_close(time_t now)
  77. snprint_addr(name, sizeof(name), addr);
  78. int last = net_last(at);
  79. +#ifndef NO_IPINFO
  80. if(!ipinfo_no) {
  81. char* fmtinfo = fmt_ipinfo(addr);
  82. if (fmtinfo != NULL) fmtinfo = trim(fmtinfo);
  83. @@ -349,6 +350,7 @@ void csv_close(time_t now)
  84. printf("MTR.%s;%lu;%s;%s;%d;%s;%d", MTR_VERSION, now, "OK", Hostname,
  85. at+1, name, last);
  86. }
  87. +#endif
  88. for( i=0; i<MAXFLD; i++ ) {
  89. j = fld_index[fld_active[j]];