Disable warning C4267 in generated files.
[metze/wireshark/wip.git] / acinclude.m4
index 1ed5f5619a1f1a4d0026e8ac9585318815dd1c75..c53ac7c46a5ac26ff4aafaa7186745451bfb8149 100644 (file)
@@ -97,85 +97,6 @@ AC_DEFUN([AC_WIRESHARK_POP_FLAGS],
   LDFLAGS="$ac_ws_LDFLAGS_saved"
 ])
 
-#
-# AC_WIRESHARK_TIMEZONE_ABBREV
-#
-
-AC_DEFUN([AC_WIRESHARK_TIMEZONE_ABBREV],
-[
-  AC_CACHE_CHECK([for tm_zone in struct tm],
-    ac_cv_wireshark_have_tm_zone,
-    [
-      AC_TRY_COMPILE(
-        [#include <time.h>],
-        [struct tm t; t.tm_zone;],
-        ac_cv_wireshark_have_tm_zone=yes,
-        ac_cv_wireshark_have_tm_zone=no)
-    ])
-  if test $ac_cv_wireshark_have_tm_zone = yes; then
-    AC_DEFINE(HAVE_TM_ZONE, 1, [Define if tm_zone field exists in struct tm])
-  else
-    AC_CACHE_CHECK([for tzname],
-      ac_cv_wireshark_have_tzname,
-      [
-        AC_TRY_LINK(
-[#include <time.h>
-#include <stdio.h>],
-          [printf("%s", tzname[0]);],
-          ac_cv_wireshark_have_tzname=yes,
-          ac_cv_wireshark_have_tzname=no)
-      ])
-    if test $ac_cv_wireshark_have_tzname = yes; then
-      AC_DEFINE(HAVE_TZNAME, 1, [Define if tzname array exists])
-    fi
-  fi
-])
-
-
-#
-# AC_WIRESHARK_STRUCT_ST_FLAGS
-#
-dnl AC_STRUCT_ST_BLKSIZE extracted from the file in question,
-dnl "acspecific.m4" in GNU Autoconf 2.12, and turned into
-dnl AC_WIRESHARK_STRUCT_ST_FLAGS, which checks if "struct stat"
-dnl has the 4.4BSD "st_flags" member, and defines HAVE_ST_FLAGS; that's
-dnl what's in this file.
-dnl Done by Guy Harris <guy@alum.mit.edu> on 2012-06-02.
-
-dnl ### Checks for structure members
-
-AC_DEFUN([AC_WIRESHARK_STRUCT_ST_FLAGS],
-[AC_CACHE_CHECK([for st_flags in struct stat], ac_cv_wireshark_struct_st_flags,
-[AC_TRY_COMPILE([#include <sys/stat.h>], [struct stat s; s.st_flags;],
-ac_cv_wireshark_struct_st_flags=yes, ac_cv_wireshark_struct_st_flags=no)])
-if test $ac_cv_wireshark_struct_st_flags = yes; then
-  AC_DEFINE(HAVE_ST_FLAGS, 1, [Define if st_flags field exists in struct stat])
-fi
-])
-
-
-#
-# AC_WIRESHARK_STRUCT_SA_LEN
-#
-dnl AC_STRUCT_ST_BLKSIZE extracted from the file in question,
-dnl "acspecific.m4" in GNU Autoconf 2.12, and turned into
-dnl AC_WIRESHARK_STRUCT_SA_LEN, which checks if "struct sockaddr"
-dnl has the 4.4BSD "sa_len" member, and defines HAVE_SA_LEN; that's
-dnl what's in this file.
-dnl Done by Guy Harris <guy@alum.mit.edu> on 1998-11-14.
-
-dnl ### Checks for structure members
-
-AC_DEFUN([AC_WIRESHARK_STRUCT_SA_LEN],
-[AC_CACHE_CHECK([for sa_len in struct sockaddr], ac_cv_wireshark_struct_sa_len,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
-ac_cv_wireshark_struct_sa_len=yes, ac_cv_wireshark_struct_sa_len=no)])
-if test $ac_cv_wireshark_struct_sa_len = yes; then
-  AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
-fi
-])
-
 
 #
 # AC_WIRESHARK_BREAKLOOP_TRY_LINK
@@ -211,6 +132,7 @@ AC_DEFUN([AC_WIRESHARK_PCAP_BREAKLOOP_TRY_LINK],
 AC_DEFUN([AC_WIRESHARK_PCAP_CHECK],
 [
        AC_WIRESHARK_PUSH_FLAGS
+       ws_ac_save_LIBS="$LIBS"
 
        if test -z "$pcap_dir"
        then
@@ -255,7 +177,17 @@ AC_DEFUN([AC_WIRESHARK_PCAP_CHECK],
            # Found it, and it's usable; use it to get the include flags
            # for libpcap.
            #
-           CPPFLAGS="$CPPFLAGS `\"$PCAP_CONFIG\" --cflags`"
+           PCAP_CFLAGS="`\"$PCAP_CONFIG\" --cflags`"
+           #
+           # We have pcap-config; we assume that means we have libpcap
+           # installed and that pcap-config will tell us whatever
+           # libraries libpcap needs.
+           #
+           if test x$enable_static = xyes; then
+             PCAP_LIBS="`\"$PCAP_CONFIG\" --libs --static`"
+           else
+             PCAP_LIBS="`\"$PCAP_CONFIG\" --libs`"
+           fi
          else
            #
            # Didn't find it; we have to look for libpcap ourselves.
@@ -263,13 +195,14 @@ AC_DEFUN([AC_WIRESHARK_PCAP_CHECK],
            # but we may have to look for the header in a "pcap"
            # subdirectory of "/usr/include" or "/usr/local/include",
            # as some systems apparently put "pcap.h" in a "pcap"
-           # subdirectory, and we also check "$prefix/include" - and
+           # subdirectory without also providing a "pcap.h" in the top-level
+           # include directory, and we also check "$prefix/include" - and
            # "$prefix/include/pcap", in case $prefix is set to
            # "/usr/include" or "/usr/local/include".
            #
-           # XXX - should we just add "$prefix/include" to the include
-           # search path and "$prefix/lib" to the library search path?
-           #
+           PCAP_CFLAGS=""
+           PCAP_LIBS="-lpcap"
+
            AC_MSG_CHECKING(for extraneous pcap header directories)
            found_pcap_dir=""
            pcap_dir_list="/usr/local/include/pcap /usr/include/pcap $prefix/include/pcap $prefix/include"
@@ -277,7 +210,7 @@ AC_DEFUN([AC_WIRESHARK_PCAP_CHECK],
            do
              if test -d $pcap_dir ; then
                if test x$pcap_dir != x/usr/include -a x$pcap_dir != x/usr/local/include ; then
-                   CPPFLAGS="$CPPFLAGS -I$pcap_dir"
+                   PCAP_CFLAGS="-I$pcap_dir"
                fi
                found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
                break
@@ -303,86 +236,107 @@ AC_DEFUN([AC_WIRESHARK_PCAP_CHECK],
          # and/or linker will search that other directory before it
          # searches the specified directory.
          #
-         CPPFLAGS="$CPPFLAGS -I$pcap_dir/include"
-         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, $pcap_dir/lib)
+         PCAP_CFLAGS="-I$pcap_dir/include"
+         #
+         # XXX - This doesn't use AC_WIRESHARK_ADD_DASH_L
+         #
+         PCAP_LIBS="-L$pcap_dir/lib -lpcap"
        fi
 
+       CFLAGS="$PCAP_CFLAGS $CFLAGS"
+       LIBS="$PCAP_LIBS $LIBS"
+
        # Pcap header check
-       AC_CHECK_HEADER(pcap.h,,
-           AC_MSG_ERROR([[Header file pcap.h not found; if you installed libpcap
+       AC_CHECK_HEADER(pcap.h,
+         [
+             AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
+         ],
+         [
+             AC_MSG_ERROR([[Header file pcap.h not found; if you installed libpcap
 from source, did you also do \"make install-incl\", and if you installed a
 binary package of libpcap, is there also a developer's package of libpcap,
-and did you also install that package?]]))
+and did you also install that package?]])
+         ])
 
-       if test -n "$PCAP_CONFIG" ; then
-         #
-         # We have pcap-config; we assume that means we have libpcap
-         # installed and that pcap-config will tell us whatever
-         # libraries libpcap needs.
-         #
-         if test x$enable_static = xyes; then
-           PCAP_LIBS="`\"$PCAP_CONFIG\" --libs --static`"
-         else
-           PCAP_LIBS="`\"$PCAP_CONFIG\" --libs`"
-         fi
-         AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
-       else
-         #
-         # Check to see if we find "pcap_open_live" in "-lpcap".
-         # Also check for various additional libraries that libpcap might
-         # require.
-         #
-         AC_CHECK_LIB(pcap, pcap_open_live,
-           [
-             PCAP_LIBS=-lpcap
-             AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
-           ], [
-             ac_wireshark_extras_found=no
-             ac_save_LIBS="$LIBS"
-             for extras in "-lcfg -lodm" "-lpfring"
-             do
-               AC_MSG_CHECKING([for pcap_open_live in -lpcap with $extras])
-               LIBS="-lpcap $extras $ac_save_LIBS"
-               #
-               # XXX - can't we use AC_CHECK_LIB here?
-               #
-               AC_TRY_LINK(
-                   [
+       #
+       # Check to see if we find "pcap_open_live" in "-lpcap".
+       # Also check for various additional libraries that libpcap might
+       # require.
+       #
+       AC_CHECK_LIB(pcap, pcap_open_live,
+         [
+         ],
+         [
+           ac_wireshark_extras_found=no
+           ac_save_LIBS="$LIBS"
+           for extras in "-lcfg -lodm" "-lpfring"
+           do
+             AC_MSG_CHECKING([for pcap_open_live in -lpcap with $extras])
+             LIBS="-lpcap $extras $ac_save_LIBS"
+             #
+             # XXX - can't we use AC_CHECK_LIB here?
+             #
+             AC_TRY_LINK(
+               [
 #      include <pcap.h>
-                   ],
-                   [
+               ],
+               [
        pcap_open_live(NULL, 0, 0, 0, NULL);
-                   ],
-                   [
-                       ac_wireshark_extras_found=yes
-                       AC_MSG_RESULT([yes])
-                       PCAP_LIBS="-lpcap $extras"
-                       AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
-                   ],
-                   [
-                       AC_MSG_RESULT([no])
-                   ])
+               ],
+               [
+                 ac_wireshark_extras_found=yes
+                 AC_MSG_RESULT([yes])
+                 PCAP_LIBS="$PCAP_LIBS $extras"
+               ],
+               [
+                 AC_MSG_RESULT([no])
+               ])
                if test x$ac_wireshark_extras_found = xyes
                then
-                   break
+                 break
                fi
-             done
-             if test x$ac_wireshark_extras_found = xno
-             then
-               AC_MSG_ERROR([Can't link with library libpcap.])
-             fi
-             LIBS=$ac_save_LIBS
-           ])
-       fi
+           done
+           if test x$ac_wireshark_extras_found = xno
+           then
+             AC_MSG_ERROR([Can't link with library libpcap.])
+           fi
+           LIBS=$ac_save_LIBS
+         ])
+       AC_SUBST(PCAP_CFLAGS)
        AC_SUBST(PCAP_LIBS)
 
        #
        # Check whether various variables and functions are defined by
        # libpcap.
        #
-       ac_save_LIBS="$LIBS"
-       LIBS="$PCAP_LIBS $LIBS"
        AC_CHECK_FUNCS(pcap_open_dead pcap_freecode)
+       AC_CHECK_FUNCS(pcap_open)
+       if test $ac_cv_func_pcap_open = "yes" ; then
+         AC_DEFINE(HAVE_PCAP_REMOTE, 1,
+            [Define to 1 if you have libpcap/WinPcap remote capturing support])
+
+         #
+         # XXX - this *should* be checked for independently of checking
+         # for pcap_open(), as you might have pcap_setsampling() without
+         # remote capture support.
+         #
+         # However, 1) the sampling options are treated as remote options
+         # in the GUI and and 2) having pcap_setsampling() doesn't mean
+         # you have sampling support.  libpcap needs a way to indicate
+         # whether a given device supports sampling, and the GUI should
+         # be changed to decouple them.
+         #
+         # (Actually, libpcap needs a general mechanism to offer options
+         # for particular devices, and Wireshark needs to use that
+         # mechanism.  The former is a work in progress.)
+         #
+         # (Note: another work in progress is support for remote
+         # capturing using pcap_create()/pcap_activate(), which we
+         # also need to support once it's available.)
+         #
+         AC_CHECK_FUNCS(pcap_setsampling)
+       fi
+
        #
        # pcap_breakloop may be present in the library but not declared
        # in the pcap.h header file.  If it's not declared in the header
@@ -455,7 +409,7 @@ install a newer version of the header file.])
                AC_LANG_SOURCE(
                  [[
                    #include <pcap.h>
-                   main()
+                   int main()
                    {
                      pcap_if_t *devpointer;
                      char errbuf[1];
@@ -491,26 +445,11 @@ install a newer version of the header file.])
            AC_DEFINE(CAN_SET_CAPTURE_BUFFER_SIZE, 1,
             [Define to 1 if the capture buffer size can be set.])
          ])
-         AC_CHECK_FUNCS(bpf_image pcap_set_tstamp_precision)
+         AC_CHECK_FUNCS(bpf_image pcap_set_tstamp_precision pcap_set_tstamp_type)
        fi
 
        AC_WIRESHARK_POP_FLAGS
-       LIBS="$ac_save_LIBS"
-])
-
-AC_DEFUN([AC_WIRESHARK_PCAP_REMOTE_CHECK],
-[
-    ac_save_LIBS="$LIBS"
-    LIBS="$PCAP_LIBS $LIBS"
-    AC_DEFINE(HAVE_REMOTE, 1, [Define to 1 to enable remote
-              capturing feature in WinPcap library])
-    AC_CHECK_FUNCS(pcap_open)
-    if test $ac_cv_func_pcap_open = "yes" ; then
-        AC_DEFINE(HAVE_PCAP_REMOTE, 1,
-            [Define to 1 if you have WinPcap remote capturing support and prefer to use these new API features.])
-    fi
-    AC_CHECK_FUNCS(pcap_setsampling)
-    LIBS="$ac_save_LIBS"
+       LIBS="$ws_ac_save_LIBS"
 ])
 
 #
@@ -576,17 +515,37 @@ AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
        then
                #
                # Well, we at least have the zlib header file.
+               #
                # We link with zlib to support uncompression of
                # gzipped network traffic, e.g. in an HTTP request
                # or response body.
                #
+               # Check for inflate() in zlib, to make sure the
+               # zlib library is usable.  For example, on at
+               # least some versions of Fedora, if you have a
+               # 64-bit machine, have both the 32-bit and 64-bit
+               # versions of the run-time zlib package installed,
+               # and have only the *32-bit* version of the zlib
+               # development package installed, it'll find the
+               # header, and think it can use zlib, and will use
+               # it in subsequent tests, but it'll try and link
+               # 64-bit test programs with the 32-bit library,
+               # causing those tests to falsely fail.  Hilarity
+               # ensues.
+               #
                if test "x$zlib_dir" != "x"
                then
                  WS_CPPFLAGS="$WS_CPPFLAGS -I$zlib_dir/include"
                  AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, $zlib_dir/lib)
                fi
-               LIBS="-lz $LIBS"
-               AC_DEFINE(HAVE_LIBZ, 1, [Define to use libz library])
+               AC_DEFINE(HAVE_ZLIB, 1, [Define to use zlib library])
+               #
+               # Check for "inflate()" in zlib to make sure we can
+               # link with it.
+               #
+               AC_CHECK_LIB(z, inflate,,
+                   AC_MSG_ERROR([zlib.h found but linking with -lz failed to find inflate(); do you have the right developer package installed (32-bit vs. 64-bit)?]))
+
                #
                # Check for "inflatePrime()" in zlib, which we need
                # in order to read compressed capture files.
@@ -745,7 +704,18 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
                                        LUA_LIBS="-L$lua_dir/lib $ac_cv_search_luaL_openlibs -lm"
                                        have_lua=yes
                                ],[
-                                       have_lua=no
+                                       # Try again with -ldl
+
+                                       # Tell autoconf we don't want to use the cached result
+                                       unset ac_cv_search_luaL_openlibs
+
+                                       AC_SEARCH_LIBS(luaL_openlibs, [lua-${lua_ver} lua${lua_ver} lua],
+                                       [
+                                               LUA_LIBS="-L$lua_dir/lib $ac_cv_search_luaL_openlibs -lm -ldl"
+                                               have_lua=yes
+                                       ],[
+                                               have_lua=no
+                                       ], -lm -ldl)
                                ], -lm)
                        fi
                fi
@@ -869,41 +839,6 @@ AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
        AC_WIRESHARK_POP_FLAGS
 ])
 
-#
-# AC_WIRESHARK_RPM_CHECK
-# Looks for the rpm program, and checks to see if we can redefine "_topdir".
-#
-AC_DEFUN([AC_WIRESHARK_RPM_CHECK],
-[
-       AC_CHECK_PROG(ac_cv_wireshark_have_rpm, rpm, "yes", "no")
-       if test "x$ac_cv_wireshark_have_rpm" = "xyes"; then
-               rpm --define '_topdir /tmp' > /dev/null 2>&1
-               AC_MSG_CHECKING(to see if we can redefine _topdir)
-               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
-])
-
-#
-# AC_WIRESHARK_GNU_SED_CHECK
-# Checks if GNU sed is the first sed in PATH.
-#
-AC_DEFUN([AC_WIRESHARK_GNU_SED_CHECK],
-[
-       AC_MSG_CHECKING(for GNU sed as first sed in PATH)
-       if  ( sh -c "sed --version" </dev/null 2> /dev/null | grep "GNU sed" 2>&1 > /dev/null ) ;  then
-               AC_MSG_RESULT(yes)
-               HAVE_GNU_SED=yes
-       else
-               AC_MSG_RESULT(no)
-               HAVE_GNU_SED=no
-       fi
-])
 
 #
 # AC_WIRESHARK_C_ARES_CHECK
@@ -919,9 +854,34 @@ AC_DEFUN([AC_WIRESHARK_C_ARES_CHECK],
        if test "x$want_c_ares" = "xyes"; then
                AC_CHECK_LIB(cares, ares_init,
                  [
-                   C_ARES_LIBS=-lcares
-                   AC_DEFINE(HAVE_C_ARES, 1, [Define to use c-ares library])
-                   have_good_c_ares=yes
+                   #
+                   # Make sure we have c-ares 1.5 or later; we don't
+                   # support the older API.
+                   #
+                   AC_MSG_CHECKING([whether we have c-ares 1.5 or later])
+                   AC_TRY_COMPILE(
+                     [
+#include <ares.h>
+#include <ares_version.h>
+                     ],
+                     [
+#if ((ARES_VERSION_MAJOR < 1) || \
+    (1 == ARES_VERSION_MAJOR == 1 && ARES_VERSION_MINOR < 5))
+#error You lose
+#else
+                       return 0;
+#endif
+                     ],
+                     [
+                       AC_MSG_RESULT([yes])
+                       C_ARES_LIBS=-lcares
+                       AC_DEFINE(HAVE_C_ARES, 1, [Define to use c-ares library])
+                       have_good_c_ares=yes
+                     ],
+                     [
+                       AC_MSG_RESULT([no])
+                       AC_MSG_ERROR([Pre-1.5 versions of c-ares aren't supported])
+                     ])
                  ])
        else
                AC_MSG_RESULT(not required)
@@ -984,7 +944,7 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
          ac_krb5_version="$ac_heimdal_version$ac_mit_version_olddir$ac_mit_version_newdir"
          if test "x$ac_krb5_version" = "xHEIMDAL"
          then
-             KRB5_LIBS="-L$krb5_dir/lib -lkrb5 -lasn1 $SSL_LIBS -lroken -lcrypt"
+             KRB5_LIBS="-L$krb5_dir/lib -lkrb5 -lasn1 -lcrypto -lroken -lcrypt"
          else
              KRB5_LIBS="-L$krb5_dir/lib -lkrb5 -lk5crypto -lcom_err"
          fi
@@ -998,33 +958,23 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
          then
            KRB5_CFLAGS=`"$KRB5_CONFIG" --cflags`
            KRB5_LIBS=`"$KRB5_CONFIG" --libs`
-           #
-           # If -lcrypto is in KRB5_FLAGS, we require it to build
-           # with Heimdal/MIT.  We don't want to built with it by
-           # default, due to annoying license incompatibilities
-           # between the OpenSSL license and the GPL, so:
-           #
-           #   if SSL_LIBS is set to a non-empty string, we
-           #   remove -lcrypto from KRB5_LIBS and replace
-           #   it with SSL_LIBS;
-           #
-           #   if SSL_LIBS is not set to a non-empty string
-           #   we fail with an appropriate error message.
-           #
-           case "$KRB5_LIBS" in
-           *-lcrypto*)
-               if test ! -z "$SSL_LIBS"
-               then
-                   KRB5_LIBS=`echo $KRB5_LIBS | sed 's/-lcrypto//'`
-                   KRB5_LIBS="$KRB5_LIBS $SSL_LIBS"
-               else
-                   AC_MSG_ERROR([Kerberos library requires -lcrypto, so you must specify --with-ssl])
-               fi
-               ;;
-           esac
            ac_krb5_version=`"$KRB5_CONFIG" --version | head -n 1 | sed -e 's/^.*heimdal.*$/HEIMDAL/' -e 's/^Kerberos .*$/MIT/' -e 's/^Solaris Kerberos .*$/MIT/'`
          fi
        fi
+       #
+       # If -lcrypto is in KRB5_LIBS, we require it to build
+       # with Heimdal/MIT.  We don't want to built with it by
+       # default, due to annoying license incompatibilities
+       # between the OpenSSL license and the GPL.
+       #
+       case "$KRB5_LIBS" in
+       *-lcrypto*)
+         if test "x$with_krb5_crypto_openssl" != "xyes"
+           then
+             AC_MSG_ERROR([Kerberos library requires -lcrypto, so you must specify --with-krb5-crypto-openssl])
+           fi
+           ;;
+       esac
 
        CPPFLAGS="$CPPFLAGS $KRB5_CFLAGS"
 
@@ -1093,9 +1043,10 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                    fi
                    AC_TRY_LINK(
                        [
+#      include <krb5.h>
                        ],
                        [
-                           krb5_kt_resolve();
+                           krb5_kt_resolve(0, 0, 0);
                        ],
                        [
                            #
@@ -1157,7 +1108,7 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                            #include <krb5.h>
                            #include <stdio.h>
 
-                           main()
+                           int main()
                            {
                              printf("%u\n", KEYTYPE_ARCFOUR_56);
                            }
@@ -1235,6 +1186,11 @@ AC_DEFUN([AC_WIRESHARK_GEOIP_CHECK],
                                AC_DEFINE(HAVE_GEOIP_V6, 1, [Define if GeoIP supports IPv6 (GeoIP 1.4.5 and later)])
                          ],,
                        )
+                       AC_CHECK_LIB(GeoIP, GeoIP_free,
+                         [
+                               AC_DEFINE(HAVE_GEOIP_FREE, 1, [Define if GeoIP has GeoIP_free])
+                         ],,
+                       )
                fi
        else
                AC_MSG_RESULT(not required)
@@ -1260,12 +1216,52 @@ AC_DEFUN([AC_WIRESHARK_LIBSSH_CHECK],
                        have_good_libssh=yes
                  ],,
                )
-               AC_CHECK_LIB(ssh, ssh_userauth_agent,
+               AC_MSG_CHECKING([whether libssh >= 0.6.0 for sshdump, ciscodump])
+               PKG_CHECK_EXISTS([libssh >= 0.6.0],
                  [
-                   LIBSSH_LIBS=-lssh
-                       AC_DEFINE(HAVE_SSH_USERAUTH_AGENT, 1, [Libssh library has ssh_userauth_agent])
-                       have_ssh_userauth_agent=yes
-                 ],,
+                  AC_MSG_RESULT(yes)
+                  AC_DEFINE(HAVE_LIBSSH_POINTSIX, 1, [Defined if libssh >= 0.6.0])
+                  have_libssh_pointsix=yes
+                 ],
+                 [AC_MSG_RESULT(no)]
+               )
+               if test "x$have_libssh_pointsix" = "xyes"; then
+                       # ssh_userauth_agent exists only >= 0.6.0, but not on Windows
+                       # so check explicitly
+                       AC_CHECK_LIB(ssh, ssh_userauth_agent,
+                         [
+                           AC_DEFINE(HAVE_SSH_USERAUTH_AGENT, 1, [Libssh library has ssh_userauth_agent])
+                           have_ssh_userauth_agent=yes
+                         ],,
+                       )
+               fi
+       else
+               AC_MSG_RESULT(not required)
+       fi
+])
+
+#
+# AC_WIRESHARK_NGHTTP2_CHECK
+#
+AC_DEFUN([AC_WIRESHARK_NGHTTP2_CHECK],
+[
+       want_nghttp2=defaultyes
+
+       if test "x$want_nghttp2" = "xdefaultyes"; then
+               want_nghttp2=yes
+       fi
+
+       if test "x$want_nghttp2" = "xyes"; then
+               AC_CHECK_LIB(nghttp2, nghttp2_hd_inflate_new,
+                       [
+                               AC_CHECK_HEADERS(nghttp2/nghttp2.h,
+                                       [
+                                               NGHTTP2_LIBS=-lnghttp2
+                                               AC_DEFINE(HAVE_NGHTTP2, 1, [Define to use nghttp2 library])
+                                               have_good_nghttp2=yes
+                                       ],,
+                               )
+                       ],,
                )
        else
                AC_MSG_RESULT(not required)
@@ -1287,7 +1283,7 @@ LDFLAGS="$LDFLAGS $LD_OPTION"
 can_add_to_ldflags=""
 AC_LINK_IFELSE(
   [
-    AC_LANG_SOURCE([[main() { return; }]])
+    AC_LANG_SOURCE([[int main() { return 0; }]])
   ],
   [
     AC_MSG_RESULT(yes)
@@ -1679,7 +1675,7 @@ fi
 AC_DEFUN([AC_WIRESHARK_GCC_SYSTEM_INCLUDE],
 [
        if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
-               $1=`printf %s " $$1" \
+               $1=`echo " $$1" \
                        | sed -e 's/  *-I *\// -isystem\//g' -e 's/^ *//'`
        fi
 ])
@@ -1693,84 +1689,6 @@ AC_DEFUN([PKG_WIRESHARK_CHECK_SYSTEM_MODULES],
        AC_WIRESHARK_GCC_SYSTEM_INCLUDE($1_CFLAGS)
 ])
 
-#
-# AC_WIRESHARK_OSX_INTEGRATION_CHECK
-#
-# Checks for the presence of OS X integration functions in the GTK+ framework
-# or as a separate library.
-#
-# GTK+ for MAC OS X now lives on www.gtk.org at:
-#
-#   http://www.gtk.org/download/macos.php
-#
-# Details on building with GTK-OSX are available at:
-#
-#   http://live.gnome.org/GTK%2B/OSX/Building
-#
-# The GTK-OSX library has been renamed to gtkmacintegration.
-# It was previously named igemacintegration.
-#
-# http://live.gnome.org/GTK%2B/OSX/Integration
-#    for the old Carbon-based integration functions
-#
-AC_DEFUN([AC_WIRESHARK_OSX_INTEGRATION_CHECK],
-[
-       AC_WIRESHARK_PUSH_FLAGS
-       ac_save_LIBS="$LIBS"
-       CFLAGS="$CFLAGS $GTK_CFLAGS"
-       LIBS="$GTK_LIBS $LIBS"
-
-       #
-       # Check for the new integration functions in a -lgtkmacintegration
-       # library.
-       #
-       AC_CHECK_LIB(gtkmacintegration, gtkosx_application_set_menu_bar,
-       [
-               AC_DEFINE(HAVE_GTKOSXAPPLICATION, 1,
-                       [Define to 1 if -lgtkmacintegration includes the GtkOSXApplication Integration functions.])
-               have_ige_mac=yes
-               # We don't want gtk stuff in LIBS (which is reset below) so
-               # manually set GTK_LIBS (which is more appropriate)
-               GTK_LIBS="$GTK_LIBS -lgtkmacintegration"
-       ])
-
-       if test x$have_ige_mac = x
-       then
-               #
-               # Not found - check for the old integration functions in
-               # the Gtk framework.
-               #
-               AC_CHECK_LIB(Gtk, gtk_mac_menu_set_menu_bar,
-               [
-                       AC_DEFINE(HAVE_IGE_MAC_INTEGRATION, 1,
-                               [Define to 1 if the the Gtk+ framework or a separate library includes the Imendio IGE Mac OS X Integration functions.])
-                       have_ige_mac=yes
-                       # We don't want gtk stuff in LIBS (which is reset below) so
-                       # manually set GTK_LIBS (which is more appropriate)
-                       GTK_LIBS="$GTK_LIBS -lGtk"
-               ])
-       fi
-
-       if test x$have_ige_mac = x
-       then
-               #
-               # Not found - check for the old integration functions in
-               # a -lgtkmacintegration library.
-               #
-               AC_CHECK_LIB(gtkmacintegration, gtk_mac_menu_set_menu_bar,
-               [
-                       AC_DEFINE(HAVE_IGE_MAC_INTEGRATION, 1,
-                               [Define to 1 if the the Gtk+ framework or a separate library includes the Imendio IGE Mac OS X Integration functions.])
-                       have_ige_mac=yes
-                       # We don't want gtk stuff in LIBS (which is reset below) so
-                       # manually set GTK_LIBS (which is more appropriate)
-                       GTK_LIBS="$GTK_LIBS -lgtkmacintegration"
-               ])
-       fi
-       LIBS="$ac_save_LIBS"
-       AC_WIRESHARK_POP_FLAGS
-])
-
 # Based on AM_PATH_GTK in gtk-2.0.m4.
 
 dnl AC_WIRESHARK_QT_MODULE_CHECK_WITH_QT_VERSION([MODULE, MINIMUM-VERSION,
@@ -1937,6 +1855,14 @@ AC_DEFUN([AC_WIRESHARK_QT_CHECK],
            [
              qt_version_to_check=$qt_version
              QT_VERSION=$mod_version
+             QT_VERSION_MAJOR=`echo "$QT_VERSION" | cut -f1 -d.`
+             QT_VERSION_MINOR=`echo "$QT_VERSION" | cut -f2 -d.`
+             QT_VERSION_MICRO=`echo "$QT_VERSION" | cut -f3 -d.`
+
+             # Qt 5.7 and later requires C++11
+             AS_IF([test $QT_VERSION_MAJOR -eq 5 -a $QT_VERSION_MINOR -ge 7],
+               [AS_IF([test "$HAVE_CXX11" -eq 0], [AC_MSG_ERROR([Qt 5.7 and later requires C++11])])])
+
            ],
            [no_qt=yes])
 
@@ -1973,7 +1899,7 @@ AC_DEFUN([AC_WIRESHARK_QT_CHECK],
 
                #
                # While we're at it, look for QtMacExtras.  (Presumably
-               # if we're not building for OS X, it won't be present.)
+               # if we're not building for macOS, it won't be present.)
                #
                # XXX - is there anything in QtX11Extras or QtWinExtras
                # that we should be using?
@@ -2051,3 +1977,204 @@ AC_DEFUN([AC_WIRESHARK_QT_TOOL_CHECK],
                fi
        fi
 ])
+
+AC_DEFUN([AC_WIRESHARK_QT_TOOL_CHECK_LRELEASE],
+[
+  AC_WIRESHARK_QT_TOOL_CHECK(LRELEASE, lrelease, $2)
+  AC_MSG_CHECKING(whether lrelease -version works)
+  lrelease_version=`$LRELEASE -version 2>&AS_MESSAGE_LOG_FD`
+  AS_IF([test $? -ne 0],
+    [
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([$LRELEASE -version returned non-zero exit status])
+    ])
+  AC_MSG_RESULT([ok, $lrelease_version])
+])
+
+#
+# AC_WIRESHARK_LZ4_CHECK
+#
+AC_DEFUN([AC_WIRESHARK_LZ4_CHECK],
+[
+       AC_WIRESHARK_PUSH_FLAGS
+
+       if test "x$lz4_dir" != "x"
+       then
+         #
+         # The user specified a directory in which lz4 resides,
+         # so add the "include" subdirectory of that directory to
+         # the include file search path and the "lib" subdirectory
+         # of that directory to the library search path.
+         #
+         # XXX - if there's also a lz4 in a directory that's
+         # already in CPPFLAGS or LDFLAGS, this won't make us find
+         # the version in the specified directory, as the compiler
+         # and/or linker will search that other directory before it
+         # searches the specified directory.
+         #
+         LZ4_CFLAGS="-I$lz4_dir/include"
+       fi
+
+       #
+       # Make sure we have "lz4.h".  If we don't, it means we probably
+       # don't have lz4, so don't use it.
+       #
+       AC_CHECK_HEADER(lz4.h,,
+         [
+           if test "x$lz4_dir" != "x"
+           then
+             #
+             # The user used "--with-lz4=" to specify a directory
+             # containing lz4, but we didn't find the header file
+             # there; that either means they didn't specify the
+             # right directory or are confused about whether lz4
+             # is, in fact, installed.  Report the error and give up.
+             #
+             AC_MSG_ERROR([lz4 header not found in directory specified in --with-lz4])
+           else
+             if test "x$want_lz4" = "xyes"
+             then
+               #
+               # The user tried to force us to use the library, but we
+               # couldn't find the header file; report an error.
+               #
+               AC_MSG_ERROR(Header file lz4.h not found.)
+             else
+               #
+               # We couldn't find the header file; don't use the
+               # library, as it's probably not present.
+               #
+               want_lz4=no
+             fi
+           fi
+         ])
+
+       if test "x$want_lz4" != "xno"
+       then
+               #
+               # Well, we at least have the lz4 header file.
+               # We link with lz4 to support uncompression of
+               # CQL traffic.
+               #
+               LZ4_LIBS="-llz4"
+               ac_save_LIBS="$LIBS"
+               LIBS="$LZ4_LIBS $LIBS"
+               AC_DEFINE(HAVE_LZ4, 1, [Define to use lz4 library])
+               #
+               # Check for "LZ4_decompress_safe()" in lz4, which we need
+               # in order to read compressed capture files.
+               #
+               AC_CHECK_FUNCS(LZ4_decompress_safe)
+               LIBS="$ac_save_LIBS"
+       fi
+
+       AC_WIRESHARK_POP_FLAGS
+])
+
+#
+# AC_WIRESHARK_SNAPPY_CHECK
+#
+AC_DEFUN([AC_WIRESHARK_SNAPPY_CHECK],
+[
+       AC_WIRESHARK_PUSH_FLAGS
+
+       if test "x$snappy_dir" != "x"
+       then
+         #
+         # The user specified a directory in which snappy resides,
+         # so add the "include" subdirectory of that directory to
+         # the include file search path and the "lib" subdirectory
+         # of that directory to the library search path.
+         #
+         # XXX - if there's also a snappy in a directory that's
+         # already in CPPFLAGS or LDFLAGS, this won't make us find
+         # the version in the specified directory, as the compiler
+         # and/or linker will search that other directory before it
+         # searches the specified directory.
+         #
+         SNAPPY_CFLAGS="-I$snappy_dir/include"
+       fi
+
+       #
+       # Make sure we have "snappy-c.h".  If we don't, it means we probably
+       # don't have snappy, so don't use it.
+       #
+       AC_CHECK_HEADER(snappy-c.h,,
+         [
+           if test "x$snappy_dir" != "x"
+           then
+             #
+             # The user used "--with-snappy=" to specify a directory
+             # containing snappy, but we didn't find the header file
+             # there; that either means they didn't specify the
+             # right directory or are confused about whether snappy
+             # is, in fact, installed.  Report the error and give up.
+             #
+             AC_MSG_ERROR([snappy-c.header not found in directory specified in --with-snappy])
+           else
+             if test "x$want_snappy" = "xyes"
+             then
+               #
+               # The user tried to force us to use the library, but we
+               # couldn't find the header file; report an error.
+               #
+               AC_MSG_ERROR(Header file snappy-c.h not found.)
+             else
+               #
+               # We couldn't find the header file; don't use the
+               # library, as it's probably not present.
+               #
+               want_snappy=no
+             fi
+           fi
+         ])
+
+       if test "x$want_snappy" != "xno"
+       then
+               #
+               # Well, we at least have the snappy-c.header file.
+               # We link with snappy to support uncompression of
+               # compressed CQL traffic.
+               #
+               SNAPPY_LIBS=-lsnappy
+               ac_save_LIBS="$LIBS"
+               LIBS="$SNAPPY_LIBS $LIBS"
+               AC_DEFINE(HAVE_SNAPPY, 1, [Define to use snappy library])
+               #
+               # Check for "snappy_uncompress()" in snappy, which we need
+               # in order to read compressed capture files.
+               #
+               AC_CHECK_FUNCS(snappy_uncompress)
+               LIBS="$ac_save_LIBS"
+       fi
+
+       AC_WIRESHARK_POP_FLAGS
+])
+
+#
+# AC_WIRESHARK_BCG729_CHECK
+#
+AC_DEFUN([AC_WIRESHARK_BCG729_CHECK],
+[
+       want_bcg729=defaultyes
+
+       if test "x$want_bcg729" = "xdefaultyes"; then
+               want_bcg729=yes
+       fi
+
+       if test "x$want_bcg729" = "xyes"; then
+               AC_CHECK_LIB(bcg729, bcg729Decoder,
+                       [
+                               AC_CHECK_HEADERS(bcg729/decoder.h,
+                                       [
+                                               BCG729_LIBS=-lbcg729
+                                               AC_DEFINE(HAVE_BCG729, 1, [Define to use bcg729 library])
+                                               have_good_bcg729=yes
+                                       ],,
+                               )
+                       ],,
+               )
+       else
+               AC_MSG_RESULT(not required)
+       fi
+])