[Diameter] Add a couple of command codes from IANA.
[metze/wireshark/wip.git] / configure.ac
index 23dee60058ff256c950b40d52f88b4fb4bb6abb3..4da9b9364675090a1291b7dc8fafb2a69faa6f6a 100644 (file)
@@ -6,12 +6,13 @@
 # Define variables for the components of the Wireshark version number.
 #
 m4_define([version_major], [2])
-m4_define([version_minor], [1])
+m4_define([version_minor], [5])
 m4_define([version_micro], [0])
-m4_define([version_micro_extra], version_micro)
-m4_append([version_micro_extra], [])
+dnl Updated by make-version.pl
+m4_define([version_extra], [])
+m4_define([version_micro_extra], m4_join([], version_micro, version_extra))
 
-AC_INIT(wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/)
+AC_INIT(Wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/)
 CONFIG_ARGS="$*"
 AC_SUBST(CONFIG_ARGS)
 
@@ -45,39 +46,39 @@ dnl AC_CANONICAL_BUILD
 dnl AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
-AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2 no-dist-gzip subdir-objects])
+AM_INIT_AUTOMAKE([1.11 tar-ustar dist-xz no-dist-gzip subdir-objects])
+
+# Enable silent builds by default. Verbose builds can be enabled with "./configure
+# --enable-silent-rules ..." or "make V=1 ..."
+AM_SILENT_RULES([yes])
 
 # Make Wireshark's version available in config.h
 AC_DEFINE(VERSION_MAJOR, version_major, [Wireshark's major version])
 AC_DEFINE(VERSION_MINOR, version_minor, [Wireshark's minor version])
 AC_DEFINE(VERSION_MICRO, version_micro, [Wireshark's micro version])
 
-AC_DEFINE(VERSION_FLAVOR, "Development Build", [Wireshark's package flavor])
+AC_DEFINE_UNQUOTED(VERSION_FLAVOR,
+       ["${WIRESHARK_VERSION_FLAVOR:-"Development Build"}"], [Wireshark's package flavor])
 
-AM_DISABLE_STATIC
+LT_PREREQ([2.2.2])
+LT_INIT([disable-static dlopen])
+AC_SUBST([LIBTOOL_DEPS])
+
+AC_CONFIG_LIBOBJ_DIR([wsutil])
 
 #
 # Checks for programs used in the main build process.
 #
-AC_PROG_CC_STDC
-if test "$ac_cv_prog_cc_stdc" == "no"
+# See doc/README.developer for allowed C99 features
+#
+AC_PROG_CC_C99
+if test "$ac_cv_prog_cc_c99" = "no"
 then
-       AC_MSG_ERROR([The C compiler does not support standard C])
+       AC_MSG_ERROR([The C compiler does not support C99])
 fi
-AC_PROG_CXX
 AC_PROG_CPP
-AC_PROG_MKDIR_P
 
-# Set CC_FOR_BUILD (the *local* gcc to use for building e.g. lemon)
-if test "x$cross_compiling" = xno -a -z "$CC_FOR_BUILD"; then
-       CC_FOR_BUILD="$CC"
-fi
-AX_PROG_CC_FOR_BUILD
-
-dnl Work around libtool bug (fixed in the version 1.5a?)
-AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
-AC_LIBTOOL_DLOPEN
-AC_PROG_LIBTOOL
+AC_PROG_CXX
 if test ! -z "$CXX"; then
        #
        # OK, we found something AC_LANG_CXX thinks is a C++ compiler,
@@ -87,16 +88,12 @@ if test ! -z "$CXX"; then
        # system, and AC_PROG_CXX looks for, among other things,
        # "CC" as a C++ compiler, and, if you have a case-insensitive
        # file system and a C compiler named "cc" (both true, by
-       # default, on OS X), AC_PROG_CXX may end up thinking it's
+       # default, on macOS), AC_PROG_CXX may end up thinking it's
        # the C++ compiler.
        #
        # So we check by feeding the purported C++ compiler a
        # program using C++ features (iostream).
        #
-       # We do this after AC_PROG_LIBTOOL; if we did so before, and
-       # cleared CXX if what we had isn't a C++ compiler, that'd
-       # get undone by AC_PROG_LIBTOOL for some reason.
-       #
        AC_MSG_CHECKING(whether $CXX is a C++ compiler)
        AC_LANG_PUSH([C++])
        AC_LINK_IFELSE([AC_LANG_PROGRAM(
@@ -114,6 +111,26 @@ if test ! -z "$CXX"; then
                ])
        AC_LANG_POP([C++])
 fi
+
+# Qt 5.7 or later requires C++11
+AS_IF([test -n "$CXX"],
+       [AX_CXX_COMPILE_STDCXX([11], [noext], [optional])])
+
+# Set CC_FOR_BUILD (the *local* gcc to use for building e.g. lemon)
+if test "x$cross_compiling" = xno -a -z "$CC_FOR_BUILD"; then
+       CC_FOR_BUILD="$CC"
+fi
+AX_PROG_CC_FOR_BUILD
+
+#
+# Check for versions of "sed" inadequate to handle, in libtool, a list
+# of object files as large as the list in Wireshark.
+#
+AC_PROG_SED
+
+AC_PROG_LN_S
+AC_PROG_MKDIR_P
+
 AC_PATH_PROG(PERL, perl)
 
 # Check for Python.
@@ -138,37 +155,21 @@ else
        AC_MSG_ERROR(I couldn't find python; make sure it's installed and in your path)
 fi
 
-#
-# XXX - should autogen.sh check for YACC/Bison and Flex?  A user building
-# from a distribution tarball shouldn't have to have YACC/Bison or Flex,
-# as the tarball should contain the results of running YACC/Bison on .y
-# files and running Flex on .l files, but a user building from SVN
-# will have to run YACC/Bison and Flex to process those files.
-#
-# On the other hand, what about users who use a distribution tarball to
-# do development?  They *shouldn't* - that's what the SVN repository is
-# for - but they might.  They'd get errors if they modify a .y or .l
-# file and try to do a build - but the error should tell them that they
-# need to get YACC/Bison and/or Flex.
-#
-# Then again, getting them shouldn't be too big of a burden.
-#
-# XXX - is the same true of pod2man and pod2html, or are they needed
-# even when building from a distribution tarball?
-#
-#
+dnl
+dnl Check for yacc/lex. Distribution tarballs include generated source,
+dnl in which case these tools are not a mandatory requirement to build.
+dnl
 AC_PROG_YACC
-AC_PATH_PROG(YACCDUMMY, $YACC)
-if test "x$YACCDUMMY" = x
-then
-       AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
-fi
-AM_PROG_LEX
-AC_PATH_PROG(LEX, flex)
-if test "x$LEX" = x
-then
-       AC_MSG_ERROR(I couldn't find flex; make sure it's installed and in your path)
-fi
+AS_IF([test "x$YACC" = xyacc], [AS_UNSET(YACC)])
+AS_IF([test -z "$YACC" -a ! -f $srcdir/wiretap/ascend.c],
+       [AC_MSG_ERROR([I couldn't find bison or byacc; make sure it's installed and in your path])])
+AM_MISSING_PROG(YACC, bison)
+AC_PROG_LEX
+AS_IF([test "x$LEX" != xflex], [AS_UNSET(LEX)])
+AS_IF([test -z "$LEX" -a ! -f $srcdir/wiretap/ascend_scanner.c],
+       [AC_MSG_ERROR([I couldn't find flex; make sure it's installed and in your path])])
+AM_MISSING_PROG(LEX, flex)
+
 AC_PATH_PROG(POD2MAN, pod2man)
 if test "x$POD2MAN" = x
 then
@@ -186,41 +187,6 @@ then
        AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
 fi
 
-#
-# Checks for programs used by Wireshark/TShark/etc.
-#
-
-#
-# XXX - this looks for various HTML viewers on the host, not the target;
-# we really want to know what's available on the target, for cross-builds.
-# That would probably require us to, at run time, look for xdg-open and,
-# if we don't find it, look for mozilla, htmlview, etc.
-#
-AC_PATH_PROG(HTML_VIEWER, xdg-open)
-if test "x$HTML_VIEWER" != x
-then
-       #
-       # XXX - the HTML_VIEWER shell variable is the full path of xdg-open.
-       # Define some variable to be that, so we just run that?
-       #
-       AC_DEFINE(HAVE_XDG_OPEN, 1, [Define if we have xdg-open])
-
-       #
-       # XXX - we have to define HTML_VIEWER for the prefs.c code that
-       # sets the default value of the Web browser preference, even
-       # though that preference won't be offered.
-       #
-       AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
-else
-       AC_PATH_PROG(HTML_VIEWER, htmlview)
-       if test "x$HTML_VIEWER" = x
-       then
-               AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
-       else
-               AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
-       fi
-fi
-
 #
 # Set "ac_supports_gcc_flags" if the compiler is known to support GCC-style
 # flags such as -pedantic, -W warning flags and -f feature flags.  Currently,
@@ -255,266 +221,10 @@ 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
 
-AC_ARG_ENABLE(osx-deploy-target,
-  AC_HELP_STRING( [--enable-osx-deploy-target],
-    [choose an OS X deployment target @<:@default=major release on which you're building@:>@]),
-[
-       #
-       # Is this OS X?
-       #
-       case "$host_os" in
-       darwin*)
-               #
-               # Yes.
-               #
-               # Let the user specify an OS X release to use as a
-               # deplayment target; if they specify that we should
-               # have a deployment target but don't specify the
-               # deployment target, then, if we have SDKs available,
-               # pick the OS version on which the build is being done.
-               # This also causes the build to be done against an SDK
-               # rather than against the headers and libraries in
-               # /usr/include and /usr/lib.
-               #
-               # Check for an OS X deployment target early, so that
-               # as many tests using the compiler are done using the
-               # flags that we'll be using when building.
-               #
-               if test $enableval = no
-               then
-                       #
-                       # The user explicitly said
-                       # --disable-osx-deploy-target, so don't build
-                       # against an SDK.
-                       #
-                       deploy_target=
-               elif test $enableval = yes
-               then
-                       #
-                       # The user said --enable-osx-deploy-target, but
-                       # didn't say what version to target; target the
-                       # major version number of the version of OS X on
-                       # which we're running.
-                       #
-                       # (We quote the command so that we can use
-                       # autoconf's M4 quoting characters, [ and ], in
-                       # the sed expression.)
-                       #
-                       [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
-               else
-                       deploy_target="$enableval"
-               fi
-               ;;
-
-       *)
-               #
-               # No.  Fail, because whatever the user intended for us to
-               # do, we can't do it.
-               #
-               AC_MSG_ERROR([--enable-osx-deploy-target specified on an OS other than OS X])
-               ;;
-       esac
-],[
-       #
-       # Is this OS X?
-       #
-       case "$host_os" in
-       darwin*)
-               #
-               # Yes.
-               #
-               # If we have SDKs available, default to targeting the major
-               # version number of the version of OS X on which we're
-               # running.
-               #
-               # (We quote the command so that we can use autoconf's
-               # M4 quoting characters, [ and ], in the sed expression.)
-               #
-               for i in /Developer/SDKs \
-                   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
-                   /Library/Developer/CommandLineTools/SDKs
-               do
-                       if test -d "$i"
-                       then
-                               [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
-                               break
-                       fi
-               done
-               ;;
-
-       *)
-               #
-               # No.  There's nothing to do.
-               #
-               ;;
-       esac
-])
-
-if test ! -z "$deploy_target"
-then
-       AC_MSG_CHECKING([whether we can build for OS X $deploy_target])
-       case $deploy_target in
-
-       10.0|10.1|10.2)
-               #
-               # I'm not sure this would even work.
-               #
-               AC_MSG_RESULT(no)
-               AC_ERROR([We don't support building for OS X $deploy_target])
-               ;;
-
-       10.3)
-               #
-               # XXX - never tested.
-               #
-               AC_MSG_RESULT(yes)
-               SDKPATH="/Developer/SDKs/MacOSX10.3.9.sdk"
-               ;;
-
-       *)
-               #
-               # Look for the oldest SDK we can find that's
-               # for an OS equal to or later than this one.
-               #
-               # XXX - for 10.4, do we need 10.4u?  We're
-               # not currently doing fat builds (we'd need
-               # fat versions of the support libraries for
-               # that to be useful), but, if we do, we'd
-               # need to use 10.4u.
-               #
-
-               #
-               # Get the real version - strip off the "10.".
-               # We'll worry about that if, as, and when there's ever
-               # an OS XI.
-               #
-               deploy_real_version=`echo "$deploy_target" | sed -n 's/10\.\(.*\)/\1/p'`
-
-               #
-               # Search each directory that might contain SDKs.
-               #
-               sdkpath=""
-               for sdksdir in /Developer/SDKs \
-                   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
-                   /Library/Developer/CommandLineTools/SDKs
-               do
-                       #
-                       # Get a list of all the SDKs.
-                       #
-                       if ! test -d "$sdksdir"
-                       then
-                               #
-                               # There is no directory with that name.
-                               # Move on to the next one in the list,
-                               # if any.
-                               #
-                               continue
-                       fi
-
-                       #
-                       # Get a list of all the SDKs in that directory,
-                       # if any.
-                       #
-                       # We have to use @<:@ for [ and @:>@ for ] to
-                       # avoid m4 removing the square brackets.
-                       #
-                       sdklist=`(cd "$sdksdir"; ls -d MacOSX10.@<:@0-9@:>@*.sdk 2>/dev/null)`
-
-                       for sdk in $sdklist
-                       do
-                               #
-                               # Get the real version for this SDK.
-                               #
-                               sdk_real_version=`echo "$sdk" | sed -n 's/MacOSX10\.\(.*\)\.sdk/\1/p'`
-
-                               #
-                               # Is it for the deployment target or
-                               # some later release?
-                               #
-                               if test "$sdk_real_version" -ge "$deploy_real_version"
-                               then
-                                       #
-                                       # Yes, use it.
-                                       #
-                                       sdkpath="$sdksdir/$sdk"
-                                       break 2
-                               fi
-                       done
-               done
-               if test -z "$sdkpath"
-               then
-                       AC_MSG_RESULT(no)
-                       AC_MSG_ERROR([We couldn't find an SDK for OS X $deploy_target or later])
-               fi
-               SDKPATH="$sdkpath"
-               AC_MSG_RESULT([yes, with the 10.$sdk_real_version SDK])
-               ;;
-       esac
-
-       #
-       # Add a -mmacosx-version-min flag to force tests that
-       # use the compiler, as well as the build itself, not to,
-       # for example, use compiler or linker features not supported
-       # by the minimum targeted version of the OS.
-       #
-       # Add an -isysroot flag to use the SDK.
-       #
-       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.
-       #
-       OSX_APP_FLAGS="-sdkroot $SDKPATH"
-
-       #
-       # XXX - do we need this to build the Wireshark wrapper?
-       # XXX - is this still necessary with the -mmacosx-version-min
-       # flag being set?
-       #
-       OSX_DEPLOY_TARGET="MACOSX_DEPLOYMENT_TARGET=$deploy_target"
-
-       #
-       # In the installer package XML file, give the deployment target
-       # as the minimum version.
-       #
-       OSX_MIN_VERSION="$deploy_target"
-
-       case $deploy_target in
-
-       10.4|10.5)
-               #
-               # 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.
-               #
-               WS_CFLAGS="-m32 $WS_CFLAGS"
-               WS_CXXFLAGS="-m32 $WS_CXXFLAGS"
-               WS_LDFLAGS="-m32 $WS_LDFLAGS"
-               ;;
-       esac
-else
-       #
-       # Is this OS X?
-       #
-       case "$host_os" in
-       darwin*)
-               #
-               # Yes.
-               #
-               # In the installer package XML file, give the current OS
-               # version, minor version and all, as the minimum version.
-               # We can't guarantee that the resulting binary will work
-               # on older OS versions, not even older minor versions
-               # (original release or earlier software updates).
-               #
-               OSX_MIN_VERSION=`sw_vers -productVersion`
-               ;;
-       esac
-fi
-AC_SUBST(OSX_MIN_VERSION)
+#
+# Add configure argument to select macOS deployment target.
+#
+AC_WIRESHARK_OSX_DEPLOY_TARGET
 
 #
 # Try to arrange for large file support.
@@ -522,22 +232,14 @@ AC_SUBST(OSX_MIN_VERSION)
 AC_SYS_LARGEFILE
 
 #
-# Look for math functions; use libm if necessary.
+# Check if we need to link with libm
 #
-AC_SEARCH_LIBS(floor, m)
-AC_SEARCH_LIBS(ceil, m)
-AC_SEARCH_LIBS(exp, m)
-AC_SEARCH_LIBS(log, m)
-AC_SEARCH_LIBS(log10, m)
-AC_SEARCH_LIBS(floorl, m,
-  [
-    FLOORL_LO=""
-    AC_DEFINE(HAVE_FLOORL, 1, [Define if you have the floorl function.])
-  ],
-  FLOORL_LO="floorl.lo")
-AC_SUBST(FLOORL_LO)
-AC_SEARCH_LIBS(lrint, m,
-  [AC_DEFINE(HAVE_LRINT, 1, [Define if you have the 'lrint' function.])])
+AC_SEARCH_LIBS([cos], [m])
+
+#
+# Check for C99 math functions.
+#
+AC_CHECK_FUNCS([floorl lrint])
 
 #
 # Check if we need to link with -lnsl and -lsocket
@@ -549,18 +251,19 @@ AX_LIB_SOCKET_NSL
 #
 AC_ARG_WITH([qt],
   AC_HELP_STRING( [--with-qt=@<:@yes/no/4/5@:>@],
-                 [use Qt @<:@default=yes@:>@]),
+                 [use Qt @<:@default=yes, if available@:>@]),
   with_qt="$withval", with_qt="unspecified")
 
-AC_ARG_WITH([gtk2],
-  AC_HELP_STRING( [--with-gtk2=@<:@yes/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@:>@]),
-  with_gtk3="$withval", with_gtk3="unspecified")
+AC_ARG_WITH([gtk],
+  AC_HELP_STRING( [--with-gtk=@<:@yes/no/2/3@:>@],
+       [use GTK+ @<:@default=no@:>@]),
+       AS_CASE([$withval],
+         [yes], [with_gtk="3 2 fail"],
+         [no],  [with_gtk="no"],
+         [3],   [with_gtk="3 fail3"],
+         [2],   [with_gtk="2 fail2"],
+         [AC_MSG_ERROR([--with-gtk must be one of yes/no/2/3])]),
+       with_gtk="no")
 
 # GnuTLS
 # Version 3.0 switched from LGPLv2.1+ to LGPLv3+, then switched back to
@@ -599,35 +302,10 @@ if test "x$with_gnutls" = "xyes"; then
   fi
 fi
 
-# libgrypt
-gcrypt_message="no"
-want_gcrypt="if_available"
-AC_ARG_WITH([gcrypt],
-  AC_HELP_STRING( [--with-gcrypt=@<:@yes/no@:>@],
-                 [use gcrypt library @<:@default=yes, if available@:>@]),
-  [ with_gcrypt="$withval"; want_gcrypt="yes" ], with_gcrypt="yes")
-
-if test "x$with_gcrypt" = "xyes"; then
-  AM_PATH_LIBGCRYPT(1.4.2,
-       [
-               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
-                       AS_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
+# libgrypt (for decryption, MAC, etc. functionality).
+AM_PATH_LIBGCRYPT(1.4.2, [ ] , [
+  AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
+])
 
 AC_ARG_WITH(libnl,
   AC_HELP_STRING([--with-libnl@<:@=VERSION@:>@],
@@ -762,34 +440,19 @@ AX_LIBSMI
 #
 # Check for programs used when building DocBook documentation.
 #
+AC_CHECK_PROGS(XSLTPROC, xsltproc, xsltproc)
+AC_CHECK_PROGS(A2X, a2x, a2x)
+AC_CHECK_PROGS(FOP, fop, fop)
 
-# Check for a2x (convert asciidoc to another format)
-AC_PATH_PROG(A2X, a2x)
-AC_CHECK_PROG(HAVE_A2X, a2x, "yes", "no")
-AM_CONDITIONAL(HAVE_A2X, test x$HAVE_A2X = 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)
-
-# 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 (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)
-
-# Check for xsltproc
-AC_PATH_PROG(XSLTPROC, xsltproc)
-AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
-AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
-
+# HTML to text processor
+AC_MSG_CHECKING([for an HTML to text processor])
+AS_IF([w3m -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=w3m],
+       [lynx -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=lynx],
+       [have_a2x_text=no])
+AC_MSG_RESULT([$have_a2x_text])
+AM_CONDITIONAL(HAVE_A2X_TEXT, [test "x$have_a2x_text" != xno])
+AS_IF([test $have_a2x_text = lynx], [A2X_LYNX="--lynx"])
+AC_SUBST(A2X_LYNX)
 
 # Check for packaging utilities
 # For now, we check to see if the various packaging utilites are in our
@@ -815,13 +478,27 @@ fi
 AC_SUBST(HAVE_SVR4_PACKAGING)
 
 # RPM
-AC_WIRESHARK_RPM_CHECK
-AC_SUBST(HAVE_RPM)
+#
+# Looks for the rpmbuild program, and checks to see if we can redefine "_topdir".
+#
+AC_CHECK_PROGS(RPMBUILD, [rpmbuild], [false])
+if test "x$RPMBUILD" != "xfalse" ; then
+       AC_MSG_CHECKING([to see if we can redefine _topdir])
+       rpm --define '_topdir /tmp' > /dev/null 2>&1
+       if test $? -eq 0 ; then
+               AC_MSG_RESULT(yes)
+               have_rpm=yes
+       else
+               AC_MSG_RESULT([no, you'll have to build packages manually])
+               have_rpm=no
+       fi
+fi
+AM_CONDITIONAL(HAVE_RPM, [test "x$have_rpm" = xyes])
 
 # Debian
 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
 
-# OS X
+# macOS
 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
@@ -835,12 +512,16 @@ fi
 AC_SUBST(HAVE_OSX_PACKAGING)
 
 #
-# Use this as a proxy for "is this OS X" (just in case somebody actually
+# Use this as a proxy for "is this macOS" (just in case somebody actually
 # built and installed Darwin as an OS, perhaps with some X11-based GUI,
 # don't look for Darwin).
 #
 AC_CHECK_PROG(have_sw_vers, sw_vers, "yes", "no")
-AM_CONDITIONAL(NOT_OS_X, test "x$have_sw_vers" = "xno")
+AM_CONDITIONAL(NOT_MACOS, test "x$have_sw_vers" = "xno")
+
+# Shellcheck
+AC_CHECK_PROG(HAVE_SHELLCHECK, shellcheck, "yes", "no")
+AM_CONDITIONAL(HAVE_SHELLCHECK, test x$HAVE_SHELLCHECK = xyes)
 
 #
 # Check compiler vendor. For GCC this will be 'gnu' and for Clang 'clang'.
@@ -864,115 +545,13 @@ AC_WIRESHARK_CHECK_UNKNOWN_WARNING_OPTION_ERROR
 #
 AC_WIRESHARK_CHECK_NON_CXX_WARNING_OPTION_ERROR
 
-#
-# Try to add some additional checks to CFLAGS.
-# These are not enabled by default, because the warnings they produce
-# are very hard or impossible to eliminate.
-#
-AC_ARG_ENABLE(extra-compiler-warnings,
-  AC_HELP_STRING( [--enable-extra-compiler-warnings],
-                 [do additional compiler warnings @<:@default=no@:>@]),
-[
-       wireshark_extra_flags=$enableval
-       if test $enableval != no
-       then
-               #
-               # The following are for C and C++
-               #
-               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)
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
-               #
-               # Due to various places where APIs we don't control
-               # require us to cast away constness, we can probably
-               # never enable this one with -Werror.
-               #
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-qual)
-               #
-               # Some generated ASN.1 dissectors block this one;
-               # multiple function declarations for the same
-               # function are being generated.
-               #
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wredundant-decls)
-               #
-               # Some loops are safe, but it's hard to convince the
-               # compiler of that.
-               #
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunsafe-loop-optimizations)
-               #
-               # All the registration functions block these for now.
-               #
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-prototypes)
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-declarations)
-               #
-               # A bunch of "that might not work on SPARC" code blocks
-               # this one for now.
-               #
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-align)
-               #
-               # Works only with Clang
-               #
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunreachable-code)
-               #
-               # Works only with Clang but generates a lot of warnings
-               # (about glib library not using Doxygen)
-               #
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdocumentation)
-
-               #
-               # The following are C only, not C++
-               #
-               # Due to various places where APIs we don't control
-               # require us to cast away constness, we can probably
-               # never enable this one with -Werror.
-               #
-               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C)
-       fi
-],)
-
-# Try to add ASAN address analyze.
-# Only needed for analyse
-#
-AC_ARG_ENABLE(asan,
-  AC_HELP_STRING( [--enable-asan],
-                 [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
-       #
-       # XXX shouldn't this also be added to LDFLAGS?
-       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address)
-
-],)
-
-
-# Add check hf conflict..
-#
-AC_ARG_ENABLE(checkhf-conflict,
-  AC_HELP_STRING( [--enable-checkhf-conflict],
-                 [Enable Check hf conflict for debugging (May be slow start)@<:@default=no@:>@]),
-[
-       AC_DEFINE(ENABLE_CHECK_FILTER, 1, [Enable check hf conflict])
-],)
-
 #
 # The following are for C and C++
 #
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wall -W) # -W is now known as -Wextra
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wextra) # -W is now known as -Wextra
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wall)
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wextra)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wendif-labels)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpointer-arith)
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Warray-bounds)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wformat-security)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fwrapv)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-strict-overflow)
@@ -986,28 +565,12 @@ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpragmas)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-overlength-strings)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable)
-#
-# Either the version of clang on the "clang code analysis" buildbot is
-# horribly broken, or the header files on that buildbot are horribly
-# broken, as the perfectly-legitimate statement
-#
-#      if( strcmp(argv[i],"--")==0 ) dashdash = 1;
-#
-# is getting stoopid "array index 3 is past the end of the array (which
-# contains 3 elements)" complaints from the compiler.
-#
-# The macro for strcmp() in glibc(?) really seems to give C compilers
-# conniptions; I think I've seen crap from GCC as well with that macro.
-#
-# So, alas, suppress the compile-time array bounds checks.
-#
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wnoarray-bounds)
+
 #
 # The following are C only, not C++
 #
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wc++-compat, C)
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdeclaration-after-statement, C)
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable, C)
 
 #
 # XXX - OK for C++?
@@ -1069,43 +632,182 @@ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wjump-misses-init, C)
 # so only enable this for C for now.
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshorten-64-to-32, C)
 
-# Clang only. Avoid "argument unused during compilation" warnings
-# (for example, when getting the -gsplit-dwarf option or
-# when combining -fwrapv with -fno-strict-overflow)
-if test x"$ax_cv_c_compiler_vendor" = xclang; then
-       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Qunused-arguments, C)
-fi
-if test x"$ax_cv_cxx_compiler_vendor" = xclang; then
-       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Qunused-arguments, CXX)
-fi
+#
+# Implicit function declarations are an error in C++ and most
+# likely a programming error in C. Turn -Wimplicit-int and
+# -Wimplicit-function-declaration into an error by default.
+#
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Werror=implicit, C)
+
+# Clang only. Avoid "argument unused during compilation" warnings
+# (for example, when getting the -gsplit-dwarf option or
+# when combining -fwrapv with -fno-strict-overflow)
+if test x"$ax_cv_c_compiler_vendor" = xclang; then
+       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Qunused-arguments, C)
+fi
+if test x"$ax_cv_cxx_compiler_vendor" = xclang; then
+       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Qunused-arguments, CXX)
+fi
+
+#
+# Use the faster pre gcc 4.5 floating point precision if available.
+#
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fexcess-precision=fast)
+
+#
+# Try to have the compiler default to hiding symbols, so that only
+# symbols explicitly exported with WS_DLL_PUBLIC will be visible
+# outside (shared) libraries; that way, more UN*X builds will catch
+# failures to export symbols, rather than having that fail only on
+# Windows.
+#
+# GCC and GCC-compatible compilers
+#
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fvisibility=hidden)
+if test "x$can_add_to_cflags" = "xno"
+then
+       #
+       # Sun^WOracle C.
+       #
+       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xldscope=hidden)
+       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)
+       fi
+fi
+
+#
+# Try to add some additional checks to CFLAGS.
+# These are not enabled by default, because the warnings they produce
+# are very hard or impossible to eliminate.
+#
+AC_ARG_ENABLE(extra-compiler-warnings,
+  AC_HELP_STRING( [--enable-extra-compiler-warnings],
+                 [do additional compiler warnings @<:@default=no@:>@]),
+[
+       wireshark_extra_flags=$enableval
+       if test $enableval != no
+       then
+               #
+               # The following are for C and C++
+               #
+               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)
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
+               #
+               # Due to various places where APIs we don't control
+               # require us to cast away constness, we can probably
+               # never enable this one with -Werror.
+               #
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-qual)
+               #
+               # Some generated ASN.1 dissectors block this one;
+               # multiple function declarations for the same
+               # function are being generated.
+               #
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wredundant-decls)
+               #
+               # Some loops are safe, but it's hard to convince the
+               # compiler of that.
+               #
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunsafe-loop-optimizations)
+               #
+               # All the registration functions block these for now.
+               #
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-prototypes)
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-declarations)
+               #
+               # A bunch of "that might not work on SPARC" code blocks
+               # this one for now.
+               #
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-align)
+               #
+               # Works only with Clang
+               #
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunreachable-code)
+               #
+               # Works only with Clang but generates a lot of warnings
+               # (about glib library not using Doxygen)
+               #
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdocumentation)
+
+               #
+               # The following are C only, not C++
+               #
+               # Due to various places where APIs we don't control
+               # require us to cast away constness, we can probably
+               # never enable this one with -Werror.
+               #
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C)
+
+               # Works only with GCC 7
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wduplicated-branches)
 
-#
-# Use the faster pre gcc 4.5 floating point precision if available.
-#
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fexcess-precision=fast)
+       fi
+])
 
+# Try to add ASAN address analyze.
+# Only needed for analyse
 #
-# Try to have the compiler default to hiding symbols, so that only
-# symbols explicitly exported with WS_DLL_PUBLIC will be visible
-# outside (shared) libraries; that way, more UN*X builds will catch
-# failures to export symbols, rather than having that fail only on
-# Windows.
-#
-# GCC and GCC-compatible compilers
-#
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fvisibility=hidden)
-if test "x$can_add_to_cflags" = "xno"
-then
+AC_ARG_ENABLE(asan,
+  AC_HELP_STRING( [--enable-asan],
+                 [Enable AddressSanitizer (ASAN) for debugging (degrades performance)@<:@default=no@:>@]),
+[
        #
-       # Sun^WOracle C.
+       # 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(-xldscope=hidden)
-       if test "x$can_add_to_cflags" = "xno"
+       # XXX shouldn't this also be added to LDFLAGS?
+       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address)
+
+       # Disable ASAN for build-time tools, e.g. lemon
+       WS_CFLAGS_saved="$WS_CFLAGS"
+       WS_LDFLAGS_saved="$WS_LDFLAGS"
+       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-sanitize=all, C)
+       if test "x$can_add_to_cflags" = "xyes"
        then
-               # TODO add other ways of hiding symbols
-               AC_MSG_WARN(Compiler will export all symbols from shared libraries)
+               NO_SANITIZE_CFLAGS="-fno-sanitize=all"
+               NO_SANITIZE_LDFLAGS="-fno-sanitize=all"
        fi
-fi
+       WS_CFLAGS="$WS_CFLAGS_saved"
+       WS_LDFLAGS="$WS_LDFLAGS_saved"
+
+])
+AC_SUBST(NO_SANITIZE_CFLAGS)
+AC_SUBST(NO_SANITIZE_LDFLAGS)
+
+# Try to enable UndefinedBehaviorSanitizer.
+#
+AC_ARG_ENABLE(ubsan,
+  AC_HELP_STRING( [--enable-ubsan],
+                 [Enable UndefinedBehaviorSanitizer (UBSan) for debugging@<:@default=no@:>@]),
+[
+       #
+       # Available since Clang >= 3.3 and GCC >= 4.9
+       #
+       # XXX shouldn't this also be added to LDFLAGS?
+       AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=undefined)
+
+])
+
+# Add check hf conflict..
+#
+AC_ARG_ENABLE(checkhf-conflict,
+  AC_HELP_STRING( [--enable-checkhf-conflict],
+                 [Enable hf conflict check for debugging (start-up may be slower)@<:@default=no@:>@]),
+[
+       AC_DEFINE(ENABLE_CHECK_FILTER, 1, [Enable hf conflict check])
+])
 
 AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,-M])
@@ -1244,8 +946,10 @@ AC_SUBST(CFLAGS_SSE42)
 #
 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
   AC_DEFINE(_U_, __attribute__((unused)), [Hint to the compiler that a function parameters is not used])
+  AC_DEFINE(WS_NORETURN, __attribute((noreturn)), [Hint to the compiler that a function never returns])
 else
   AC_DEFINE(_U_, , [Hint to the compiler that a function parameters is not used])
+  AC_DEFINE(WS_NORETURN, , [Hint to the compiler that a function never returns])
 fi
 
 # If we're running GCC or CLang, use FORTIFY_SOURCE=2
@@ -1285,9 +989,11 @@ AC_ARG_ENABLE(warnings-as-errors,
     with_warnings_as_errors="no"
     AC_MSG_RESULT(no)
   fi
-]
-)
-AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
+])
+
+AS_IF([test "x$with_warnings_as_errors" = "xyes"], [WERROR="-Werror"], [WERROR=""])
+AC_SUBST(WERROR)
+AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, [test "x$with_warnings_as_errors" = "xyes"])
 
 #
 # Add any platform-specific compiler flags needed.
@@ -1357,6 +1063,22 @@ fi
 #
 AC_MSG_CHECKING(for platform-specific linker flags)
 case "$host_os" in
+aix*)
+       #
+       # If this is GCC or Clang, Add -Wl,-bbigtoc for big libraries.
+       # XXX - what if we're using xlc?  Is that necessary?  The
+       # xlc 7.0 manual says "Specifying -qpic=large has the same
+       # effect as passing -bbigtoc to ld"; do we need to tell xlc,
+       # when it's compiling, to generate different code for a large
+       # TOC, or is that just a linker flag?  For that matter, do we
+       # have to tell GCC or Clang to generate different code for a
+       # large TOC?
+       #
+       if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
+               LDFLAGS_BIGSHAREDLIB="-Wl,-bbigtoc"
+               AC_MSG_RESULT([AIX linker with GCC or Clang - added -Wl,-bbigtoc to large shared library linker flags and -Wl,-headerpad_max_install_names -Wl,-search_paths_first and -Wl,-headerpad_max_install_names to all linker flags])
+       fi
+       ;;
 darwin*)
        #
        # Add -Wl,-single_module to the LDFLAGS used with shared
@@ -1386,22 +1108,17 @@ cygwin*)
        # undefined symbols.
        #
        WS_LDFLAGS="$WS_LDFLAGS -no-undefined"
-       AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
+       AC_MSG_RESULT(Cygwin GNU ld - added -no-undefined)
        ;;
 *)
        AC_MSG_RESULT(none needed)
        ;;
 esac
+AC_SUBST(LDFLAGS_BIGSHAREDLIB)
 AC_SUBST(LDFLAGS_SHAREDLIB)
 
-# Enable silent builds by default
-# Verbose builds can be enabled with "./configure
-# --enable-silent-rules ..." or "make V=1 ..."
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
-  [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
-
 #
-# On "Darwin", which we assume to mean "OS X" rather than "iOS" or
+# On "Darwin", which we assume to mean "macOS" rather than "iOS" or
 # "just Darwin" (as we don't currently support iOS, and as I don't
 # think you can build and run "just Darwin" as an OS for PCs), we
 # arrange to build some programs with Application Services so they
@@ -1413,17 +1130,17 @@ 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
+have_macos_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])
+       have_macos_frameworks=yes
+       AC_DEFINE(HAVE_MACOS_FRAMEWORKS, 1, [Define to 1 if you have macOS frameworks])
        APPLICATIONSERVICES_FRAMEWORKS="-framework ApplicationServices"
        SYSTEMCONFIGURATION_FRAMEWORKS="-framework SystemConfiguration"
        COREFOUNDATION_FRAMEWORKS="-framework CoreFoundation"
 
        #
-       # OK, so we have the OS X frameworks; do they include
+       # OK, so we have the macOS frameworks; do they include
        # CFPropertyListCreateWithStream, or do we have
        # to fall back on CFPropertyListCreateFromStream?
        # (They only differ in the error return, which we
@@ -1440,16 +1157,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().
-#
-case "$host_os" in
-solaris*)
-       AC_CHECK_FUNC(getexecname)
-       ;;
-esac
+AM_CONDITIONAL(HAVE_MACOS_FRAMEWORKS, [test "x$have_macos_frameworks" = "xyes"])
 
 #
 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
@@ -1467,46 +1175,6 @@ case "$host_os" in
   ;;
 esac
 
-#
-# Check for versions of "sed" inadequate to handle, in libtool, a list
-# of object files as large as the list in Wireshark.
-#
-# On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
-# as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
-# symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
-# their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
-# is the only "sed" that comes with Solaris that can handle Wireshark.
-#
-# Add any checks here that are necessary for other OSes.
-#
-AC_PATH_PROG(SED, sed)
-if test "x$SED" = x
-then
-       AC_MSG_ERROR(I couldn't find sed; make sure it's installed and in your path)
-fi
-AC_WIRESHARK_GNU_SED_CHECK
-if test "$HAVE_GNU_SED" = no ; then
-       case "$host_os" in
-       solaris*)
-               AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
-               case `which sed` in
-                       /bin/sed|/usr/bin/sed|/usr/ucb/sed)
-                       AC_MSG_RESULT(yes)
-                       AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
-                       ;;
-
-                       *)
-                       AC_MSG_RESULT(no)
-                       ;;
-               esac
-               ;;
-
-       *)
-               :
-               ;;
-       esac
-fi
-
 # Enable/disable wireshark
 AC_ARG_ENABLE(wireshark,
   AC_HELP_STRING( [--enable-wireshark],
@@ -1541,7 +1209,7 @@ else
        AC_MSG_RESULT(no)
 fi
 
-GLIB_MIN_VERSION=2.16.0
+GLIB_MIN_VERSION=2.22.0
 AC_SUBST(GLIB_MIN_VERSION)
 # GLib checks; we require GLib $GLIB_MIN_VERSION or later, and require gmodule
 # support, as we need that for dynamically loading plugins.
@@ -1567,7 +1235,7 @@ AC_SUBST(GLIB_MIN_VERSION)
 
 PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GLIB],
        [glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
-       [],
+       [GLIB_VERSION=`$PKG_CONFIG --modversion glib-2.0`],
        [AC_MSG_ERROR([GLib $GLIB_MIN_VERSION or later not found.])])
 
 # Error out if a glib header other than a "top level" header
@@ -1586,7 +1254,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.7.0
+QT_MIN_VERSION=4.8.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.
@@ -1598,59 +1266,12 @@ AC_SUBST(QT_MIN_VERSION)
 # We don't add $GTK_LIBS or $Qt_LIBS to LIBS, because we don't want to
 # force all programs to be built with GTK+ or Qt.
 #
-# Release dates for GTK+ versions:
-# 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
-# 2.18.0: 23 Sep 2009
-# 2.20.0: 23 Mar 2010
-# 2.22.0: 23 Sep 2010
-# 2.24.0: 30 Jan 2011
-# 3.0.0:  10 Feb 2011
-# 3.2.0:  25 Sep 2011
-# 3.4.0:  26 Mar 2012
-# 3.6.0:  24 Sep 2012
-# 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:
-# 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
-# 5.0.0:  19 Dec 2012
-# 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
+# For a list of library versions and their support across different platforms,
+# see https://wiki.wireshark.org/Development/Support_library_version_tracking
 
 have_qt=no
 have_gtk=no
 if test "x$enable_wireshark" = "xyes"; then
-       if test "x$with_gtk2" = "xunspecified" -a \
-               "x$with_gtk3" = "xunspecified" -a \
-               "x$with_qt" = "xunspecified"; then
-               #
-               # 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" != "xno"; then
                #
                # Qt was specified; make sure we have a C++ compiler.
@@ -1685,38 +1306,39 @@ if test "x$enable_wireshark" = "xyes"; then
                        AC_SUBST(MOC)
                        AC_WIRESHARK_QT_TOOL_CHECK(RCC, rcc, "$qt_version")
                        AC_SUBST(RCC)
+                       AC_WIRESHARK_QT_TOOL_CHECK_LRELEASE("$qt_version")
+                       AC_SUBST(LRELEASE)
 
                        #
-                       # 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.
+                       # On Darwin, make sure we're using Qt5 or later.
+                       # If so, 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.*//'`
+                                       AC_MSG_ERROR([macOS builds should use Qt5])
                                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)
-                       if test -z "$MOC_OPTIONS"
+
+                       if test -z "${MOC_OPTIONS+1}"
                        then
-                               if test $qt_version -eq 5
+                               # Squelch moc verbose "nothing to do" output
+                               if test $QT_VERSION_MAJOR -eq 5
                                then
-                                       MOC_OPTIONS="--no-notes"
-                               elif test $qt_version -eq 4
+                                       MOC_OPTIONS="-nn"
+                               elif test $QT_VERSION_MAJOR -eq 4 -a $QT_VERSION_MINOR -ge 8
                                then
-                                       qt_minor_version=`echo "$QT_VERSION" | cut -f2 -d.`
-                                       if test $qt_minor_version -ge 8
-                                       then
-                                               MOC_OPTIONS="-nn"
-                                       fi
+                                       MOC_OPTIONS="-nn"
                                fi
                        fi
                        AC_SUBST(MOC_OPTIONS)
@@ -1746,41 +1368,34 @@ if test "x$enable_wireshark" = "xyes"; then
                ])
        fi
 
-       if test "x$with_gtk3" = "xyes"; then
-               #
-               # GTK+ 3 was specified; make sure they didn't also
-               # specify GTK+ 2, as we don't support building both
-               # GTK+ 2 and GTK+ 3 versions at the same time.
-               #
-               if test "x$with_gtk2" = "xyes"; then
-                       AC_MSG_ERROR([Both GTK+ 2 and GTK+ 3 were specified; choose one but not both])
-               fi
-
-               #
-               # Make sure we have GTK+ 3.
-               #
-               PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
+       for want_gtk_version in $with_gtk; do
+               AS_CASE([$want_gtk_version],
+                 [3], [PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
                        [gtk+-3.0 >= $GTK3_MIN_VERSION glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
                        [
-                               have_gtk=yes
-                               GTK_VERSION=`$PKG_CONFIG --modversion gtk+-3.0`
-                               GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk3"
+                         have_gtk=yes
+                         GTK_VERSION=`$PKG_CONFIG --modversion gtk+-3.0`
+                         GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk=3"
                        ],
-                       [AC_MSG_ERROR([GTK+ 3 is not available])])
-       elif test "x$with_gtk2" = "xyes"; then
-               #
-               # GTK+ 3 wasn't specified, and GTK+ 2 was specified;
-               # make sure we have GTK+ 2.
-               #
-               PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
+                       [
+                         :
+                       ])],
+                 [2], [PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
                        [gtk+-2.0 >= $GTK2_MIN_VERSION glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
                        [
-                               have_gtk=yes
-                               GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
-                               GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk2"
+                         have_gtk=yes
+                         GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
+                         GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk=2"
                        ],
-                       [AC_MSG_ERROR([GTK+ 2 is not available])])
-       fi
+                       [
+                         :
+                       ])],
+                 [fail3], [AC_MSG_ERROR([GTK+ 3 was requested but is not available])],
+                 [fail2], [AC_MSG_ERROR([GTK+ 2 was requested but is not available])],
+                 [fail],  [AC_MSG_ERROR([GTK+ was requested but is not available])])
+
+               AS_IF([test "x$have_gtk" = xyes], [break])
+       done
 
        if test "$have_gtk" = "yes" ; then
                # If we have GTK then add flags for it.
@@ -1789,11 +1404,11 @@ if test "x$enable_wireshark" = "xyes"; then
                #
                GTK_CONFIG="$GLIB_CONFIG"
 
-               gtk_config_major_version=`echo $GTK_VERSION | cut -d. -f1`
-               gtk_config_minor_version=`echo $GTK_VERSION | cut -d. -f2`
+               gtk_major_version=`echo $GTK_VERSION | cut -d. -f1`
+               gtk_minor_version=`echo $GTK_VERSION | cut -d. -f2`
 
                AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATED], [GTK_CONFIG])
-               if test \( $gtk_config_major_version -eq 3 -a $gtk_config_minor_version -ge 10 \) ; then
+               if test \( $gtk_major_version -eq 3 -a $gtk_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 ...
                        AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATION_WARNINGS], [GTK_CONFIG])
@@ -1801,7 +1416,7 @@ if test "x$enable_wireshark" = "xyes"; then
                        AX_APPEND_FLAG([-DGTK_DISABLE_DEPRECATED], [GTK_CONFIG])
                fi
                AX_APPEND_FLAG([-DGTK_DISABLE_SINGLE_INCLUDES], [GTK_CONFIG])
-               if test ! \( $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -lt 20 \) ; then
+               if test ! \( $gtk_major_version -eq 2 -a $gtk_minor_version -lt 20 \) ; then
                        # Enable GSEAL when building with GTK > 2.20
                        # (Versions prior to 2.22 lacked some necessary accessors.)
                        AX_APPEND_FLAG([-DGSEAL_ENABLE], [GTK_CONFIG])
@@ -1835,26 +1450,22 @@ if test "$have_gtk" = "yes" -a "$have_qt" = "yes" ; then
 
        wireshark_bin="wireshark\$(EXEEXT) wireshark-gtk\$(EXEEXT)"
        wireshark_man="wireshark.1"
-       wireshark_SUBDIRS="codecs ui/qt ui/gtk"
-fi
-if test "$have_gtk" = "no" -a "$have_qt" = "yes" ; then
+       wireshark_SUBDIRS="ui/qt ui/gtk"
+elif test "$have_gtk" = "no" -a "$have_qt" = "yes" ; then
        # We don't have GTK+ but we have Qt.
 
        wireshark_bin="wireshark\$(EXEEXT)"
        wireshark_man="wireshark.1"
-       wireshark_SUBDIRS="codecs ui/qt"
-fi
-if test "$have_gtk" = "yes" -a "$have_qt" = "no" ; then
+       wireshark_SUBDIRS="ui/qt"
+elif test "$have_gtk" = "yes" -a "$have_qt" = "no" ; then
        # We have GTK+ but not Qt.
 
        wireshark_bin="wireshark-gtk\$(EXEEXT)"
        wireshark_man="wireshark.1"
-       wireshark_SUBDIRS="codecs ui/gtk"
-       use_glib_cflags="false"
+       wireshark_SUBDIRS="ui/gtk"
        OSX_APP_FLAGS="$OSX_APP_FLAGS -gtk"
        OSX_DMG_FLAGS="-gtk"
-fi
-if test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
+elif test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
        # We have neither GTK+ nor Qt.
        #
        # If they didn't explicitly say "--disable-wireshark",
@@ -1864,21 +1475,28 @@ if test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
        # problem).
        #
        if test "x$enable_wireshark" = "xyes"; then
-               if test "x$with_gtk3" = "xyes"; then
-                       AC_MSG_ERROR([Neither Qt nor GTK+ $GTK3_MIN_VERSION or later are available, so Wireshark can't be compiled])
-               else
-                       AC_MSG_ERROR([Neither Qt nor GTK+ $GTK2_MIN_VERSION or later are available, so Wireshark can't be compiled])
+               if test "$with_qt" != "no" -a "$with_gtk" != "no" ; then
+                       AC_MSG_ERROR([Neither Qt nor GTK+ are available, so Wireshark can't be compiled])
+               elif test "$with_qt" != "no" -a "$with_gtk" = "no" ; then
+                       AC_MSG_ERROR([Qt is not available and GTK+ was not requested, so Wireshark can't be compiled])
+               elif test "$with_qt" = "no" -a "$with_gtk" != "no" ; then
+                       AC_MSG_ERROR([Qt was not requested and GTK+ is not available, so Wireshark can't be compiled])
+               elif test "$with_qt" = "no" -a "$with_gtk" = "no" ; then
+                       AC_MSG_ERROR([Neither Qt nor GTK+ were requested, so Wireshark can't be compiled])
                fi
        fi
        wireshark_bin=""
        wireshark_man=""
+       wireshark_SUBDIRS=""
 fi
 
 #
 # Check whether GLib modules are supported, to determine whether we
 # can support plugins.
 #
-AC_MSG_CHECKING(whether GLib supports loadable modules)
+
+AC_CACHE_CHECK([whether GLib supports loadable modules],
+               [ac_cv_glib_supports_modules], [
 ac_save_CFLAGS="$CFLAGS"
 ac_save_LIBS="$LIBS"
 CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
@@ -1902,16 +1520,12 @@ main ()
     ac_cv_glib_supports_modules=yes])
 CFLAGS="$ac_save_CFLAGS"
 LIBS="$ac_save_LIBS"
+])
 if test "$ac_cv_glib_supports_modules" = yes ; then
-  AC_MSG_RESULT(yes)
   have_plugins=yes
-  plugins_dir="plugins"
 else
-  AC_MSG_RESULT(no)
   have_plugins=no
-  plugins_dir=""
 fi
-AC_SUBST(plugins_dir)
 
 #
 # If we have <dlfcn.h>, check whether we have dladdr.
@@ -1949,7 +1563,8 @@ fi
 # be different from the system's printf since GLib can optionally use
 # its own printf implementation.)
 #
-AC_MSG_CHECKING(whether GLib supports POSIX/XSI thousands grouping)
+AC_CACHE_CHECK([whether GLib supports POSIX/XSI thousands grouping],
+               [ac_cv_glib_supports_printf_grouping], [
 ac_save_CFLAGS="$CFLAGS"
 ac_save_LIBS="$LIBS"
 CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
@@ -1973,25 +1588,23 @@ main ()
     ac_cv_glib_supports_printf_grouping=no])
 CFLAGS="$ac_save_CFLAGS"
 LIBS="$ac_save_LIBS"
+])
 if test "$ac_cv_glib_supports_printf_grouping" = yes ; then
-  AC_MSG_RESULT(yes)
   AC_DEFINE(HAVE_GLIB_PRINTF_GROUPING, 1, [Define if GLib's printf functions support thousands grouping.])
-else
-  AC_MSG_RESULT(no)
 fi
 
 if test "x$have_gtk" = "xyes"
 then
     #
-    # We have GTK+; do we want the OS X integration functions and,
+    # We have GTK+; do we want the macOS integration functions and,
     # if so, do we have them and, if so, which versions do we have,
     # the old Carbon-based ones or the new Cocoa-based ones?
     #
-    AC_MSG_CHECKING(whether to use OS X integration functions)
+    AC_MSG_CHECKING(whether to use macOS integration functions)
 
     AC_ARG_WITH(osx-integration,
       AC_HELP_STRING( [--with-osx-integration],
-                     [use OS X integration functions @<:@default=yes, if available@:>@]),
+                     [use macOS integration functions @<:@default=yes, if available@:>@]),
     [
        if test $withval = no
        then
@@ -2012,6 +1625,7 @@ fi
 
 AC_SUBST(wireshark_bin)
 AC_SUBST(wireshark_man)
+AC_SUBST(wireshark_SUBDIRS)
 AM_CONDITIONAL(HAVE_Qt, test "$have_qt" = "yes")
 AM_CONDITIONAL(HAVE_GTK, test "$have_gtk" = "yes")
 AC_SUBST(OSX_APP_FLAGS)
@@ -2264,25 +1878,18 @@ fi
 AC_SUBST(rawshark_bin)
 AC_SUBST(rawshark_man)
 
-# Enable/disable echld
-AC_ARG_ENABLE(echld,
-  AC_HELP_STRING( [--enable-echld],
-                 [support echld (Experimental) @<:@default=no@:>@]),
-    have_echld=$enableval,have_echld=no)
+# Enable/disable sharkd
+AC_ARG_ENABLE(sharkd,
+  AC_HELP_STRING( [--enable-sharkd],
+                 [build sharkd @<:@default=yes@:>@]),
+    sharkd=$enableval,enable_sharkd=yes)
 
-AM_CONDITIONAL(HAVE_ECHLD, test "x$have_echld" = "xyes")
-if test "x$have_echld" = "xyes"
-then
-  AC_DEFINE(HAVE_ECHLD, 1, [Define if echld is enabled])
-  echld_test_bin="echld_test\$(EXEEXT)"
-  echld_dir="echld"
+if test "x$enable_sharkd" = "xyes" ; then
+       sharkd_bin="sharkd\$(EXEEXT)"
 else
-  have_echld="no"
-  echld_test_bin=""
-  echld_dir=""
+       sharkd_bin=""
 fi
-AC_SUBST(echld_test_bin)
-AC_SUBST(echld_dir)
+AC_SUBST(sharkd_bin)
 
 # Enable/disable tfshark
 AC_ARG_ENABLE(tfshark,
@@ -2372,6 +1979,92 @@ else
        fi
 fi
 
+dnl lz4 check
+LZ4_LIBS=''
+AC_MSG_CHECKING(whether to use lz4 compression and decompression)
+
+AC_ARG_WITH(lz4,
+  AC_HELP_STRING([--with-lz4@<:@=DIR@:>@],
+                [use lz4 (located in directory DIR, if supplied) for lz4 compression and decompression @<:@default=yes, if available@:>@]),
+[
+       if test "x$withval" = "xno"
+       then
+               want_lz4=no
+       elif test "x$withval" = "xyes"
+       then
+               want_lz4=yes
+       else
+               want_lz4=yes
+               lz4_dir="$withval"
+       fi
+],[
+       #
+       # Use lz4 if it's present, otherwise don't.
+       #
+       want_lz4=ifavailable
+       lz4_dir=
+])
+have_lz4=no
+if test "x$want_lz4" = "xno" ; then
+       AC_MSG_RESULT(no)
+else
+       AC_MSG_RESULT(yes)
+       AC_WIRESHARK_LZ4_CHECK
+       if test "x$want_lz4" = "xno" ; then
+               AC_MSG_RESULT(lz4 not found - disabling lz4 compression and decompression)
+       else
+               if test "x$ac_cv_func_LZ4_decompress_safe" = "xno" ; then
+                       AC_MSG_RESULT(LZ4_decompress_safe not found in lz4 - disabling cql lz4 decompression)
+               else
+                       have_lz4=yes
+               fi
+       fi
+fi
+AC_SUBST(LZ4_LIBS)
+
+dnl snappy check
+SNAPPY_LIBS=''
+AC_MSG_CHECKING(whether to use snappy compression and decompression)
+
+AC_ARG_WITH(snappy,
+  AC_HELP_STRING([--with-snappy@<:@=DIR@:>@],
+                [use snappy (located in directory DIR, if supplied) for snappy compression and decompression @<:@default=yes, if available@:>@]),
+[
+       if test "x$withval" = "xno"
+       then
+               want_snappy=no
+       elif test "x$withval" = "xyes"
+       then
+               want_snappy=yes
+       else
+               want_snappy=yes
+               snappy_dir="$withval"
+       fi
+],[
+       #
+       # Use snappy if it's present, otherwise don't.
+       #
+       want_snappy=ifavailable
+       snappy_dir=
+])
+have_snappy=no
+if test "x$want_snappy" = "xno" ; then
+       AC_MSG_RESULT(no)
+else
+       AC_MSG_RESULT(yes)
+       AC_WIRESHARK_SNAPPY_CHECK
+       if test "x$want_snappy" = "xno" ; then
+               AC_MSG_RESULT(snappy not found - disabling snappy compression and decompression)
+       else
+               if test "x$ac_cv_func_snappy_uncompress" = "xno" ; then
+                       AC_MSG_RESULT(snappy_uncompress not found in snappy - disabling cql snappy decompression)
+               else
+                       have_snappy=yes
+               fi
+       fi
+fi
+AC_SUBST(SNAPPY_LIBS)
+
 dnl Lua check
 AC_ARG_WITH(lua,
   AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
@@ -2660,9 +2353,6 @@ else
 fi
 AC_SUBST(C_ARES_LIBS)
 
-# Check for synchronous name resolvers
-AC_CHECK_FUNCS([getaddrinfo gethostbyname gethostbyname2])
-
 dnl GEOIP Check
 GEOIP_LIBS=''
 AC_MSG_CHECKING(whether to use the GeoIP IP address mapping library if available)
@@ -2713,32 +2403,58 @@ else
 fi
 AC_SUBST(LIBSSH_LIBS)
 
-#
-# Define WS_MSVC_NORETURN appropriately for declarations of routines that
-# never return (just like Charlie on the MTA).
-#
-# Note that MSVC++ expects __declspec(noreturn) to precede the function
-# name and GCC, as far as I know, expects __attribute__((noreturn)) to
-# follow the function name, so we need two different flavors of
-# noreturn tag.
-#
-AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
+dnl nghttp2 Check
+NGHTTP2_LIBS=''
+AC_MSG_CHECKING(whether to use the nghttp2 HPACK library if available)
+
+AC_ARG_WITH(nghttp2,
+  AC_HELP_STRING( [--with-nghttp2@<:@=DIR@:>@],
+                 [use nghttp2 (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
+[
+if   test "x$withval" = "xno";  then
+       want_nghttp2=no
+elif test "x$withval" = "xyes"; then
+       want_nghttp2=yes
+elif test -d "$withval"; then
+       want_nghttp2=yes
+       AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
+fi
+])
+if test "x$want_nghttp2" = "xno"; then
+       AC_MSG_RESULT(no)
+else
+       AC_MSG_RESULT(yes)
+       AC_WIRESHARK_NGHTTP2_CHECK
+fi
+AC_SUBST(NGHTTP2_LIBS)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 # AC_C_CONST
 
 # Check how we can get the time zone abbreviation
-AC_WIRESHARK_TIMEZONE_ABBREV
+AC_STRUCT_TIMEZONE
 
 # We need to know whether "struct stat" has an "st_flags" member
 # for file_user_immutable().
 
-AC_WIRESHARK_STRUCT_ST_FLAGS
+AC_CHECK_MEMBERS([struct stat.st_flags])
+
+# We need to know whether "struct stat" has an "st_birthtime" member
+# or an "__st_birthtime" member for the file set dialog.
+
+AC_CHECK_MEMBERS([struct stat.st_birthtime])
+AC_CHECK_MEMBERS([struct stat.__st_birthtime])
 
 # We need to know whether "struct sockaddr" has an "sa_len" member
 # for get_interface_list().
 
-AC_WIRESHARK_STRUCT_SA_LEN
+AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,
+                 [#ifdef HAVE_SYS_TYPES_H
+                  #include <sys/types.h>
+                  #endif
+                  #ifdef HAVE_SYS_SOCKET_H
+                  #include <sys/socket.h>
+                  #endif])
 
 # We must know our byte order
 AC_C_BIGENDIAN
@@ -2747,44 +2463,22 @@ AC_C_BIGENDIAN
 # XXX - do we need this?
 AC_PROG_GCC_TRADITIONAL
 
-AC_CHECK_FUNC(getopt_long,
-  [
-    GETOPT_LO=""
-    AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define to 1 if you have the getopt_long function.])
-
-    #
-    # Do we have optreset?
-    #
-    AC_MSG_CHECKING(whether optreset is defined)
-    AC_TRY_LINK([],
-      [
-       extern int optreset;
-
-       return optreset;
-      ],
-      ac_cv_pcap_debug_defined=yes,
-      ac_cv_pcap_debug_defined=no)
-    if test "$ac_cv_pcap_debug_defined" = yes ; then
-      AC_MSG_RESULT(yes)
-      AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable])
-    else
-      AC_MSG_RESULT(no)
-    fi
-  ],
-  GETOPT_LO="wsgetopt.lo")
-AC_SUBST(GETOPT_LO)
-
-AC_CHECK_FUNCS(mkstemp mkdtemp)
+AC_REPLACE_FUNCS(getopt_long)
+dnl
+dnl Do we have optreset?
+dnl
+if test "x$ac_cv_func_getopt_long" = xyes; then
+  AC_CACHE_CHECK([whether optreset is defined], ac_cv_have_optreset,
+    AC_LINK_IFELSE([AC_LANG_SOURCE([[extern int optreset;return optreset;]])],
+        ac_cv_have_optreset=yes, ac_cv_have_optreset=no))
+  if test "$ac_cv_have_optreset" = yes ; then
+    AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable])
+  fi
+fi
 
-AC_SEARCH_LIBS(inet_aton, [socket nsl],
-  [
-    INET_ATON_LO=""
-    AC_DEFINE(HAVE_INET_ATON, 1, [Define to 1 if you have the inet_aton function.])
-  ],
-  INET_ATON_LO="inet_aton.lo")
-AC_SUBST(INET_ATON_LO)
+AC_REPLACE_FUNCS(inet_aton)
 
-AC_SEARCH_LIBS(inet_pton, [socket nsl], [
+AC_CHECK_FUNC(inet_pton, [
   dnl check for pre-BIND82 inet_pton() bug.
   AC_MSG_CHECKING(for broken inet_pton)
   AC_TRY_RUN([#include <sys/types.h>
@@ -2802,70 +2496,34 @@ int main()
 #endif
 }], [AC_MSG_RESULT(ok);
 have_inet_pton=yes], [AC_MSG_RESULT(broken);
-have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
+have_inet_pton=no], [AC_MSG_RESULT([cross compiling, assume it is broken]);
 have_inet_pton=no])],
 have_inet_pton=no)
 if test "$have_inet_pton" = no; then
-  INET_PTON_LO="inet_pton.lo"
+  AC_LIBOBJ(inet_pton)
 else
-  AC_DEFINE(HAVE_INET_PTON, 1,
-    [Define to 1 if you have the `inet_pton' function.])
-  INET_PTON_LO=""
+  AC_DEFINE(HAVE_INET_PTON, 1, [Define to 1 if you have the `inet_pton' function.])
 fi
-AM_CONDITIONAL(NEED_INET_PTON_LO, test "x$have_inet_pton" = "xno")
-AC_SUBST(INET_PTON_LO)
-
-AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
-  AC_MSG_CHECKING([for inet_ntop prototype])
-  AC_TRY_COMPILE([#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 
-extern const char *inet_ntop(int, const void *, char *, size_t);],, [
-    AC_MSG_RESULT(yes)
-    AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
-    [Define if inet_ntop() prototype exists])], [
-    AC_TRY_COMPILE([#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
-      AC_MSG_RESULT(yes)
-      AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
-      [Define if inet_ntop() prototype exists])], [
-      AC_MSG_RESULT(no)])])
-  INET_NTOP_LO=""], [
-  INET_NTOP_LO="inet_ntop.lo"])
-AM_CONDITIONAL(NEED_INET_NTOP_LO, test "x$INET_NTOP_LO" != "x")
-AC_SUBST(INET_NTOP_LO)
-
-AC_CHECK_FUNC(strptime,
-  [
-    STRPTIME_LO=""
-    AC_DEFINE(HAVE_STRPTIME, 1, [Define if you have the strptime function.])
-  ],
-  STRPTIME_LO="strptime.lo")
-AC_SUBST(STRPTIME_LO)
-
-AC_CHECK_FUNC(popcount,
-  [
-    POPCOUNT_LO=""
-    AC_DEFINE(HAVE_POPCOUNT, 1, [Define if you have the popcount function.])
-  ],
-  POPCOUNT_LO="popcount.lo")
-AC_SUBST(POPCOUNT_LO)
+AC_REPLACE_FUNCS(inet_ntop)
+AC_REPLACE_FUNCS(strptime)
+AC_REPLACE_FUNCS(popcount)
 
+AC_CHECK_FUNCS(mkstemps mkdtemp)
 AC_CHECK_FUNCS(getprotobynumber)
 AC_CHECK_FUNCS(issetugid)
 AC_CHECK_FUNCS(sysconf)
 AC_CHECK_FUNCS(getifaddrs)
+AC_CHECK_FUNC(getexecname)
 
-dnl blank for now, but will be used in future
-AC_SUBST(wireshark_SUBDIRS)
+#
+# Check for SpeexDSP (http://www.speex.org)
+#
+AS_IF([test "x$have_qt_multimedia_lib" = xyes],
+       [PKG_CHECK_MODULES(SPEEXDSP, speexdsp, [have_speexdsp=yes], [have_speexdsp=no])])
+AS_IF([test "x$have_speexdsp" = xyes],
+       [AC_DEFINE(HAVE_SPEEXDSP, 1, [Define to 1 if you have SpeexDSP])])
+AM_CONDITIONAL(HAVE_SPEEXDSP, [test "x$have_speexdsp" = "xyes"])
 
 # Check Bluetooth SBC codec for RTP Player
 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
@@ -2887,6 +2545,48 @@ else
 fi
 AM_CONDITIONAL(HAVE_SBC, test "x$have_sbc" = "xyes")
 
+#`
+# Check SpanDSP library for RTP Player
+# http://www.soft-switch.org/
+AC_ARG_WITH([spandsp],
+  AC_HELP_STRING( [--with-spandsp=@<:@yes/no@:>@],
+                 [use SpanDSP to play G.722/G.726 codecs @<:@default=yes, if available@:>@]),
+  with_spandsp="$withval"; want_spandsp="yes", with_spandsp="yes")
+
+PKG_CHECK_MODULES(SPANDSP, spandsp, [have_spandsp=yes], [have_spandsp=no])
+if test "x$with_spandsp" != "xno"; then
+    if (test "${have_spandsp}" = "yes"); then
+        AC_DEFINE(HAVE_SPANDSP, 1, [Define if you have the SpanDSP library])
+    elif test "x$want_spandsp" = "xyes"; then
+        # Error out if the user explicitly requested the SpanDSP library
+        AC_MSG_ERROR([SpanDSP library was requested, but is not available])
+    fi
+else
+    have_spandsp=no
+fi
+AM_CONDITIONAL(HAVE_SPANDSP, test "x$have_spandsp" = "xyes")
+
+#`
+# Libxml2 check
+AC_ARG_WITH(libxml2,
+  AC_HELP_STRING([--with-libxml2=@<:@yes/no@:>@],
+                [Libxml2 is a XML C parser, which can be used for handling XML configuration in dissectors @<:@default=yes, if available@:>@]),
+  with_libxml2="$withval"; want_libxml2="yes", with_libxml2="yes")
+
+PKG_CHECK_MODULES(LIBXML2, libxml-2.0, [have_libxml2=yes], [have_libxml2=no])
+if test "x$with_libxml2" != "xno"; then
+    if (test "${have_libxml2}" = "yes"); then
+        AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have libxml2])
+    elif test "x$want_libxml2" = "xyes"; then
+        # Error out if the user explicitly requested libxml2
+        AC_MSG_ERROR([Libxml2 was requested, but is not available])
+    fi
+else
+    have_libxml2=no
+fi
+AM_CONDITIONAL(HAVE_LIBXML2, test "x$have_libxml2" = "xyes")
+
+
 dnl
 dnl check whether plugins should be enabled and, if they should be,
 dnl check for plugins directory - stolen from Amanda's configure.ac
@@ -2908,8 +2608,12 @@ AC_ARG_WITH(plugins,
 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
 if test x$have_plugins = xyes
 then
+  plugins_dir="plugins"
   AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
+else
+  plugins_dir=""
 fi
+AC_SUBST(plugins_dir)
 AC_SUBST(plugindir)
 
 #
@@ -2997,8 +2701,8 @@ AC_ARG_ENABLE(sshdump,
 if test "x$have_extcap" != xyes; then
        AC_MSG_RESULT([no, extcap disabled])
        enable_sshdump=no
-elif test "x$have_good_libssh" != xyes; then
-       AC_MSG_RESULT([no, libssh not available])
+elif test "x$have_libssh_pointsix" != xyes; then
+       AC_MSG_RESULT([no, libssh >= 0.6.0 not available])
        enable_sshdump=no
 elif test "x$enable_sshdump" = "xyes" ; then
        AC_MSG_RESULT(yes)
@@ -3027,8 +2731,8 @@ AC_ARG_ENABLE(ciscodump,
 if test "x$have_extcap" != xyes; then
        AC_MSG_RESULT([no, extcap disabled])
        enable_ciscodump=no
-elif test "x$have_good_libssh" != xyes; then
-       AC_MSG_RESULT([no, libssh not available])
+elif test "x$have_libssh_pointsix" != xyes; then
+       AC_MSG_RESULT([no, libssh >= 0.6.0 not available])
        enable_ciscodump=no
 elif test "x$enable_ciscodump" = "xyes" ; then
        AC_MSG_RESULT(yes)
@@ -3051,7 +2755,7 @@ AC_MSG_CHECKING(whether to build randpktdump)
 
 AC_ARG_ENABLE(randpktdump,
        AC_HELP_STRING( [--enable-randpktdump],
-               [build androiddump @<:@default=yes@:>@]),
+               [build randpktdump @<:@default=yes@:>@]),
        randpktdump=$enableval,enable_randpktdump=yes)
 
 if test "x$have_extcap" != xyes; then
@@ -3073,17 +2777,32 @@ fi
 AC_SUBST(randpktdump_bin)
 AC_SUBST(randpktdump_man)
 
-dnl libtool defs
-#
-# Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
-# (autoconf?  automake?  libtool?) - with the newer version(s), it's
-# just an alias for AC_PROG_LIBTOOL, which is called earlier.
-#
-# With older version(s) of those tool(s), however, it's not just an
-# alias, and the configure scripts don't work without it.
-#
-AM_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
+dnl udpdump check
+AC_MSG_CHECKING(whether to build udpdump)
+
+AC_ARG_ENABLE(udpdump,
+       AC_HELP_STRING( [--enable-udpdump],
+               [build udpdump @<:@default=yes@:>@]),
+       [],[enable_udpdump=yes])
+
+if test "x$have_extcap" != xyes; then
+       AC_MSG_RESULT([no, extcap disabled])
+       enable_udpdump=no
+elif test "x$enable_udpdump" = "xyes" ; then
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+
+if test "x$enable_udpdump" = "xyes" ; then
+       udpdump_bin="udpdump\$(EXEEXT)"
+       udpdump_man="udpdump.1"
+else
+       udpdump_bin=""
+       udpdump_man=""
+fi
+AC_SUBST(udpdump_bin)
+AC_SUBST(udpdump_man)
 
 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
 if test x$enable_static = xyes -a x$have_plugins = xyes
@@ -3094,7 +2813,7 @@ AC_SUBST(ENABLE_STATIC)
 
 # Gather which GUI we're building for rpmbuild
 if test "x$have_gtk" = "xyes"; then
-       if test "x$with_gtk3" = "xyes"; then
+       if test "x$gtk_major_version" = "x3"; then
                RPMBUILD_WITH_ARGS="--with gtk3 --without gtk2"
        else
                RPMBUILD_WITH_ARGS="--without gtk3 --with gtk2"
@@ -3117,6 +2836,7 @@ else
        RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without lua"
 fi
 AC_SUBST(RPMBUILD_WITH_ARGS)
+AC_SUBST(RPM_VERSION, version_major.version_minor.version_micro)
 
 AC_SUBST(WS_CPPFLAGS)
 AC_SUBST(WS_CFLAGS)
@@ -3125,17 +2845,20 @@ AC_SUBST(WS_LDFLAGS)
 
 AC_SUBST(WS_CFLAGS_FOR_BUILD)
 
+AH_BOTTOM([#include <ws_diag_control.h>])
+
 dnl Save the cacheable configure results to config.cache before recursing
 AC_CACHE_SAVE
 
 sinclude(plugins/Custom.m4) dnl
 ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
 
-sinclude(asn1/Custom.m4) dnl
+sinclude(epan/dissectors/asn1/Custom.m4) dnl
 ifdef(_CUSTOM_ASN1_AC_OUTPUT_,, define(_CUSTOM_ASN1_AC_OUTPUT_, )) dnl
 
-AC_CONFIG_HEADERS(config.h)
-AC_OUTPUT(
+AC_CONFIG_HEADERS([config.h])
+
+AC_CONFIG_FILES(
   Makefile
   doxygen.cfg
   epan/dissectors/asn1/Makefile
@@ -3191,10 +2914,12 @@ AC_OUTPUT(
   epan/dissectors/asn1/lppa/Makefile
   epan/dissectors/asn1/lppe/Makefile
   epan/dissectors/asn1/lte-rrc/Makefile
+  epan/dissectors/asn1/m2ap/Makefile
   epan/dissectors/asn1/m3ap/Makefile
   epan/dissectors/asn1/mms/Makefile
   epan/dissectors/asn1/mpeg-audio/Makefile
   epan/dissectors/asn1/mpeg-pes/Makefile
+  epan/dissectors/asn1/mudurl/Makefile
   epan/dissectors/asn1/nbap/Makefile
   epan/dissectors/asn1/ns_cert_exts/Makefile
   epan/dissectors/asn1/novell_pkis/Makefile
@@ -3258,7 +2983,6 @@ AC_OUTPUT(
   epan/dissectors/Makefile
   epan/dissectors/dcerpc/Makefile
   epan/ftypes/Makefile
-  epan/nghttp2/Makefile
   epan/wmem/Makefile
   epan/wslua/Makefile
   extcap/Makefile
@@ -3283,6 +3007,7 @@ AC_OUTPUT(
   packaging/svr4/Makefile
   packaging/svr4/checkinstall
   packaging/svr4/pkginfo
+  packaging/wix/Makefile
   plugins/Makefile
   plugins/docsis/Makefile
   plugins/easy_codec/Makefile
@@ -3294,6 +3019,7 @@ AC_OUTPUT(
   plugins/opcua/Makefile
   plugins/profinet/Makefile
   plugins/stats_tree/Makefile
+  plugins/transum/Makefile
   plugins/unistim/Makefile
   plugins/wimax/Makefile
   plugins/wimaxasncp/Makefile
@@ -3306,10 +3032,10 @@ AC_OUTPUT(
   writecap/Makefile
   writecap/doxygen.cfg
   wsutil/Makefile
-  echld/Makefile
   _CUSTOM_AC_OUTPUT_
-  ,)
-dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
+)
+
+AC_OUTPUT
 
 
 # Pretty messages
@@ -3317,7 +3043,7 @@ dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
 if test "x$have_gtk" = "xyes"; then
        gtk_lib_message=" (with GTK+ v$GTK_VERSION"
        if test "x$have_ige_mac" = "xyes"; then
-               gtk_lib_message="$gtk_lib_message and OS X integration)"
+               gtk_lib_message="$gtk_lib_message and macOS integration)"
        else
                gtk_lib_message="$gtk_lib_message)"
        fi
@@ -3387,8 +3113,7 @@ fi
 if test "x$have_good_c_ares" = "xyes" ; then
        c_ares_message="yes"
 else
-       # We should make this an error at some point.
-       c_ares_message="no. This can cause serious performance issues."
+       c_ares_message="no (name resolution will be disabled)"
 fi
 
 if test "x$have_good_libcap" = "xyes" ; then
@@ -3415,6 +3140,12 @@ else
        ssh_userauth_agent_message="no"
 fi
 
+if test "x$have_good_nghttp2" = "xyes" ; then
+       nghttp2_message="yes"
+else
+       nghttp2_message="no"
+fi
+
 echo ""
 echo "  CPPFLAGS: $WS_CPPFLAGS $CPPFLAGS"
 echo ""
@@ -3428,6 +3159,7 @@ echo "  LIBS: $LIBS"
 
 echo ""
 echo "The Wireshark package has been configured with the following options:"
+echo "                       GLib version : v$GLIB_VERSION"
 echo "                    Build wireshark : $enable_wireshark_qt$qt_lib_message"
 echo "                Build wireshark-gtk : $have_gtk""$gtk_lib_message"
 echo "                       Build tshark : $enable_tshark"
@@ -3442,11 +3174,12 @@ echo "                    Build text2pcap : $enable_text2pcap"
 echo "                      Build randpkt : $enable_randpkt"
 echo "                       Build dftest : $enable_dftest"
 echo "                     Build rawshark : $enable_rawshark"
+echo "                       Build sharkd : $enable_sharkd"
 echo "                  Build androiddump : $enable_androiddump"
 echo "                      Build sshdump : $enable_sshdump"
 echo "                    Build ciscodump : $enable_ciscodump"
 echo "                  Build randpktdump : $enable_randpktdump"
-echo "                        Build echld : $have_echld"
+echo "                      Build udpdump : $enable_udpdump"
 echo ""
 echo "   Save files as pcap-ng by default : $enable_pcap_ng_default"
 echo "  Install dumpcap with capabilities : $setcap_message"
@@ -3463,7 +3196,7 @@ echo "                   Use zlib library : $zlib_message"
 echo "               Use kerberos library : $krb5_message"
 echo "                 Use c-ares library : $c_ares_message"
 echo "                Use SMI MIB library : $libsmi_message"
-echo "             Use GNU gcrypt library : $gcrypt_message"
+echo "             Use GNU gcrypt library : yes"
 echo "             Use SSL crypto library : $ssl_message"
 echo "                 Use GnuTLS library : $tls_message"
 echo "     Use POSIX capabilities library : $libcap_message"
@@ -3472,4 +3205,9 @@ 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 SpanDSP library : $have_spandsp"
+echo "                Use libxml2 library : $have_libxml2"
+echo "                Use nghttp2 library : $nghttp2_message"
+echo "                    Use LZ4 library : $have_lz4"
+echo "                 Use Snappy library : $have_snappy"
 #echo "       Use GDK-Pixbuf with GResource: $have_gresource_pixbuf"