Detect gnutls via pkg-config instead of the deprecated libgnutls-config.
[obnox/wireshark/wip.git] / configure.in
index 4fa55e36e41dc4ccb7be186e806dabec8ec938ee..396c732d64fb9a9b66c398b0b0bcb2638dfeefe4 100644 (file)
@@ -1,8 +1,6 @@
 # $Id$
 #
-AC_INIT(cfile.h)
-
-AC_PREREQ(2.52)
+AC_PREREQ(2.60)
 
 dnl Check for CPU / vendor / OS
 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
@@ -12,14 +10,16 @@ dnl macros.
 
 dnl AC_CANONICAL_HOST
 dnl AC_CANONICAL_BUILD
-AC_CANONICAL_TARGET
+dnl AC_CANONICAL_TARGET
 
-AM_INIT_AUTOMAKE(wireshark, 0.99.9)
+AC_INIT(wireshark, 1.3.0)
+AM_INIT_AUTOMAKE([1.9 tar-ustar])
 
 AM_DISABLE_STATIC
 
 dnl Checks for programs.
 AC_PROG_CC
+AM_PROG_CC_C_O
 AC_PROG_CPP
 dnl Work around libtool bug (fixed in the version 1.5a?)
 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
@@ -33,10 +33,10 @@ then
        AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
 fi
 AM_PROG_LEX
-AC_PATH_PROG(LEXDUMMY, $LEX)
-if test "x$LEXDUMMY" = x
+AC_PATH_PROG(LEX, flex)
+if test "x$LEX" = x
 then
-       AC_MSG_ERROR(I couldn't find (f)lex; make sure it's installed and in your path)
+       AC_MSG_ERROR(I couldn't find flex; make sure it's installed and in your path)
 fi
 AC_PATH_PROG(POD2MAN, pod2man)
 if test "x$POD2MAN" = x
@@ -54,9 +54,29 @@ then
        #
        AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
 fi
+
+#
+# XXX - this looks for various HTML viewers on the host, not the target;
+# we really want to know what's available on the target, for cross-builds.
+# That would probably require us to, at run time, look for xdg-open and,
+# if we don't find it, look for mozilla, htmlview, etc.
+#
 AC_PATH_PROG(HTML_VIEWER, xdg-open)
-if test "x$HTML_VIEWER" = x
+if test "x$HTML_VIEWER" != x
 then
+       #
+       # XXX - the HTML_VIEWER shell variable is the full path of xdg-open.
+       # Define some variable to be that, so we just run that?
+       #
+       AC_DEFINE(HAVE_XDG_OPEN, 1, [Define if we have xdg-open])
+
+       #
+       # XXX - we have to define HTML_VIEWER for the prefs.c code that
+       # sets the default value of the Web browser preference, even
+       # though that preference won't be offered.
+       #
+       AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
+else
        AC_PATH_PROG(HTML_VIEWER, htmlview)
        if test "x$HTML_VIEWER" = x
        then
@@ -64,8 +84,6 @@ then
        else
                AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
        fi
-else
-       AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
 fi
 
 AC_PATH_PROG(LEX, flex)
@@ -98,19 +116,15 @@ AC_ARG_WITH([gnutls],
                  [use gnutls library @<:@default=yes@:>@]),
   with_gnutls="$withval", with_gnutls="yes")
 if test "x$with_gnutls" = "xyes"; then
-  AM_PATH_LIBGNUTLS(1.2.0,
+  PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0],
         [
                 echo "gnuTLS found, enabling ssl decryption"
                 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use gnutls library])
                 tls_message="yes"
         ]
         , [
-                if test x$libgnutls_config_prefix != x ; then
-                       AC_MSG_ERROR([[gnuTLS not found; install gnuTLS-devel package for your system]])
-                else
-                        echo echo "gnuTLS not found, disabling ssl decryption"
-                        tls_message="no"
-                fi
+                echo echo "gnuTLS not found, disabling ssl decryption"
+                tls_message="no"
         ]
   )
 fi
@@ -122,7 +136,7 @@ AC_ARG_WITH([gcrypt],
                  [use gcrypt library @<:@default=yes@:>@]),
   with_gcrypt="$withval", with_gcrypt="yes")
 if test "x$with_gcrypt" = "xyes"; then
-  AM_PATH_LIBGCRYPT(1.1.42,
+  AM_PATH_LIBGCRYPT(1.1.92,
         [
                 echo "libgcrypt found, enabling ipsec decryption"
                 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
@@ -212,26 +226,39 @@ AC_ARG_ENABLE(extra-gcc-checks,
        then
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-pedantic)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Woverflow)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wlogical-op)
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-overlength-strings)
+#              AC_WIRESHARK_GCC_CFLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
+#              AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wunreachable-code)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-long-long)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wbad-function-cast)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-qual)
-               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
+               #
+               # epan/dissectors/packet-ncp2222.inc blocks this one
+               # for now.
+               #
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wwrite-strings)
-               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshorten-64-to-32)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wstrict-prototypes)
                AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wmissing-declarations)
-               #Temporarily put cast-align here waiting eradication of 'cast
-               #increases required alignment of target type' on the Solaris
-               #slave.
-               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
+               #
+               # epan/dissectors/packet-afs.c blocks this one for now.
+               #
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshadow)
+               #
+               # More cleanup needed for this on LP64.
+               #
+               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshorten-64-to-32)
        fi
 ],)
-AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wall -W)
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wall -W) # -W is now known as -Wextra
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wextra) # -W is now known as -Wextra
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdeclaration-after-statement)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wendif-labels)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpointer-arith)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-pointer-sign)
 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
+AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
 
 #
 # If we're running gcc add '-D_U_="__attribute__((unused))"' to CFLAGS as well,
@@ -248,7 +275,7 @@ fi
 #
 # If we're running gcc, will enable a barrier "stop on warning".
 # This barrier is set for a very large part of the code. However, it is
-# typically not set for "generated" code  (lex, ans2wrs, idl2wrs, ...)
+# typically not set for "generated" code  (flex, ans2wrs, idl2wrs, ...)
 #
 warnings_as_errors_default="yes"
 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
@@ -420,6 +447,30 @@ darwin*)
 esac
 AC_SUBST(FRAMEWORKS)
 
+#
+# If using $prefix we add "$prefix/include" to the include search path
+# and "$prefix/lib" to the library search path.
+#
+if test "x$prefix" != "x" ; then
+       AC_MSG_CHECKING(whether to use $prefix for headers and libraries)
+       if test -d $prefix/include ; then
+               AC_MSG_RESULT(yes)
+               #
+               # Arrange that we search for header files in "$prefix/include", as
+               # various packages we use may have been installed under "$prefix/include".
+               #
+               CFLAGS="$CFLAGS -I$prefix/include"
+               CPPFLAGS="$CPPFLAGS -I$prefix/include"
+
+               #
+               # Arrange that we search for libraries in "$prefix/lib".
+               #
+               AC_WIRESHARK_ADD_DASH_L(LDFLAGS, $prefix/lib)
+       else
+               AC_MSG_RESULT(no)
+       fi
+fi
+
 dnl Look in /usr/local for header files and libraries ?
 dnl XXX FIXME don't include /usr/local if it is already in the system
 dnl search path as this causes gcc 3.2 on Linux to complain about a change
@@ -507,12 +558,6 @@ AC_ARG_ENABLE(wireshark,
                   [build GTK+-based wireshark.  @<:@default=yes, if GTK+ available@:>@]),
     enable_wireshark=$enableval,enable_wireshark=yes)
 
-AC_ARG_ENABLE(gtk2,
-  AC_HELP_STRING( [--disable-gtk2],
-                  [build Glib1/Gtk1+-based wireshark/tshark.  @<:@default=no@:>@]),
-    enable_gtk2=$enableval,enable_gtk2=yes)
-AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
-
 AC_ARG_ENABLE(threads,
   AC_HELP_STRING( [--enable-threads],
                   [use threads in wireshark.  @<:@default=no@:>@]),
@@ -549,16 +594,12 @@ datafiledir=`(
 )`
 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
 
-# GTK checks
+# GTK checks; we require GTK+ 2.4 or later.
 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
 # programs to be built with GTK+.
 #
-if test "x$enable_gtk2" = "xyes" -a "x$enable_wireshark" = "xyes"; then
-       GTK_OK=two
-       AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
-elif test "x$enable_gtk2" != "xyes" -a "x$enable_wireshark" = "xyes"; then
-       GTK_OK=one
-       AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
+if test "x$enable_wireshark" = "xyes"; then
+       AM_PATH_GTK_2_0(2.4.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
 else
        GTK_OK=no
 fi
@@ -582,26 +623,19 @@ if test "$GTK_OK" = "no" ; then
        # Wireshark unless they fix the GTK+ problem).
        #
        if test "x$enable_wireshark" = "xyes"; then
-               AC_MSG_ERROR([GTK+ isn't available, so Wireshark can't be compiled])
+               AC_MSG_ERROR([GTK+ 2.4 or later isn't available, so Wireshark can't be compiled])
        fi
        wireshark_bin=""
        wireshark_man=""
        # Honor GLIB_CFLAGS
-       if test "x$enable_gtk2" = "xyes" ; then
-               AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
-       else
-               AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
-       fi
+       AM_PATH_GLIB_2_0(2.4.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib 2.4 or later distribution not found.), gmodule)
+
 else
        wireshark_bin="wireshark\$(EXEEXT)"
        wireshark_man="wireshark.1"
         wireshark_SUBDIRS="codecs gtk"
        # Honor GLIB_CFLAGS
-       if test "$GTK_OK" = "two" ; then
-               AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
-       else
-               AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
-       fi
+       AM_PATH_GLIB_2_0(2.4.0, , AC_MSG_ERROR(GLib 2.4 or later distribution not found.), gmodule)
 fi
 
 #
@@ -641,71 +675,69 @@ else
 fi
 
 #
-# We can't just check for <inttypes.h> - some systems have one that
-# doesn't define all the PRI[doxu]64 macros.
+# If we have <dlfcn.h>, check whether we can use dladdr to find a
+# filename (hopefully, a full pathname, but no guarantees) for
+# the executable.
 #
-AC_CHECK_HEADERS(inttypes.h,
-  [
-    #
-    # OK, we have inttypes.h, but does it define those macros?
-    #
-    AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
-    AC_COMPILE_IFELSE(
-      [
-       AC_LANG_SOURCE(
-         [[
-           #include <inttypes.h>
-           #include <glib.h>
-           #include <stdio.h>
-           #include <sys/types.h>
-
-           main()
-           {
-             printf("%" PRId64 "\n", (gint64)1);
-             printf("%" PRIo64 "\n", (guint64)1);
-             printf("%" PRIx64 "\n", (guint64)1);
-             printf("%" PRIX64 "\n", (guint64)1);
-             printf("%" PRIu64 "\n", (guint64)1);
-           }
-         ]])
-      ],
-      [
-       AC_MSG_RESULT(yes)
-       ac_wireshark_inttypes_h_defines_formats=yes
-      ],
-      [
-       AC_MSG_RESULT(no)
-       ac_wireshark_inttypes_h_defines_formats=no
-      ])
-  ],
-  [
-    #
-    # We don't have inttypes.h, so it obviously can't define those
-    # macros.
-    #
-    ac_wireshark_inttypes_h_defines_formats=no
-  ])
-if test "$ac_wireshark_inttypes_h_defines_formats" = yes; then
-  AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
+if test "$ac_cv_header_dlfcn_h" = "yes"
+then
+       AC_MSG_CHECKING(whether dladdr can be used to find the pathname of an executable)
+       ac_save_CFLAGS="$CFLAGS"
+       ac_save_LIBS="$LIBS"
+       CFLAGS="$CFLAGS $GLIB_CFLAGS"
+       LIBS="$GLIB_LIBS $LIBS"
+       AC_TRY_RUN([
+#define _GNU_SOURCE    /* required on Linux, sigh */
+#include <dlfcn.h>
+
+int
+main(void)
+{
+       Dl_info info;
+
+       if (!dladdr((void *)main, &info))
+               return 1;       /* failure */
+       return 0;               /* assume success */
+}
+], ac_cv_dladdr_finds_executable_path=yes, ac_cv_dladdr_finds_executable_path=no,
+   [echo $ac_n "cross compiling; assumed OK... $ac_c"
+    ac_cv_dladdr_finds_executable_path=yes])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+       if test x$ac_cv_dladdr_finds_executable_path = xyes
+       then
+               AC_DEFINE(DLADDR_FINDS_EXECUTABLE_PATH, 1, [Define if dladdr can be used to find the path of the executable])
+       fi
+       AC_MSG_RESULT($ac_cv_dladdr_finds_executable_path)
+fi
+
+dnl IGE Mac integration check
+AC_MSG_CHECKING(whether to use IGE Mac integration functions)
+
+AC_ARG_WITH(ige-mac-integration,
+  AC_HELP_STRING( [--with-ige-mac-integration],
+                  [use IGE Mac integration. (@<:@default=yes, if available@:>@]),
+[
+    if test $withval = no
+    then
+        want_ige_mac_integration=no
+    else
+        want_ige_mac_integration=yes
+    fi
+],[
+    want_ige_mac_integration=yes
+])
+if test "x$want_ige_mac_integration" = "xno" -o "x$no_gtk" = "xyes" ; then
+    AC_MSG_RESULT(no)
 else
-  AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
-    [
-      AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
-       [
-         AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
-           [
-             AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
-           ])
-       ])
-    ])
+    AC_MSG_RESULT(yes)
+    AC_WIRESHARK_IGE_MAC_INTEGRATION_CHECK
 fi
 
+
 AC_SUBST(wireshark_bin)
 AC_SUBST(wireshark_man)
 
-rdps_bin="rdps\$(EXEEXT)"
-AC_SUBST(rdps_bin)
-
 
 # Enable/disable tshark
 
@@ -1046,7 +1078,7 @@ AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
 
 AC_ARG_WITH(lua,
   AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
-                  [use liblua (located in directory DIR, if supplied) for the lua scripting plugin.  @<:@default=no@:>@]),
+                  [use liblua (located in directory DIR, if supplied) for the lua scripting plugin.  @<:@default=yes, if available@:>@]),
 [
        if test $withval = no
        then
@@ -1060,9 +1092,9 @@ AC_ARG_WITH(lua,
        fi
 ],[
        #
-       # Don't use liblua by default (it isn't ready yet)
+       # Use liblua by default
        #
-       want_lua=no
+       want_lua=ifavailable
        lua_dir=
 ])
 if test "x$want_lua" = "xno" ; then
@@ -1139,7 +1171,7 @@ if test "x$enable_setuid_install" = "xno" ; then
        AC_MSG_RESULT(no)
 else
        if test "x$enable_dumpcap" = "xno" ; then
-               AC_MSG_ERROR(Setuid install works only with --enable-dumpcap, but dumpcap is disabled)
+               AC_MSG_ERROR(Setuid install works only with dumpcap but dumpcap is disabled)
        else
                AC_MSG_RESULT(yes)
        fi
@@ -1174,15 +1206,11 @@ fi
 AC_SUBST(LIBCAP_LIBS)
 
 dnl Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS(direct.h dirent.h fcntl.h grp.h netdb.h pwd.h stdarg.h stddef.h unistd.h)
+AC_CHECK_HEADERS(direct.h dirent.h fcntl.h grp.h inttypes.h netdb.h pwd.h stdarg.h stddef.h unistd.h)
 AC_CHECK_HEADERS(sys/ioctl.h sys/param.h sys/socket.h sys/sockio.h sys/stat.h sys/time.h sys/types.h sys/utsname.h sys/wait.h)
 AC_CHECK_HEADERS(netinet/in.h)
 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
 
-dnl iconv check
-AM_ICONV
-
 dnl SSL Check
 SSL_LIBS=''
 AC_MSG_CHECKING(whether to use SSL library)
@@ -1248,6 +1276,31 @@ else
 fi
 
 
+dnl c-ares Check
+C_ARES_LIBS=''
+AC_MSG_CHECKING(whether to use the c-ares library if available)
+
+AC_ARG_WITH(c-ares,
+  AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
+                  [use c-ares (located in directory DIR, if supplied). Supersedes --with-adns.   @<:@default=yes, if present@:>@]),
+[
+if   test "x$withval" = "xno";  then
+       want_c_ares=no
+elif test "x$withval" = "xyes"; then
+       want_c_ares=yes
+elif test -d "$withval"; then
+       want_c_ares=yes
+       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+fi
+])
+if test "x$want_c_ares" = "xno" ; then
+       AC_MSG_RESULT(no)
+else
+       AC_MSG_RESULT(yes)
+       AC_WIRESHARK_C_ARES_CHECK
+fi
+AC_SUBST(C_ARES_LIBS)
+
 dnl ADNS Check
 ADNS_LIBS=''
 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
@@ -1265,7 +1318,7 @@ elif test -d "$withval"; then
        AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
 fi
 ])
-if test "x$with_adns" = "xno" ; then
+if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
        AC_MSG_RESULT(no)
 else
        AC_MSG_RESULT(yes)
@@ -1273,12 +1326,65 @@ else
 fi
 AC_SUBST(ADNS_LIBS)
 
+dnl GEOIP Check
+GEOIP_LIBS=''
+AC_MSG_CHECKING(whether to use the GeoIP IP address mapping library if available)
+
+AC_ARG_WITH(geoip,
+  AC_HELP_STRING( [--with-geoip@<:@=DIR@:>@],
+                  [use GeoIP (located in directory DIR, if supplied).   @<:@default=yes, if present@:>@]),
+[
+if   test "x$withval" = "xno";  then
+       want_geoip=no
+elif test "x$withval" = "xyes"; then
+       want_geoip=yes
+elif test -d "$withval"; then
+       want_geoip=yes
+       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+fi
+])
+if test "x$want_geoip" = "xno"; then
+       AC_MSG_RESULT(no)
+else
+       AC_MSG_RESULT(yes)
+       AC_WIRESHARK_GEOIP_CHECK
+fi
+AC_SUBST(GEOIP_LIBS)
+
+dnl Python devel Check
+AC_ARG_WITH(python,
+    AC_HELP_STRING( [--with-python@<:@=DIR@:>@],
+                    [use python interpretor (installed in DIR, if supplied). @<:@default=no@:>@ (EXPERIMENTAL)]),
+[
+pythondir='${libdir}/wireshark/python/${VERSION}'
+if test "x$withval" = "xno"; then
+  want_python=no
+elif test "x$withval" != "xyes"; then
+  pythondir="$withval"
+  want_python=yes
+  AC_WIRESHARK_PYTHON_CHECK
+else
+  want_python=yes
+  AC_WIRESHARK_PYTHON_CHECK
+fi
+])
+AM_CONDITIONAL(HAVE_LIBPY, test x$want_python = xyes)
+AC_SUBST(pythondir)
+
 #
 # Define WS_VAR_IMPORT appropriately for declarations of external
 # variables exported from dynamically-linked libraries.
 #
 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
 
+AC_ARG_ENABLE(airpcap,
+  AC_HELP_STRING( [--enable-airpcap],
+                  [use airpcap in wireshark.  @<:@default=no@:>@]),
+  enable_airpcap=$enableval
+  if test x$enable_airpcap != xno; then
+       AC_DEFINE(HAVE_AIRPCAP, 1, [Enable AirPcap])
+  fi
+)
 #
 # Define HAVE_AIRPDCAP
 # We'll want to remove this eventually.
@@ -1300,47 +1406,6 @@ AC_C_BIGENDIAN
 # XXX - do we need this?
 AC_PROG_GCC_TRADITIONAL
 
-#
-# Does GLib define G_GINT64_MODIFIER?
-#
-AC_MSG_CHECKING([[whether glib.h defines the G_GINT64_MODIFIER macro]])
-AC_COMPILE_IFELSE(
-  [
-    AC_LANG_SOURCE(
-      [[
-       #include <glib.h>
-       #if GTK_MAJOR_VERSION >= 2
-       #include <glib/gprintf.h>
-       #endif
-       #include <stdio.h>
-
-       main()
-       {
-         char strbuf[16+1];
-         g_snprintf(strbuf, sizeof strbuf, "%" G_GINT64_MODIFIER "x\n", (gint64)1);
-       }
-      ]])
-  ],
-  [
-    AC_MSG_RESULT(yes)
-  ],
-  [
-    AC_MSG_RESULT(no)
-    AC_WIRESHARK_CHECK_64BIT_FORMAT(l,
-      [
-      AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
-       [
-         AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
-           [
-             AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
-               [
-                 AC_MSG_ERROR([neither %lx nor %llx nor %Lx nor %qx worked on a 64-bit integer])
-               ])
-           ])
-       ])
-    ])
-  ])
-
 GETOPT_C=""
 GETOPT_O=""
 AC_CHECK_FUNC(getopt, GETOPT_O="",
@@ -1392,61 +1457,23 @@ fi
 AC_SUBST(MKSTEMP_C)
 AC_SUBST(MKSTEMP_O)
 
-ac_save_LIBS="$LIBS"
-LIBS="$GLIB_LIBS $LIBS"
-G_ASCII_STRCASECMP_C=""
-G_ASCII_STRCASECMP_O=""
-G_ASCII_STRCASECMP_LO=""
-AC_CHECK_FUNC(g_ascii_strcasecmp,
-  [G_ASCII_STRCASECMP_O=""
-   G_ASCII_STRCASECMP_LO=""],
-  [G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
-   G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
-   AC_DEFINE(NEED_G_ASCII_STRCASECMP_H, 1, [Define if g_ascii_strcasecmp.h needs to be included])
-])
-LIBS="$ac_save_LIBS"
-if test "$ac_cv_func_g_ascii_strcasecmp" = no ; then
-  G_ASCII_STRCASECMP_C="g_ascii_strcasecmp.c"
-  G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
-  G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
-fi
-AC_SUBST(G_ASCII_STRCASECMP_C)
-AC_SUBST(G_ASCII_STRCASECMP_O)
-AC_SUBST(G_ASCII_STRCASECMP_LO)
-
-ac_save_LIBS="$LIBS"
-LIBS="$GLIB_LIBS $LIBS"
-G_ASCII_STRTOULL_C=""
-G_ASCII_STRTOULL_O=""
-G_ASCII_STRTOULL_LO=""
-AC_CHECK_FUNC(g_ascii_strtoull,
-  [G_ASCII_STRTOULL_O=""
-   G_ASCII_STRTOULL_LO=""],
-  [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
-   G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
-   AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
-])
-LIBS="$ac_save_LIBS"
-if test "$ac_cv_func_g_ascii_strtoull" = no ; then
-  G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
-  G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
-  G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
-fi
-AC_SUBST(G_ASCII_STRTOULL_C)
-AC_SUBST(G_ASCII_STRTOULL_O)
-AC_SUBST(G_ASCII_STRTOULL_LO)
-
-AC_CHECK_FUNC(inet_aton,
-  [INET_ATON_O=""
-   INET_ATON_LO=""],
-  [INET_ATON_O="inet_aton.o"
-   INET_ATON_LO="inet_aton.lo"
-])
-if test "$ac_cv_func_inet_aton" = no ; then
+#
+# XXX - if inet_aton isn't found, the build fails, with a complaint from
+# libtool about inet_aton.lo not being a valid libtool object.  We
+# probably have to handle it - and all the other replacement functions that
+# get built into libwireshark - differently.
+#
+AC_SEARCH_LIBS(inet_aton, [socket nsl], have_inet_aton=yes,
+    have_inet_aton=no)
+if test "$have_inet_aton" = no; then
   INET_ATON_C="inet_aton.c"
   INET_ATON_O="inet_aton.o"
   INET_ATON_LO="inet_aton.lo"
   AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
+else
+  INET_ATON_C=""
+  INET_ATON_O=""
+  INET_ATON_LO=""
 fi
 AC_SUBST(INET_ATON_C)
 AC_SUBST(INET_ATON_O)
@@ -1592,6 +1619,9 @@ AC_SUBST(ENABLE_STATIC)
 dnl Save the cacheable configure results to config.cache before recursing
 AC_CACHE_SAVE
 
+sinclude(plugins/Custom.m4) dnl
+ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
+
 AM_CONFIG_HEADER(config.h)
 AC_OUTPUT(
   Makefile
@@ -1603,6 +1633,7 @@ AC_OUTPUT(
   asn1/ansi-tcap/Makefile
   asn1/camel/Makefile
   asn1/cdt/Makefile
+  asn1/charging_ase/Makefile
   asn1/cmip/Makefile
   asn1/cms/Makefile
   asn1/dap/Makefile
@@ -1612,6 +1643,7 @@ AC_OUTPUT(
   asn1/ess/Makefile
   asn1/ftam/Makefile
   asn1/gnm/Makefile
+  asn1/goose/Makefile
   asn1/gsmmap/Makefile
   asn1/h225/Makefile
   asn1/h235/Makefile
@@ -1627,6 +1659,7 @@ AC_OUTPUT(
   asn1/inap/Makefile
   asn1/ldap/Makefile
   asn1/logotype-cert-extn/Makefile
+  asn1/lte-rrc/Makefile
   asn1/mms/Makefile
   asn1/mpeg-audio/Makefile
   asn1/mpeg-pes/Makefile
@@ -1676,18 +1709,21 @@ AC_OUTPUT(
   asn1/x721/Makefile
   doc/Makefile
   epan/Makefile
+  epan/crc/Makefile
   epan/crypt/Makefile
   epan/doxygen.cfg
   epan/dfilter/Makefile
   epan/dissectors/Makefile
   epan/ftypes/Makefile
   epan/wslua/Makefile
+  epan/wspython/Makefile
   codecs/Makefile
   gtk/Makefile
   gtk/doxygen.cfg
   help/Makefile
   packaging/Makefile
   packaging/macosx/Info.plist
+  packaging/macosx/Makefile
   packaging/nsis/Makefile
   packaging/rpm/Makefile
   packaging/rpm/SPECS/Makefile
@@ -1696,37 +1732,27 @@ AC_OUTPUT(
   packaging/svr4/checkinstall
   packaging/svr4/pkginfo
   plugins/Makefile
-  plugins/agentx/Makefile
-  plugins/artnet/Makefile
   plugins/asn1/Makefile
-  plugins/ciscosm/Makefile
   plugins/docsis/Makefile
-  plugins/enttec/Makefile
   plugins/ethercat/Makefile
   plugins/giop/Makefile
   plugins/gryphon/Makefile
-  plugins/infiniband/Makefile
   plugins/irda/Makefile
-  plugins/lwres/Makefile
   plugins/m2m/Makefile
   plugins/mate/Makefile
   plugins/opcua/Makefile
-  plugins/opsi/Makefile
-  plugins/pcli/Makefile
   plugins/profinet/Makefile
-  plugins/rlm/Makefile
-  plugins/rtnet/Makefile
-  plugins/rudp/Makefile
-  plugins/sbus/Makefile
+  plugins/sercosiii/Makefile
   plugins/stats_tree/Makefile
   plugins/unistim/Makefile
-  plugins/v5ua/Makefile
   plugins/wimax/Makefile
   plugins/wimaxasncp/Makefile
   tools/Makefile
   tools/idl2wrs.sh
   tools/lemon/Makefile
   wiretap/Makefile
+  wsutil/Makefile
+  _CUSTOM_AC_OUTPUT_
   ,)
 dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
 
@@ -1751,12 +1777,18 @@ else
        pcre_message="yes"
 fi
 
-if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
+if test "x$want_lua" = "xyes" ; then
        lua_message="yes"
 else
        lua_message="no"
 fi
 
+if test "x$want_python" = "xyes"; then
+        python_message="yes"
+else
+        python_message="no"
+fi
+
 if test "x$want_portaudio" = "xyes" ; then
        portaudio_message="yes"
 else
@@ -1775,6 +1807,12 @@ else
        krb5_message="yes ($ac_krb5_version)"
 fi
 
+if test "x$have_good_c_ares" = "xyes" ; then
+       c_ares_message="yes"
+else
+       c_ares_message="no"
+fi
+
 if test "x$have_good_adns" = "xyes" ; then
        adns_message="yes"
 else
@@ -1787,6 +1825,12 @@ else
        libcap_message="no"
 fi
 
+if test "x$have_good_geoip" = "xyes" ; then
+       geoip_message="yes"
+else
+       geoip_message="no"
+fi
+
 echo ""
 echo "The Wireshark package has been configured with the following options."
 echo "                    Build wireshark : $enable_wireshark"
@@ -1803,21 +1847,21 @@ echo "                     Build rawshark : $enable_rawshark"
 echo ""
 echo "             Install dumpcap setuid : $setuid_message"
 echo "                        Use plugins : $have_plugins"
-echo "                   Build lua plugin : $lua_message"
+echo "                    Use lua library : $lua_message"
+echo "                 Use python binding : $python_message"
 echo "                   Build rtp_player : $portaudio_message"
-echo "                Use GTK+ v2 library : $enable_gtk2"
-if test "x$enable_gtk2" = "xyes" ; then
 echo "                        Use threads : $enable_threads"
 echo "             Build profile binaries : $enable_profile_build"
-fi
 echo "                   Use pcap library : $want_pcap"
 echo "                   Use zlib library : $zlib_message"
 echo "                   Use pcre library : $pcre_message"
 echo "               Use kerberos library : $krb5_message"
+echo "                 Use c-ares library : $c_ares_message"
 echo "               Use GNU ADNS library : $adns_message"
 echo "                Use SMI MIB library : $libsmi_message"
 echo "             Use GNU crypto library : $gcrypt_message"
 echo "             Use SSL crypto library : $ssl_message"
 echo "           Use IPv6 name resolution : $enable_ipv6"
 echo "                 Use gnutls library : $tls_message"
-echo "                 Use libcap library : $libcap_message"
+echo "     Use POSIX capabilities library : $libcap_message"
+echo "                  Use GeoIP library : $geoip_message"