Make init_progfile_dir() take a function pointer [-Wpedantic]
[metze/wireshark/wip.git] / configure.ac
index 01d5feeca557731f29d2618a733c21773a9c8504..a7cb6c30af7d3e88219e54c1a04a32e3732253e4 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], [8])
+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?
@@ -574,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
 
@@ -603,9 +607,9 @@ 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,
+  AM_PATH_LIBGCRYPT(1.4.2,
        [
-               echo "libgcrypt found, enabling ipsec decryption"
+               echo "libgcrypt found, enabling decryption for ipsec, ssl, etc."
                AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
                gcrypt_message="yes"
        ]
@@ -613,7 +617,7 @@ if test "x$with_gcrypt" = "xyes"; then
                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"
+                       echo "libgcrypt not found, disabling decryption for ipsec, ssl, etc."
                        gcrypt_message="no"
                fi
 
@@ -676,13 +680,13 @@ 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"
@@ -690,21 +694,18 @@ linux*)
                        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"
                        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"
                        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
@@ -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)
@@ -936,6 +942,7 @@ AC_ARG_ENABLE(asan,
        # 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,12 +1078,12 @@ 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"
+WS_CHECKED_CFLAGS_before_pie="$WS_CHECKED_CFLAGS"
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE, C)
+if test "x$can_add_to_cflags" = "xyes"
 then
        # Restore CFLAGS
-       CFLAGS="$CFLAGS_before_pie"
+       WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS_before_pie"
 
        LDFLAGS_before_pie="$LDFLAGS"
        AC_WIRESHARK_LDFLAGS_CHECK([-fPIE -pie])
@@ -1097,9 +1101,9 @@ fi
 AC_SUBST(PIE_CFLAGS)
 AC_SUBST(PIE_LDFLAGS)
 
-CFLAGS_before_simd="$CFLAGS"
+WS_CHECKED_CFLAGS_before_simd="$WS_CHECKED_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.
@@ -1109,14 +1113,14 @@ then
        # is run only if the hardware supports it, but other
        # code would do no such checks.
        #
-       CFLAGS="$CFLAGS_before_simd"
+       WS_CHECKED_CFLAGS="$WS_CHECKED_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
@@ -1124,11 +1128,18 @@ else
                #
                # Restore CFLAGS; see above.
                #
-               CFLAGS="$CFLAGS_before_simd"
+               WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS_before_simd"
                ac_sse4_2_flag=-xarch=sse4_2
        fi
 fi
 
+#
+# All AC_WIRESHARK_COMPILER_FLAGS_CHECK are done, do not call it again!
+# Prepend them to the user-specified CFLAGS/CXXFLAGS.
+#
+CFLAGS="$WS_CHECKED_CFLAGS $CFLAGS"
+CXXFLAGS="$WS_CHECKED_CXXFLAGS $CXXFLAGS"
+
 if test "x$ac_sse4_2_flag" != x; then
        #
        # OK, we have a compiler flag to enable SSE 4.2.
@@ -1279,15 +1290,16 @@ 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.
+               #
+               # Add +O2, for optimization, as suggested by Jost Martin.
+               # XXX - works with "-g"?
                #
-               # HP's ANSI C++ compiler doesn't support "-Ae", but
-               # does support "+O2", at least according to the
-               # documentation I can find online.
+               # +O2 is supported both by the C and C++ compiler.
                #
-               CFLAGS="-Ae +O2 $CFLAGS"
+               CFLAGS="+O2 $CFLAGS"
                if test "$CC" = "$CC_FOR_BUILD"; then
                        #
                        # We're building the build tools with the same
@@ -1297,8 +1309,8 @@ else
                        #
                        CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
                fi
-               CXXFLAGS="+O2 $CFLAGS"
-               AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
+               CXXFLAGS="+O2 $CXXFLAGS"
+               AC_MSG_RESULT(HP C/C++ compiler - added +O2)
                ;;
        solaris*)
                #
@@ -1338,15 +1350,8 @@ 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])
+       LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first $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*)
        #
@@ -1381,9 +1386,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"
@@ -1407,6 +1413,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().
@@ -1566,7 +1573,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.
@@ -1579,7 +1586,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
@@ -1594,9 +1601,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
@@ -1604,6 +1614,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
@@ -1628,7 +1640,7 @@ if test "x$enable_wireshark" = "xyes"; then
        fi
        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)
@@ -1650,6 +1662,42 @@ if test "x$enable_wireshark" = "xyes"; then
                        # compile.
                        #
                        CPPFLAGS="-DQT_GUI_LIB"
+
+                       #
+                       # 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)
                ],
                [
                        case "$with_qt" in
@@ -1744,6 +1792,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
@@ -1823,32 +1874,12 @@ else
        AM_PATH_GLIB_2_0($GLIB_MIN_VERSION, , AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
 fi
 
-#
-# If we're building with Qt, we need the Qt build tools in order to
-# build the Wireshark GUI.  We've already found Qt, and found a
-# particular major version, 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.
-#
-# If we're *not* building with Qt, "make dist" requires that we have
-# the Qt build tools, so we *still* need to look for them.  We didn't
-# look for Qt, so we don't know what version(s) we have; we look for
-# whatever version we can find.
-#
-# XXX - but the above comment about Qt 4 vs. Qt 5 means that if we
-# ship files built with the uic from one version of Qt, they won't
-# compile with another major version of Qt, so should we be shipping
-# those files?  If we don't, that means somebody building from a
-# source tarball would need to have the Qt tools installed, but
-# they'll need other developer packages of Qt *anyway*.
-#
-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)
+# 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
 
 # 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)
@@ -2192,29 +2223,6 @@ else
        AC_WIRESHARK_PCAP_CHECK
 fi
 
-
-dnl Check for airpcap
-dnl We might want to remove this entirely unless we want to support
-dnl AutoTools on Windows.
-AC_MSG_CHECKING(whether to include airpcap support)
-AC_ARG_ENABLE(airpcap,
-  AC_HELP_STRING( [--enable-airpcap],
-                 [use AirPcap in Wireshark @<:@default=no@:>@]),
-  enable_airpcap=$enableval, enable_airpcap=no)
-
-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)
 
@@ -2308,6 +2316,20 @@ 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
+
 # Enable/disable echld
 AC_ARG_ENABLE(echld,
   AC_HELP_STRING( [--enable-echld],
@@ -2454,11 +2476,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
@@ -2483,27 +2505,12 @@ 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,
@@ -2793,6 +2800,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(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).
@@ -3023,6 +3055,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)
@@ -3053,9 +3102,18 @@ 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 --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 qt"
+       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without lua"
 fi
 AC_SUBST(RPMBUILD_WITH_ARGS)
 
@@ -3250,7 +3308,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
@@ -3293,6 +3351,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
@@ -3339,6 +3403,18 @@ 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$qt_lib_message"
@@ -3356,6 +3432,7 @@ 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 echld : $have_echld"
 echo ""
 echo "   Save files as pcap-ng by default : $enable_pcap_ng_default"
@@ -3365,7 +3442,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"
@@ -3375,9 +3453,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"