Qt: add initializers (CID 1162824).
[metze/wireshark/wip.git] / acinclude.m4
index 81d385e043e968b8c313385813e99408bff8324e..4ab5bcbdfb89dc4040d6d61941618a421080379f 100644 (file)
@@ -97,156 +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_GETADDRINFO_LIB_CHECK
-#
-# Checks whether we have "getaddrinfo()" and whether we need "-lnsl" to get it.
-AC_DEFUN([AC_WIRESHARK_GETADDRINFO_LIB_CHECK],
-[
-    AC_CHECK_FUNCS(getaddrinfo, ,
-       AC_CHECK_LIB(nsl, getaddrinfo,
-                    [
-                        NSL_LIBS="-lnsl"
-                        AC_DEFINE(HAVE_GETADDRINFO, 1, [Defined if we have getaddrinfo])
-                    ]))
-    AC_SUBST(NSL_LIBS)
-])
-
-#
-# AC_WIRESHARK_GETHOSTBY_LIB_CHECK
-#
-# Checks whether we need "-lnsl" to get "gethostby*()", which we use
-# in "resolv.c".
-#
-# Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
-# GNU Autoconf 2.13; the comment came from there.
-# Done by Guy Harris <guy@alum.mit.edu> on 2000-01-14.
-#
-AC_DEFUN([AC_WIRESHARK_GETHOSTBY_LIB_CHECK],
-[
-    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
-    # to get the SysV transport functions.
-    # chad@anasazi.com says the Pyramid MIS-ES running DC/OSx (SVR4)
-    # needs -lnsl.
-    # The nsl library prevents programs from opening the X display
-    # on Irix 5.2, according to dickey@clark.net.
-    AC_CHECK_FUNCS(gethostbyname, ,
-       AC_CHECK_LIB(nsl, gethostbyname,
-                    [
-                       NSL_LIBS="-lnsl"
-                       AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [Defined if we have gethostbyname])
-                    ]))
-    AC_SUBST(NSL_LIBS)
-])
-
-#
-# AC_WIRESHARK_SOCKET_LIB_CHECK
-#
-# Checks whether we need "-lsocket" to get "socket()", which is used
-# by libpcap on some platforms - and, in effect, "gethostbyname()" or
-# "getaddrinfo()" on most if not all platforms (so that it can use NIS or
-# DNS or... to look up host names).
-#
-# Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
-# GNU Autoconf 2.13; the comment came from there.
-# Done by Guy Harris <guy@alum.mit.edu> on 2000-01-14.
-#
-# We use "connect" because that's what AC_PATH_XTRA did.
-#
-AC_DEFUN([AC_WIRESHARK_SOCKET_LIB_CHECK],
-[
-    # lieder@skyler.mavd.honeywell.com says without -lsocket,
-    # socket/setsockopt and other routines are undefined under SCO ODT
-    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
-    # on later versions), says simon@lia.di.epfl.ch: it contains
-    # gethostby* variants that don't use the nameserver (or something).
-    # -lsocket must be given before -lnsl if both are needed.
-    # We assume that if connect needs -lnsl, so does gethostbyname.
-    AC_CHECK_FUNC(connect, ,
-      AC_CHECK_LIB(socket, connect, SOCKET_LIBS="-lsocket",
-               AC_MSG_ERROR(Function 'socket' not found.), $NSL_LIBS))
-    AC_SUBST(SOCKET_LIBS)
-])
 
 #
 # AC_WIRESHARK_BREAKLOOP_TRY_LINK
@@ -343,10 +193,7 @@ AC_DEFUN([AC_WIRESHARK_PCAP_CHECK],
            #
            AC_MSG_CHECKING(for extraneous pcap header directories)
            found_pcap_dir=""
-           pcap_dir_list="/usr/include/pcap $prefix/include/pcap $prefix/include"
-           if test "x$ac_cv_enable_usr_local" = "xyes" ; then
-             pcap_dir_list="$pcap_dir_list /usr/local/include/pcap"
-           fi
+           pcap_dir_list="/usr/local/include/pcap /usr/include/pcap $prefix/include/pcap $prefix/include"
            for pcap_dir in $pcap_dir_list
            do
              if test -d $pcap_dir ; then
@@ -416,7 +263,7 @@ and did you also install that package?]]))
              for extras in "-lcfg -lodm" "-lpfring"
              do
                AC_MSG_CHECKING([for pcap_open_live in -lpcap with $extras])
-               LIBS="-lpcap $extras"
+               LIBS="-lpcap $extras $ac_save_LIBS"
                #
                # XXX - can't we use AC_CHECK_LIB here?
                #
@@ -446,7 +293,7 @@ and did you also install that package?]]))
                AC_MSG_ERROR([Can't link with library libpcap.])
              fi
              LIBS=$ac_save_LIBS
-           ], $SOCKET_LIBS $NSL_LIBS)
+           ])
        fi
        AC_SUBST(PCAP_LIBS)
 
@@ -455,7 +302,7 @@ and did you also install that package?]]))
        # libpcap.
        #
        ac_save_LIBS="$LIBS"
-       LIBS="$PCAP_LIBS $SOCKET_LIBS $NSL_LIBS $LIBS"
+       LIBS="$PCAP_LIBS $LIBS"
        AC_CHECK_FUNCS(pcap_open_dead pcap_freecode)
        #
        # pcap_breakloop may be present in the library but not declared
@@ -529,7 +376,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];
@@ -575,13 +422,11 @@ install a newer version of the header file.])
 AC_DEFUN([AC_WIRESHARK_PCAP_REMOTE_CHECK],
 [
     ac_save_LIBS="$LIBS"
-    LIBS="$PCAP_LIBS $SOCKET_LIBS $NSL_LIBS $LIBS"
-    AC_DEFINE(HAVE_REMOTE, 1, [Define to 1 to enable remote
-              capturing feature in WinPcap library])
+    LIBS="$PCAP_LIBS $LIBS"
     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.])
+            [Define to 1 if you have libpcap/WinPcap remote capturing support and prefer to use these new API features.])
     fi
     AC_CHECK_FUNCS(pcap_setsampling)
     LIBS="$ac_save_LIBS"
@@ -650,17 +495,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="$LIBS -lz"
-               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.
@@ -751,7 +616,7 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
                then
                        # The user didn't tell us where to look so we'll look in some
                        # standard locations.
-                       want_lua_dir="/usr /usr/local $prefix"
+                       want_lua_dir="/usr/local /usr $prefix"
                fi
                for dir in $want_lua_dir
                do
@@ -813,15 +678,12 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
                                # searches the specified directory.
                                #
                                # XXX - lib64?
-                               wireshark_save_LIBS="$LIBS"
-                               LIBS="$LIBS -L$lua_dir/lib"
+                               LDFLAGS="-L$lua_dir/lib $LDFLAGS"
                                AC_SEARCH_LIBS(luaL_openlibs, [lua-${lua_ver} lua${lua_ver} lua],
                                [
                                        LUA_LIBS="-L$lua_dir/lib $ac_cv_search_luaL_openlibs -lm"
-                                       LIBS="$wireshark_save_LIBS"
                                        have_lua=yes
                                ],[
-                                       LIBS="$wireshark_save_LIBS"
                                        have_lua=no
                                ], -lm)
                        fi
@@ -856,7 +718,7 @@ AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
                CPPFLAGS="$CPPFLAGS -I$portaudio_dir/include"
                LDFLAGS="$LDFLAGS -L$portaudio_dir/lib"
        fi
-       LIBS="$LIBS -lportaudio"
+       LIBS="-lportaudio $LIBS"
 
        #
        # Make sure we have "portaudio.h".  If we don't, it means we probably
@@ -946,41 +808,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
@@ -991,53 +818,15 @@ AC_DEFUN([AC_WIRESHARK_C_ARES_CHECK],
 
        if test "x$want_c_ares" = "xdefaultyes"; then
                want_c_ares=yes
-               if test "x$ac_cv_enable_usr_local" = "xyes" ; then
-                       withval=/usr/local
-                       if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
-                       fi
-               fi
        fi
 
        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
-                 ],, $SOCKET_LIBS $NSL_LIBS
-               )
-       else
-               AC_MSG_RESULT(not required)
-       fi
-])
-
-
-#
-# AC_WIRESHARK_ADNS_CHECK
-#
-AC_DEFUN([AC_WIRESHARK_ADNS_CHECK],
-[
-       want_adns=defaultyes
-
-       if test "x$want_adns" = "xdefaultyes"; then
-               want_adns=yes
-               if test "x$ac_cv_enable_usr_local" = "xyes" ; then
-                       withval=/usr/local
-                       if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
-                       fi
-               fi
-       fi
-
-       if test "x$want_adns" = "xyes"; then
-               AC_CHECK_LIB(adns, adns_init,
-                 [
-                   ADNS_LIBS=-ladns
-                   AC_DEFINE(HAVE_GNU_ADNS, 1, [Define to use GNU ADNS library])
-                   have_good_adns=yes
-                 ],, $SOCKET_LIBS $NSL_LIBS
-               )
+                   AC_DEFINE(HAVE_C_ARES, 1, [Define to use c-ares library])
+                   have_good_c_ares=yes
+                 ])
        else
                AC_MSG_RESULT(not required)
        fi
@@ -1053,12 +842,6 @@ AC_DEFUN([AC_WIRESHARK_LIBCAP_CHECK],
 
        if test "x$want_libcap" = "xdefaultyes"; then
                want_libcap=yes
-               if test "x$ac_cv_enable_usr_local" = "xyes" ; then
-                       withval=/usr/local
-                       if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
-                       fi
-               fi
        fi
 
        if test "x$want_libcap" = "xyes"; then
@@ -1205,7 +988,7 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                found_krb5_kt_resolve=no
                for extras in "" "-lresolv"
                do
-                   LIBS="$KRB5_LIBS $extras"
+                   LIBS="$KRB5_LIBS $extras $wireshark_save_LIBS"
                    if test -z "$extras"
                    then
                        AC_MSG_CHECKING([whether $ac_krb5_version includes krb5_kt_resolve])
@@ -1214,17 +997,19 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                    fi
                    AC_TRY_LINK(
                        [
+#      include <krb5.h>
                        ],
                        [
-                           krb5_kt_resolve();
+                           krb5_kt_resolve(0, 0, 0);
                        ],
                        [
                            #
-                           # We found "krb5_kt_resolve()", and required
-                           # the libraries in extras as well.
+                           # We found "krb5_kt_resolve()".
                            #
                            AC_MSG_RESULT(yes)
-                           KRB5_LIBS="$LIBS"
+                           if test -n "$extras"; then
+                             KRB5_LIBS="$KRB5_LIBS $extras"
+                           fi
                            AC_DEFINE(HAVE_KERBEROS, 1, [Define to use kerberos])
                            if test "x$ac_krb5_version" = "xHEIMDAL"
                            then
@@ -1277,7 +1062,7 @@ AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
                            #include <krb5.h>
                            #include <stdio.h>
 
-                           main()
+                           int main()
                            {
                              printf("%u\n", KEYTYPE_ARCFOUR_56);
                            }
@@ -1339,12 +1124,6 @@ AC_DEFUN([AC_WIRESHARK_GEOIP_CHECK],
 
        if test "x$want_geoip" = "xdefaultyes"; then
                want_geoip=yes
-               if test "x$ac_cv_enable_usr_local" = "xyes" ; then
-                       withval=/usr/local
-                       if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
-                       fi
-               fi
        fi
 
        if test "x$want_geoip" = "xyes"; then
@@ -1361,6 +1140,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 (not available upstream with 1.6.10 or earlier)])
+                         ],,
+                       )
                fi
        else
                AC_MSG_RESULT(not required)
@@ -1376,12 +1160,6 @@ AC_DEFUN([AC_WIRESHARK_LIBSSH_CHECK],
 
        if test "x$want_libssh" = "xdefaultyes"; then
                want_libssh=yes
-               if test "x$ac_cv_enable_usr_local" = "xyes" ; then
-                       withval=/usr/local
-                       if test -d "$withval"; then
-                               AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
-                       fi
-               fi
        fi
 
        if test "x$want_libssh" = "xyes"; then
@@ -1392,12 +1170,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)
@@ -1419,7 +1237,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)
@@ -1783,7 +1601,7 @@ fi
 AC_DEFUN([AC_WIRESHARK_GCC_FORTIFY_SOURCE_CHECK],
 [
 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
-  AC_MSG_CHECKING([whether -D_FORTIFY_SOURCE=... can be used (without generating a warning)])
+  AC_MSG_CHECKING([whether -D_FORTIFY_SOURCE=2 can be used (without generating a warning)])
   AC_WIRESHARK_PUSH_FLAGS
   CFLAGS="$CFLAGS -Werror"
   CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
@@ -1811,7 +1629,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
 ])
@@ -1825,84 +1643,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,
@@ -2069,6 +1809,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])
 
@@ -2105,7 +1853,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?
@@ -2183,3 +1931,176 @@ 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
+])