2 # Autoconf script for Wireshark
6 # Define variables for the components of the Wireshark version number.
8 m4_define([version_major], [2])
9 m4_define([version_minor], [3])
10 m4_define([version_micro], [0])
11 dnl Updated by make-version.pl
12 m4_define([version_extra], [])
13 m4_define([version_micro_extra], m4_join([], version_micro, version_extra))
15 AC_INIT(Wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/)
19 # Minimum autoconf version we require.
21 # Variable expansion doesn't work in AC_PREREQ()
23 AC_SUBST(AC_MIN_VERSION)
25 dnl Make sure to keep ACLOCAL_AMFLAGS in Makefile.am and AC_CONFIG_MACRO_DIRS
26 dnl in configure.ac in sync, otherwise there will be an error running autogen.sh.
27 m4_ifdef([AC_CONFIG_MACRO_DIRS],[AC_CONFIG_MACRO_DIRS([m4])])
29 dnl Check for CPU / vendor / OS
30 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
31 dnl `AC_CANONICAL_HOST', or `AC_CANONICAL_TARGET', depending on the
32 dnl needs. Using `AC_CANONICAL_TARGET' is enough to run the two other
35 dnl As nothing in the Wireshark is itself a build tool (we are not,
36 dnl for example, a compiler that generates machine code), we probably
37 dnl don't need AC_CANONICAL_TARGET, so, in theory, we should be able
38 dnl to use AC_CANONICAL_BUILD and AC_CANONICAL_HOST - or perhaps just
39 dnl AC_CANONICAL_HOST - instead. Note that we do have tools, such as
40 dnl lemon, that need to be built for the build machine, not for the
41 dnl host machine, so we might need both.
43 dnl This has to be done *after* AC_INIT, otherwise autogen.sh fails.
45 dnl AC_CANONICAL_BUILD
49 AM_INIT_AUTOMAKE([1.11 tar-ustar dist-xz no-dist-gzip subdir-objects])
51 # Enable silent builds by default. Verbose builds can be enabled with "./configure
52 # --enable-silent-rules ..." or "make V=1 ..."
53 AM_SILENT_RULES([yes])
55 # Make Wireshark's version available in config.h
56 AC_DEFINE(VERSION_MAJOR, version_major, [Wireshark's major version])
57 AC_DEFINE(VERSION_MINOR, version_minor, [Wireshark's minor version])
58 AC_DEFINE(VERSION_MICRO, version_micro, [Wireshark's micro version])
60 AC_DEFINE_UNQUOTED(VERSION_FLAVOR,
61 ["${WIRESHARK_VERSION_FLAVOR:-"Development Build"}"], [Wireshark's package flavor])
64 LT_INIT([disable-static dlopen])
65 AC_SUBST([LIBTOOL_DEPS])
67 AC_CONFIG_LIBOBJ_DIR([wsutil])
70 # Checks for programs used in the main build process.
72 # See doc/README.developer for allowed C99 features
75 if test "$ac_cv_prog_cc_c99" = "no"
77 AC_MSG_ERROR([The C compiler does not support C99])
82 if test ! -z "$CXX"; then
84 # OK, we found something AC_LANG_CXX thinks is a C++ compiler,
87 # Some UN*Xes have, by default, a case-insensitive file
88 # system, and AC_PROG_CXX looks for, among other things,
89 # "CC" as a C++ compiler, and, if you have a case-insensitive
90 # file system and a C compiler named "cc" (both true, by
91 # default, on macOS), AC_PROG_CXX may end up thinking it's
94 # So we check by feeding the purported C++ compiler a
95 # program using C++ features (iostream).
97 AC_MSG_CHECKING(whether $CXX is a C++ compiler)
99 AC_LINK_IFELSE([AC_LANG_PROGRAM(
104 std::cout << "Hello World! ";
107 [AC_MSG_RESULT(yes)],
115 # Qt 5.7 or later requires C++11
116 AS_IF([test -n "$CXX"],
117 [AX_CXX_COMPILE_STDCXX([11], [noext], [optional])])
119 # Set CC_FOR_BUILD (the *local* gcc to use for building e.g. lemon)
120 if test "x$cross_compiling" = xno -a -z "$CC_FOR_BUILD"; then
126 # Check for versions of "sed" inadequate to handle, in libtool, a list
127 # of object files as large as the list in Wireshark.
134 AC_PATH_PROG(PERL, perl)
137 AC_PATH_PROGS(PYTHON, python python3)
138 if test ! -z "$PYTHON"; then
140 # OK, we found Python; is it Python 2.5 or later?
141 # Note: we don't use named components for sys.version_info to get
142 # the major version number, as named components for version_info
143 # were apparently introduced in Python 2.7.
145 AC_MSG_CHECKING([whether $PYTHON is Python 2.5 or later])
146 python_major_version=`$PYTHON -c 'import sys; print (sys.version_info[[0]])'`
147 python_minor_version=`$PYTHON -c 'import sys; print (sys.version_info[[1]])'`
148 if test "$python_major_version" -eq 2 -a "$python_minor_version" -lt 5 ; then
150 AC_MSG_WARN([Building with Python $python_major_version.$python_minor_version may not work])
155 AC_MSG_ERROR(I couldn't find python; make sure it's installed and in your path)
159 dnl Check for yacc/lex. Distribution tarballs include generated source,
160 dnl in which case these tools are not a mandatory requirement to build.
163 AS_IF([test "x$YACC" = xyacc], [AS_UNSET(YACC)])
164 AS_IF([test -z "$YACC" -a ! -f $srcdir/wiretap/ascend.c],
165 [AC_MSG_ERROR([I couldn't find bison or byacc; make sure it's installed and in your path])])
166 AM_MISSING_PROG(YACC, bison)
168 AS_IF([test "x$LEX" != xflex], [AS_UNSET(LEX)])
169 AS_IF([test -z "$LEX" -a ! -f $srcdir/wiretap/ascend_scanner.c],
170 [AC_MSG_ERROR([I couldn't find flex; make sure it's installed and in your path])])
171 AM_MISSING_PROG(LEX, flex)
173 AC_PATH_PROG(POD2MAN, pod2man)
174 if test "x$POD2MAN" = x
177 # The alternative is not to build the man pages....
179 AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
181 AC_PATH_PROG(POD2HTML, pod2html)
182 if test "x$POD2HTML" = x
185 # The alternative is not to build the HTML man pages....
187 AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
191 # Set "ac_supports_gcc_flags" if the compiler is known to support GCC-style
192 # flags such as -pedantic, -W warning flags and -f feature flags. Currently,
193 # we assume GCC and clang do; other compilers should be added here.
195 # This is done to avoid getting tripped up by compilers that support
196 # those flags but give them a different meaning.
198 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
199 ac_supports_gcc_flags=yes
203 AC_PATH_PROG(DOXYGEN, doxygen)
204 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
205 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
208 # Check for pkg-config and set PKG_CONFIG accordingly.
210 # This is referenced via AC_REQUIRE([PKG_PROG_PKG_CONFIG] in some macros
211 # like PKG_CHECK_MODULES. If the first call to such a macro is under an
212 # "if" statement, it's safer to call PKG_PROG_PKG_CONFIG directly, see
213 # the comments in acolocal.m4
215 # We want version 0.7 or better. (XXX - explain why. Is that just
216 # because our Qt tests were originally based on AM_PATH_GTK, and *it*
217 # requires 0.7 or better?)
219 PKG_PROG_PKG_CONFIG(0.7)
220 if test -z "$PKG_CONFIG"; then
221 AC_MSG_ERROR(I couldn't find pkg-config; make sure it's installed and in your path)
225 # Add configure argument to select macOS deployment target.
227 AC_WIRESHARK_OSX_DEPLOY_TARGET
230 # Try to arrange for large file support.
235 # Check if we need to link with libm
237 AC_SEARCH_LIBS([cos], [m])
240 # Check for C99 math functions.
242 AC_CHECK_FUNCS([floorl lrint])
245 # Check if we need to link with -lnsl and -lsocket
250 # GUI toolkit options
253 AC_HELP_STRING( [--with-qt=@<:@yes/no/4/5@:>@],
254 [use Qt @<:@default=yes, if available@:>@]),
255 with_qt="$withval", with_qt="unspecified")
258 AC_HELP_STRING( [--with-gtk=@<:@yes/no/2/3@:>@],
259 [use GTK+ @<:@default=no@:>@]),
261 [yes], [with_gtk="3 2 fail"],
262 [no], [with_gtk="no"],
263 [3], [with_gtk="3 fail3"],
264 [2], [with_gtk="2 fail2"],
265 [AC_MSG_ERROR([--with-gtk must be one of yes/no/2/3])]),
269 # Version 3.0 switched from LGPLv2.1+ to LGPLv3+, then switched back to
270 # LGPLv2.1+ in version 3.1.10.
271 # GnuTLS depends on GMP which switched from LGPLv2.1+ to LGPLv3+ in
272 # version 4.2.2, the switched to LGPLv3+ / GPLv2+ in version 6.0.0.
275 want_gnutls="if_available"
276 AC_ARG_WITH([gnutls],
277 AC_HELP_STRING( [--with-gnutls=@<:@yes/no@:>@],
278 [use GnuTLS library @<:@default=yes, if available@:>@]),
279 [ with_gnutls="$withval"; want_gnutls="yes" ], with_gnutls="yes")
281 if test "x$with_gnutls" = "xyes"; then
282 have_license_compatible_gnutls="no"
283 PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.10 ],
284 [ have_license_compatible_gnutls="yes" ], [ echo "GnuTLS >= 3.1.10 not found " ]
287 if test "x$have_license_compatible_gnutls" != "xyes"; then
288 PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0 gnutls < 3],
289 [ have_license_compatible_gnutls="yes" ] , [ echo "GnuTLS >= 2.12.0, < 3.0 not found " ]
293 if test "x$have_license_compatible_gnutls" != "xyes"; then
294 if test "x$want_gnutls" = "xyes"; then
295 AC_MSG_ERROR([GnuTLS crypto library was requested, but is not available])
297 AS_ECHO(["GnuTLS with compatible license not found, disabling SSL decryption"])
300 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use GnuTLS library])
305 # libgrypt (for decryption, MAC, etc. functionality).
306 AM_PATH_LIBGCRYPT(1.4.2, [ ] , [
307 AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
311 AC_HELP_STRING([--with-libnl@<:@=VERSION@:>@],
312 [use libnl (force version VERSION, if supplied) @<:@default: yes, if available@:>@]),
314 if test "x$withval" = "xno"
317 elif test "x$withval" = "xyes"
321 elif test "x$withval" = "x1"
325 elif test "x$withval" = "x2"
329 elif test "x$withval" = "x3"
334 AC_MSG_ERROR(["$withval" is not a valid argument to --with-libnl])
338 # Use libnl if it's present, otherwise don't.
340 want_libnl=ifavailable
344 # Libnl is Linux-specific.
349 AC_MSG_CHECKING(whether to use libnl for various network interface purposes)
351 if test x$want_libnl = "xno"; then
356 # Test for specific libnl versions only if no version
357 # was specified by the user or if the version in question
358 # was requested by the user.
360 if test x$libnl_version = "xany" -o x$libnl_version = "x3"; then
361 PKG_CHECK_EXISTS([libnl-3.0 libnl-route-3.0 libnl-genl-3.0], [have_libnl3=yes], [have_libnl3=no])
363 if test x$libnl_version = "xany" -o x$libnl_version = "x2"; then
364 PKG_CHECK_EXISTS([libnl-2.0], [have_libnl2=yes], [have_libnl2=no])
366 if test x$libnl_version = "xany" -o x$libnl_version = "x1"; then
367 PKG_CHECK_EXISTS([libnl-1], [have_libnl1=yes], [have_libnl1=no])
369 if (test "${have_libnl3}" = "yes"); then
370 PKG_WIRESHARK_CHECK_SYSTEM_MODULES([LIBNL], [libnl-3.0 libnl-route-3.0 libnl-genl-3.0])
371 AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
372 AC_DEFINE(HAVE_LIBNL3, 1, [libnl version 3])
373 libnl_message="yes (v3)"
374 elif (test "${have_libnl2}" = "yes"); then
375 PKG_WIRESHARK_CHECK_SYSTEM_MODULES([LIBNL], [libnl-2.0])
376 AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
377 AC_DEFINE(HAVE_LIBNL2, 1, [libnl version 2])
378 libnl_message="yes (v2)"
379 elif (test "${have_libnl1}" = "yes"); then
380 PKG_WIRESHARK_CHECK_SYSTEM_MODULES([LIBNL], [libnl-1])
381 AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
382 AC_DEFINE(HAVE_LIBNL1, 1, [libnl version 1])
383 libnl_message="yes (v1)"
385 if test x$want_libnl = "xyes"; then
386 case "$libnl_version" in
389 AC_MSG_ERROR("I couldn't find libnl even though you manually enabled it.")
393 AC_MSG_ERROR("I couldn't find libnl version $libnl_version even though you manually enabled it.")
400 AC_MSG_CHECKING([if nl80211.h is new enough])
401 AC_TRY_COMPILE([#include <linux/nl80211.h>],
402 [int x = NL80211_FREQUENCY_ATTR_MAX_TX_POWER;
403 x |= NL80211_ATTR_SUPPORTED_IFTYPES;
404 x |= NL80211_ATTR_SUPPORTED_COMMANDS;
405 x |= NL80211_ATTR_WIPHY_FREQ;
406 x |= NL80211_CHAN_NO_HT;
408 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211, 1, [nl80211.h is new enough])],
411 AC_MSG_CHECKING([for NL80211_SET_CHANNEL])
412 AC_TRY_COMPILE([#include <linux/nl80211.h>],
413 [enum nl80211_commands x = NL80211_CMD_SET_CHANNEL;],
414 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_CMD_SET_CHANNEL, 1, [SET_CHANNEL is supported])],
417 AC_MSG_CHECKING([for NL80211_SPLIT_WIPHY_DUMP])
418 AC_TRY_COMPILE([#include <linux/nl80211.h>],
419 [enum nl80211_protocol_features x = NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP;],
420 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_SPLIT_WIPHY_DUMP, 1, [SPLIT_WIPHY_DUMP is supported])],
423 AC_MSG_CHECKING([for NL80211_VHT_CAPABILITY])
424 AC_TRY_COMPILE([#include <linux/nl80211.h>],
425 [enum nl80211_attrs x = NL80211_ATTR_VHT_CAPABILITY;],
426 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_VHT_CAPABILITY, 1, [VHT_CAPABILITY is supported])],
431 if test x$want_libnl != "xno" -a x$want_libnl != "xifavailable"; then
432 AC_MSG_WARN([libnl is Linux-specific, ignoring --with-libnl])
437 # FIXME: currently the path argument to with-libsmi is being ignored
441 # Check for programs used when building DocBook documentation.
443 AC_CHECK_PROGS(XSLTPROC, xsltproc, xsltproc)
444 AC_CHECK_PROGS(A2X, a2x, a2x)
445 AC_CHECK_PROGS(FOP, fop, fop)
447 # HTML to text processor
448 AC_MSG_CHECKING([for an HTML to text processor])
449 AS_IF([w3m -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=w3m],
450 [lynx -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=lynx],
452 AC_MSG_RESULT([$have_a2x_text])
453 AM_CONDITIONAL(HAVE_A2X_TEXT, [test "x$have_a2x_text" != xno])
454 AS_IF([test $have_a2x_text = lynx], [A2X_LYNX="--lynx"])
457 # Check for packaging utilities
458 # For now, we check to see if the various packaging utilites are in our
459 # path. I'm too lazy to write code to go hunt for them. - Gerald
463 # (Lets you install the desktop files.)
465 AC_PATH_PROG(DESKTOP_FILE_INSTALL, desktop-file-install)
468 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
469 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
470 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
472 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
473 -a x$HAVE_PKGTRANS = xyes ; then
474 HAVE_SVR4_PACKAGING=yes
476 HAVE_SVR4_PACKAGING=no
478 AC_SUBST(HAVE_SVR4_PACKAGING)
482 # Looks for the rpmbuild program, and checks to see if we can redefine "_topdir".
484 AC_CHECK_PROGS(RPMBUILD, [rpmbuild], [false])
485 if test "x$RPMBUILD" != "xfalse" ; then
486 AC_MSG_CHECKING([to see if we can redefine _topdir])
487 rpm --define '_topdir /tmp' > /dev/null 2>&1
488 if test $? -eq 0 ; then
492 AC_MSG_RESULT([no, you'll have to build packages manually])
496 AM_CONDITIONAL(HAVE_RPM, [test "x$have_rpm" = xyes])
499 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
502 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
503 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
504 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
506 if test x$HAVE_XCODEBUILD = xyes -a x$HAVE_HDIUTIL = xyes \
507 -a x$HAVE_BLESS = xyes ; then
508 HAVE_OSX_PACKAGING=yes
510 HAVE_OSX_PACKAGING=no
512 AC_SUBST(HAVE_OSX_PACKAGING)
515 # Use this as a proxy for "is this macOS" (just in case somebody actually
516 # built and installed Darwin as an OS, perhaps with some X11-based GUI,
517 # don't look for Darwin).
519 AC_CHECK_PROG(have_sw_vers, sw_vers, "yes", "no")
520 AM_CONDITIONAL(NOT_OS_X, test "x$have_sw_vers" = "xno")
523 AC_CHECK_PROG(HAVE_SHELLCHECK, shellcheck, "yes", "no")
524 AM_CONDITIONAL(HAVE_SHELLCHECK, test x$HAVE_SHELLCHECK = xyes)
527 # Check compiler vendor. For GCC this will be 'gnu' and for Clang 'clang'.
530 if test "x$CXX" != "x" ; then
537 # Some compilers have to be told to fail when passed an unknown -W flag;
538 # make sure we do that.
540 AC_WIRESHARK_CHECK_UNKNOWN_WARNING_OPTION_ERROR
543 # Some C++ compilers have to be told to fail when passed a -W flag that
544 # they don't think should apply to C++; make sure we do that.
546 AC_WIRESHARK_CHECK_NON_CXX_WARNING_OPTION_ERROR
549 # The following are for C and C++
551 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wall)
552 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wextra)
553 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wendif-labels)
554 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpointer-arith)
555 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wformat-security)
556 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fwrapv)
557 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-strict-overflow)
558 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-delete-null-pointer-checks)
559 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wvla)
560 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Waddress)
561 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wattributes)
562 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdiv-by-zero)
563 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wignored-qualifiers)
564 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpragmas)
565 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-overlength-strings)
566 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
567 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
570 # The following are C only, not C++
572 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wc++-compat, C)
573 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable, C)
578 # Make sure -Wshadow doesn't complain about variables in function and
579 # function pointer declarations shadowing other variables; if not, don't
580 # turn it on, as some versions of GCC (including the one in at least
581 # some Xcode versions that came with Mac OS X 10.5) complain about
584 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshadow, C,
586 extern int bar(int a);
592 int (*fptr)(int a) = bar;
597 [warns about variables in function declarations shadowing other variables])
599 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-pointer-sign, C)
600 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wold-style-definition, C)
601 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wstrict-prototypes, C)
603 # Unfortunately some versions of gcc generate logical-op warnings when strchr()
604 # is given a constant string.
605 # gcc versions 4.3.2 and 4.4.5 are known to have the problem.
606 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wlogical-op, C,
610 int foo(const char *, int);
614 foo(const char *sep, int c)
616 if (strchr (sep, c) != NULL)
625 return foo("<", 'a');
628 [generates warnings from strchr()])
630 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wjump-misses-init, C)
631 # The Qt headers generate a ton of shortening errors on 64-bit systems
632 # so only enable this for C for now.
633 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshorten-64-to-32, C)
636 # Implicit function declarations are an error in C++ and most
637 # likely a programming error in C. Turn -Wimplicit-int and
638 # -Wimplicit-function-declaration into an error by default.
640 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Werror=implicit, C)
642 # Clang only. Avoid "argument unused during compilation" warnings
643 # (for example, when getting the -gsplit-dwarf option or
644 # when combining -fwrapv with -fno-strict-overflow)
645 if test x"$ax_cv_c_compiler_vendor" = xclang; then
646 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Qunused-arguments, C)
648 if test x"$ax_cv_cxx_compiler_vendor" = xclang; then
649 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Qunused-arguments, CXX)
653 # Use the faster pre gcc 4.5 floating point precision if available.
655 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fexcess-precision=fast)
658 # Try to have the compiler default to hiding symbols, so that only
659 # symbols explicitly exported with WS_DLL_PUBLIC will be visible
660 # outside (shared) libraries; that way, more UN*X builds will catch
661 # failures to export symbols, rather than having that fail only on
664 # GCC and GCC-compatible compilers
666 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fvisibility=hidden)
667 if test "x$can_add_to_cflags" = "xno"
672 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xldscope=hidden)
673 if test "x$can_add_to_cflags" = "xno"
675 # TODO add other ways of hiding symbols
676 AC_MSG_WARN(Compiler will export all symbols from shared libraries)
681 # Try to add some additional checks to CFLAGS.
682 # These are not enabled by default, because the warnings they produce
683 # are very hard or impossible to eliminate.
685 AC_ARG_ENABLE(extra-compiler-warnings,
686 AC_HELP_STRING( [--enable-extra-compiler-warnings],
687 [do additional compiler warnings @<:@default=no@:>@]),
689 wireshark_extra_flags=$enableval
690 if test $enableval != no
693 # The following are for C and C++
695 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpedantic)
697 # As we use variadic macros, we don't want warnings
698 # about them, even with -Wpedantic.
700 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-variadic-macros)
702 # Various code blocks this one.
704 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Woverflow)
705 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
707 # Due to various places where APIs we don't control
708 # require us to cast away constness, we can probably
709 # never enable this one with -Werror.
711 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-qual)
713 # Some generated ASN.1 dissectors block this one;
714 # multiple function declarations for the same
715 # function are being generated.
717 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wredundant-decls)
719 # Some loops are safe, but it's hard to convince the
722 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunsafe-loop-optimizations)
724 # All the registration functions block these for now.
726 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-prototypes)
727 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-declarations)
729 # A bunch of "that might not work on SPARC" code blocks
732 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-align)
734 # Works only with Clang
736 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunreachable-code)
738 # Works only with Clang but generates a lot of warnings
739 # (about glib library not using Doxygen)
741 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdocumentation)
744 # The following are C only, not C++
746 # Due to various places where APIs we don't control
747 # require us to cast away constness, we can probably
748 # never enable this one with -Werror.
750 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C)
754 # Try to add ASAN address analyze.
755 # Only needed for analyse
758 AC_HELP_STRING( [--enable-asan],
759 [Enable AddressSanitizer (ASAN) for debugging (degrades performance)@<:@default=no@:>@]),
762 # With Clang >= 3.5 Leak detection is enable by default
763 # and no yet all leak is fixed...
764 # use ASAN_OPTIONS=detect_leaks=0 to disable detect_leaks
766 # XXX shouldn't this also be added to LDFLAGS?
767 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address)
769 # Disable ASAN for build-time tools, e.g. lemon
770 WS_CFLAGS_saved="$WS_CFLAGS"
771 WS_LDFLAGS_saved="$WS_LDFLAGS"
772 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-sanitize=all, C)
773 if test "x$can_add_to_cflags" = "xyes"
775 NO_SANITIZE_CFLAGS="-fno-sanitize=all"
776 NO_SANITIZE_LDFLAGS="-fno-sanitize=all"
778 WS_CFLAGS="$WS_CFLAGS_saved"
779 WS_LDFLAGS="$WS_LDFLAGS_saved"
782 AC_SUBST(NO_SANITIZE_CFLAGS)
783 AC_SUBST(NO_SANITIZE_LDFLAGS)
785 # Add check hf conflict..
787 AC_ARG_ENABLE(checkhf-conflict,
788 AC_HELP_STRING( [--enable-checkhf-conflict],
789 [Enable hf conflict check for debugging (start-up may be slower)@<:@default=no@:>@]),
791 AC_DEFINE(ENABLE_CHECK_FILTER, 1, [Enable hf conflict check])
794 AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
795 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,-M])
796 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--cref])
797 # AC_WIRESHARK_LDFLAGS_CHECK([-flto])
798 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhopr])
799 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhole-program])
802 # Put -fPIE in PIE_CFLAGS and -pie in PIE_LDFLAGS if we can use them,
803 # so that we can build dumpcap PIE - it may run with elevated
804 # privileges, and using PIE means the OS can run it at random locations
805 # in the address space to make attacks more difficult.
808 WS_CFLAGS_saved="$WS_CFLAGS"
809 WS_LDFLAGS_saved="$WS_LDFLAGS"
810 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE, C)
811 if test "x$can_add_to_cflags" = "xyes"
813 AC_WIRESHARK_LDFLAGS_CHECK([-fPIE -pie])
814 if test "x$can_add_to_ldflags" = "xyes"
821 WS_CFLAGS="$WS_CFLAGS_saved"
822 WS_LDFLAGS="$WS_LDFLAGS_saved"
824 AC_SUBST(PIE_LDFLAGS)
826 WS_CFLAGS_saved="$WS_CFLAGS"
827 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-msse4.2, C)
828 if test "x$can_add_to_cflags" = "xyes"
831 # The compiler supports -msse4.2; use that to enable SSE 4.2.
833 # We only want to apply -msse4.2 to
834 # wsutil/ws_mempbrk_sse42.c, as the SSE4.2 code there
835 # is run only if the hardware supports it, but other
836 # code would do no such checks.
838 ac_sse4_2_flag=-msse4.2
841 # Try -xarch=sse4_2; that's the flag for Sun's compiler.
843 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xarch=sse4_2, C)
844 if test "x$can_add_to_cflags" = "xyes"
847 # The compiler supports -xarch=sse4_2; use that to
849 ac_sse4_2_flag=-xarch=sse4_2
852 WS_CFLAGS="$WS_CFLAGS_saved"
854 if test "x$ac_sse4_2_flag" != x; then
856 # OK, we have a compiler flag to enable SSE 4.2.
858 # Make sure we have the necessary headers for the SSE4.2 intrinsics
859 # and that we can use them.
861 # First, check whether we have emmintrin.h and can use it
862 # *without* the SSE 4.2 flag.
864 AC_MSG_CHECKING([whether there is emmintrin.h header and we can use it])
866 [#include <emmintrin.h>],
869 emmintrin_h_works=yes
879 # OK, if that works, see whether we have nmmintrin.h and
880 # can use it *with* the SSE 4.2 flag.
882 if test "x$emmintrin_h_works" = "xyes"; then
884 # Add the SSE4.2 flags to the beginning of CFLAGS,
885 # in case the user explicitly specified -mno-sse4.2
886 # (or in case Gentoo's build tools did so); if they
887 # did so, we only want this to work if we can use
888 # the #pragma to override that for ws_mempbrk_sse42.c,
889 # and putting it at the beginning means that the
890 # CFLAGS setting in the environment will come later
893 AC_MSG_CHECKING([whether there is nmmintrin.h header and we can use it])
894 saved_CFLAGS="$CFLAGS"
895 CFLAGS="$ac_sse4_2_flag $WS_CFLAGS $CFLAGS"
897 [#include <nmmintrin.h>],
901 AC_DEFINE(HAVE_SSE4_2, 1, [Support SSSE4.2 (Streaming SIMD Extensions 4.2) instructions])
902 CFLAGS_SSE42="$ac_sse4_2_flag"
910 CFLAGS="$saved_CFLAGS"
917 dnl build libwsutil_sse42 only if there is SSE4.2
918 AM_CONDITIONAL(SSE42_SUPPORTED, test "x$have_sse42" = "xyes")
919 AC_SUBST(CFLAGS_SSE42)
922 # If we're running GCC or clang define _U_ to be "__attribute__((unused))"
923 # so we can use _U_ to flag unused function parameters and not get warnings
924 # about them. Otherwise, define _U_ to be an empty string so that _U_ used
925 # to flag an unused function parameters will compile with other compilers.
927 # XXX - similar hints for other compilers?
929 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
930 AC_DEFINE(_U_, __attribute__((unused)), [Hint to the compiler that a function parameters is not used])
931 AC_DEFINE(WS_NORETURN, __attribute((noreturn)), [Hint to the compiler that a function never returns])
933 AC_DEFINE(_U_, , [Hint to the compiler that a function parameters is not used])
934 AC_DEFINE(WS_NORETURN, , [Hint to the compiler that a function never returns])
937 # If we're running GCC or CLang, use FORTIFY_SOURCE=2
938 # (only if the GCC 'optimization level' > 0).
940 # See: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
941 # See: http://sourceware.org/bugzilla/show_bug.cgi?id=13979
943 # Note: FORTIFY_SOURCE is only effective for gcc optimization level > 0 (-O1, etc)
944 AC_WIRESHARK_GCC_FORTIFY_SOURCE_CHECK
947 # If the compiler supports GCC-style flags, enable a barrier "stop on
949 # This barrier is set for a very large part of the code. However, it is
950 # typically not set for "generated" code (flex, ans2wrs, idl2wrs, ...)
952 warnings_as_errors_default="yes"
953 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
954 AC_ARG_ENABLE(warnings-as-errors,
955 AC_HELP_STRING( [--enable-warnings-as-errors],
956 [treat warnings as errors (only for GCC or clang) @<:@default=yes, unless extra compiler warnings are enabled@:>@]),
958 if test "x$ac_supports_gcc_flags" = "xyes" -a "x$enableval" = "xyes"; then
959 with_warnings_as_errors="yes"
962 with_warnings_as_errors="no"
967 if test "x$ac_supports_gcc_flags" = "xyes" -a "x$wireshark_extra_flags" = "x" -a "x$warnings_as_errors_default" = "xyes"; then
968 with_warnings_as_errors="yes"
971 with_warnings_as_errors="no"
976 AS_IF([test "x$with_warnings_as_errors" = "xyes"], [WERROR="-Werror"], [WERROR=""])
978 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, [test "x$with_warnings_as_errors" = "xyes"])
981 # Add any platform-specific compiler flags needed.
983 AC_MSG_CHECKING(for platform-specific compiler flags)
984 if test "x$GCC" = "xyes" ; then
986 # GCC - do any platform-specific tweaking necessary.
990 # the X11 headers don't automatically include prototype info
991 # and a lot don't include the return type
992 WS_CPPFLAGS="$WS_CPPFLAGS -DFUNCPROTO=15"
993 WS_CFLAGS="$WS_CFLAGS -Wno-return-type"
994 WS_CXXFLAGS="$WS_CXXFLAGS -Wno-return-type"
995 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
998 AC_MSG_RESULT(none needed)
1003 # Not GCC - assume it's the vendor's compiler.
1008 # AC_PROG_CC_STDC should already have added whatever
1009 # flags are necessary for ISO C - C99 if available,
1010 # otherwise C89 - with extensions.
1012 # Add +O2, for optimization, as suggested by Jost Martin.
1013 # XXX - works with "-g"?
1015 # +O2 is supported both by the C and C++ compiler.
1017 WS_CFLAGS="+O2 $WS_CFLAGS"
1018 if test "$CC" = "$CC_FOR_BUILD"; then
1020 # We're building the build tools with the same
1021 # compiler as the one with which we're building
1022 # Wireshark, so add the flags to the flags for
1023 # that compiler as well.
1025 CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
1027 WS_CXXFLAGS="+O2 $WS_CXXFLAGS"
1028 AC_MSG_RESULT(HP C/C++ compiler - added +O2)
1032 # Crank up the warning level.
1034 WS_CFLAGS="$WS_CFLAGS -v"
1035 WS_CXXFLAGS="$WS_CXXFLAGS +w2"
1038 AC_MSG_RESULT(none needed)
1044 # Add any platform-specific linker flags needed.
1046 AC_MSG_CHECKING(for platform-specific linker flags)
1050 # If this is GCC or Clang, Add -Wl,-bbigtoc for big libraries.
1051 # XXX - what if we're using xlc? Is that necessary? The
1052 # xlc 7.0 manual says "Specifying -qpic=large has the same
1053 # effect as passing -bbigtoc to ld"; do we need to tell xlc,
1054 # when it's compiling, to generate different code for a large
1055 # TOC, or is that just a linker flag? For that matter, do we
1056 # have to tell GCC or Clang to generate different code for a
1059 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
1060 LDFLAGS_BIGSHAREDLIB="-Wl,-bbigtoc"
1061 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])
1066 # Add -Wl,-single_module to the LDFLAGS used with shared
1067 # libraries, to fix some error that show up in some cases;
1068 # some Apple documentation recommends it for most shared
1071 LDFLAGS_SHAREDLIB="-Wl,-single_module"
1073 # Add -Wl,-headerpad_max_install_names to the LDFLAGS, as
1074 # code-signing issues is running out of padding space.
1076 # Add -Wl,-search_paths_first to make sure that if we search
1077 # directories A and B, in that order, for a given library, a
1078 # non-shared version in directory A, rather than a shared
1079 # version in directory B, is chosen (so we can use
1080 # --with-pcap=/usr/local to force all programs to be linked
1081 # with a static version installed in /usr/local/lib rather than
1082 # the system version in /usr/lib).
1084 WS_LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first $WS_LDFLAGS"
1085 AC_MSG_RESULT([Apple linker - added -Wl,-single_module to shared library linker flags and -Wl,-headerpad_max_install_names -Wl,-search_paths_first and -Wl,-headerpad_max_install_names to all linker flags])
1089 # Shared libraries in cygwin/Win32 must never contain
1090 # undefined symbols.
1092 WS_LDFLAGS="$WS_LDFLAGS -no-undefined"
1093 AC_MSG_RESULT(Cygwin GNU ld - added -no-undefined)
1096 AC_MSG_RESULT(none needed)
1099 AC_SUBST(LDFLAGS_BIGSHAREDLIB)
1100 AC_SUBST(LDFLAGS_SHAREDLIB)
1103 # On "Darwin", which we assume to mean "macOS" rather than "iOS" or
1104 # "just Darwin" (as we don't currently support iOS, and as I don't
1105 # think you can build and run "just Darwin" as an OS for PCs), we
1106 # arrange to build some programs with Application Services so they
1107 # can launch Web browsers and Finder windows, arrange to build some
1108 # programs with System Configuration so they can get "friendly names"
1109 # and other information about interfaces, and build any programs that
1110 # use either of those frameworks or that report version information
1111 # with Core Foundation as the frameworks in question use it and as we
1112 # get version information from plists and thus need Core Foundation
1113 # to process those plists.
1115 have_os_x_frameworks=no
1118 have_os_x_frameworks=yes
1119 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have macOS frameworks])
1120 APPLICATIONSERVICES_FRAMEWORKS="-framework ApplicationServices"
1121 SYSTEMCONFIGURATION_FRAMEWORKS="-framework SystemConfiguration"
1122 COREFOUNDATION_FRAMEWORKS="-framework CoreFoundation"
1125 # OK, so we have the macOS frameworks; do they include
1126 # CFPropertyListCreateWithStream, or do we have
1127 # to fall back on CFPropertyListCreateFromStream?
1128 # (They only differ in the error return, which we
1129 # don't care about. And, no, we shouldn't just
1130 # use CFPropertyListCreateFromStream, because it's
1131 # deprecated in newer releases.)
1133 ac_save_LIBS="$LIBS"
1134 LIBS="$LIBS $COREFOUNDATION_FRAMEWORKS"
1135 AC_CHECK_FUNCS(CFPropertyListCreateWithStream)
1136 LIBS="$ac_save_LIBS"
1139 AC_SUBST(APPLICATIONSERVICES_FRAMEWORKS)
1140 AC_SUBST(SYSTEMCONFIGURATION_FRAMEWORKS)
1141 AC_SUBST(COREFOUNDATION_FRAMEWORKS)
1142 AM_CONDITIONAL(HAVE_OS_X_FRAMEWORKS, [test "x$have_os_x_frameworks" = "xyes"])
1145 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
1150 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
1151 if test x$LD_LIBRARY_PATH != x ; then
1152 LIBS="$LIBS -R$LD_LIBRARY_PATH"
1153 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
1155 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
1160 # Enable/disable wireshark
1161 AC_ARG_ENABLE(wireshark,
1162 AC_HELP_STRING( [--enable-wireshark],
1163 [build the Wireshark GUI (with Gtk+, Qt, or both) @<:@default=yes@:>@]),
1164 enable_wireshark=$enableval,enable_wireshark=yes)
1165 AM_CONDITIONAL(BUILDING_WIRESHARK, test x$enable_wireshark = xyes)
1167 AC_ARG_ENABLE(packet-editor,
1168 AC_HELP_STRING( [--enable-packet-editor],
1169 [add support for packet editor in Wireshark @<:@default=yes@:>@]),
1170 enable_packet_editor=$enableval,enable_packet_editor=yes)
1171 if test x$enable_packet_editor = xyes; then
1172 AC_DEFINE(WANT_PACKET_EDITOR, 1, [Support for packet editor])
1175 AC_ARG_ENABLE(profile-build,
1176 AC_HELP_STRING( [--enable-profile-build],
1177 [build profile-ready binaries @<:@default=no@:>@]),
1178 enable_profile_build=$enableval,enable_profile_build=no)
1179 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
1180 AC_MSG_CHECKING(if profile builds must be generated)
1181 if test "x$enable_profile_build" = "xyes" ; then
1182 if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
1184 WS_CFLAGS="-pg $WS_CFLAGS"
1185 WS_CXXFLAGS="-pg $WS_CXXFLAGS"
1188 echo "Building profile binaries currently only supported for GCC and clang."
1194 GLIB_MIN_VERSION=2.22.0
1195 AC_SUBST(GLIB_MIN_VERSION)
1196 # GLib checks; we require GLib $GLIB_MIN_VERSION or later, and require gmodule
1197 # support, as we need that for dynamically loading plugins.
1199 # Release dates for GLib versions:
1200 # 2.14.0: 03 Aug 2007
1201 # 2.16.0: 10 Mar 2008
1202 # 2.18.0: 02 Sep 2008
1203 # 2.20.0: 13 Mar 2009
1204 # 2.22.0: 22 Sep 2009
1205 # 2.24.0: 28 Mar 2010
1206 # 2.26.0: 27 Sep 2010
1207 # 2.28.0: 08 Feb 2011
1208 # 2.30.0: 27 Sep 2011
1209 # 2.32.0: 24 Mar 2012
1210 # 2.34.0: 24 Sep 2012
1211 # 2.36.0: 25 Mar 2013
1212 # 2.38.0: 23 Sep 2013
1213 # 2.40.0: 24 Mar 2014
1214 # 2.42.0: 22 Sep 2014
1215 # 2.44.0: 23 Mar 2014
1216 # 2.46.0: 25 Sep 2015
1218 PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GLIB],
1219 [glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
1220 [GLIB_VERSION=`$PKG_CONFIG --modversion glib-2.0`],
1221 [AC_MSG_ERROR([GLib $GLIB_MIN_VERSION or later not found.])])
1223 # Error out if a glib header other than a "top level" header
1224 # (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
1226 AX_APPEND_FLAG([-DG_DISABLE_SINGLE_INCLUDES], [GLIB_CONFIG])
1228 # Error out on the usage of deprecated glib functions
1229 AX_APPEND_FLAG([-DG_DISABLE_DEPRECATED], [GLIB_CONFIG])
1231 GLIB_CFLAGS="$GLIB_CONFIG $GLIB_CFLAGS"
1232 AC_SUBST(GLIB_CFLAGS)
1235 GTK2_MIN_VERSION=2.12.0
1236 AC_SUBST(GTK2_MIN_VERSION)
1237 GTK3_MIN_VERSION=3.0.0
1238 AC_SUBST(GTK3_MIN_VERSION)
1239 QT_MIN_VERSION=4.8.0
1240 AC_SUBST(QT_MIN_VERSION)
1241 # GTK+ and Qt checks; we require GTK+ $GTK2_MIN_VERSION or later or
1242 # GTK3_MIN_VERSION or later or Qt $QT_MIN_VERSION or later.
1244 # We only do those if we're going to be building Wireshark;
1245 # otherwise, we don't have any GUI to build, so we don't use
1248 # We don't add $GTK_LIBS or $Qt_LIBS to LIBS, because we don't want to
1249 # force all programs to be built with GTK+ or Qt.
1251 # For a list of library versions and their support across different platforms,
1252 # see https://wiki.wireshark.org/Development/Support_library_version_tracking
1256 if test "x$enable_wireshark" = "xyes"; then
1257 if test "x$with_qt" != "xno"; then
1259 # Qt was specified; make sure we have a C++ compiler.
1261 if test -z "$CXX"; then
1262 AC_MSG_ERROR(Need a working C++ compiler to build Wireshark with Qt)
1266 # Now make sure we have Qt and, if so, add the flags
1267 # for it to CFLAGS and CXXFLAGS.
1269 AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION, "$with_qt",
1274 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-qt"
1277 # We're building with Qt, so we need the Qt build
1278 # tools in order to build the Wireshark GUI.
1279 # We've found a particular major version of Qt,
1280 # and we want that version's build tools; for
1281 # example, the Qt 4 version of uic produces files
1282 # that include Qt headers with paths that work
1283 # with Qt 4 but not Qt 5, so we can't use the
1284 # Qt 4 version of uic if we're building with Qt 5.
1285 AC_WIRESHARK_QT_TOOL_CHECK(UIC, uic, "$qt_version")
1287 AC_WIRESHARK_QT_TOOL_CHECK(MOC, moc, "$qt_version")
1289 AC_WIRESHARK_QT_TOOL_CHECK(RCC, rcc, "$qt_version")
1291 AC_WIRESHARK_QT_TOOL_CHECK_LRELEASE("$qt_version")
1295 # On Darwin, make sure we're using Qt5 or later.
1296 # If so, find where the Qt frameworks are located
1297 # and add that to the rpath, just in case this is
1298 # Qt 5.5 or later and the frameworks have an
1299 # install name that begins with @rpath and aren't
1300 # installed in a frameworks directory that's
1301 # searched by default.
1305 if test $qt_version -le 4
1307 AC_MSG_ERROR([macOS builds should use Qt5])
1309 Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs Qt${qt_version}Core | sed -e 's/-F//' -e 's/ -framework.*//'`
1313 AC_SUBST(Qt_LDFLAGS)
1315 if test -z "${MOC_OPTIONS+1}"
1317 # Squelch moc verbose "nothing to do" output
1318 if test $QT_VERSION_MAJOR -eq 5
1321 elif test $QT_VERSION_MAJOR -eq 4 -a $QT_VERSION_MINOR -ge 8
1326 AC_SUBST(MOC_OPTIONS)
1333 # They didn't explicitly ask for Qt,
1334 # so just don't build with it.
1339 AC_MSG_ERROR([Qt is not available])
1343 AC_MSG_ERROR([Qt 4 is not available])
1347 AC_MSG_ERROR([Qt 5 is not available])
1353 for want_gtk_version in $with_gtk; do
1354 AS_CASE([$want_gtk_version],
1355 [3], [PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
1356 [gtk+-3.0 >= $GTK3_MIN_VERSION glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
1359 GTK_VERSION=`$PKG_CONFIG --modversion gtk+-3.0`
1360 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk=3"
1365 [2], [PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
1366 [gtk+-2.0 >= $GTK2_MIN_VERSION glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
1369 GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
1370 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk=2"
1375 [fail3], [AC_MSG_ERROR([GTK+ 3 was requested but is not available])],
1376 [fail2], [AC_MSG_ERROR([GTK+ 2 was requested but is not available])],
1377 [fail], [AC_MSG_ERROR([GTK+ was requested but is not available])])
1379 AS_IF([test "x$have_gtk" = xyes], [break])
1382 if test "$have_gtk" = "yes" ; then
1383 # If we have GTK then add flags for it.
1387 GTK_CONFIG="$GLIB_CONFIG"
1389 gtk_major_version=`echo $GTK_VERSION | cut -d. -f1`
1390 gtk_minor_version=`echo $GTK_VERSION | cut -d. -f2`
1392 AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATED], [GTK_CONFIG])
1393 if test \( $gtk_major_version -eq 3 -a $gtk_minor_version -ge 10 \) ; then
1394 ## Allow use of deprecated & disable deprecated warnings if Gtk >= 3.10;
1395 ## The deprecations in Gtk 3.10 will not be fixed ...
1396 AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATION_WARNINGS], [GTK_CONFIG])
1398 AX_APPEND_FLAG([-DGTK_DISABLE_DEPRECATED], [GTK_CONFIG])
1400 AX_APPEND_FLAG([-DGTK_DISABLE_SINGLE_INCLUDES], [GTK_CONFIG])
1401 if test ! \( $gtk_major_version -eq 2 -a $gtk_minor_version -lt 20 \) ; then
1402 # Enable GSEAL when building with GTK > 2.20
1403 # (Versions prior to 2.22 lacked some necessary accessors.)
1404 AX_APPEND_FLAG([-DGSEAL_ENABLE], [GTK_CONFIG])
1407 GTK_CFLAGS="$GTK_CONFIG $GTK_CFLAGS"
1411 AC_SUBST(GTK_CFLAGS)
1413 AC_SUBST(GUI_CONFIGURE_FLAGS)
1415 # Check for GTK GUI support for GResource pixbufs
1416 have_gresource_pixbuf=no
1417 if test "x$have_gtk" = "xyes"; then
1418 AC_MSG_CHECKING(whether GDK-Pixbuf can load data using GResource)
1419 PKG_CHECK_EXISTS([gio-2.0 >= 2.32 gdk-pixbuf-2.0 >= 2.26],
1422 AC_DEFINE(HAVE_GDK_GRESOURCE, 1, [Defined if GResource is supported])
1423 have_gresource_pixbuf=yes
1425 [AC_MSG_RESULT(no)])
1427 AM_CONDITIONAL(HAVE_GRESOURCE_PIXBUF, test "x$have_gresource_pixbuf" = "xyes")
1429 if test "$have_gtk" = "yes" -a "$have_qt" = "yes" ; then
1430 # We have both GTK and Qt and thus will be building both wireshark
1431 # and wireshark-gtk.
1433 wireshark_bin="wireshark\$(EXEEXT) wireshark-gtk\$(EXEEXT)"
1434 wireshark_man="wireshark.1"
1435 wireshark_SUBDIRS="codecs ui/qt ui/gtk"
1436 elif test "$have_gtk" = "no" -a "$have_qt" = "yes" ; then
1437 # We don't have GTK+ but we have Qt.
1439 wireshark_bin="wireshark\$(EXEEXT)"
1440 wireshark_man="wireshark.1"
1441 wireshark_SUBDIRS="codecs ui/qt"
1442 elif test "$have_gtk" = "yes" -a "$have_qt" = "no" ; then
1443 # We have GTK+ but not Qt.
1445 wireshark_bin="wireshark-gtk\$(EXEEXT)"
1446 wireshark_man="wireshark.1"
1447 wireshark_SUBDIRS="codecs ui/gtk"
1448 OSX_APP_FLAGS="$OSX_APP_FLAGS -gtk"
1449 OSX_DMG_FLAGS="-gtk"
1450 elif test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
1451 # We have neither GTK+ nor Qt.
1453 # If they didn't explicitly say "--disable-wireshark",
1454 # fail (so that, unless they explicitly indicated that
1455 # they don't want Wireshark, we stop so they know they
1456 # won't be getting Wireshark unless they fix the GTK+/Qt
1459 if test "x$enable_wireshark" = "xyes"; then
1460 if test "$with_qt" != "no" -a "$with_gtk" != "no" ; then
1461 AC_MSG_ERROR([Neither Qt nor GTK+ are available, so Wireshark can't be compiled])
1462 elif test "$with_qt" != "no" -a "$with_gtk" = "no" ; then
1463 AC_MSG_ERROR([Qt is not available and GTK+ was not requested, so Wireshark can't be compiled])
1464 elif test "$with_qt" = "no" -a "$with_gtk" != "no" ; then
1465 AC_MSG_ERROR([Qt was not requested and GTK+ is not available, so Wireshark can't be compiled])
1466 elif test "$with_qt" = "no" -a "$with_gtk" = "no" ; then
1467 AC_MSG_ERROR([Neither Qt nor GTK+ were requested, so Wireshark can't be compiled])
1472 wireshark_SUBDIRS=""
1476 # Check whether GLib modules are supported, to determine whether we
1477 # can support plugins.
1480 AC_CACHE_CHECK([whether GLib supports loadable modules],
1481 [ac_cv_glib_supports_modules], [
1482 ac_save_CFLAGS="$CFLAGS"
1483 ac_save_LIBS="$LIBS"
1484 CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
1485 LIBS="$LIBS $GLIB_LIBS"
1488 #include <gmodule.h>
1495 if (g_module_supported())
1496 return 0; /* success */
1498 return 1; /* failure */
1500 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
1501 [echo $ac_n "cross compiling; assumed OK... $ac_c"
1502 ac_cv_glib_supports_modules=yes])
1503 CFLAGS="$ac_save_CFLAGS"
1504 LIBS="$ac_save_LIBS"
1506 if test "$ac_cv_glib_supports_modules" = yes ; then
1508 plugins_dir="plugins"
1513 AC_SUBST(plugins_dir)
1516 # If we have <dlfcn.h>, check whether we have dladdr.
1518 if test "$ac_cv_header_dlfcn_h" = "yes"
1521 # Use GLib compiler flags and linker flags; GLib's gmodule
1522 # stuff uses the dl APIs if available, so it might know
1523 # what flags are needed.
1525 ac_save_CFLAGS="$CFLAGS"
1526 ac_save_LIBS="$LIBS"
1527 CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
1528 LIBS="$LIBS $GLIB_LIBS"
1529 AC_CHECK_FUNCS(dladdr)
1530 if test x$ac_cv_func_dladdr = xno
1533 # OK, try it with -ldl, in case you need that to get
1534 # dladdr(). For some reason, on Linux, that's not
1535 # part of the GLib flags; perhaps GLib itself is
1536 # linked with libdl, so that you can link with
1537 # Glib and it'll pull libdl in itself.
1540 AC_CHECK_FUNCS(dladdr)
1542 CFLAGS="$ac_save_CFLAGS"
1543 LIBS="$ac_save_LIBS"
1547 # Check whether GLib's printf supports thousands grouping. (This might
1548 # be different from the system's printf since GLib can optionally use
1549 # its own printf implementation.)
1551 AC_CACHE_CHECK([whether GLib supports POSIX/XSI thousands grouping],
1552 [ac_cv_glib_supports_printf_grouping], [
1553 ac_save_CFLAGS="$CFLAGS"
1554 ac_save_LIBS="$LIBS"
1555 CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
1556 LIBS="$LIBS $GLIB_LIBS"
1567 setlocale(LC_ALL, "en_US.UTF-8");
1568 str = g_strdup_printf("%'u", 123456);
1569 return (strcmp (str, "123,456") != 0);
1571 ], ac_cv_glib_supports_printf_grouping=yes, ac_cv_glib_supports_printf_grouping=no,
1572 [echo $ac_n "cross compiling; playing it safe... $ac_c"
1573 ac_cv_glib_supports_printf_grouping=no])
1574 CFLAGS="$ac_save_CFLAGS"
1575 LIBS="$ac_save_LIBS"
1577 if test "$ac_cv_glib_supports_printf_grouping" = yes ; then
1578 AC_DEFINE(HAVE_GLIB_PRINTF_GROUPING, 1, [Define if GLib's printf functions support thousands grouping.])
1581 if test "x$have_gtk" = "xyes"
1584 # We have GTK+; do we want the macOS integration functions and,
1585 # if so, do we have them and, if so, which versions do we have,
1586 # the old Carbon-based ones or the new Cocoa-based ones?
1588 AC_MSG_CHECKING(whether to use macOS integration functions)
1590 AC_ARG_WITH(osx-integration,
1591 AC_HELP_STRING( [--with-osx-integration],
1592 [use macOS integration functions @<:@default=yes, if available@:>@]),
1594 if test $withval = no
1596 want_osx_integration=no
1598 want_osx_integration=yes
1601 want_osx_integration=yes
1603 if test "x$want_osx_integration" = "xno"; then
1607 AC_WIRESHARK_OSX_INTEGRATION_CHECK
1611 AC_SUBST(wireshark_bin)
1612 AC_SUBST(wireshark_man)
1613 AC_SUBST(wireshark_SUBDIRS)
1614 AM_CONDITIONAL(HAVE_Qt, test "$have_qt" = "yes")
1615 AM_CONDITIONAL(HAVE_GTK, test "$have_gtk" = "yes")
1616 AC_SUBST(OSX_APP_FLAGS)
1617 AC_SUBST(OSX_DMG_FLAGS)
1619 # Enable/disable tshark
1620 AC_ARG_ENABLE(tshark,
1621 AC_HELP_STRING( [--enable-tshark],
1622 [build tshark @<:@default=yes@:>@]),
1623 tshark=$enableval,enable_tshark=yes)
1625 if test "x$enable_tshark" = "xyes" ; then
1626 tshark_bin="tshark\$(EXEEXT)"
1627 tshark_man="tshark.1"
1628 wiresharkfilter_man="wireshark-filter.4"
1633 AC_SUBST(tshark_bin)
1634 AC_SUBST(tshark_man)
1636 # Enable/disable editcap
1638 AC_ARG_ENABLE(editcap,
1639 AC_HELP_STRING( [--enable-editcap],
1640 [build editcap @<:@default=yes@:>@]),
1641 enable_editcap=$enableval,enable_editcap=yes)
1643 if test "x$enable_editcap" = "xyes" ; then
1644 editcap_bin="editcap\$(EXEEXT)"
1645 editcap_man="editcap.1"
1650 AC_SUBST(editcap_bin)
1651 AC_SUBST(editcap_man)
1654 # Enabling/disabling of dumpcap is done later (after we know if we have PCAP
1657 # Enable/disable capinfos
1659 AC_ARG_ENABLE(capinfos,
1660 AC_HELP_STRING( [--enable-capinfos],
1661 [build capinfos @<:@default=yes@:>@]),
1662 enable_capinfos=$enableval,enable_capinfos=yes)
1664 if test "x$enable_capinfos" = "xyes" ; then
1665 capinfos_bin="capinfos\$(EXEEXT)"
1666 capinfos_man="capinfos.1"
1671 AC_SUBST(capinfos_bin)
1672 AC_SUBST(capinfos_man)
1674 # Enable/disable captype
1676 AC_ARG_ENABLE(captype,
1677 AC_HELP_STRING( [--enable-captype],
1678 [build captype @<:@default=yes@:>@]),
1679 enable_captype=$enableval,enable_captype=yes)
1681 if test "x$enable_captype" = "xyes" ; then
1682 captype_bin="captype\$(EXEEXT)"
1683 captype_man="captype.1"
1688 AC_SUBST(captype_bin)
1689 AC_SUBST(captype_man)
1691 # Enable/disable mergecap
1693 AC_ARG_ENABLE(mergecap,
1694 AC_HELP_STRING( [--enable-mergecap],
1695 [build mergecap @<:@default=yes@:>@]),
1696 enable_mergecap=$enableval,enable_mergecap=yes)
1698 if test "x$enable_mergecap" = "xyes" ; then
1699 mergecap_bin="mergecap\$(EXEEXT)"
1700 mergecap_man="mergecap.1"
1705 AC_SUBST(mergecap_bin)
1706 AC_SUBST(mergecap_man)
1708 # Enable/disable reordercap
1710 AC_ARG_ENABLE(reordercap,
1711 AC_HELP_STRING( [--enable-reordercap],
1712 [build reordercap @<:@default=yes@:>@]),
1713 enable_reordercap=$enableval,enable_reordercap=yes)
1715 if test "x$enable_reordercap" = "xyes" ; then
1716 reordercap_bin="reordercap\$(EXEEXT)"
1717 reordercap_man="reordercap.1"
1722 AC_SUBST(reordercap_bin)
1723 AC_SUBST(reordercap_man)
1725 # Enable/disable text2pcap
1727 AC_ARG_ENABLE(text2pcap,
1728 AC_HELP_STRING( [--enable-text2pcap],
1729 [build text2pcap @<:@default=yes@:>@]),
1730 text2pcap=$enableval,enable_text2pcap=yes)
1732 if test "x$enable_text2pcap" = "xyes" ; then
1733 text2pcap_bin="text2pcap\$(EXEEXT)"
1734 text2pcap_man="text2pcap.1"
1739 AC_SUBST(text2pcap_bin)
1740 AC_SUBST(text2pcap_man)
1742 # Enable/disable dftest
1744 AC_ARG_ENABLE(dftest,
1745 AC_HELP_STRING( [--enable-dftest],
1746 [build dftest @<:@default=yes@:>@]),
1747 enable_dftest=$enableval,enable_dftest=yes)
1749 if test "x$enable_dftest" = "xyes" ; then
1750 dftest_bin="dftest\$(EXEEXT)"
1751 dftest_man="dftest.1"
1756 AC_SUBST(dftest_bin)
1757 AC_SUBST(dftest_man)
1759 # Enable/disable randpkt
1761 AC_ARG_ENABLE(randpkt,
1762 AC_HELP_STRING( [--enable-randpkt],
1763 [build randpkt @<:@default=yes@:>@]),
1764 enable_randpkt=$enableval,enable_randpkt=yes)
1766 if test "x$enable_randpkt" = "xyes" ; then
1767 randpkt_bin="randpkt\$(EXEEXT)"
1768 randpkt_man="randpkt.1"
1773 AC_SUBST(randpkt_bin)
1774 AC_SUBST(randpkt_man)
1776 AC_SUBST(wiresharkfilter_man)
1779 AC_MSG_CHECKING(whether to use libpcap for packet capture)
1782 AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
1783 [use libpcap for packet capturing @<:@default=yes@:>@]),
1785 if test $withval = no
1788 elif test $withval = yes
1799 if test "x$want_pcap" = "xno" ; then
1803 AC_WIRESHARK_PCAP_CHECK
1807 AC_MSG_CHECKING(whether to build dumpcap)
1809 AC_ARG_ENABLE(dumpcap,
1810 AC_HELP_STRING( [--enable-dumpcap],
1811 [build dumpcap @<:@default=yes@:>@]),
1812 enable_dumpcap=$enableval,enable_dumpcap=yes)
1814 if test "x$enable_dumpcap" = "xyes" ; then
1815 if test "x$want_pcap" = "xno" ; then
1817 AC_MSG_RESULT(pcap not available - disabling dumpcap)
1825 if test "x$enable_dumpcap" = "xyes" ; then
1826 dumpcap_bin="dumpcap\$(EXEEXT)"
1827 dumpcap_man="dumpcap.1"
1832 AC_SUBST(dumpcap_bin)
1833 AC_SUBST(dumpcap_man)
1835 # Enable/disable rawshark
1838 AC_MSG_CHECKING(whether to build rawshark)
1840 AC_ARG_ENABLE(rawshark,
1841 AC_HELP_STRING( [--enable-rawshark],
1842 [build rawshark @<:@default=yes@:>@]),
1843 rawshark=$enableval,enable_rawshark=yes)
1845 if test "x$enable_rawshark" = "xyes" ; then
1846 if test "x$want_pcap" = "xno" ; then
1848 AC_MSG_RESULT(pcap not available - disabling rawshark)
1856 if test "x$enable_rawshark" = "xyes" ; then
1857 rawshark_bin="rawshark\$(EXEEXT)"
1858 rawshark_man="rawshark.1"
1863 AC_SUBST(rawshark_bin)
1864 AC_SUBST(rawshark_man)
1866 # Enable/disable sharkd
1867 AC_ARG_ENABLE(sharkd,
1868 AC_HELP_STRING( [--enable-sharkd],
1869 [build sharkd @<:@default=yes@:>@]),
1870 sharkd=$enableval,enable_sharkd=yes)
1872 if test "x$enable_sharkd" = "xyes" ; then
1873 sharkd_bin="sharkd\$(EXEEXT)"
1877 AC_SUBST(sharkd_bin)
1879 # Enable/disable echld
1880 AC_ARG_ENABLE(echld,
1881 AC_HELP_STRING( [--enable-echld],
1882 [support echld (Experimental) @<:@default=no@:>@]),
1883 have_echld=$enableval,have_echld=no)
1885 AM_CONDITIONAL(HAVE_ECHLD, test "x$have_echld" = "xyes")
1886 if test "x$have_echld" = "xyes"
1888 AC_DEFINE(HAVE_ECHLD, 1, [Define if echld is enabled])
1889 echld_test_bin="echld_test\$(EXEEXT)"
1896 AC_SUBST(echld_test_bin)
1899 # Enable/disable tfshark
1900 AC_ARG_ENABLE(tfshark,
1901 AC_HELP_STRING( [--enable-tfshark],
1902 [build tfshark (Experimental) @<:@default=no@:>@]),
1903 tfshark=$enableval,enable_tfshark=no)
1905 if test "x$enable_tfshark" = "xyes" ; then
1906 tfshark_bin="tfshark\$(EXEEXT)"
1907 tfshark_man="tfshark.1"
1908 wiresharkfilter_man="wireshark-filter.4"
1913 AC_SUBST(tfshark_bin)
1914 AC_SUBST(tfshark_man)
1917 dnl Use pcap-ng by default
1918 AC_ARG_ENABLE(pcap-ng-default,
1919 AC_HELP_STRING( [--enable-pcap-ng-default],
1920 [use the pcap-ng file format by default instead of pcap @<:@default=yes@:>@]),
1921 enable_pcap_ng_default=$enableval,enable_pcap_ng_default=yes)
1922 if test x$enable_pcap_ng_default = xyes; then
1923 AC_DEFINE(PCAP_NG_DEFAULT, 1, [Support for pcap-ng])
1926 dnl pcap remote check
1927 AC_MSG_CHECKING(whether to use libpcap remote capturing feature)
1929 AC_ARG_WITH(pcap-remote,
1930 AC_HELP_STRING([--with-pcap-remote],
1931 [use libpcap remote capturing (requires libpcap)]),
1933 if test $withval = no
1937 want_pcap_remote=yes
1942 if test "x$want_pcap_remote" = "xno" -o "x$want_pcap" = "xno" ; then
1946 AC_WIRESHARK_PCAP_REMOTE_CHECK
1950 AC_MSG_CHECKING(whether to use zlib for gzip compression and decompression)
1953 AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
1954 [use zlib (located in directory DIR, if supplied) for gzip compression and decompression @<:@default=yes, if available@:>@]),
1956 if test "x$withval" = "xno"
1959 elif test "x$withval" = "xyes"
1968 # Use zlib if it's present, otherwise don't.
1970 want_zlib=ifavailable
1973 if test "x$want_zlib" = "xno" ; then
1977 AC_WIRESHARK_ZLIB_CHECK
1978 if test "x$want_zlib" = "xno" ; then
1979 AC_MSG_RESULT(zlib not found - disabling gzip compression and decompression)
1981 if test "x$ac_cv_func_inflatePrime" = "xno" ; then
1982 AC_MSG_RESULT(inflatePrime not found in zlib - disabling gzipped capture file support)
1989 AC_MSG_CHECKING(whether to use lz4 compression and decompression)
1992 AC_HELP_STRING([--with-lz4@<:@=DIR@:>@],
1993 [use lz4 (located in directory DIR, if supplied) for lz4 compression and decompression @<:@default=yes, if available@:>@]),
1995 if test "x$withval" = "xno"
1998 elif test "x$withval" = "xyes"
2007 # Use lz4 if it's present, otherwise don't.
2009 want_lz4=ifavailable
2013 if test "x$want_lz4" = "xno" ; then
2017 AC_WIRESHARK_LZ4_CHECK
2018 if test "x$want_lz4" = "xno" ; then
2019 AC_MSG_RESULT(lz4 not found - disabling lz4 compression and decompression)
2021 if test "x$ac_cv_func_LZ4_decompress_safe" = "xno" ; then
2022 AC_MSG_RESULT(LZ4_decompress_safe not found in lz4 - disabling cql lz4 decompression)
2032 AC_MSG_CHECKING(whether to use snappy compression and decompression)
2035 AC_HELP_STRING([--with-snappy@<:@=DIR@:>@],
2036 [use snappy (located in directory DIR, if supplied) for snappy compression and decompression @<:@default=yes, if available@:>@]),
2038 if test "x$withval" = "xno"
2041 elif test "x$withval" = "xyes"
2046 snappy_dir="$withval"
2050 # Use snappy if it's present, otherwise don't.
2052 want_snappy=ifavailable
2056 if test "x$want_snappy" = "xno" ; then
2060 AC_WIRESHARK_SNAPPY_CHECK
2061 if test "x$want_snappy" = "xno" ; then
2062 AC_MSG_RESULT(snappy not found - disabling snappy compression and decompression)
2064 if test "x$ac_cv_func_snappy_uncompress" = "xno" ; then
2065 AC_MSG_RESULT(snappy_uncompress not found in snappy - disabling cql snappy decompression)
2071 AC_SUBST(SNAPPY_LIBS)
2075 AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
2076 [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin @<:@default=yes, if available@:>@]),
2078 if test $withval = no
2081 elif test $withval = yes
2086 want_lua_dir=$withval
2089 # By default use Lua if we can find it
2090 want_lua=ifavailable
2093 if test "x$want_lua" != "xno" ; then
2094 AC_WIRESHARK_LIBLUA_CHECK
2096 if test "x$want_lua" = "xyes" -a "x$have_lua" = "xno"
2098 AC_MSG_ERROR([Lua support was requested, but is not available])
2101 if test "x$have_lua" = "xyes"
2103 AC_DEFINE(HAVE_LUA, 1, [Define to use Lua])
2105 AM_CONDITIONAL(HAVE_LIBLUA, test x$have_lua = xyes)
2107 AC_SUBST(LUA_CFLAGS)
2111 AC_MSG_CHECKING(whether to use libportaudio for the GTK+ RTP player)
2113 AC_ARG_WITH(portaudio,
2114 AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
2115 [use libportaudio (located in directory DIR, if supplied) for the GTK+ RTP player @<:@default=yes, if available@:>@]),
2117 if test $withval = no
2120 elif test $withval = yes
2125 portaudio_dir=$withval
2129 # Use libportaudio by default
2131 want_portaudio=ifavailable
2134 if test "x$want_portaudio" = "xno" ; then
2138 AC_WIRESHARK_LIBPORTAUDIO_CHECK
2139 if test "x$want_portaudio" = "xno" ; then
2140 AC_MSG_RESULT(libportaudio not found - disabling support for the GTK+ RTP player)
2143 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
2146 dnl Check if dumpcap should be installed with filesystem capabilities
2147 AC_PATH_PROG(SETCAP, setcap)
2148 AC_ARG_ENABLE(setcap-install,
2149 AC_HELP_STRING( [--enable-setcap-install],
2150 [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
2151 enable_setcap_install=$enableval,enable_setcap_install=no)
2153 AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
2154 if test "x$enable_setcap_install" = "xno" ; then
2157 if test "x$SETCAP" = "x" ; then
2158 AC_MSG_RESULT(setcap not found)
2159 AC_MSG_ERROR([Setcap install was requested, but setcap was not found])
2160 elif test "x$enable_dumpcap" = "xno" ; then
2161 AC_MSG_RESULT(dumpcap disabled)
2162 AC_MSG_ERROR([Setcap install works only with dumpcap, but dumpcap is disabled])
2168 AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
2170 dnl Check if dumpcap should be installed setuid
2171 AC_ARG_ENABLE(setuid-install,
2172 AC_HELP_STRING( [--enable-setuid-install],
2173 [install dumpcap as setuid @<:@default=no@:>@]),
2174 enable_setuid_install=$enableval,enable_setuid_install=no)
2176 AC_MSG_CHECKING(whether to install dumpcap setuid)
2177 if test "x$enable_setuid_install" = "xno" ; then
2180 if test "x$enable_setcap_install" = "xyes" ; then
2181 enable_setuid_install=no
2182 AC_MSG_RESULT(setcap and setuid both selected)
2183 AC_MSG_ERROR(You must choose one of setcap install and setuid install)
2184 elif test "x$enable_dumpcap" = "xno" ; then
2185 AC_MSG_RESULT(dumpcap disabled)
2186 AC_MSG_ERROR([Setuid install works only with dumpcap, but dumpcap is disabled])
2192 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
2193 AC_CHECK_FUNCS(setresuid setresgid)
2195 dnl ...but our Network Operations group is named "no"!
2197 AC_ARG_WITH(dumpcap-group,
2198 AC_HELP_STRING( [--with-dumpcap-group=GROUP],
2199 [restrict dumpcap to GROUP]),
2201 if test "x$withval" = "xyes"; then
2202 AC_MSG_ERROR([No dumpcap group specified.])
2203 elif test "x$withval" != "xno"; then
2204 if test "x$enable_dumpcap" = "xno" ; then
2205 AC_MSG_ERROR(dumpcap group install works only with dumpcap but dumpcap is disabled)
2207 AC_MSG_RESULT($withval)
2208 DUMPCAP_GROUP="$withval"
2211 AC_SUBST(DUMPCAP_GROUP)
2212 AM_CONDITIONAL(HAVE_DUMPCAP_GROUP, test x$DUMPCAP_GROUP != x)
2214 dnl libcap (not libpcap) check
2216 AC_MSG_CHECKING(whether to use the libcap capabilities library)
2219 AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
2220 [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management @<:@default=yes, if present@:>@]),
2222 if test "x$withval" = "xno"; then
2224 elif test "x$withval" = "xyes"; then
2226 elif test -d "$withval"; then
2228 AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2231 if test "x$with_libcap" = "xno" ; then
2235 AC_WIRESHARK_LIBCAP_CHECK
2237 AC_SUBST(LIBCAP_LIBS)
2239 dnl Checks for header files.
2240 dnl Some of these may not be needed: http://hacks.owlfolio.org/header-survey/
2241 dnl Note, however, that, whilst this script is generally run only on UN*Xes:
2243 dnl 1) we also support building on and for Windows and not all of those
2244 dnl headers are present on Windows, so the code has to check a
2245 dnl #define *anyway* to determine whether to include the header
2250 dnl 2) this might also be run on Windows with a sufficiently UNIXy
2251 dnl environment such as Cygwin (although Wireshark should be built
2252 dnl natively rather than using Cygwin).
2254 AC_CHECK_HEADERS(fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h unistd.h)
2255 AC_CHECK_HEADERS(sys/ioctl.h sys/param.h sys/socket.h sys/sockio.h sys/stat.h sys/time.h sys/types.h sys/utsname.h sys/wait.h)
2256 AC_CHECK_HEADERS(netinet/in.h)
2257 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
2258 AC_CHECK_HEADERS(ifaddrs.h)
2261 # On Linux, check for some additional headers, which we need as a
2262 # workaround for a bonding driver bug and for libpcap's current lack
2263 # of its own workaround for that bug.
2267 AC_CHECK_HEADERS(linux/sockios.h linux/if_bonding.h,,,[#include <sys/socket.h>])
2273 AC_MSG_CHECKING(whether to use SSL library)
2276 AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
2277 [use SSL crypto library (located in directory DIR, if supplied) @<:@default=no@:>@]),
2279 if test "x$withval" = "xno"; then
2281 elif test "x$withval" = "xyes"; then
2283 elif test -d "$withval"; then
2285 AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2290 if test "x$want_ssl" = "xyes"; then
2292 AC_CHECK_LIB(crypto,EVP_md5,
2297 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
2305 AC_MSG_CHECKING(whether to use Kerberos library)
2308 AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
2309 [use Kerberos library (located in directory DIR, if supplied) to use in Kerberos dissection @<:@default=yes@:>@]),
2311 if test $withval = no
2314 elif test $withval = yes
2323 # Use Kerberos library if available, otherwise don't.
2325 want_krb5=ifavailable
2328 if test "x$want_krb5" = "xno" ; then
2332 AC_WIRESHARK_KRB5_CHECK
2338 AC_MSG_CHECKING(whether to use the c-ares library if available)
2341 AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
2342 [use c-ares (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2344 if test "x$withval" = "xno"; then
2346 elif test "x$withval" = "xyes"; then
2348 elif test -d "$withval"; then
2350 AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2353 if test "x$want_c_ares" = "xno" ; then
2357 AC_WIRESHARK_C_ARES_CHECK
2359 AC_SUBST(C_ARES_LIBS)
2363 AC_MSG_CHECKING(whether to use the GeoIP IP address mapping library if available)
2366 AC_HELP_STRING( [--with-geoip@<:@=DIR@:>@],
2367 [use GeoIP (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2369 if test "x$withval" = "xno"; then
2371 elif test "x$withval" = "xyes"; then
2373 elif test -d "$withval"; then
2375 AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2378 if test "x$want_geoip" = "xno"; then
2382 AC_WIRESHARK_GEOIP_CHECK
2384 AC_SUBST(GEOIP_LIBS)
2388 AC_MSG_CHECKING(whether to use the libssh library if available)
2391 AC_HELP_STRING( [--with-libssh@<:@=DIR@:>@],
2392 [use libssh (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2394 if test "x$withval" = "xno"; then
2396 elif test "x$withval" = "xyes"; then
2398 elif test -d "$withval"; then
2400 AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2403 if test "x$want_libssh" = "xno"; then
2407 AC_WIRESHARK_LIBSSH_CHECK
2409 AC_SUBST(LIBSSH_LIBS)
2413 AC_MSG_CHECKING(whether to use the nghttp2 HPACK library if available)
2415 AC_ARG_WITH(nghttp2,
2416 AC_HELP_STRING( [--with-nghttp2@<:@=DIR@:>@],
2417 [use nghttp2 (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2419 if test "x$withval" = "xno"; then
2421 elif test "x$withval" = "xyes"; then
2423 elif test -d "$withval"; then
2425 AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2428 if test "x$want_nghttp2" = "xno"; then
2432 AC_WIRESHARK_NGHTTP2_CHECK
2434 AC_SUBST(NGHTTP2_LIBS)
2436 dnl Checks for typedefs, structures, and compiler characteristics.
2439 # Check how we can get the time zone abbreviation
2442 # We need to know whether "struct stat" has an "st_flags" member
2443 # for file_user_immutable().
2445 AC_CHECK_MEMBERS([struct stat.st_flags])
2447 # We need to know whether "struct stat" has an "st_birthtime" member
2448 # or an "__st_birthtime" member for the file set dialog.
2450 AC_CHECK_MEMBERS([struct stat.st_birthtime])
2451 AC_CHECK_MEMBERS([struct stat.__st_birthtime])
2453 # We need to know whether "struct sockaddr" has an "sa_len" member
2454 # for get_interface_list().
2456 AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,
2457 [#ifdef HAVE_SYS_TYPES_H
2458 #include <sys/types.h>
2460 #ifdef HAVE_SYS_SOCKET_H
2461 #include <sys/socket.h>
2464 # We must know our byte order
2467 # Checks whether "-traditional" is needed when using "ioctl".
2468 # XXX - do we need this?
2469 AC_PROG_GCC_TRADITIONAL
2471 AC_REPLACE_FUNCS(getopt_long)
2473 dnl Do we have optreset?
2475 if test "x$ac_cv_func_getopt_long" = xyes; then
2476 AC_CACHE_CHECK([whether optreset is defined], ac_cv_have_optreset,
2477 AC_LINK_IFELSE([AC_LANG_SOURCE([[extern int optreset;return optreset;]])],
2478 ac_cv_have_optreset=yes, ac_cv_have_optreset=no))
2479 if test "$ac_cv_have_optreset" = yes ; then
2480 AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable])
2484 AC_REPLACE_FUNCS(inet_aton)
2486 AC_CHECK_FUNC(inet_pton, [
2487 dnl check for pre-BIND82 inet_pton() bug.
2488 AC_MSG_CHECKING(for broken inet_pton)
2489 AC_TRY_RUN([#include <sys/types.h>
2490 #include <sys/socket.h>
2491 #include <netinet/in.h>
2492 #include <arpa/inet.h>
2497 /* this should return 0 (error) */
2498 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
2502 }], [AC_MSG_RESULT(ok);
2503 have_inet_pton=yes], [AC_MSG_RESULT(broken);
2504 have_inet_pton=no], [AC_MSG_RESULT([cross compiling, assume it is broken]);
2505 have_inet_pton=no])],
2507 if test "$have_inet_pton" = no; then
2508 AC_LIBOBJ(inet_pton)
2510 AC_DEFINE(HAVE_INET_PTON, 1, [Define to 1 if you have the `inet_pton' function.])
2513 AC_REPLACE_FUNCS(inet_ntop)
2514 AC_REPLACE_FUNCS(strptime)
2515 AC_REPLACE_FUNCS(popcount)
2517 AC_CHECK_FUNCS(mkstemps mkdtemp)
2518 AC_CHECK_FUNCS(getprotobynumber)
2519 AC_CHECK_FUNCS(issetugid)
2520 AC_CHECK_FUNCS(sysconf)
2521 AC_CHECK_FUNCS(getifaddrs)
2522 AC_CHECK_FUNC(getexecname)
2525 # Check for SpeexDSP (http://www.speex.org)
2527 AS_IF([test "x$have_qt_multimedia_lib" = xyes],
2528 [PKG_CHECK_MODULES(SPEEXDSP, speexdsp, [have_speexdsp=yes], [have_speexdsp=no])])
2529 AS_IF([test "x$have_speexdsp" = xyes],
2530 [AC_DEFINE(HAVE_SPEEXDSP, 1, [Define to 1 if you have SpeexDSP])])
2531 AM_CONDITIONAL(HAVE_SPEEXDSP, [test "x$have_speexdsp" = "xyes"])
2533 # Check Bluetooth SBC codec for RTP Player
2534 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
2536 AC_HELP_STRING( [--with-sbc=@<:@yes/no@:>@],
2537 [use SBC codec to play Bluetooth A2DP stream @<:@default=yes, if available@:>@]),
2538 with_sbc="$withval"; want_sbc="yes", with_sbc="yes")
2540 PKG_CHECK_MODULES(SBC, sbc >= 1.0, [have_sbc=yes], [have_sbc=no])
2541 if test "x$with_sbc" != "xno"; then
2542 if (test "${have_sbc}" = "yes"); then
2543 AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
2544 elif test "x$want_sbc" = "xyes"; then
2545 # Error out if the user explicitly requested the sbc library
2546 AC_MSG_ERROR([SBC codec library was requested, but is not available])
2551 AM_CONDITIONAL(HAVE_SBC, test "x$have_sbc" = "xyes")
2554 # Check SpanDSP library for RTP Player
2555 # http://www.soft-switch.org/
2556 AC_ARG_WITH([spandsp],
2557 AC_HELP_STRING( [--with-spandsp=@<:@yes/no@:>@],
2558 [use SpanDSP to play G.722/G.726 codecs @<:@default=yes, if available@:>@]),
2559 with_spandsp="$withval"; want_spandsp="yes", with_spandsp="yes")
2561 PKG_CHECK_MODULES(SPANDSP, spandsp, [have_spandsp=yes], [have_spandsp=no])
2562 if test "x$with_spandsp" != "xno"; then
2563 if (test "${have_spandsp}" = "yes"); then
2564 AC_DEFINE(HAVE_SPANDSP, 1, [Define if you have the SpanDSP library])
2565 elif test "x$want_spandsp" = "xyes"; then
2566 # Error out if the user explicitly requested the SpanDSP library
2567 AC_MSG_ERROR([SpanDSP library was requested, but is not available])
2572 AM_CONDITIONAL(HAVE_SPANDSP, test "x$have_spandsp" = "xyes")
2575 dnl check whether plugins should be enabled and, if they should be,
2576 dnl check for plugins directory - stolen from Amanda's configure.ac
2578 dnl we don't wish to expand ${libdir} yet
2579 plugindir="\${libdir}/wireshark/plugins/${VERSION}"
2580 AC_ARG_WITH(plugins,
2581 AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
2582 [support plugins (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
2584 if test "x$withval" = "xno"; then
2586 elif test "x$have_plugins" = "xno"; then
2587 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
2588 elif test "x$withval" != "xyes"; then
2589 plugindir="$withval"
2592 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
2593 if test x$have_plugins = xyes
2595 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
2600 # The plugin dissectors reside in ./plugins/PROTO/
2603 AC_SUBST(PLUGIN_LIBS)
2606 dnl check whether extcap programs should be enabled and, if they should be,
2607 dnl check for extcap directory - stolen from Amanda's configure.ac
2609 dnl we don't wish to expand ${libdir} yet
2610 extcapdir="\${libdir}/wireshark/extcap"
2612 AC_HELP_STRING( [--with-extcap@<:@=DIR@:>@],
2613 [use extcap for external capture sources (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
2615 if test "x$withval" = "xno"; then
2617 elif test "x$withval" = "xyes"; then
2619 elif test "x$withval" != "xyes"; then
2621 extcapdir ="$withval"
2626 AM_CONDITIONAL(HAVE_EXTCAP, test "x$have_extcap" = "xyes")
2627 if test "x$have_extcap" = "xyes"
2629 AC_DEFINE(HAVE_EXTCAP, 1, [Define if external capture sources should be enabled])
2630 extcap_subdir="extcap"
2631 extcap_man="extcap.4"
2633 AC_SUBST(extcap_subdir)
2634 AC_SUBST(extcap_man)
2637 dnl androiddump check
2638 AC_MSG_CHECKING(whether to build androiddump)
2640 AC_ARG_ENABLE(androiddump,
2641 AC_HELP_STRING( [--enable-androiddump],
2642 [build androiddump @<:@default=yes@:>@]),
2643 androiddump=$enableval,enable_androiddump=yes)
2645 if test "x$have_extcap" != xyes; then
2646 AC_MSG_RESULT([no, extcap disabled])
2647 enable_androiddump=no
2648 elif test "x$enable_androiddump" = "xyes" ; then
2654 AC_ARG_ENABLE(androiddump_use_libpcap,
2655 AC_HELP_STRING( [--enable-androiddump-use-libpcap],
2656 [build androiddump using libpcap @<:@default=no@:>@]),
2657 androiddump_use_libpcap=$enableval,enable_androiddump_use_libpcap=no)
2659 if test "x$enable_androiddump" = "xyes" -a "x$enable_androiddump_use_libpcap" = "xyes" ; then
2660 AC_DEFINE(ANDROIDDUMP_USE_LIBPCAP, 1, [Androiddump will use Libpcap])
2663 if test "x$enable_androiddump" = "xyes" ; then
2664 androiddump_bin="androiddump\$(EXEEXT)"
2665 androiddump_man="androiddump.1"
2670 AC_SUBST(androiddump_bin)
2671 AC_SUBST(androiddump_man)
2674 AC_MSG_CHECKING(whether to build sshdump)
2676 AC_ARG_ENABLE(sshdump,
2677 AC_HELP_STRING( [--enable-sshdump],
2678 [build sshdump @<:@default=yes@:>@]),
2679 [],[enable_sshdump=yes])
2681 if test "x$have_extcap" != xyes; then
2682 AC_MSG_RESULT([no, extcap disabled])
2684 elif test "x$have_libssh_pointsix" != xyes; then
2685 AC_MSG_RESULT([no, libssh >= 0.6.0 not available])
2687 elif test "x$enable_sshdump" = "xyes" ; then
2693 if test "x$enable_sshdump" = "xyes" ; then
2694 sshdump_bin="sshdump\$(EXEEXT)"
2695 sshdump_man="sshdump.1"
2700 AC_SUBST(sshdump_bin)
2701 AC_SUBST(sshdump_man)
2704 AC_MSG_CHECKING(whether to build ciscodump)
2706 AC_ARG_ENABLE(ciscodump,
2707 AC_HELP_STRING( [--enable-ciscodump],
2708 [build ciscodump @<:@default=yes@:>@]),
2709 [],[enable_ciscodump=yes])
2711 if test "x$have_extcap" != xyes; then
2712 AC_MSG_RESULT([no, extcap disabled])
2714 elif test "x$have_libssh_pointsix" != xyes; then
2715 AC_MSG_RESULT([no, libssh >= 0.6.0 not available])
2717 elif test "x$enable_ciscodump" = "xyes" ; then
2723 if test "x$enable_ciscodump" = "xyes" ; then
2724 ciscodump_bin="ciscodump\$(EXEEXT)"
2725 ciscodump_man="ciscodump.1"
2730 AC_SUBST(ciscodump_bin)
2731 AC_SUBST(ciscodump_man)
2733 dnl randpktdump check
2734 AC_MSG_CHECKING(whether to build randpktdump)
2736 AC_ARG_ENABLE(randpktdump,
2737 AC_HELP_STRING( [--enable-randpktdump],
2738 [build randpktdump @<:@default=yes@:>@]),
2739 randpktdump=$enableval,enable_randpktdump=yes)
2741 if test "x$have_extcap" != xyes; then
2742 AC_MSG_RESULT([no, extcap disabled])
2743 enable_randpktdump=no
2744 elif test "x$enable_randpktdump" = "xyes" ; then
2750 if test "x$enable_randpktdump" = "xyes" ; then
2751 randpktdump_bin="randpktdump\$(EXEEXT)"
2752 randpktdump_man="randpktdump.1"
2757 AC_SUBST(randpktdump_bin)
2758 AC_SUBST(randpktdump_man)
2761 AC_MSG_CHECKING(whether to build udpdump)
2763 AC_ARG_ENABLE(udpdump,
2764 AC_HELP_STRING( [--enable-udpdump],
2765 [build udpdump @<:@default=yes@:>@]),
2766 [],[enable_udpdump=yes])
2768 if test "x$have_extcap" != xyes; then
2769 AC_MSG_RESULT([no, extcap disabled])
2771 elif test "x$enable_udpdump" = "xyes" ; then
2777 if test "x$enable_udpdump" = "xyes" ; then
2778 udpdump_bin="udpdump\$(EXEEXT)"
2779 udpdump_man="udpdump.1"
2784 AC_SUBST(udpdump_bin)
2785 AC_SUBST(udpdump_man)
2787 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
2788 if test x$enable_static = xyes -a x$have_plugins = xyes
2790 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
2792 AC_SUBST(ENABLE_STATIC)
2794 # Gather which GUI we're building for rpmbuild
2795 if test "x$have_gtk" = "xyes"; then
2796 if test "x$gtk_major_version" = "x3"; then
2797 RPMBUILD_WITH_ARGS="--with gtk3 --without gtk2"
2799 RPMBUILD_WITH_ARGS="--without gtk3 --with gtk2"
2802 RPMBUILD_WITH_ARGS="--without gtk2 --without gtk3"
2804 if test "x$have_qt" = "xyes" ; then
2805 if test "$qt_version" -eq "5"; then
2806 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt5"
2808 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
2811 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt --without qt5"
2813 if test "x$have_lua" = "xyes" ; then
2814 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with lua"
2816 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without lua"
2818 AC_SUBST(RPMBUILD_WITH_ARGS)
2819 AC_SUBST(RPM_VERSION, version_major.version_minor.version_micro)
2821 AC_SUBST(WS_CPPFLAGS)
2823 AC_SUBST(WS_CXXFLAGS)
2824 AC_SUBST(WS_LDFLAGS)
2826 AC_SUBST(WS_CFLAGS_FOR_BUILD)
2828 AH_BOTTOM([#include <ws_diag_control.h>])
2830 dnl Save the cacheable configure results to config.cache before recursing
2833 sinclude(plugins/Custom.m4) dnl
2834 ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
2836 sinclude(epan/dissectors/asn1/Custom.m4) dnl
2837 ifdef(_CUSTOM_ASN1_AC_OUTPUT_,, define(_CUSTOM_ASN1_AC_OUTPUT_, )) dnl
2839 AC_CONFIG_HEADERS([config.h])
2844 epan/dissectors/asn1/Makefile
2846 _CUSTOM_ASN1_AC_OUTPUT_
2847 epan/dissectors/asn1/acp133/Makefile
2848 epan/dissectors/asn1/acse/Makefile
2849 epan/dissectors/asn1/ansi_map/Makefile
2850 epan/dissectors/asn1/ansi_tcap/Makefile
2851 epan/dissectors/asn1/atn-cm/Makefile
2852 epan/dissectors/asn1/atn-cpdlc/Makefile
2853 epan/dissectors/asn1/atn-ulcs/Makefile
2854 epan/dissectors/asn1/c1222/Makefile
2855 epan/dissectors/asn1/camel/Makefile
2856 epan/dissectors/asn1/cdt/Makefile
2857 epan/dissectors/asn1/charging_ase/Makefile
2858 epan/dissectors/asn1/cmip/Makefile
2859 epan/dissectors/asn1/cmp/Makefile
2860 epan/dissectors/asn1/crmf/Makefile
2861 epan/dissectors/asn1/cms/Makefile
2862 epan/dissectors/asn1/credssp/Makefile
2863 epan/dissectors/asn1/dap/Makefile
2864 epan/dissectors/asn1/disp/Makefile
2865 epan/dissectors/asn1/dop/Makefile
2866 epan/dissectors/asn1/dsp/Makefile
2867 epan/dissectors/asn1/ess/Makefile
2868 epan/dissectors/asn1/ftam/Makefile
2869 epan/dissectors/asn1/goose/Makefile
2870 epan/dissectors/asn1/gprscdr/Makefile
2871 epan/dissectors/asn1/gsm_map/Makefile
2872 epan/dissectors/asn1/h225/Makefile
2873 epan/dissectors/asn1/h235/Makefile
2874 epan/dissectors/asn1/h245/Makefile
2875 epan/dissectors/asn1/h248/Makefile
2876 epan/dissectors/asn1/h282/Makefile
2877 epan/dissectors/asn1/h283/Makefile
2878 epan/dissectors/asn1/h323/Makefile
2879 epan/dissectors/asn1/h450/Makefile
2880 epan/dissectors/asn1/h450-ros/Makefile
2881 epan/dissectors/asn1/h460/Makefile
2882 epan/dissectors/asn1/h501/Makefile
2883 epan/dissectors/asn1/HI2Operations/Makefile
2884 epan/dissectors/asn1/hnbap/Makefile
2885 epan/dissectors/asn1/idmp/Makefile
2886 epan/dissectors/asn1/ilp/Makefile
2887 epan/dissectors/asn1/inap/Makefile
2888 epan/dissectors/asn1/isdn-sup/Makefile
2889 epan/dissectors/asn1/kerberos/Makefile
2890 epan/dissectors/asn1/lcsap/Makefile
2891 epan/dissectors/asn1/ldap/Makefile
2892 epan/dissectors/asn1/logotypecertextn/Makefile
2893 epan/dissectors/asn1/lpp/Makefile
2894 epan/dissectors/asn1/lppa/Makefile
2895 epan/dissectors/asn1/lppe/Makefile
2896 epan/dissectors/asn1/lte-rrc/Makefile
2897 epan/dissectors/asn1/m2ap/Makefile
2898 epan/dissectors/asn1/m3ap/Makefile
2899 epan/dissectors/asn1/mms/Makefile
2900 epan/dissectors/asn1/mpeg-audio/Makefile
2901 epan/dissectors/asn1/mpeg-pes/Makefile
2902 epan/dissectors/asn1/mudurl/Makefile
2903 epan/dissectors/asn1/nbap/Makefile
2904 epan/dissectors/asn1/ns_cert_exts/Makefile
2905 epan/dissectors/asn1/novell_pkis/Makefile
2906 epan/dissectors/asn1/ocsp/Makefile
2907 epan/dissectors/asn1/p1/Makefile
2908 epan/dissectors/asn1/p22/Makefile
2909 epan/dissectors/asn1/p7/Makefile
2910 epan/dissectors/asn1/p772/Makefile
2911 epan/dissectors/asn1/pcap/Makefile
2912 epan/dissectors/asn1/pkcs1/Makefile
2913 epan/dissectors/asn1/pkcs12/Makefile
2914 epan/dissectors/asn1/pkinit/Makefile
2915 epan/dissectors/asn1/pkixac/Makefile
2916 epan/dissectors/asn1/pkix1explicit/Makefile
2917 epan/dissectors/asn1/pkix1implicit/Makefile
2918 epan/dissectors/asn1/pkixproxy/Makefile
2919 epan/dissectors/asn1/pkixqualified/Makefile
2920 epan/dissectors/asn1/pkixtsp/Makefile
2921 epan/dissectors/asn1/pres/Makefile
2922 epan/dissectors/asn1/q932/Makefile
2923 epan/dissectors/asn1/q932-ros/Makefile
2924 epan/dissectors/asn1/qsig/Makefile
2925 epan/dissectors/asn1/ranap/Makefile
2926 epan/dissectors/asn1/rnsap/Makefile
2927 epan/dissectors/asn1/ros/Makefile
2928 epan/dissectors/asn1/rrc/Makefile
2929 epan/dissectors/asn1/rrlp/Makefile
2930 epan/dissectors/asn1/rtse/Makefile
2931 epan/dissectors/asn1/rua/Makefile
2932 epan/dissectors/asn1/s1ap/Makefile
2933 epan/dissectors/asn1/sabp/Makefile
2934 epan/dissectors/asn1/sbc-ap/Makefile
2935 epan/dissectors/asn1/smrse/Makefile
2936 epan/dissectors/asn1/snmp/Makefile
2937 epan/dissectors/asn1/spnego/Makefile
2938 epan/dissectors/asn1/sv/Makefile
2939 epan/dissectors/asn1/t124/Makefile
2940 epan/dissectors/asn1/t125/Makefile
2941 epan/dissectors/asn1/t38/Makefile
2942 epan/dissectors/asn1/tcap/Makefile
2943 epan/dissectors/asn1/tetra/Makefile
2944 epan/dissectors/asn1/ulp/Makefile
2945 epan/dissectors/asn1/wlancertextn/Makefile
2946 epan/dissectors/asn1/x2ap/Makefile
2947 epan/dissectors/asn1/x509af/Makefile
2948 epan/dissectors/asn1/x509ce/Makefile
2949 epan/dissectors/asn1/x509if/Makefile
2950 epan/dissectors/asn1/x509sat/Makefile
2951 epan/dissectors/asn1/x721/Makefile
2953 capchild/doxygen.cfg
2955 caputils/doxygen.cfg
2959 epan/compress/Makefile
2962 epan/dfilter/Makefile
2963 epan/dissectors/Makefile
2964 epan/dissectors/dcerpc/Makefile
2965 epan/ftypes/Makefile
2979 packaging/macosx/Info.plist
2980 packaging/macosx/Makefile
2981 packaging/macosx/osx-dmg.sh
2982 packaging/macosx/Wireshark_package.pmdoc/index.xml
2983 packaging/nsis/Makefile
2984 packaging/rpm/Makefile
2985 packaging/rpm/SPECS/Makefile
2986 packaging/rpm/SPECS/wireshark.spec
2987 packaging/svr4/Makefile
2988 packaging/svr4/checkinstall
2989 packaging/svr4/pkginfo
2990 packaging/wix/Makefile
2992 plugins/docsis/Makefile
2993 plugins/easy_codec/Makefile
2994 plugins/ethercat/Makefile
2995 plugins/gryphon/Makefile
2996 plugins/irda/Makefile
2997 plugins/m2m/Makefile
2998 plugins/mate/Makefile
2999 plugins/opcua/Makefile
3000 plugins/profinet/Makefile
3001 plugins/stats_tree/Makefile
3002 plugins/transum/Makefile
3003 plugins/unistim/Makefile
3004 plugins/wimax/Makefile
3005 plugins/wimaxasncp/Makefile
3006 plugins/wimaxmacphy/Makefile
3007 randpkt_core/doxygen.cfg
3008 randpkt_core/Makefile
3010 tools/lemon/Makefile
3013 writecap/doxygen.cfg
3024 if test "x$have_gtk" = "xyes"; then
3025 gtk_lib_message=" (with GTK+ v$GTK_VERSION"
3026 if test "x$have_ige_mac" = "xyes"; then
3027 gtk_lib_message="$gtk_lib_message and macOS integration)"
3029 gtk_lib_message="$gtk_lib_message)"
3033 if test "x$have_qt" = "xyes" ; then
3034 enable_wireshark_qt="yes"
3035 qt_lib_message=" (with Qt$qt_version v$QT_VERSION)"
3037 enable_wireshark_qt="no"
3040 if test "x$enable_setcap_install" = "xyes" ; then
3041 setcap_message="yes"
3046 if test "x$enable_setuid_install" = "xyes" ; then
3047 setuid_message="yes"
3052 if test "x$DUMPCAP_GROUP" = "x" ; then
3053 dumpcap_group_message="(none)"
3055 dumpcap_group_message="$DUMPCAP_GROUP"
3058 if test "x$want_zlib" = "xno" ; then
3064 if test "x$have_lua" = "xyes" ; then
3070 if test "x$have_qt_multimedia_lib" = "xyes" ; then
3071 qt_multimedia_message="yes"
3073 qt_multimedia_message="no"
3076 if test "x$want_portaudio" = "xyes" ; then
3077 portaudio_message="yes"
3079 portaudio_message="no"
3082 if test "x$want_ssl" = "xno" ; then
3088 if test "x$want_krb5" = "xno" ; then
3091 krb5_message="yes ($ac_krb5_version)"
3094 if test "x$have_good_c_ares" = "xyes" ; then
3095 c_ares_message="yes"
3097 c_ares_message="no (name resolution will be disabled)"
3100 if test "x$have_good_libcap" = "xyes" ; then
3101 libcap_message="yes"
3106 if test "x$have_good_geoip" = "xyes" ; then
3112 if test "x$have_good_libssh" = "xyes" ; then
3113 libssh_message="yes"
3118 if test "x$have_ssh_userauth_agent" = "xyes" ; then
3119 ssh_userauth_agent_message="yes"
3121 ssh_userauth_agent_message="no"
3124 if test "x$have_good_nghttp2" = "xyes" ; then
3125 nghttp2_message="yes"
3127 nghttp2_message="no"
3131 echo " CPPFLAGS: $WS_CPPFLAGS $CPPFLAGS"
3133 echo " CFLAGS: $WS_CFLAGS $CFLAGS"
3135 echo " CXXFLAGS: $WS_CXXFLAGS $CXXFLAGS"
3137 echo " LDFLAGS: $WS_LDFLAGS $LDFLAGS"
3142 echo "The Wireshark package has been configured with the following options:"
3143 echo " GLib version : v$GLIB_VERSION"
3144 echo " Build wireshark : $enable_wireshark_qt$qt_lib_message"
3145 echo " Build wireshark-gtk : $have_gtk""$gtk_lib_message"
3146 echo " Build tshark : $enable_tshark"
3147 echo " Build tfshark : $enable_tfshark"
3148 echo " Build capinfos : $enable_capinfos"
3149 echo " Build captype : $enable_captype"
3150 echo " Build editcap : $enable_editcap"
3151 echo " Build dumpcap : $enable_dumpcap"
3152 echo " Build mergecap : $enable_mergecap"
3153 echo " Build reordercap : $enable_reordercap"
3154 echo " Build text2pcap : $enable_text2pcap"
3155 echo " Build randpkt : $enable_randpkt"
3156 echo " Build dftest : $enable_dftest"
3157 echo " Build rawshark : $enable_rawshark"
3158 echo " Build sharkd : $enable_sharkd"
3159 echo " Build androiddump : $enable_androiddump"
3160 echo " Build sshdump : $enable_sshdump"
3161 echo " Build ciscodump : $enable_ciscodump"
3162 echo " Build randpktdump : $enable_randpktdump"
3163 echo " Build udpdump : $enable_udpdump"
3164 echo " Build echld : $have_echld"
3166 echo " Save files as pcap-ng by default : $enable_pcap_ng_default"
3167 echo " Install dumpcap with capabilities : $setcap_message"
3168 echo " Install dumpcap setuid : $setuid_message"
3169 echo " Use dumpcap group : $dumpcap_group_message"
3170 echo " Use plugins : $have_plugins"
3171 echo " Use external capture sources : $have_extcap"
3172 echo " Use Lua library : $lua_message"
3173 echo " Build Qt RTP player : $qt_multimedia_message"
3174 echo " Build GTK+ RTP player : $portaudio_message"
3175 echo " Build profile binaries : $enable_profile_build"
3176 echo " Use pcap library : $want_pcap"
3177 echo " Use zlib library : $zlib_message"
3178 echo " Use kerberos library : $krb5_message"
3179 echo " Use c-ares library : $c_ares_message"
3180 echo " Use SMI MIB library : $libsmi_message"
3181 echo " Use GNU gcrypt library : yes"
3182 echo " Use SSL crypto library : $ssl_message"
3183 echo " Use GnuTLS library : $tls_message"
3184 echo " Use POSIX capabilities library : $libcap_message"
3185 echo " Use GeoIP library : $geoip_message"
3186 echo " Use libssh library : $libssh_message"
3187 echo " Have ssh_userauth_agent : $ssh_userauth_agent_message"
3188 echo " Use nl library : $libnl_message"
3189 echo " Use SBC codec library : $have_sbc"
3190 echo " Use SpanDSP library : $have_spandsp"
3191 echo " Use nghttp2 library : $nghttp2_message"
3192 echo " Use LZ4 library : $have_lz4"
3193 echo " Use Snappy library : $have_snappy"
3194 #echo " Use GDK-Pixbuf with GResource: $have_gresource_pixbuf"