tools: improve debian-setup with optional packages.
[metze/wireshark/wip.git] / configure.ac
index 82fe48d51f80139528bd3ff65e7b3a83bb860b06..8b9b1f9bce1edba9f65b9f5ae5ca95744c6d10e8 100644 (file)
@@ -5,9 +5,9 @@
 #
 # Define variables for the components of the Wireshark version number.
 #
-m4_define([version_major], [1])
-m4_define([version_minor], [99])
-m4_define([version_micro], [3])
+m4_define([version_major], [2])
+m4_define([version_minor], [1])
+m4_define([version_micro], [0])
 m4_define([version_micro_extra], version_micro)
 m4_append([version_micro_extra], [])
 
@@ -59,7 +59,11 @@ AM_DISABLE_STATIC
 #
 # Checks for programs used in the main build process.
 #
-AC_PROG_CC
+AC_PROG_CC_STDC
+if test "$ac_cv_prog_cc_stdc" == "no"
+then
+       AC_MSG_ERROR([The C compiler does not support standard C])
+fi
 AM_PROG_CC_C_O
 AC_PROG_CXX
 AC_PROG_CPP
@@ -108,7 +112,7 @@ fi
 AC_PATH_PROG(PERL, perl)
 
 # Check for Python.
-AC_PATH_PROGS(PYTHON, python, python3)
+AC_PATH_PROGS(PYTHON, python python3)
 if test ! -z "$PYTHON"; then
        #
        # OK, we found Python; is it Python 2.5 or later?
@@ -244,7 +248,11 @@ AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
 # "if" statement, it's safer to call PKG_PROG_PKG_CONFIG directly, see
 # the comments in acolocal.m4
 #
-PKG_PROG_PKG_CONFIG
+# We want version 0.7 or better.  (XXX - explain why. Is that just
+# because our Qt tests were originally based on AM_PATH_GTK, and *it*
+# requires 0.7 or better?)
+#
+PKG_PROG_PKG_CONFIG(0.7)
 if test -z "$PKG_CONFIG"; then
        AC_MSG_ERROR(I couldn't find pkg-config; make sure it's installed and in your path)
 fi
@@ -453,9 +461,9 @@ then
        #
        # Add an -isysroot flag to use the SDK.
        #
-       CFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $CFLAGS"
-       CXXFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $CXXFLAGS"
-       LDFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $LDFLAGS"
+       WS_CFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CFLAGS"
+       WS_CXXFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CXXFLAGS"
+       WS_LDFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_LDFLAGS"
 
        #
        # Add a -sdkroot flag to use with osx-app.sh.
@@ -482,11 +490,11 @@ then
                # Only 32-bit builds are supported.  10.5
                # (and 10.4?) had a bug that causes some BPF
                # functions not to work with 64-bit userland
-               # code, so capturing won't work.
+               # code, so capturing won't work.
                #
-               CFLAGS="-m32 $CFLAGS"
-               CXXFLAGS="-m32 $CXXFLAGS"
-               LDFLAGS="-m32 $LDFLAGS"
+               WS_CFLAGS="-m32 $WS_CFLAGS"
+               WS_CXXFLAGS="-m32 $WS_CXXFLAGS"
+               WS_LDFLAGS="-m32 $WS_LDFLAGS"
                ;;
        esac
 else
@@ -536,18 +544,18 @@ AC_SUBST(FLOORL_LO)
 # GUI toolkit options
 #
 AC_ARG_WITH([qt],
-  AC_HELP_STRING( [--with-qt=@<:@yes/no@:>@],
-                  [use Qt @<:@default=yes@:>@]),
+  AC_HELP_STRING( [--with-qt=@<:@yes/no/4/5@:>@],
+                 [use Qt @<:@default=yes@:>@]),
   with_qt="$withval", with_qt="unspecified")
 
 AC_ARG_WITH([gtk2],
   AC_HELP_STRING( [--with-gtk2=@<:@yes/no@:>@],
-                  [use GTK+ 2.0 @<:@default=no@:>@]),
+                 [use GTK+ 2.0 @<:@default=no@:>@]),
   with_gtk2="$withval", with_gtk2="unspecified")
 
 AC_ARG_WITH([gtk3],
   AC_HELP_STRING( [--with-gtk3=@<:@yes/no@:>@],
-                  [use GTK+ 3.0 instead of 2.0 @<:@default=yes@:>@]),
+                 [use GTK+ 3.0 instead of 2.0 @<:@default=yes@:>@]),
   with_gtk3="$withval", with_gtk3="unspecified")
 
 # GnuTLS
@@ -570,8 +578,8 @@ if test "x$with_gnutls" = "xyes"; then
   )
 
   if test "x$have_license_compatible_gnutls" != "xyes"; then
-    PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0 gnutls < 3],
-      [ have_license_compatible_gnutls="yes" ] , [ echo "GnuTLS >= 1.2.0, < 3.0 not found " ]
+    PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0 gnutls < 3],
+      [ have_license_compatible_gnutls="yes" ] , [ echo "GnuTLS >= 2.12.0, < 3.0 not found " ]
     )
   fi
 
@@ -599,31 +607,31 @@ AC_ARG_WITH([gcrypt],
   [ with_gcrypt="$withval"; want_gcrypt="yes" ], with_gcrypt="yes")
 
 if test "x$with_gcrypt" = "xyes"; then
-  AM_PATH_LIBGCRYPT(1.1.92,
-        [
-                echo "libgcrypt found, enabling ipsec decryption"
-                AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
-                gcrypt_message="yes"
-        ]
-        , [
-                if test x$libgcrypt_config_prefix != x ; then
-                       AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
-                else
-                        echo "libgcrypt not found, disabling ipsec decryption"
-                        gcrypt_message="no"
-                fi
+  AM_PATH_LIBGCRYPT(1.4.2,
+       [
+               echo "libgcrypt found, enabling decryption for ipsec, ssl, etc."
+               AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
+               gcrypt_message="yes"
+       ]
+       , [
+               if test x$libgcrypt_config_prefix != x ; then
+                       AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
+               else
+                       echo "libgcrypt not found, disabling decryption for ipsec, ssl, etc."
+                       gcrypt_message="no"
+               fi
 
                # Error out if the user explicitly requested gcrypt
                if test "x$want_gcrypt" = "xyes"; then
                    AC_MSG_ERROR([libgcrypt library was requested, but is not available])
                fi
-        ]
+       ]
   )
 fi
 
 AC_ARG_WITH(libnl,
   AC_HELP_STRING([--with-libnl@<:@=VERSION@:>@],
-                 [use libnl (force version VERSION, if supplied) @<:@default: yes, if available@:>@]),
+                [use libnl (force version VERSION, if supplied) @<:@default: yes, if available@:>@]),
 [
        if test "x$withval" = "xno"
        then
@@ -672,35 +680,32 @@ linux*)
                # was requested by the user.
                #
                if test x$libnl_version = "xany" -o x$libnl_version = "x3"; then
-                       PKG_CHECK_MODULES(LIBNL3, [libnl-route-3.0 >= 3.0 libnl-genl-3.0] >= 3.0, [have_libnl3=yes], [have_libnl3=no])
+                       PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL3, [libnl-route-3.0 >= 3.0 libnl-genl-3.0] >= 3.0, [have_libnl3=yes], [have_libnl3=no])
                fi
                if test x$libnl_version = "xany" -o x$libnl_version = "x2"; then
-                       PKG_CHECK_MODULES(LIBNL2, libnl-2.0 >= 2.0, [have_libnl2=yes], [have_libnl2=no])
+                       PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL2, libnl-2.0 >= 2.0, [have_libnl2=yes], [have_libnl2=no])
                fi
                if test x$libnl_version = "xany" -o x$libnl_version = "x1"; then
-                       PKG_CHECK_MODULES(LIBNL1, libnl-1 >= 1.0, [have_libnl1=yes], [have_libnl1=no])
+                       PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL1, libnl-1 >= 1.0, [have_libnl1=yes], [have_libnl1=no])
                fi
                if (test "${have_libnl3}" = "yes"); then
-                       CFLAGS="$CFLAGS $LIBNL3_CFLAGS"
-                       LIBS="$LIBS $LIBNL3_LIBS"
+                       WS_CFLAGS="$WS_CFLAGS $LIBNL3_CFLAGS"
+                       LIBS="$LIBS $LIBNL3_LIBS"
                        AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
                        AC_DEFINE(HAVE_LIBNL3, 1, [libnl version 3])
                        libnl_message="yes (v3)"
-                       enable_airpcap=no
                elif (test "${have_libnl2}" = "yes"); then
-                       CFLAGS="$CFLAGS $LIBNL2_CFLAGS"
-                       LIBS="$LIBS $LIBNL2_LIBS"
+                       WS_CFLAGS="$WS_CFLAGS $LIBNL2_CFLAGS"
+                       LIBS="$LIBS $LIBNL2_LIBS"
                        AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
                        AC_DEFINE(HAVE_LIBNL2, 1, [libnl version 2])
                        libnl_message="yes (v2)"
-                       enable_airpcap=no
                elif (test "${have_libnl1}" = "yes"); then
-                       CFLAGS="$CFLAGS $LIBNL1_CFLAGS"
-                       LIBS="$LIBS $LIBNL1_LIBS"
+                       WS_CFLAGS="$WS_CFLAGS $LIBNL1_CFLAGS"
+                       LIBS="$LIBS $LIBNL1_LIBS"
                        AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
                        AC_DEFINE(HAVE_LIBNL1, 1, [libnl version 1])
                        libnl_message="yes (v1)"
-                       enable_airpcap=no
                else
                        if test x$want_libnl = "xyes"; then
                                case "$libnl_version" in
@@ -760,23 +765,19 @@ AC_PATH_PROG(A2X, a2x)
 AC_CHECK_PROG(HAVE_A2X, a2x, "yes", "no")
 AM_CONDITIONAL(HAVE_A2X, test x$HAVE_A2X = xyes)
 
-# Want to control a tape drive? Use mt. Want to convert HTML to text?
-# Uhhhhh... elinks? lynx? w3m? pandoc? html2text?
-AC_PATH_PROG(ELINKS, elinks)
-AC_CHECK_PROG(HAVE_ELINKS, elinks, "yes", "no")
-AM_CONDITIONAL(HAVE_ELINKS, test x$HAVE_ELINKS = xyes)
-
 # Check for fop (translate .fo to e.g. pdf)
 AC_PATH_PROG(FOP, fop)
 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
 
-# Check for lynx (html -> text)
+# TODO: HAVE_LYNX and HAVE_W3M are unused. Maybe require one of them
+# to be found when a2x is enabled? Otherwise it will fail later...
+# Check for lynx (asciidoc text format from html)
 AC_PATH_PROG(LYNX, lynx)
 AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no")
 AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes)
 
-# Check for w3m (html -> text)
+# Check for w3m (asciidoc text format from html)
 AC_PATH_PROG(W3M, w3m)
 AC_CHECK_PROG(HAVE_W3M, w3m, "yes", "no")
 AM_CONDITIONAL(HAVE_W3M, test x$HAVE_W3M = xyes)
@@ -822,7 +823,7 @@ AC_SUBST(HAVE_RPM)
 # Debian
 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
 
-# Mac OS X
+# OS X
 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
@@ -872,6 +873,11 @@ AC_ARG_ENABLE(extra-compiler-warnings,
                #
                AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpedantic)
                #
+               # As we use variadic macros, we don't want warnings
+               # about them, even with -Wpedantic.
+               #
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-variadic-macros)
+               #
                # Various code blocks this one.
                #
                AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Woverflow)
@@ -929,14 +935,15 @@ AC_ARG_ENABLE(extra-compiler-warnings,
 #
 AC_ARG_ENABLE(asan,
   AC_HELP_STRING( [--enable-asan],
-                  [Enable AddressSanitizer (ASAN) for debugging (May be slow down)@<:@default=no@:>@]),
+                 [Enable AddressSanitizer (ASAN) for debugging (May be slow down)@<:@default=no@:>@]),
 [
-        #
-        # With Clang >= 3.5 Leak detection is enable by default
-        # and no yet all leak is fixed...
-        # use ASAN_OPTIONS=detect_leaks=0 to disable detect_leaks
-        #
-        AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address)
+       #
+       # With Clang >= 3.5 Leak detection is enable by default
+       # and no yet all leak is fixed...
+       # use ASAN_OPTIONS=detect_leaks=0 to disable detect_leaks
+       #
+       # XXX shouldn't this also be added to LDFLAGS?
+       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address)
 
 ],)
 
@@ -961,7 +968,6 @@ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdiv-by-zero)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wignored-qualifiers)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpragmas)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-overlength-strings)
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wwrite-strings)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable)
@@ -1043,18 +1049,16 @@ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fexcess-precision=fast)
 # failures to export symbols, rather than having that fail only on
 # Windows.
 #
-CFLAGS_before_fvhidden="$CFLAGS"
-#
 # GCC and GCC-compatible compilers
 #
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fvisibility=hidden)
-if test "x$CFLAGS" = "x$CFLAGS_before_fvhidden"
+if test "x$can_add_to_cflags" = "xno"
 then
        #
        # Sun^WOracle C.
        #
        AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xldscope=hidden)
-       if test "x$CFLAGS" = "x$CFLAGS_before_fvhidden"
+       if test "x$can_add_to_cflags" = "xno"
        then
                # TODO add other ways of hiding symbols
                AC_MSG_WARN(Compiler will export all symbols from shared libraries)
@@ -1074,60 +1078,52 @@ AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
 # privileges, and using PIE means the OS can run it at random locations
 # in the address space to make attacks more difficult.
 #
-CFLAGS_before_pie="$CFLAGS"
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE)
-if test "x$CFLAGS" != "x$CFLAGS_before_pie"
-then
-       # Restore CFLAGS
-       CFLAGS="$CFLAGS_before_pie"
 
-       LDFLAGS_before_pie="$LDFLAGS"
+WS_CFLAGS_saved="$WS_CFLAGS"
+WS_LDFLAGS_saved="$WS_LDFLAGS"
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE, C)
+if test "x$can_add_to_cflags" = "xyes"
+then
        AC_WIRESHARK_LDFLAGS_CHECK([-fPIE -pie])
-       if test "x$LDFLAGS" != "x$LDFLAGS_before_pie"
+       if test "x$can_add_to_ldflags" = "xyes"
        then
                # We can use PIE
                PIE_CFLAGS="-fPIE"
                PIE_LDFLAGS="-pie"
-
-               # Restore LDFLAGS
-               LDFLAGS="$LDFLAGS_before_pie"
        fi
-
 fi
+WS_CFLAGS="$WS_CFLAGS_saved"
+WS_LDFLAGS="$WS_LDFLAGS_saved"
 AC_SUBST(PIE_CFLAGS)
 AC_SUBST(PIE_LDFLAGS)
 
-CFLAGS_before_simd="$CFLAGS"
+WS_CFLAGS_saved="$WS_CFLAGS"
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-msse4.2, C)
-if test "x$CFLAGS" != "x$CFLAGS_before_simd"
+if test "x$can_add_to_cflags" = "xyes"
 then
        #
        # The compiler supports -msse4.2; use that to enable SSE 4.2.
        #
-       # Restore CFLAGS.  We only want to apply -msse4.2 to
+       # We only want to apply -msse4.2 to
        # wsutil/ws_mempbrk_sse42.c, as the SSE4.2 code there
        # is run only if the hardware supports it, but other
        # code would do no such checks.
        #
-       CFLAGS="$CFLAGS_before_simd"
        ac_sse4_2_flag=-msse4.2
 else
        #
        # Try -xarch=sse4_2; that's the flag for Sun's compiler.
        #
        AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xarch=sse4_2, C)
-       if test "x$CFLAGS" != "x$CFLAGS_before_simd"
+       if test "x$can_add_to_cflags" = "xyes"
        then
                #
                # The compiler supports -xarch=sse4_2; use that to
                # enable SSE 4.2.
-               #
-               # Restore CFLAGS; see above.
-               #
-               CFLAGS="$CFLAGS_before_simd"
                ac_sse4_2_flag=-xarch=sse4_2
        fi
 fi
+WS_CFLAGS="$WS_CFLAGS_saved"
 
 if test "x$ac_sse4_2_flag" != x; then
        #
@@ -1144,12 +1140,12 @@ if test "x$ac_sse4_2_flag" != x; then
                [#include <emmintrin.h>],
                [return 0;],
                [
-                       emmintrin_h_works=yes
-                       AC_MSG_RESULT([yes])
+                       emmintrin_h_works=yes
+                       AC_MSG_RESULT([yes])
                ],
                [
                        emmintrin_h_works=no
-                       AC_MSG_RESULT([no])
+                       AC_MSG_RESULT([no])
                ]
        )
 
@@ -1170,7 +1166,7 @@ if test "x$ac_sse4_2_flag" != x; then
                #
                AC_MSG_CHECKING([whether there is nmmintrin.h header and we can use it])
                saved_CFLAGS="$CFLAGS"
-               CFLAGS="$ac_sse4_2_flag $CFLAGS"
+               CFLAGS="$ac_sse4_2_flag $WS_CFLAGS $CFLAGS"
                AC_TRY_COMPILE(
                        [#include <nmmintrin.h>],
                        [return 0;],
@@ -1263,9 +1259,9 @@ if test "x$GCC" = "xyes" ; then
        solaris*)
                # the X11 headers don't automatically include prototype info
                # and a lot don't include the return type
-               CPPFLAGS="$CPPFLAGS -DFUNCPROTO=15"
-               CFLAGS="$CFLAGS -Wno-return-type"
-               CXXFLAGS="$CXXFLAGS -Wno-return-type"
+               WS_CPPFLAGS="$WS_CPPFLAGS -DFUNCPROTO=15"
+               WS_CFLAGS="$WS_CFLAGS -Wno-return-type"
+               WS_CXXFLAGS="$WS_CXXFLAGS -Wno-return-type"
                AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
                ;;
        *)
@@ -1279,18 +1275,34 @@ else
        case "$host_os" in
        hpux*)
                #
-               # HP's ANSI C compiler; flags suggested by Jost Martin.
-               # "-Ae" for ANSI C plus extensions such as "long long".
-               # "+O2", for optimization.  XXX - works with "-g"?
+               # AC_PROG_CC_STDC should already have added whatever
+               # flags are necessary for ISO C - C99 if available,
+               # otherwise C89 - with extensions.
                #
-               # HP's ANSI C++ compiler doesn't support "-Ae", but
-               # does support "+O2", at least according to the
-               # documentation I can find online.
+               # Add +O2, for optimization, as suggested by Jost Martin.
+               # XXX - works with "-g"?
                #
-               CFLAGS="-Ae +O2 $CFLAGS"
-               CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
-               CXXFLAGS="+O2 $CFLAGS"
-               AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
+               # +O2 is supported both by the C and C++ compiler.
+               #
+               WS_CFLAGS="+O2 $WS_CFLAGS"
+               if test "$CC" = "$CC_FOR_BUILD"; then
+                       #
+                       # We're building the build tools with the same
+                       # compiler as the one with which we're building
+                       # Wireshark, so add the flags to the flags for
+                       # that compiler as well.
+                       #
+                       CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
+               fi
+               WS_CXXFLAGS="+O2 $WS_CXXFLAGS"
+               AC_MSG_RESULT(HP C/C++ compiler - added +O2)
+               ;;
+       solaris*)
+               #
+               # Crank up the warning level.
+               #
+               WS_CFLAGS="$WS_CFLAGS -v"
+               WS_CXXFLAGS="$WS_CXXFLAGS +w2"
                ;;
        *)
                AC_MSG_RESULT(none needed)
@@ -1323,22 +1335,15 @@ darwin*)
        # with a static version installed in /usr/local/lib rather than
        # the system version in /usr/lib).
        #
-       # Also add -Wl,-rpath,@executable_path/../lib and
-       # -Wl,-rpath,/usr/local/lib, so that, if we build an app
-       # bundle, we can tweak all the executable images, shared
-       # libraries, and plugins in the bundle to look for non-system
-       # libraries in the rpath, rather than having a script tweak
-       # DYLD_LIBRARY_PATH.
-       #
-       LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first -Wl,-rpath,@executable_path/../lib -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,/usr/local/lib $LDFLAGS"
-       AC_MSG_RESULT([Apple linker - added -Wl,-single_module to shared library linker flags and -Wl,-headerpad_max_install_names -Wl,-search_paths_first and rpaths to all linker flags])
+       WS_LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first $WS_LDFLAGS"
+       AC_MSG_RESULT([Apple linker - added -Wl,-single_module to shared library linker flags and -Wl,-headerpad_max_install_names -Wl,-search_paths_first and -Wl,-headerpad_max_install_names to all linker flags])
        ;;
 cygwin*)
        #
        # Shared libraries in cygwin/Win32 must never contain
        # undefined symbols.
        #
-       LDFLAGS="$LDFLAGS -no-undefined"
+       WS_LDFLAGS="$WS_LDFLAGS -no-undefined"
        AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
        ;;
 *)
@@ -1366,9 +1371,10 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
 # get version information from plists and thus need Core Foundation
 # to process those plists.
 #
+have_os_x_frameworks=no
 case "$host_os" in
-
 darwin*)
+       have_os_x_frameworks=yes
        AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
        APPLICATIONSERVICES_FRAMEWORKS="-framework ApplicationServices"
        SYSTEMCONFIGURATION_FRAMEWORKS="-framework SystemConfiguration"
@@ -1392,6 +1398,7 @@ esac
 AC_SUBST(APPLICATIONSERVICES_FRAMEWORKS)
 AC_SUBST(SYSTEMCONFIGURATION_FRAMEWORKS)
 AC_SUBST(COREFOUNDATION_FRAMEWORKS)
+AM_CONDITIONAL(HAVE_OS_X_FRAMEWORKS, [test "x$have_os_x_frameworks" = "xyes"])
 
 #
 # On Solaris, check whether we have getexecname().
@@ -1408,7 +1415,7 @@ dnl search path as this causes gcc 3.2 on Linux to complain about a change
 dnl of the system search order for includes
 AC_ARG_ENABLE(usr-local,
   AC_HELP_STRING( [--enable-usr-local],
-                  [look for headers and libs in /usr/local tree @<:@default=yes@:>@]),
+                 [look for headers and libs in /usr/local tree @<:@default=yes@:>@]),
     ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
 
 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
@@ -1421,12 +1428,12 @@ if test "x$ac_cv_enable_usr_local" = "xyes" ; then
                # as various packages we use ("libpcap", "zlib", "adns")
                # may have been installed under "/usr/local/include".
                #
-               CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+               WS_CPPFLAGS="$WS_CPPFLAGS -I/usr/local/include"
 
                #
                # Arrange that we search for libraries in "/usr/local/lib".
                #
-               AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
+               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, /usr/local/lib)
        else
                AC_MSG_RESULT(no)
        fi
@@ -1493,13 +1500,13 @@ fi
 # Enable/disable wireshark
 AC_ARG_ENABLE(wireshark,
   AC_HELP_STRING( [--enable-wireshark],
-                  [build the Wireshark GUI (with Gtk+, Qt, or both) @<:@default=yes@:>@]),
+                 [build the Wireshark GUI (with Gtk+, Qt, or both) @<:@default=yes@:>@]),
     enable_wireshark=$enableval,enable_wireshark=yes)
 AM_CONDITIONAL(BUILDING_WIRESHARK, test x$enable_wireshark = xyes)
 
 AC_ARG_ENABLE(packet-editor,
   AC_HELP_STRING( [--enable-packet-editor],
-                  [add support for packet editor in Wireshark @<:@default=yes@:>@]),
+                 [add support for packet editor in Wireshark @<:@default=yes@:>@]),
     enable_packet_editor=$enableval,enable_packet_editor=yes)
 if test x$enable_packet_editor = xyes; then
        AC_DEFINE(WANT_PACKET_EDITOR, 1, [Support for packet editor])
@@ -1514,8 +1521,8 @@ AC_MSG_CHECKING(if profile builds must be generated)
 if test "x$enable_profile_build" = "xyes" ; then
        if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
                AC_MSG_RESULT(yes)
-               CFLAGS=" -pg $CFLAGS"
-               CXXFLAGS=" -pg $CXXFLAGS"
+               WS_CFLAGS="-pg $WS_CFLAGS"
+               WS_CXXFLAGS="-pg $WS_CXXFLAGS"
        else
                AC_MSG_RESULT(no)
                echo "Building profile binaries currently only supported for GCC and clang."
@@ -1551,7 +1558,7 @@ GTK2_MIN_VERSION=2.12.0
 AC_SUBST(GTK2_MIN_VERSION)
 GTK3_MIN_VERSION=3.0.0
 AC_SUBST(GTK3_MIN_VERSION)
-QT_MIN_VERSION=4.6.0
+QT_MIN_VERSION=4.7.0
 AC_SUBST(QT_MIN_VERSION)
 # GTK+ and Qt checks; we require GTK+ $GTK2_MIN_VERSION or later or
 # GTK3_MIN_VERSION or later or Qt $QT_MIN_VERSION or later.
@@ -1564,7 +1571,7 @@ AC_SUBST(QT_MIN_VERSION)
 # force all programs to be built with GTK+ or Qt.
 #
 # Release dates for GTK+ versions:
-# http://en.wikipedia.org/wiki/GTK+#Releases
+# https://en.wikipedia.org/wiki/GTK+#Releases
 # 2.12.0: 14 Sep 2007
 # 2.14.0: 04 Sep 2008
 # 2.16.0: 13 Mar 2009
@@ -1579,9 +1586,12 @@ AC_SUBST(QT_MIN_VERSION)
 # 3.8.0:  25 Mar 2013
 # 3.10.0: 23 Sep 2013
 # 3.12.0: 25 Mar 2014
+# 3.14.0: 30 Sep 2014
+# 3.16.0: 22 Mar 2015
+# 3.18.0  22 Sep 2015
 #
 # Release dates for Qt versions:
-# http://en.wikipedia.org/wiki/List_of_Qt_releases
+# https://en.wikipedia.org/wiki/List_of_Qt_releases
 # 4.6.0:  01 Dec 2009
 # 4.7.0:  21 Sep 2010
 # 4.8.0:  15 Dec 2011
@@ -1589,6 +1599,8 @@ AC_SUBST(QT_MIN_VERSION)
 # 5.1.0:  03 Jul 2013
 # 5.2.0:  12 Dec 2013
 # 5.3.0:  20 May 2014
+# 5.4.0:  10 Dec 2015
+# 5.5.0:  01 Jul 2015
 
 have_qt=no
 have_gtk=no
@@ -1597,14 +1609,23 @@ if test "x$enable_wireshark" = "xyes"; then
                "x$with_gtk3" = "xunspecified" -a \
                "x$with_qt" = "xunspecified"; then
                #
-               # No GUI toolkit was explicitly specified; pick Qt and GTK+ 3.
+               # No GUI toolkits were explicitly specified; pick Qt
+               # and GTK+ 3.
                #
                with_qt=yes
                with_gtk3=yes
+       elif test "x$with_gtk2" = "xunspecified" -a \
+                 "x$with_gtk3" = "xunspecified" -a \
+                 "x$with_qt" = "xno"; then
+               #
+               # Qt was explicitly disabled, and neither GTK+ 2 nor
+               # GTK+ 3 were explicitly specified; pick GTK+ 3.
+               #
+               with_gtk3=yes
        fi
-       if test "x$with_qt" = "xyes"; then
+       if test "x$with_qt" != "xno"; then
                #
-               # Qt was specified; Make sure we have a C++ compiler.
+               # Qt was specified; make sure we have a C++ compiler.
                #
                if test -z "$CXX"; then
                        AC_MSG_ERROR(Need a working C++ compiler to build Wireshark with Qt)
@@ -1614,20 +1635,72 @@ if test "x$enable_wireshark" = "xyes"; then
                # Now make sure we have Qt and, if so, add the flags
                # for it to CFLAGS and CXXFLAGS.
                #
-               AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION,
+               AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION, "$with_qt",
                [
-                       CFLAGS="$CFLAGS $Qt_CFLAGS"
-                       CXXFLAGS="$CXXFLAGS $Qt_CFLAGS"
+                       WS_CFLAGS="$WS_CFLAGS $Qt_CFLAGS"
+                       WS_CXXFLAGS="$WS_CXXFLAGS $Qt_CFLAGS"
                        have_qt=yes
                        GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-qt"
+
+                       #
+                       # We're building with Qt, so we need the Qt build
+                       # tools in order to build the Wireshark GUI.
+                       # We've found a particular major version of Qt,
+                       # and we want that version's build tools; for
+                       # example, the Qt 4 version of uic produces files
+                       # that include Qt headers with paths that work
+                       # with Qt 4 but not Qt 5, so we can't use the
+                       # Qt 4 version of uic if we're building with Qt 5.
+                       AC_WIRESHARK_QT_TOOL_CHECK(UIC, uic, "$qt_version")
+                       AC_SUBST(UIC)
+                       AC_WIRESHARK_QT_TOOL_CHECK(MOC, moc, "$qt_version")
+                       AC_SUBST(MOC)
+                       AC_WIRESHARK_QT_TOOL_CHECK(RCC, rcc, "$qt_version")
+                       AC_SUBST(RCC)
+
+                       #
+                       # On Darwin, find where the Qt frameworks are
+                       # located, and add that to the rpath, just in
+                       # case this is Qt 5.5 or later and the frameworks
+                       # have an install name that begins with @rpath
+                       # and aren't installed in a frameworks directory
+                       # that's searched by default.
+                       #
+                       case "$host_os" in
+                       darwin*)
+                               if test $qt_version -le 4
+                               then
+                                       Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs QtCore | sed -e 's/-F//' -e 's/ -framework.*//'`
+                               else
+                                       Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs Qt${qt_version}Core | sed -e 's/-F//' -e 's/ -framework.*//'`
+                               fi
+                               ;;
+                       esac
+                       AC_SUBST(Qt_LDFLAGS)
                ],
-               [AC_MSG_ERROR([Qt is not available])])
+               [
+                       case "$with_qt" in
 
-               #
-               # XXX - greasy hack to make ui/gtk/recent.c
-               # compile.
-               #
-               CPPFLAGS="-DQT_GUI_LIB"
+                       unspecified)
+                               #
+                               # They didn't explicitly ask for Qt,
+                               # so just don't build with it.
+                               #
+                               ;;
+
+                       yes)
+                               AC_MSG_ERROR([Qt is not available])
+                               ;;
+
+                       4)
+                               AC_MSG_ERROR([Qt 4 is not available])
+                               ;;
+
+                       5)
+                               AC_MSG_ERROR([Qt 5 is not available])
+                               ;;
+                       esac
+               ])
        fi
 
        if test "x$with_gtk3" = "xyes"; then
@@ -1645,8 +1718,8 @@ if test "x$enable_wireshark" = "xyes"; then
                #
                AM_PATH_GTK_3_0(3.0.0,
                [
-                       CFLAGS="$CFLAGS $GTK_CFLAGS"
-                       CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
+                       WS_CFLAGS="$WS_CFLAGS $GTK_CFLAGS"
+                       WS_CXXFLAGS="$WS_CXXFLAGS $GTK_CFLAGS"
                        have_gtk=yes
                        GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk3"
                ],
@@ -1658,8 +1731,8 @@ if test "x$enable_wireshark" = "xyes"; then
                #
                AM_PATH_GTK_2_0($GTK2_MIN_VERSION,
                [
-                       CFLAGS="$CFLAGS $GTK_CFLAGS"
-                       CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
+                       WS_CFLAGS="$WS_CFLAGS $GTK_CFLAGS"
+                       WS_CXXFLAGS="$WS_CXXFLAGS $GTK_CFLAGS"
                        have_gtk=yes
                        GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk2"
                ],
@@ -1698,6 +1771,9 @@ AC_SUBST(GLIB_MIN_VERSION)
 # 2.36.0: 25 Mar 2013
 # 2.38.0: 23 Sep 2013
 # 2.40.0: 24 Mar 2014
+# 2.42.0: 22 Sep 2014
+# 2.44.0: 23 Mar 2014
+# 2.46.0: 25 Sep 2015
 
 use_glib_cflags="true"
 if test "$have_gtk" = "yes" -a "$have_qt" = "yes" ; then
@@ -1748,20 +1824,19 @@ fi
 if test "$have_gtk" = "yes" ; then
        # If we have GTK then add flags for it.
 
-       CPPFLAGS="-DGDK_PIXBUF_DISABLE_DEPRECATED $CPPFLAGS"
-       CPPFLAGS="-DGDK_DISABLE_DEPRECATED $CPPFLAGS"
+       WS_CPPFLAGS="-DGDK_DISABLE_DEPRECATED $WS_CPPFLAGS"
        if test \( $gtk_config_major_version -eq 3 -a $gtk_config_minor_version -ge 10 \) ; then
                ## Allow use of deprecated & disable deprecated warnings if Gtk >= 3.10;
                ##  The deprecations in Gtk 3.10 will not be fixed ...
-               CPPFLAGS="-DGDK_DISABLE_DEPRECATION_WARNINGS $CPPFLAGS"
+               WS_CPPFLAGS="-DGDK_DISABLE_DEPRECATION_WARNINGS $WS_CPPFLAGS"
        else
-               CPPFLAGS="-DGTK_DISABLE_DEPRECATED $CPPFLAGS"
+               WS_CPPFLAGS="-DGTK_DISABLE_DEPRECATED $WS_CPPFLAGS"
        fi
-       CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
+       WS_CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $WS_CPPFLAGS"
        if test ! \( $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -lt 20 \) ; then
                # Enable GSEAL when building with GTK > 2.20
                # (Versions prior to 2.22 lacked some necessary accessors.)
-               CPPFLAGS="-DGSEAL_ENABLE $CPPFLAGS"
+               WS_CPPFLAGS="-DGSEAL_ENABLE $WS_CPPFLAGS"
        fi
 fi
 
@@ -1770,120 +1845,28 @@ if test "$use_glib_cflags" = "true"; then
        # Use GLIB_CFLAGS
        AM_PATH_GLIB_2_0($GLIB_MIN_VERSION,
        [
-               CFLAGS="$CFLAGS $GLIB_CFLAGS"
-               CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS"
+               WS_CFLAGS="$WS_CFLAGS $GLIB_CFLAGS"
+               WS_CXXFLAGS="$WS_CXXFLAGS $GLIB_CFLAGS"
        ], AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
 else
        # Don't use GLIB_CFLAGS
        AM_PATH_GLIB_2_0($GLIB_MIN_VERSION, , AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
 fi
 
-#
-# "make dist" requires that we have the Qt build tools.
-#
-# Annoyingly, at least on Fedora 16, uic and moc are named XXX-qt4
-# rather than just XXX, perhaps to allow Qt 3 and Qt 4 tools to be
-# installed; if they're still doing that in current Fedora releases,
-# perhaps there will also be XXX-qt5 when they pick up Qt 5.
-#
-AC_PATH_PROG(UIC, uic)
-if test "x$UIC" = x
-then
-       AC_PATH_PROG(UIC, uic-qt5)
-       if test "x$UIC" = x
-       then
-               AC_PATH_PROG(UIC, uic-qt4)
-               if test "x$UIC" = x
-               then
-                       if test "x$with_qt" = "xyes"; then
-                               #
-                               # If you want to build with Qt, you'd better
-                               # have uic.
-                               #
-                               AC_MSG_ERROR(I couldn't find uic or uic-qt5 or uic-qt4; make sure it's installed and in your path)
-                       else
-                               #
-                               # We shouldn't fail here, as the user's not
-                               # building with Qt, and we shouldn't force them
-                               # to have Qt installed if they're not doing so.
-                               # "make dist" will fail if they do that, but
-                               # we don't know whether they'll be doing that,
-                               # so this is the best we can do.
-                               #
-                               UIC=uic
-                       fi
-               fi
-       fi
-fi
-AC_SUBST(UIC)
-AC_PATH_PROG(MOC, moc)
-if test "x$MOC" = x
-then
-       AC_PATH_PROG(MOC, moc-qt5)
-       if test "x$MOC" = x
-       then
-               AC_PATH_PROG(MOC, moc-qt4)
-               if test "x$MOC" = x
-               then
-                       if test "x$with_qt" = "xyes"; then
-                               #
-                               # If you want to build with Qt, you'd better
-                               # have moc.
-                               #
-                               AC_MSG_ERROR(I couldn't find moc or moc-qt5 or moc-qt4; make sure it's installed and in your path)
-                       else
-                               #
-                               # We shouldn't fail here, as the user's not
-                               # building with Qt, and we shouldn't force them
-                               # to have Qt installed if they're not doing so.
-                               # "make dist" will fail if they do that, but
-                               # we don't know whether they'll be doing that,
-                               # so this is the best we can do.
-                               #
-                               MIC=moc
-                       fi
-               fi
-       fi
-fi
-AC_SUBST(MOC)
-AC_PATH_PROG(RCC, rcc)
-if test "x$RCC" = x
-then
-       AC_PATH_PROG(RCC, rcc-qt5)
-       if test "x$RCC" = x
-       then
-               AC_PATH_PROG(RCC, rcc)
-               if test "x$RCC" = x
-               then
-                       if test "x$with_qt" = "xyes"; then
-                               #
-                               # If you want to build with Qt, you'd better
-                               # have moc.
-                               #
-                               AC_MSG_ERROR(I couldn't find rcc or rcc-qt5; make sure it's installed and in your path)
-                       else
-                               #
-                               # We shouldn't fail here, as the user's not
-                               # building with Qt, and we shouldn't force them
-                               # to have Qt installed if they're not doing so.
-                               # "make dist" will fail if they do that, but
-                               # we don't know whether they'll be doing that,
-                               # so this is the best we can do.
-                               #
-                               RCC=rcc
-                       fi
-               fi
-       fi
+# Check for GResource support
+PKG_CHECK_EXISTS([gio-2.0 >= 2.32 gdk-pixbuf-2.0 >= 2.26], [have_gresource=yes], [have_gresource=no])
+AM_CONDITIONAL(HAVE_GRESOURCE, test "x$have_gresource" = "xyes")
+if test "x$have_gresource" = "xyes"; then
+       AC_DEFINE(HAVE_GRESOURCE, 1, [Defined if GLib GResource is supported])
 fi
-AC_SUBST(RCC)
 
 # Error out if a glib header other than a "top level" header
 #  (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
 #  is used.
-CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
+WS_CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $WS_CPPFLAGS"
 
 # Error out on the usage of deprecated glib functions
-CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
+WS_CPPFLAGS="-DG_DISABLE_DEPRECATED $WS_CPPFLAGS"
 
 #
 # Check whether GLib modules are supported, to determine whether we
@@ -1892,8 +1875,8 @@ CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
 AC_MSG_CHECKING(whether GLib supports loadable modules)
 ac_save_CFLAGS="$CFLAGS"
 ac_save_LIBS="$LIBS"
-CFLAGS="$CFLAGS $GLIB_CFLAGS"
-LIBS="$GLIB_LIBS $LIBS"
+CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
+LIBS="$LIBS $GLIB_LIBS"
 AC_TRY_RUN([
 #include <glib.h>
 #include <gmodule.h>
@@ -1936,8 +1919,8 @@ then
        #
        ac_save_CFLAGS="$CFLAGS"
        ac_save_LIBS="$LIBS"
-       CFLAGS="$CFLAGS $GLIB_CFLAGS"
-       LIBS="$GLIB_LIBS $LIBS"
+       CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
+       LIBS="$LIBS $GLIB_LIBS"
        AC_CHECK_FUNCS(dladdr)
        if test x$ac_cv_func_dladdr = xno
        then
@@ -1963,8 +1946,8 @@ fi
 AC_MSG_CHECKING(whether GLib supports POSIX/XSI thousands grouping)
 ac_save_CFLAGS="$CFLAGS"
 ac_save_LIBS="$LIBS"
-CFLAGS="$CFLAGS $GLIB_CFLAGS"
-LIBS="$GLIB_LIBS $LIBS"
+CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
+LIBS="$LIBS $GLIB_LIBS"
 AC_TRY_RUN([
 #include <glib.h>
 #include <locale.h>
@@ -2002,22 +1985,22 @@ then
 
     AC_ARG_WITH(osx-integration,
       AC_HELP_STRING( [--with-osx-integration],
-                      [use OS X integration functions @<:@default=yes, if available@:>@]),
+                     [use OS X integration functions @<:@default=yes, if available@:>@]),
     [
-        if test $withval = no
-        then
-            want_osx_integration=no
-        else
-            want_osx_integration=yes
-        fi
+       if test $withval = no
+       then
+           want_osx_integration=no
+       else
+           want_osx_integration=yes
+       fi
     ],[
-        want_osx_integration=yes
+       want_osx_integration=yes
     ])
     if test "x$want_osx_integration" = "xno"; then
-        AC_MSG_RESULT(no)
+       AC_MSG_RESULT(no)
     else
-        AC_MSG_RESULT(yes)
-        AC_WIRESHARK_OSX_INTEGRATION_CHECK
+       AC_MSG_RESULT(yes)
+       AC_WIRESHARK_OSX_INTEGRATION_CHECK
     fi
 fi
 
@@ -2031,7 +2014,7 @@ AC_SUBST(OSX_DMG_FLAGS)
 # Enable/disable tshark
 AC_ARG_ENABLE(tshark,
   AC_HELP_STRING( [--enable-tshark],
-                  [build tshark @<:@default=yes@:>@]),
+                 [build tshark @<:@default=yes@:>@]),
     tshark=$enableval,enable_tshark=yes)
 
 if test "x$enable_tshark" = "xyes" ; then
@@ -2049,7 +2032,7 @@ AC_SUBST(tshark_man)
 
 AC_ARG_ENABLE(editcap,
   AC_HELP_STRING( [--enable-editcap],
-                  [build editcap @<:@default=yes@:>@]),
+                 [build editcap @<:@default=yes@:>@]),
     enable_editcap=$enableval,enable_editcap=yes)
 
 if test "x$enable_editcap" = "xyes" ; then
@@ -2070,7 +2053,7 @@ AC_SUBST(editcap_man)
 
 AC_ARG_ENABLE(capinfos,
   AC_HELP_STRING( [--enable-capinfos],
-                  [build capinfos @<:@default=yes@:>@]),
+                 [build capinfos @<:@default=yes@:>@]),
     enable_capinfos=$enableval,enable_capinfos=yes)
 
 if test "x$enable_capinfos" = "xyes" ; then
@@ -2087,7 +2070,7 @@ AC_SUBST(capinfos_man)
 
 AC_ARG_ENABLE(captype,
   AC_HELP_STRING( [--enable-captype],
-                  [build captype @<:@default=yes@:>@]),
+                 [build captype @<:@default=yes@:>@]),
     enable_captype=$enableval,enable_captype=yes)
 
 if test "x$enable_captype" = "xyes" ; then
@@ -2104,7 +2087,7 @@ AC_SUBST(captype_man)
 
 AC_ARG_ENABLE(mergecap,
   AC_HELP_STRING( [--enable-mergecap],
-                  [build mergecap @<:@default=yes@:>@]),
+                 [build mergecap @<:@default=yes@:>@]),
     enable_mergecap=$enableval,enable_mergecap=yes)
 
 if test "x$enable_mergecap" = "xyes" ; then
@@ -2121,7 +2104,7 @@ AC_SUBST(mergecap_man)
 
 AC_ARG_ENABLE(reordercap,
   AC_HELP_STRING( [--enable-reordercap],
-                  [build reordercap @<:@default=yes@:>@]),
+                 [build reordercap @<:@default=yes@:>@]),
     enable_reordercap=$enableval,enable_reordercap=yes)
 
 if test "x$enable_reordercap" = "xyes" ; then
@@ -2138,7 +2121,7 @@ AC_SUBST(reordercap_man)
 
 AC_ARG_ENABLE(text2pcap,
   AC_HELP_STRING( [--enable-text2pcap],
-                  [build text2pcap @<:@default=yes@:>@]),
+                 [build text2pcap @<:@default=yes@:>@]),
     text2pcap=$enableval,enable_text2pcap=yes)
 
 if test "x$enable_text2pcap" = "xyes" ; then
@@ -2155,7 +2138,7 @@ AC_SUBST(text2pcap_man)
 
 AC_ARG_ENABLE(dftest,
   AC_HELP_STRING( [--enable-dftest],
-                  [build dftest @<:@default=yes@:>@]),
+                 [build dftest @<:@default=yes@:>@]),
     enable_dftest=$enableval,enable_dftest=yes)
 
 if test "x$enable_dftest" = "xyes" ; then
@@ -2172,7 +2155,7 @@ AC_SUBST(dftest_man)
 
 AC_ARG_ENABLE(randpkt,
   AC_HELP_STRING( [--enable-randpkt],
-                  [build randpkt @<:@default=yes@:>@]),
+                 [build randpkt @<:@default=yes@:>@]),
     enable_randpkt=$enableval,enable_randpkt=yes)
 
 if test "x$enable_randpkt" = "xyes" ; then
@@ -2187,10 +2170,6 @@ AC_SUBST(randpkt_man)
 
 AC_SUBST(wiresharkfilter_man)
 
-dnl Checks for "getaddrinfo()" - and "-lnsl", if we need it to get
-dnl "getaddrinfo()".
-AC_WIRESHARK_GETADDRINFO_LIB_CHECK
-
 dnl Checks for "connect()", used as a proxy for "socket()" - and
 dnl "-lsocket", if we need it to get "connect()".
 AC_WIRESHARK_SOCKET_LIB_CHECK
@@ -2200,7 +2179,7 @@ AC_MSG_CHECKING(whether to use libpcap for packet capture)
 
 AC_ARG_WITH(pcap,
   AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
-                  [use libpcap for packet capturing @<:@default=yes@:>@]),
+                 [use libpcap for packet capturing @<:@default=yes@:>@]),
 [
        if test $withval = no
        then
@@ -2223,33 +2202,12 @@ else
        AC_WIRESHARK_PCAP_CHECK
 fi
 
-
-dnl Check for airpcap
-AC_MSG_CHECKING(whether to include airpcap support)
-AC_ARG_ENABLE(airpcap,
-  AC_HELP_STRING( [--enable-airpcap],
-                  [use AirPcap in Wireshark @<:@default=yes@:>@]),
-  enable_airpcap=$enableval, enable_airpcap=yes)
-
-if test x$enable_airpcap = xyes; then
-       if test "x$want_pcap" = "xno" ; then
-               enable_airpcap=no
-               AC_MSG_RESULT(pcap not available - disabling airpcap)
-       else
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_AIRPCAP, 1, [Enable AirPcap])
-       fi
-else
-       AC_MSG_RESULT(no)
-fi
-
-
 dnl dumpcap check
 AC_MSG_CHECKING(whether to build dumpcap)
 
 AC_ARG_ENABLE(dumpcap,
   AC_HELP_STRING( [--enable-dumpcap],
-                  [build dumpcap @<:@default=yes@:>@]),
+                 [build dumpcap @<:@default=yes@:>@]),
     enable_dumpcap=$enableval,enable_dumpcap=yes)
 
 if test "x$enable_dumpcap" = "xyes" ; then
@@ -2280,7 +2238,7 @@ AC_MSG_CHECKING(whether to build rawshark)
 
 AC_ARG_ENABLE(rawshark,
   AC_HELP_STRING( [--enable-rawshark],
-                  [build rawshark @<:@default=yes@:>@]),
+                 [build rawshark @<:@default=yes@:>@]),
     rawshark=$enableval,enable_rawshark=yes)
 
 if test "x$enable_rawshark" = "xyes" ; then
@@ -2304,11 +2262,81 @@ fi
 AC_SUBST(rawshark_bin)
 AC_SUBST(rawshark_man)
 
+dnl androiddump check
+AC_MSG_CHECKING(whether to build androiddump)
+
+AC_ARG_ENABLE(androiddump,
+  AC_HELP_STRING( [--enable-androiddump],
+                 [build androiddump @<:@default=yes@:>@]),
+    androiddump=$enableval,enable_androiddump=yes)
+
+if test "x$enable_androiddump" = "xyes" ; then
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+
+AC_ARG_ENABLE(androiddump_use_libpcap,
+  AC_HELP_STRING( [--enable-androiddump-use-libpcap],
+                 [build androiddump using libpcap @<:@default=no@:>@]),
+    androiddump_use_libpcap=$enableval,enable_androiddump_use_libpcap=no)
+
+if test "x$enable_androiddump_use_libpcap" = "xyes" ; then
+       AC_DEFINE(ANDROIDDUMP_USE_LIBPCAP, 1, [Androiddump will use Libpcap])
+fi
+
+if test "x$enable_androiddump" = "xyes" ; then
+       androiddump_bin="androiddump\$(EXEEXT)"
+       androiddump_man=""
+else
+       androiddump_bin=""
+       androiddump_man=""
+fi
+AC_SUBST(androiddump_bin)
+AC_SUBST(androiddump_man)
+
+dnl sshdump check
+AC_MSG_CHECKING(whether to build sshdump)
+
+AC_ARG_ENABLE(sshdump,
+  AC_HELP_STRING( [--enable-sshdump],
+                 [build sshdump @<:@default=yes@:>@]),
+    sshdump=$enableval,enable_sshdump=yes)
+
+if test "x$enable_sshdump" = "xyes" ; then
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+
+dnl randpktdump check
+AC_MSG_CHECKING(whether to build randpktdump)
+
+AC_ARG_ENABLE(randpktdump,
+  AC_HELP_STRING( [--enable-randpktdump],
+                 [build androiddump @<:@default=yes@:>@]),
+    randpktdump=$enableval,enable_randpktdump=yes)
+
+if test "x$enable_randpktdump" = "xyes" ; then
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+
+if test "x$enable_randpktdump" = "xyes" ; then
+       randpktdump_bin="randpktdump\$(EXEEXT)"
+       randpktdump_man=""
+else
+       randpktdump_bin=""
+       randpktdump_man=""
+fi
+AC_SUBST(randpktdump_bin)
+AC_SUBST(randpktdump_man)
 
 # Enable/disable echld
 AC_ARG_ENABLE(echld,
   AC_HELP_STRING( [--enable-echld],
-                  [support echld (Experimental) @<:@default=no@:>@]),
+                 [support echld (Experimental) @<:@default=no@:>@]),
     have_echld=$enableval,have_echld=no)
 
 AM_CONDITIONAL(HAVE_ECHLD, test "x$have_echld" = "xyes")
@@ -2328,7 +2356,7 @@ AC_SUBST(echld_dir)
 # Enable/disable tfshark
 AC_ARG_ENABLE(tfshark,
   AC_HELP_STRING( [--enable-tfshark],
-                  [build tfshark (Experimental) @<:@default=no@:>@]),
+                 [build tfshark (Experimental) @<:@default=no@:>@]),
     tfshark=$enableval,enable_tfshark=no)
 
 if test "x$enable_tfshark" = "xyes" ; then
@@ -2346,7 +2374,7 @@ AC_SUBST(tfshark_man)
 dnl Use pcap-ng by default
 AC_ARG_ENABLE(pcap-ng-default,
   AC_HELP_STRING( [--enable-pcap-ng-default],
-                  [use the pcap-ng file format by default instead of pcap @<:@default=yes@:>@]),
+                 [use the pcap-ng file format by default instead of pcap @<:@default=yes@:>@]),
     enable_pcap_ng_default=$enableval,enable_pcap_ng_default=yes)
 if test x$enable_pcap_ng_default = xyes; then
        AC_DEFINE(PCAP_NG_DEFAULT, 1, [Support for pcap-ng])
@@ -2357,13 +2385,13 @@ AC_MSG_CHECKING(whether to use libpcap remote capturing feature)
 
 AC_ARG_WITH(pcap-remote,
     AC_HELP_STRING([--with-pcap-remote],
-                   [use libpcap remote capturing (requires libpcap)]),
+                  [use libpcap remote capturing (requires libpcap)]),
 [
     if test $withval = no
     then
-        want_pcap_remote=no
+       want_pcap_remote=no
     else
-        want_pcap_remote=yes
+       want_pcap_remote=yes
     fi
 ],[
     want_pcap_remote=no
@@ -2380,7 +2408,7 @@ AC_MSG_CHECKING(whether to use zlib for gzip compression and decompression)
 
 AC_ARG_WITH(zlib,
   AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
-                 [use zlib (located in directory DIR, if supplied) for gzip compression and decompression @<:@default=yes, if available@:>@]),
+                [use zlib (located in directory DIR, if supplied) for gzip compression and decompression @<:@default=yes, if available@:>@]),
 [
        if test "x$withval" = "xno"
        then
@@ -2400,10 +2428,10 @@ AC_ARG_WITH(zlib,
        zlib_dir=
 ])
 if test "x$want_zlib" = "xno" ; then
-        AC_MSG_RESULT(no)
+       AC_MSG_RESULT(no)
 else
-        AC_MSG_RESULT(yes)
-        AC_WIRESHARK_ZLIB_CHECK
+       AC_MSG_RESULT(yes)
+       AC_WIRESHARK_ZLIB_CHECK
        if test "x$want_zlib" = "xno" ; then
                AC_MSG_RESULT(zlib not found - disabling gzip compression and decompression)
        else
@@ -2416,7 +2444,7 @@ fi
 dnl Lua check
 AC_ARG_WITH(lua,
   AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
-                  [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin @<:@default=yes, if available@:>@]),
+                 [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin @<:@default=yes, if available@:>@]),
 [
        if test $withval = no
        then
@@ -2438,7 +2466,7 @@ if test "x$want_lua" != "xno" ; then
 
        if test "x$want_lua" = "xyes" -a "x$have_lua" = "xno"
        then
-                AC_MSG_ERROR([Lua support was requested, but is not available])
+               AC_MSG_ERROR([Lua support was requested, but is not available])
        fi
 fi
 if test "x$have_lua" = "xyes"
@@ -2451,11 +2479,11 @@ AC_SUBST(LUA_CFLAGS)
 
 
 dnl portaudio check
-AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
+AC_MSG_CHECKING(whether to use libportaudio for the GTK+ RTP player)
 
 AC_ARG_WITH(portaudio,
   AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
-                  [use libportaudio (located in directory DIR, if supplied) for the rtp_player @<:@default=yes, if available@:>@]),
+                 [use libportaudio (located in directory DIR, if supplied) for the GTK+ RTP player @<:@default=yes, if available@:>@]),
 [
        if test $withval = no
        then
@@ -2480,32 +2508,17 @@ else
        AC_MSG_RESULT(yes)
        AC_WIRESHARK_LIBPORTAUDIO_CHECK
        if test "x$want_portaudio" = "xno" ; then
-               AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
+               AC_MSG_RESULT(libportaudio not found - disabling support for the GTK+ RTP player)
        fi
 fi
 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
 
 
-dnl ipv6 check
-AC_ARG_ENABLE(ipv6,
-  AC_HELP_STRING( [--enable-ipv6],
-                  [use IPv6 name resolution, if available @<:@default=yes@:>@]),
-    enable_ipv6=$enableval,enable_ipv6=yes)
-
-AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
-if test "x$enable_ipv6" = "xno" ; then
-       AC_MSG_RESULT(no)
-else
-       AC_MSG_RESULT(yes)
-       AC_WIRESHARK_IPV6_STACK
-fi
-
-
 dnl Check if dumpcap should be installed with filesystem capabilities
 AC_PATH_PROG(SETCAP, setcap)
 AC_ARG_ENABLE(setcap-install,
   AC_HELP_STRING( [--enable-setcap-install],
-                  [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
+                 [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
     enable_setcap_install=$enableval,enable_setcap_install=no)
 
 AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
@@ -2528,7 +2541,7 @@ AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
 dnl Check if dumpcap should be installed setuid
 AC_ARG_ENABLE(setuid-install,
   AC_HELP_STRING( [--enable-setuid-install],
-                  [install dumpcap as setuid @<:@default=no@:>@]),
+                 [install dumpcap as setuid @<:@default=no@:>@]),
     enable_setuid_install=$enableval,enable_setuid_install=no)
 
 AC_MSG_CHECKING(whether to install dumpcap setuid)
@@ -2554,13 +2567,13 @@ dnl ...but our Network Operations group is named "no"!
 DUMPCAP_GROUP=''
 AC_ARG_WITH(dumpcap-group,
   AC_HELP_STRING( [--with-dumpcap-group=GROUP],
-                  [restrict dumpcap to GROUP]),
+                 [restrict dumpcap to GROUP]),
 [
   if test "x$withval" = "xyes"; then
       AC_MSG_ERROR([No dumpcap group specified.])
   elif test "x$withval" != "xno"; then
       if test "x$enable_dumpcap" = "xno" ; then
-          AC_MSG_ERROR(dumpcap group install works only with dumpcap but dumpcap is disabled)
+         AC_MSG_ERROR(dumpcap group install works only with dumpcap but dumpcap is disabled)
       fi
       AC_MSG_RESULT($withval)
       DUMPCAP_GROUP="$withval"
@@ -2575,7 +2588,7 @@ AC_MSG_CHECKING(whether to use the libcap capabilities library)
 
 AC_ARG_WITH(libcap,
   AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
-                  [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management @<:@default=yes, if present@:>@]),
+                 [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management @<:@default=yes, if present@:>@]),
 [
 if   test "x$withval" = "xno";  then
        want_libcap=no
@@ -2583,7 +2596,7 @@ elif test "x$withval" = "xyes"; then
        want_libcap=yes
 elif test -d "$withval"; then
        want_libcap=yes
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ])
 if test "x$with_libcap" = "xno" ; then
@@ -2599,28 +2612,39 @@ dnl Some of these may not be needed: http://hacks.owlfolio.org/header-survey/
 dnl Note, however, that, whilst this script is generally run only on UN*Xes:
 dnl
 dnl     1) we also support building on and for Windows and not all of those
-dnl        headers are present on Windows, so the code has to check a
-dnl        #define *anyway* to determine whether to include the header
-dnl        file
+dnl       headers are present on Windows, so the code has to check a
+dnl       #define *anyway* to determine whether to include the header
+dnl       file
 dnl
 dnl and
 dnl
 dnl     2) this might also be run on Windows with a sufficiently UNIXy
-dnl        environment such as Cygwin (although Wireshark should be built
-dnl        natively rather than using Cygwin).
+dnl       environment such as Cygwin (although Wireshark should be built
+dnl       natively rather than using Cygwin).
 dnl
 AC_CHECK_HEADERS(fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.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)
 
+#
+# On Linux, check for some additional headers, which we need as a
+# workaround for a bonding driver bug and for libpcap's current lack
+# of its own workaround for that bug.
+#
+case "$host_os" in
+linux*)
+       AC_CHECK_HEADERS(linux/sockios.h linux/if_bonding.h,,,[#include <sys/socket.h>])
+       ;;
+esac
+
 dnl SSL Check
 SSL_LIBS=''
 AC_MSG_CHECKING(whether to use SSL library)
 
 AC_ARG_WITH(ssl,
   AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
-                  [use SSL crypto library (located in directory DIR, if supplied) @<:@default=no@:>@]),
+                 [use SSL crypto library (located in directory DIR, if supplied) @<:@default=no@:>@]),
 [
 if test "x$withval" = "xno";  then
        want_ssl=no
@@ -2628,7 +2652,7 @@ elif test "x$withval" = "xyes"; then
        want_ssl=yes
 elif test -d "$withval"; then
        want_ssl=yes
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ],[
        want_ssl=no
@@ -2640,7 +2664,7 @@ if test "x$want_ssl" = "xyes"; then
                SSL_LIBS=-lcrypto
            ],
            [
-                AC_MSG_ERROR([SSL crypto library was requested, but is not available])
+               AC_MSG_ERROR([SSL crypto library was requested, but is not available])
            ])
 else
        AC_MSG_RESULT(no)
@@ -2652,7 +2676,7 @@ AC_MSG_CHECKING(whether to use Kerberos library)
 
 AC_ARG_WITH(krb5,
   AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
-                  [use Kerberos library (located in directory DIR, if supplied) to use in Kerberos dissection @<:@default=yes@:>@]),
+                 [use Kerberos library (located in directory DIR, if supplied) to use in Kerberos dissection @<:@default=yes@:>@]),
 [
        if test $withval = no
        then
@@ -2685,7 +2709,7 @@ 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@:>@]),
+                 [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
@@ -2693,7 +2717,7 @@ 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)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ])
 if test "x$want_c_ares" = "xno" ; then
@@ -2710,7 +2734,7 @@ AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
 
 AC_ARG_WITH(adns,
   AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
-                  [use GNU ADNS (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
+                 [use GNU ADNS (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
 [
 if   test "x$withval" = "xno";  then
        want_adns=no
@@ -2718,7 +2742,7 @@ elif test "x$withval" = "xyes"; then
        want_adns=yes
 elif test -d "$withval"; then
        want_adns=yes
-       AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ])
 if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
@@ -2729,13 +2753,38 @@ else
 fi
 AC_SUBST(ADNS_LIBS)
 
+if test "x$have_good_c_ares" != "xyes" -a "x$have_good_adns" != "xyes"; then
+       # We don't have an asynchronous name resolver, look for a synchronous one
+
+       dnl Checks for "getaddrinfo()" - and "-lnsl", if we need it to get
+       dnl "getaddrinfo()".
+       AC_WIRESHARK_GETADDRINFO_LIB_CHECK
+
+       if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then
+               # We don't have the modern name resolver, try older stuff
+
+               dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
+               dnl "gethostbyname()".
+               AC_WIRESHARK_GETHOSTBY_LIB_CHECK
+
+               if test "x$ac_cv_func_gethostbyname" != "xyes" ; then
+                       # Hopefully this never actually happens.
+                       # The code works even without name resolvers but we
+                       # alert the user to this unusual condition.
+                       AC_MSG_ERROR(Couldn't find any name resolvers!)
+               fi
+
+               AC_CHECK_FUNCS(gethostbyname2)
+       fi
+fi
+
 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@:>@]),
+                 [use GeoIP (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
 [
 if   test "x$withval" = "xno";  then
        want_geoip=no
@@ -2743,7 +2792,7 @@ 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)
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
 fi
 ])
 if test "x$want_geoip" = "xno"; then
@@ -2754,6 +2803,31 @@ else
 fi
 AC_SUBST(GEOIP_LIBS)
 
+dnl LIBSSH Check
+LIBSSH=''
+AC_MSG_CHECKING(whether to use the libssh library if available)
+
+AC_ARG_WITH(ssh,
+  AC_HELP_STRING( [--with-libssh@<:@=DIR@:>@],
+                 [use libssh (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
+[
+if   test "x$withval" = "xno";  then
+       want_libssh=no
+elif test "x$withval" = "xyes"; then
+       want_libssh=yes
+elif test -d "$withval"; then
+       want_libssh=yes
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
+fi
+])
+if test "x$want_libssh" = "xno"; then
+       AC_MSG_RESULT(no)
+else
+       AC_MSG_RESULT(yes)
+       AC_WIRESHARK_LIBSSH_CHECK
+fi
+AC_SUBST(LIBSSH_LIBS)
+
 #
 # Define WS_MSVC_NORETURN appropriately for declarations of routines that
 # never return (just like Charlie on the MTA).
@@ -2799,9 +2873,9 @@ AC_CHECK_FUNC(getopt_long,
     AC_MSG_CHECKING(whether optreset is defined)
     AC_TRY_LINK([],
       [
-        extern int optreset;
+       extern int optreset;
 
-        return optreset;
+       return optreset;
       ],
       ac_cv_pcap_debug_defined=yes,
       ac_cv_pcap_debug_defined=no)
@@ -2900,9 +2974,9 @@ AC_CHECK_FUNC(popcount,
   POPCOUNT_LO="popcount.lo")
 AC_SUBST(POPCOUNT_LO)
 
-AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
+AC_CHECK_FUNCS(getprotobynumber)
 AC_CHECK_FUNCS(issetugid)
-AC_CHECK_FUNCS(mmap mprotect sysconf)
+AC_CHECK_FUNCS(sysconf)
 
 dnl blank for now, but will be used in future
 AC_SUBST(wireshark_SUBDIRS)
@@ -2911,13 +2985,13 @@ AC_SUBST(wireshark_SUBDIRS)
 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
 AC_ARG_WITH([sbc],
   AC_HELP_STRING( [--with-sbc=@<:@yes/no@:>@],
-                  [use SBC codec to play Bluetooth A2DP stream @<:@default=yes, if available@:>@]),
+                 [use SBC codec to play Bluetooth A2DP stream @<:@default=yes, if available@:>@]),
   with_sbc="$withval"; want_sbc="yes", with_sbc="yes")
 
 PKG_CHECK_MODULES(SBC, sbc >= 1.0, [have_sbc=yes], [have_sbc=no])
 if test "x$with_sbc" != "xno"; then
     if (test "${have_sbc}" = "yes"); then
-        AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
+       AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
     elif test "x$want_sbc" = "xyes"; then
        # Error out if the user explicitly requested the sbc library
        AC_MSG_ERROR([SBC codec library was requested, but is not available])
@@ -2931,10 +3005,10 @@ dnl check whether plugins should be enabled and, if they should be,
 dnl check for plugins directory - stolen from Amanda's configure.ac
 dnl
 dnl we don't wish to expand ${libdir} yet
-plugindir='${libdir}/wireshark/plugins/${VERSION}'
+plugindir="\${libdir}/wireshark/plugins/${VERSION}"
 AC_ARG_WITH(plugins,
   AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
-                  [support plugins (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
+                 [support plugins (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
 [
   if test "x$withval" = "xno"; then
     have_plugins=no
@@ -2950,7 +3024,7 @@ then
   AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
 fi
 AC_SUBST(plugindir)
-CPPFLAGS="$CPPFLAGS '-DPLUGIN_INSTALL_DIR=\"\$(plugindir)\"'"
+WS_CPPFLAGS="$WS_CPPFLAGS '-DPLUGIN_INSTALL_DIR=\"\$(plugindir)\"'"
 
 #
 # The plugin dissectors reside in ./plugins/PROTO/
@@ -2963,7 +3037,7 @@ dnl Use extcap by default
 extcapdir='${datadir}/wireshark/extcap/'
 AC_ARG_WITH(extcap,
   AC_HELP_STRING( [--with-extcap@<:@=DIR@:>@],
-                  [use extcap for external capture sources (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
+                 [use extcap for external capture sources (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
 [
   if test "x$withval" = "xno"; then
       have_extcap=no
@@ -2984,6 +3058,23 @@ then
 fi
 AC_SUBST(extcapdir)
 
+if test "x$enable_sshdump" = "xyes" ; then
+       if  test "x$have_good_libssh" = "xyes" ; then
+               sshdump_bin="sshdump\$(EXEEXT)"
+               sshdump_man="sshdump.1"
+       else
+               echo "Can't find libssh. Disabling sshdump."
+               enable_sshdump=no
+               sshdump_bin=""
+               sshdump_man=""
+       fi
+else
+       sshdump_bin=""
+       sshdump_man=""
+fi
+AC_SUBST(sshdump_bin)
+AC_SUBST(sshdump_man)
+
 dnl libtool defs
 #
 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
@@ -3014,12 +3105,26 @@ else
        RPMBUILD_WITH_ARGS="--without gtk2 --without gtk3"
 fi
 if test "x$have_qt" = "xyes" ; then
-       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
+       if test "$qt_version" -eq "5"; then
+               RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt5"
+       else
+               RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
+       fi
 else
-       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt"
+       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt --without qt5"
+fi
+if test "x$have_lua" = "xyes" ; then
+       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with lua"
+else
+       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without lua"
 fi
 AC_SUBST(RPMBUILD_WITH_ARGS)
 
+AC_SUBST(WS_CPPFLAGS)
+AC_SUBST(WS_CFLAGS)
+AC_SUBST(WS_CXXFLAGS)
+AC_SUBST(WS_LDFLAGS)
+
 dnl Save the cacheable configure results to config.cache before recursing
 AC_CACHE_SAVE
 
@@ -3034,6 +3139,7 @@ AC_OUTPUT(
   Makefile
   doxygen.cfg
   asn1/Makefile
+  wireshark.pc
   _CUSTOM_ASN1_AC_OUTPUT_
   asn1/acp133/Makefile
   asn1/acse/Makefile
@@ -3211,7 +3317,7 @@ if test "x$have_gtk" = "xyes"; then
                gtk_lib_message=" (with GTK+ 2"
        fi
        if test "x$have_ige_mac" = "xyes"; then
-               gtk_lib_message="$gtk_lib_message and Mac OS X integration)"
+               gtk_lib_message="$gtk_lib_message and OS X integration)"
        else
                gtk_lib_message="$gtk_lib_message)"
        fi
@@ -3219,6 +3325,7 @@ fi
 
 if test "x$have_qt" = "xyes" ; then
        enable_wireshark_qt="yes"
+       qt_lib_message=" (with Qt $qt_version)"
 else
        enable_wireshark_qt="no"
 fi
@@ -3253,6 +3360,12 @@ else
        lua_message="no"
 fi
 
+if test "x$have_qt_multimedia_lib" = "xyes" ; then
+       qt_multimedia_message="yes"
+else
+       qt_multimedia_message="no"
+fi
+
 if test "x$want_portaudio" = "xyes" ; then
        portaudio_message="yes"
 else
@@ -3299,9 +3412,21 @@ else
        geoip_message="no"
 fi
 
+if test "x$have_good_libssh" = "xyes" ; then
+       libssh_message="yes"
+else
+       libssh_message="no"
+fi
+
+if test "x$have_ssh_userauth_agent" = "xyes" ; then
+       ssh_userauth_agent_message="yes"
+else
+       ssh_userauth_agent_message="no"
+fi
+
 echo ""
 echo "The Wireshark package has been configured with the following options."
-echo "                    Build wireshark : $enable_wireshark_qt"
+echo "                    Build wireshark : $enable_wireshark_qt$qt_lib_message"
 echo "                Build wireshark-gtk : $have_gtk""$gtk_lib_message"
 echo "                       Build tshark : $enable_tshark"
 echo "                      Build tfshark : $enable_tfshark"
@@ -3315,6 +3440,9 @@ echo "                    Build text2pcap : $enable_text2pcap"
 echo "                      Build randpkt : $enable_randpkt"
 echo "                       Build dftest : $enable_dftest"
 echo "                     Build rawshark : $enable_rawshark"
+echo "                  Build androiddump : $enable_androiddump"
+echo "                      Build sshdump : $enable_sshdump"
+echo "                  Build randpktdump : $enable_randpktdump"
 echo "                        Build echld : $have_echld"
 echo ""
 echo "   Save files as pcap-ng by default : $enable_pcap_ng_default"
@@ -3324,7 +3452,8 @@ echo "                  Use dumpcap group : $dumpcap_group_message"
 echo "                        Use plugins : $have_plugins"
 echo "       Use external capture sources : $have_extcap"
 echo "                    Use Lua library : $lua_message"
-echo "                   Build rtp_player : $portaudio_message"
+echo "                Build Qt RTP player : $qt_multimedia_message"
+echo "              Build GTK+ RTP player : $portaudio_message"
 echo "             Build profile binaries : $enable_profile_build"
 echo "                   Use pcap library : $want_pcap"
 echo "                   Use zlib library : $zlib_message"
@@ -3334,9 +3463,11 @@ 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 POSIX capabilities library : $libcap_message"
 echo "                  Use GeoIP library : $geoip_message"
+echo "                 Use libssh library : $libssh_message"
+echo "            Have ssh_userauth_agent : $ssh_userauth_agent_message"
 echo "                     Use nl library : $libnl_message"
 echo "              Use SBC codec library : $have_sbc"
+#echo "                      Use GResource : $have_gresource"