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], [1])
10 m4_define([version_micro], [0])
11 m4_define([version_micro_extra], version_micro)
12 m4_append([version_micro_extra], [])
14 AC_INIT(wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/)
18 # Minimum autoconf version we require.
20 # Variable expansion doesn't work in AC_PREREQ()
22 AC_SUBST(AC_MIN_VERSION)
24 dnl Make sure to keep ACLOCAL_AMFLAGS in Makefile.am and AC_CONFIG_MACRO_DIRS
25 dnl in configure.ac in sync, otherwise there will be an error running autogen.sh.
26 m4_ifdef([AC_CONFIG_MACRO_DIRS],AC_CONFIG_MACRO_DIRS([./aclocal-fallback]))
28 dnl Check for CPU / vendor / OS
29 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
30 dnl `AC_CANONICAL_HOST', or `AC_CANONICAL_TARGET', depending on the
31 dnl needs. Using `AC_CANONICAL_TARGET' is enough to run the two other
34 dnl As nothing in the Wireshark is itself a build tool (we are not,
35 dnl for example, a compiler that generates machine code), we probably
36 dnl don't need AC_CANONICAL_TARGET, so, in theory, we should be able
37 dnl to use AC_CANONICAL_BUILD and AC_CANONICAL_HOST - or perhaps just
38 dnl AC_CANONICAL_HOST - instead. Note that we do have tools, such as
39 dnl lemon, that need to be built for the build machine, not for the
40 dnl host machine, so we might need both.
42 dnl This has to be done *after* AC_INIT, otherwise autogen.sh fails.
44 dnl AC_CANONICAL_BUILD
48 AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2 no-dist-gzip subdir-objects])
50 # Make Wireshark's version available in config.h
51 AC_DEFINE(VERSION_MAJOR, version_major, [Wireshark's major version])
52 AC_DEFINE(VERSION_MINOR, version_minor, [Wireshark's minor version])
53 AC_DEFINE(VERSION_MICRO, version_micro, [Wireshark's micro version])
55 AC_DEFINE(VERSION_FLAVOR, "Development Build", [Wireshark's package flavor])
60 # Checks for programs used in the main build process.
63 if test "$ac_cv_prog_cc_stdc" == "no"
65 AC_MSG_ERROR([The C compiler does not support standard C])
72 dnl Work around libtool bug (fixed in the version 1.5a?)
73 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
76 if test ! -z "$CXX"; then
78 # OK, we found something AC_LANG_CXX thinks is a C++ compiler,
81 # Some UN*Xes have, by default, a case-insensitive file
82 # system, and AC_PROG_CXX looks for, among other things,
83 # "CC" as a C++ compiler, and, if you have a case-insensitive
84 # file system and a C compiler named "cc" (both true, by
85 # default, on OS X), AC_PROG_CXX may end up thinking it's
88 # So we check by feeding the purported C++ compiler a
89 # program using C++ features (iostream).
91 # We do this after AC_PROG_LIBTOOL; if we did so before, and
92 # cleared CXX if what we had isn't a C++ compiler, that'd
93 # get undone by AC_PROG_LIBTOOL for some reason.
95 AC_MSG_CHECKING(whether $CXX is a C++ compiler)
97 AC_LINK_IFELSE([AC_LANG_PROGRAM(
102 std::cout << "Hello World! ";
105 [AC_MSG_RESULT(yes)],
112 AC_PATH_PROG(PERL, perl)
115 AC_PATH_PROGS(PYTHON, python python3)
116 if test ! -z "$PYTHON"; then
118 # OK, we found Python; is it Python 2.5 or later?
119 # Note: we don't use named components for sys.version_info to get
120 # the major version number, as named components for version_info
121 # were apparently introduced in Python 2.7.
123 AC_MSG_CHECKING([whether $PYTHON is Python 2.5 or later])
124 python_major_version=`$PYTHON -c 'import sys; print (sys.version_info[[0]])'`
125 python_minor_version=`$PYTHON -c 'import sys; print (sys.version_info[[1]])'`
126 if test "$python_major_version" -eq 2 -a "$python_minor_version" -lt 5 ; then
128 AC_MSG_WARN([Building with Python $python_major_version.$python_minor_version may not work])
133 AC_MSG_ERROR(I couldn't find python; make sure it's installed and in your path)
137 # XXX - should autogen.sh check for YACC/Bison and Flex? A user building
138 # from a distribution tarball shouldn't have to have YACC/Bison or Flex,
139 # as the tarball should contain the results of running YACC/Bison on .y
140 # files and running Flex on .l files, but a user building from SVN
141 # will have to run YACC/Bison and Flex to process those files.
143 # On the other hand, what about users who use a distribution tarball to
144 # do development? They *shouldn't* - that's what the SVN repository is
145 # for - but they might. They'd get errors if they modify a .y or .l
146 # file and try to do a build - but the error should tell them that they
147 # need to get YACC/Bison and/or Flex.
149 # Then again, getting them shouldn't be too big of a burden.
151 # XXX - is the same true of pod2man and pod2html, or are they needed
152 # even when building from a distribution tarball?
156 AC_PATH_PROG(YACCDUMMY, $YACC)
157 if test "x$YACCDUMMY" = x
159 AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
162 AC_PATH_PROG(LEX, flex)
165 AC_MSG_ERROR(I couldn't find flex; make sure it's installed and in your path)
167 AC_PATH_PROG(POD2MAN, pod2man)
168 if test "x$POD2MAN" = x
171 # The alternative is not to build the man pages....
173 AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
175 AC_PATH_PROG(POD2HTML, pod2html)
176 if test "x$POD2HTML" = x
179 # The alternative is not to build the HTML man pages....
181 AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
185 # Checks for programs used by Wireshark/TShark/etc.
189 # XXX - this looks for various HTML viewers on the host, not the target;
190 # we really want to know what's available on the target, for cross-builds.
191 # That would probably require us to, at run time, look for xdg-open and,
192 # if we don't find it, look for mozilla, htmlview, etc.
194 AC_PATH_PROG(HTML_VIEWER, xdg-open)
195 if test "x$HTML_VIEWER" != x
198 # XXX - the HTML_VIEWER shell variable is the full path of xdg-open.
199 # Define some variable to be that, so we just run that?
201 AC_DEFINE(HAVE_XDG_OPEN, 1, [Define if we have xdg-open])
204 # XXX - we have to define HTML_VIEWER for the prefs.c code that
205 # sets the default value of the Web browser preference, even
206 # though that preference won't be offered.
208 AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
210 AC_PATH_PROG(HTML_VIEWER, htmlview)
211 if test "x$HTML_VIEWER" = x
213 AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
215 AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
220 # Set "ac_supports_gcc_flags" if the compiler is known to support GCC-style
221 # flags such as -pedantic, -W warning flags and -f feature flags. Currently,
222 # we assume GCC and clang do; other compilers should be added here.
224 # This is done to avoid getting tripped up by compilers that support
225 # those flags but give them a different meaning.
227 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
228 ac_supports_gcc_flags=yes
231 if test "x$CC_FOR_BUILD" = x
235 AC_SUBST(CC_FOR_BUILD)
236 AC_SUBST(CFLAGS_FOR_BUILD)
239 AC_PATH_PROG(DOXYGEN, doxygen)
240 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
241 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
244 # Check for pkg-config and set PKG_CONFIG accordingly.
246 # This is referenced via AC_REQUIRE([PKG_PROG_PKG_CONFIG] in some macros
247 # like PKG_CHECK_MODULES. If the first call to such a macro is under an
248 # "if" statement, it's safer to call PKG_PROG_PKG_CONFIG directly, see
249 # the comments in acolocal.m4
251 # We want version 0.7 or better. (XXX - explain why. Is that just
252 # because our Qt tests were originally based on AM_PATH_GTK, and *it*
253 # requires 0.7 or better?)
255 PKG_PROG_PKG_CONFIG(0.7)
256 if test -z "$PKG_CONFIG"; then
257 AC_MSG_ERROR(I couldn't find pkg-config; make sure it's installed and in your path)
260 AC_ARG_ENABLE(osx-deploy-target,
261 AC_HELP_STRING( [--enable-osx-deploy-target],
262 [choose an OS X deployment target @<:@default=major release on which you're building@:>@]),
272 # Let the user specify an OS X release to use as a
273 # deplayment target; if they specify that we should
274 # have a deployment target but don't specify the
275 # deployment target, then, if we have SDKs available,
276 # pick the OS version on which the build is being done.
277 # This also causes the build to be done against an SDK
278 # rather than against the headers and libraries in
279 # /usr/include and /usr/lib.
281 # Check for an OS X deployment target early, so that
282 # as many tests using the compiler are done using the
283 # flags that we'll be using when building.
285 if test $enableval = no
288 # The user explicitly said
289 # --disable-osx-deploy-target, so don't build
293 elif test $enableval = yes
296 # The user said --enable-osx-deploy-target, but
297 # didn't say what version to target; target the
298 # major version number of the version of OS X on
299 # which we're running.
301 # (We quote the command so that we can use
302 # autoconf's M4 quoting characters, [ and ], in
303 # the sed expression.)
305 [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
307 deploy_target="$enableval"
313 # No. Fail, because whatever the user intended for us to
314 # do, we can't do it.
316 AC_MSG_ERROR([--enable-osx-deploy-target specified on an OS other than OS X])
328 # If we have SDKs available, default to targeting the major
329 # version number of the version of OS X on which we're
332 # (We quote the command so that we can use autoconf's
333 # M4 quoting characters, [ and ], in the sed expression.)
335 for i in /Developer/SDKs \
336 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
337 /Library/Developer/CommandLineTools/SDKs
341 [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
349 # No. There's nothing to do.
355 if test ! -z "$deploy_target"
357 AC_MSG_CHECKING([whether we can build for OS X $deploy_target])
358 case $deploy_target in
362 # I'm not sure this would even work.
365 AC_ERROR([We don't support building for OS X $deploy_target])
370 # XXX - never tested.
373 SDKPATH="/Developer/SDKs/MacOSX10.3.9.sdk"
378 # Look for the oldest SDK we can find that's
379 # for an OS equal to or later than this one.
381 # XXX - for 10.4, do we need 10.4u? We're
382 # not currently doing fat builds (we'd need
383 # fat versions of the support libraries for
384 # that to be useful), but, if we do, we'd
389 # Get the real version - strip off the "10.".
390 # We'll worry about that if, as, and when there's ever
393 deploy_real_version=`echo "$deploy_target" | sed -n 's/10\.\(.*\)/\1/p'`
396 # Search each directory that might contain SDKs.
399 for sdksdir in /Developer/SDKs \
400 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
401 /Library/Developer/CommandLineTools/SDKs
404 # Get a list of all the SDKs.
406 if ! test -d "$sdksdir"
409 # There is no directory with that name.
410 # Move on to the next one in the list,
417 # Get a list of all the SDKs in that directory,
420 # We have to use @<:@ for [ and @:>@ for ] to
421 # avoid m4 removing the square brackets.
423 sdklist=`(cd "$sdksdir"; ls -d MacOSX10.@<:@0-9@:>@*.sdk 2>/dev/null)`
428 # Get the real version for this SDK.
430 sdk_real_version=`echo "$sdk" | sed -n 's/MacOSX10\.\(.*\)\.sdk/\1/p'`
433 # Is it for the deployment target or
434 # some later release?
436 if test "$sdk_real_version" -ge "$deploy_real_version"
441 sdkpath="$sdksdir/$sdk"
446 if test -z "$sdkpath"
449 AC_MSG_ERROR([We couldn't find an SDK for OS X $deploy_target or later])
452 AC_MSG_RESULT([yes, with the 10.$sdk_real_version SDK])
457 # Add a -mmacosx-version-min flag to force tests that
458 # use the compiler, as well as the build itself, not to,
459 # for example, use compiler or linker features not supported
460 # by the minimum targeted version of the OS.
462 # Add an -isysroot flag to use the SDK.
464 CFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $CFLAGS"
465 CXXFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $CXXFLAGS"
466 LDFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $LDFLAGS"
469 # Add a -sdkroot flag to use with osx-app.sh.
471 OSX_APP_FLAGS="-sdkroot $SDKPATH"
474 # XXX - do we need this to build the Wireshark wrapper?
475 # XXX - is this still necessary with the -mmacosx-version-min
478 OSX_DEPLOY_TARGET="MACOSX_DEPLOYMENT_TARGET=$deploy_target"
481 # In the installer package XML file, give the deployment target
482 # as the minimum version.
484 OSX_MIN_VERSION="$deploy_target"
486 case $deploy_target in
490 # Only 32-bit builds are supported. 10.5
491 # (and 10.4?) had a bug that causes some BPF
492 # functions not to work with 64-bit userland
493 # code, so capturing won't work.
495 CFLAGS="-m32 $CFLAGS"
496 CXXFLAGS="-m32 $CXXFLAGS"
497 LDFLAGS="-m32 $LDFLAGS"
509 # In the installer package XML file, give the current OS
510 # version, minor version and all, as the minimum version.
511 # We can't guarantee that the resulting binary will work
512 # on older OS versions, not even older minor versions
513 # (original release or earlier software updates).
515 OSX_MIN_VERSION=`sw_vers -productVersion`
519 AC_SUBST(OSX_MIN_VERSION)
522 # Try to arrange for large file support.
527 # Look for math functions; use libm if necessary.
529 AC_SEARCH_LIBS(floor, m)
530 AC_SEARCH_LIBS(ceil, m)
531 AC_SEARCH_LIBS(exp, m)
532 AC_SEARCH_LIBS(log, m)
533 AC_SEARCH_LIBS(log10, m)
534 AC_SEARCH_LIBS(floorl, m,
537 AC_DEFINE(HAVE_FLOORL, 1, [Define if you have the floorl function.])
539 FLOORL_LO="floorl.lo")
544 # GUI toolkit options
547 AC_HELP_STRING( [--with-qt=@<:@yes/no/4/5@:>@],
548 [use Qt @<:@default=yes@:>@]),
549 with_qt="$withval", with_qt="unspecified")
552 AC_HELP_STRING( [--with-gtk2=@<:@yes/no@:>@],
553 [use GTK+ 2.0 @<:@default=no@:>@]),
554 with_gtk2="$withval", with_gtk2="unspecified")
557 AC_HELP_STRING( [--with-gtk3=@<:@yes/no@:>@],
558 [use GTK+ 3.0 instead of 2.0 @<:@default=yes@:>@]),
559 with_gtk3="$withval", with_gtk3="unspecified")
562 # Version 3.0 switched from LGPLv2.1+ to LGPLv3+, then switched back to
563 # LGPLv2.1+ in version 3.1.10.
564 # GnuTLS depends on GMP which switched from LGPLv2.1+ to LGPLv3+ in
565 # version 4.2.2, the switched to LGPLv3+ / GPLv2+ in version 6.0.0.
568 want_gnutls="if_available"
569 AC_ARG_WITH([gnutls],
570 AC_HELP_STRING( [--with-gnutls=@<:@yes/no@:>@],
571 [use GnuTLS library @<:@default=yes, if available@:>@]),
572 [ with_gnutls="$withval"; want_gnutls="yes" ], with_gnutls="yes")
574 if test "x$with_gnutls" = "xyes"; then
575 have_license_compatible_gnutls="no"
576 PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.10 ],
577 [ have_license_compatible_gnutls="yes" ], [ echo "GnuTLS >= 3.1.10 not found " ]
580 if test "x$have_license_compatible_gnutls" != "xyes"; then
581 PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0 gnutls < 3],
582 [ have_license_compatible_gnutls="yes" ] , [ echo "GnuTLS >= 2.12.0, < 3.0 not found " ]
586 if test "x$have_license_compatible_gnutls" = "xyes"; then
587 echo "GnuTLS found, enabling SSL decryption"
588 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use GnuTLS library])
591 echo "GnuTLS with compatible license not found, disabling SSL decryption"
594 # Error out if the user explicitly requested gnutls
595 if test "x$want_gnutls" = "xyes"; then
596 AC_MSG_ERROR([GnuTLS crypto library was requested, but is not available])
603 want_gcrypt="if_available"
604 AC_ARG_WITH([gcrypt],
605 AC_HELP_STRING( [--with-gcrypt=@<:@yes/no@:>@],
606 [use gcrypt library @<:@default=yes, if available@:>@]),
607 [ with_gcrypt="$withval"; want_gcrypt="yes" ], with_gcrypt="yes")
609 if test "x$with_gcrypt" = "xyes"; then
610 AM_PATH_LIBGCRYPT(1.4.2,
612 echo "libgcrypt found, enabling decryption for ipsec, ssl, etc."
613 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
617 if test x$libgcrypt_config_prefix != x ; then
618 AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
620 echo "libgcrypt not found, disabling decryption for ipsec, ssl, etc."
624 # Error out if the user explicitly requested gcrypt
625 if test "x$want_gcrypt" = "xyes"; then
626 AC_MSG_ERROR([libgcrypt library was requested, but is not available])
633 AC_HELP_STRING([--with-libnl@<:@=VERSION@:>@],
634 [use libnl (force version VERSION, if supplied) @<:@default: yes, if available@:>@]),
636 if test "x$withval" = "xno"
639 elif test "x$withval" = "xyes"
643 elif test "x$withval" = "x1"
647 elif test "x$withval" = "x2"
651 elif test "x$withval" = "x3"
656 AC_MSG_ERROR(["$withval" is not a valid argument to --with-libnl])
660 # Use libnl if it's present, otherwise don't.
662 want_libnl=ifavailable
666 # Libnl is Linux-specific.
671 AC_MSG_CHECKING(whether to use libnl for various network interface purposes)
673 if test x$want_libnl = "xno"; then
678 # Test for specific libnl versions only if no version
679 # was specified by the user or if the version in question
680 # was requested by the user.
682 if test x$libnl_version = "xany" -o x$libnl_version = "x3"; then
683 PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL3, [libnl-route-3.0 >= 3.0 libnl-genl-3.0] >= 3.0, [have_libnl3=yes], [have_libnl3=no])
685 if test x$libnl_version = "xany" -o x$libnl_version = "x2"; then
686 PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL2, libnl-2.0 >= 2.0, [have_libnl2=yes], [have_libnl2=no])
688 if test x$libnl_version = "xany" -o x$libnl_version = "x1"; then
689 PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL1, libnl-1 >= 1.0, [have_libnl1=yes], [have_libnl1=no])
691 if (test "${have_libnl3}" = "yes"); then
692 CFLAGS="$CFLAGS $LIBNL3_CFLAGS"
693 LIBS="$LIBS $LIBNL3_LIBS"
694 AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
695 AC_DEFINE(HAVE_LIBNL3, 1, [libnl version 3])
696 libnl_message="yes (v3)"
697 elif (test "${have_libnl2}" = "yes"); then
698 CFLAGS="$CFLAGS $LIBNL2_CFLAGS"
699 LIBS="$LIBS $LIBNL2_LIBS"
700 AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
701 AC_DEFINE(HAVE_LIBNL2, 1, [libnl version 2])
702 libnl_message="yes (v2)"
703 elif (test "${have_libnl1}" = "yes"); then
704 CFLAGS="$CFLAGS $LIBNL1_CFLAGS"
705 LIBS="$LIBS $LIBNL1_LIBS"
706 AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
707 AC_DEFINE(HAVE_LIBNL1, 1, [libnl version 1])
708 libnl_message="yes (v1)"
710 if test x$want_libnl = "xyes"; then
711 case "$libnl_version" in
714 AC_MSG_ERROR("I couldn't find libnl even though you manually enabled it.")
718 AC_MSG_ERROR("I couldn't find libnl version $libnl_version even though you manually enabled it.")
725 AC_MSG_CHECKING([if nl80211.h is new enough])
726 AC_TRY_COMPILE([#include <linux/nl80211.h>],
727 [int x = NL80211_FREQUENCY_ATTR_MAX_TX_POWER;
728 x |= NL80211_ATTR_SUPPORTED_IFTYPES;
729 x |= NL80211_ATTR_SUPPORTED_COMMANDS;
730 x |= NL80211_ATTR_WIPHY_FREQ;
731 x |= NL80211_CHAN_NO_HT;
733 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211, 1, [nl80211.h is new enough])],
736 AC_MSG_CHECKING([for NL80211_SET_CHANNEL])
737 AC_TRY_COMPILE([#include <linux/nl80211.h>],
738 [enum nl80211_commands x = NL80211_CMD_SET_CHANNEL;],
739 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_CMD_SET_CHANNEL, 1, [SET_CHANNEL is supported])],
742 AC_MSG_CHECKING([for NL80211_SPLIT_WIPHY_DUMP])
743 AC_TRY_COMPILE([#include <linux/nl80211.h>],
744 [enum nl80211_protocol_features x = NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP;],
745 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_SPLIT_WIPHY_DUMP, 1, [SPLIT_WIPHY_DUMP is supported])],
750 if test x$want_libnl != "xno" -a x$want_libnl != "xifavailable"; then
751 AC_MSG_WARN([libnl is Linux-specific, ignoring --with-libnl])
756 # FIXME: currently the path argument to with-libsmi is being ignored
760 # Check for programs used when building DocBook documentation.
763 # Check for a2x (convert asciidoc to another format)
764 AC_PATH_PROG(A2X, a2x)
765 AC_CHECK_PROG(HAVE_A2X, a2x, "yes", "no")
766 AM_CONDITIONAL(HAVE_A2X, test x$HAVE_A2X = xyes)
768 # Check for fop (translate .fo to e.g. pdf)
769 AC_PATH_PROG(FOP, fop)
770 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
771 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
773 # TODO: HAVE_LYNX and HAVE_W3M are unused. Maybe require one of them
774 # to be found when a2x is enabled? Otherwise it will fail later...
775 # Check for lynx (asciidoc text format from html)
776 AC_PATH_PROG(LYNX, lynx)
777 AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no")
778 AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes)
780 # Check for w3m (asciidoc text format from html)
781 AC_PATH_PROG(W3M, w3m)
782 AC_CHECK_PROG(HAVE_W3M, w3m, "yes", "no")
783 AM_CONDITIONAL(HAVE_W3M, test x$HAVE_W3M = xyes)
786 AC_PATH_PROG(XMLLINT, xmllint)
787 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
788 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
791 AC_PATH_PROG(XSLTPROC, xsltproc)
792 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
793 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
796 # Check for packaging utilities
797 # For now, we check to see if the various packaging utilites are in our
798 # path. I'm too lazy to write code to go hunt for them. - Gerald
802 # (Lets you install the desktop files.)
804 AC_PATH_PROG(DESKTOP_FILE_INSTALL, desktop-file-install)
807 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
808 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
809 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
811 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
812 -a x$HAVE_PKGTRANS = xyes ; then
813 HAVE_SVR4_PACKAGING=yes
815 HAVE_SVR4_PACKAGING=no
817 AC_SUBST(HAVE_SVR4_PACKAGING)
820 AC_WIRESHARK_RPM_CHECK
824 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
827 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
828 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
829 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
831 if test x$HAVE_XCODEBUILD = xyes -a x$HAVE_HDIUTIL = xyes \
832 -a x$HAVE_BLESS = xyes ; then
833 HAVE_OSX_PACKAGING=yes
835 HAVE_OSX_PACKAGING=no
837 AC_SUBST(HAVE_OSX_PACKAGING)
840 # Use this as a proxy for "is this OS X" (just in case somebody actually
841 # built and installed Darwin as an OS, perhaps with some X11-based GUI,
842 # don't look for Darwin).
844 AC_CHECK_PROG(have_sw_vers, sw_vers, "yes", "no")
845 AM_CONDITIONAL(NOT_OS_X, test "x$have_sw_vers" = "xno")
848 # Some compilers have to be told to fail when passed an unknown -W flag;
849 # make sure we do that.
851 AC_WIRESHARK_CHECK_UNKNOWN_WARNING_OPTION_ERROR
854 # Some C++ compilers have to be told to fail when passed a -W flag that
855 # they don't think should apply to C++; make sure we do that.
857 AC_WIRESHARK_CHECK_NON_CXX_WARNING_OPTION_ERROR
860 # Try to add some additional checks to CFLAGS.
861 # These are not enabled by default, because the warnings they produce
862 # are very hard or impossible to eliminate.
864 AC_ARG_ENABLE(extra-compiler-warnings,
865 AC_HELP_STRING( [--enable-extra-compiler-warnings],
866 [do additional compiler warnings @<:@default=no@:>@]),
868 wireshark_extra_flags=$enableval
869 if test $enableval != no
872 # The following are for C and C++
874 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpedantic)
875 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-variadic-macros)
877 # Various code blocks this one.
879 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Woverflow)
880 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
882 # Due to various places where APIs we don't control
883 # require us to cast away constness, we can probably
884 # never enable this one with -Werror.
886 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-qual)
888 # Some generated ASN.1 dissectors block this one;
889 # multiple function declarations for the same
890 # function are being generated.
892 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wredundant-decls)
894 # Some loops are safe, but it's hard to convince the
897 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunsafe-loop-optimizations)
899 # All the registration functions block these for now.
901 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-prototypes)
902 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-declarations)
904 # A bunch of "that might not work on SPARC" code blocks
907 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-align)
909 # Works only with Clang
911 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunreachable-code)
913 # Works only with Clang but generates a lot of warnings
914 # (about glib library not using Doxygen)
916 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdocumentation)
919 # The following are C only, not C++
921 # Due to various places where APIs we don't control
922 # require us to cast away constness, we can probably
923 # never enable this one with -Werror.
925 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C)
929 # Try to add ASAN address analyze.
930 # Only needed for analyse
933 AC_HELP_STRING( [--enable-asan],
934 [Enable AddressSanitizer (ASAN) for debugging (May be slow down)@<:@default=no@:>@]),
937 # With Clang >= 3.5 Leak detection is enable by default
938 # and no yet all leak is fixed...
939 # use ASAN_OPTIONS=detect_leaks=0 to disable detect_leaks
941 # XXX shouldn't this also be added to LDFLAGS?
942 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address)
949 # The following are for C and C++
951 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wall -W) # -W is now known as -Wextra
952 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wextra) # -W is now known as -Wextra
953 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wendif-labels)
954 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpointer-arith)
955 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Warray-bounds)
956 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wformat-security)
957 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fwrapv)
958 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-strict-overflow)
959 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-delete-null-pointer-checks)
960 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wvla)
961 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Waddress)
962 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wattributes)
963 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdiv-by-zero)
964 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wignored-qualifiers)
965 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpragmas)
966 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-overlength-strings)
967 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
968 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
969 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable)
971 # The following are C only, not C++
973 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wc++-compat, C)
974 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdeclaration-after-statement, C)
979 # Make sure -Wshadow doesn't complain about variables in function and
980 # function pointer declarations shadowing other variables; if not, don't
981 # turn it on, as some versions of GCC (including the one in at least
982 # some Xcode versions that came with Mac OS X 10.5) complain about
985 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshadow, C,
987 extern int bar(int a);
993 int (*fptr)(int a) = bar;
998 [warns about variables in function declarations shadowing other variables])
1000 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-pointer-sign, C)
1001 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wold-style-definition, C)
1002 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wstrict-prototypes, C)
1004 # Unfortunately some versions of gcc generate logical-op warnings when strchr()
1005 # is given a constant string.
1006 # gcc versions 4.3.2 and 4.4.5 are known to have the problem.
1007 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wlogical-op, C,
1011 int foo(const char *, int);
1015 foo(const char *sep, int c)
1017 if (strchr (sep, c) != NULL)
1026 return foo("<", 'a');
1029 [generates warnings from strchr()])
1031 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wjump-misses-init, C)
1032 # The Qt headers generate a ton of shortening errors on 64-bit systems
1033 # so only enable this for C for now.
1034 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshorten-64-to-32, C)
1037 # Use the faster pre gcc 4.5 floating point precision if available.
1039 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fexcess-precision=fast)
1042 # Try to have the compiler default to hiding symbols, so that only
1043 # symbols explicitly exported with WS_DLL_PUBLIC will be visible
1044 # outside (shared) libraries; that way, more UN*X builds will catch
1045 # failures to export symbols, rather than having that fail only on
1048 # GCC and GCC-compatible compilers
1050 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fvisibility=hidden)
1051 if test "x$can_add_to_cflags" = "xno"
1056 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xldscope=hidden)
1057 if test "x$can_add_to_cflags" = "xno"
1059 # TODO add other ways of hiding symbols
1060 AC_MSG_WARN(Compiler will export all symbols from shared libraries)
1064 AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
1065 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,-M])
1066 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--cref])
1067 # AC_WIRESHARK_LDFLAGS_CHECK([-flto])
1068 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhopr])
1069 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhole-program])
1072 # Put -fPIE in PIE_CFLAGS and -pie in PIE_LDFLAGS if we can use them,
1073 # so that we can build dumpcap PIE - it may run with elevated
1074 # privileges, and using PIE means the OS can run it at random locations
1075 # in the address space to make attacks more difficult.
1077 WS_CHECKED_CFLAGS_before_pie="$WS_CHECKED_CFLAGS"
1078 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE, C)
1079 if test "x$can_add_to_cflags" = "xyes"
1082 WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS_before_pie"
1084 LDFLAGS_before_pie="$LDFLAGS"
1085 AC_WIRESHARK_LDFLAGS_CHECK([-fPIE -pie])
1086 if test "x$LDFLAGS" != "x$LDFLAGS_before_pie"
1093 LDFLAGS="$LDFLAGS_before_pie"
1097 AC_SUBST(PIE_CFLAGS)
1098 AC_SUBST(PIE_LDFLAGS)
1100 WS_CHECKED_CFLAGS_before_simd="$WS_CHECKED_CFLAGS"
1101 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-msse4.2, C)
1102 if test "x$can_add_to_cflags" = "xyes"
1105 # The compiler supports -msse4.2; use that to enable SSE 4.2.
1107 # Restore CFLAGS. We only want to apply -msse4.2 to
1108 # wsutil/ws_mempbrk_sse42.c, as the SSE4.2 code there
1109 # is run only if the hardware supports it, but other
1110 # code would do no such checks.
1112 WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS_before_simd"
1113 ac_sse4_2_flag=-msse4.2
1116 # Try -xarch=sse4_2; that's the flag for Sun's compiler.
1118 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xarch=sse4_2, C)
1119 if test "x$can_add_to_cflags" = "xyes"
1122 # The compiler supports -xarch=sse4_2; use that to
1125 # Restore CFLAGS; see above.
1127 WS_CHECKED_CFLAGS="$WS_CHECKED_CFLAGS_before_simd"
1128 ac_sse4_2_flag=-xarch=sse4_2
1133 # All AC_WIRESHARK_COMPILER_FLAGS_CHECK are done, do not call it again!
1134 # Prepend them to the user-specified CFLAGS/CXXFLAGS.
1136 CFLAGS="$WS_CHECKED_CFLAGS $CFLAGS"
1137 CXXFLAGS="$WS_CHECKED_CXXFLAGS $CXXFLAGS"
1139 if test "x$ac_sse4_2_flag" != x; then
1141 # OK, we have a compiler flag to enable SSE 4.2.
1143 # Make sure we have the necessary headers for the SSE4.2 intrinsics
1144 # and that we can use them.
1146 # First, check whether we have emmintrin.h and can use it
1147 # *without* the SSE 4.2 flag.
1149 AC_MSG_CHECKING([whether there is emmintrin.h header and we can use it])
1151 [#include <emmintrin.h>],
1154 emmintrin_h_works=yes
1155 AC_MSG_RESULT([yes])
1158 emmintrin_h_works=no
1164 # OK, if that works, see whether we have nmmintrin.h and
1165 # can use it *with* the SSE 4.2 flag.
1167 if test "x$emmintrin_h_works" = "xyes"; then
1169 # Add the SSE4.2 flags to the beginning of CFLAGS,
1170 # in case the user explicitly specified -mno-sse4.2
1171 # (or in case Gentoo's build tools did so); if they
1172 # did so, we only want this to work if we can use
1173 # the #pragma to override that for ws_mempbrk_sse42.c,
1174 # and putting it at the beginning means that the
1175 # CFLAGS setting in the environment will come later
1178 AC_MSG_CHECKING([whether there is nmmintrin.h header and we can use it])
1179 saved_CFLAGS="$CFLAGS"
1180 CFLAGS="$ac_sse4_2_flag $CFLAGS"
1182 [#include <nmmintrin.h>],
1186 AC_DEFINE(HAVE_SSE4_2, 1, [Support SSSE4.2 (Streaming SIMD Extensions 4.2) instructions])
1187 CFLAGS_SSE42="$ac_sse4_2_flag"
1188 AC_MSG_RESULT([yes])
1195 CFLAGS="$saved_CFLAGS"
1202 dnl build libwsutil_sse42 only if there is SSE4.2
1203 AM_CONDITIONAL(SSE42_SUPPORTED, test "x$have_sse42" = "xyes")
1204 AC_SUBST(CFLAGS_SSE42)
1207 # If we're running GCC or clang define _U_ to be "__attribute__((unused))"
1208 # so we can use _U_ to flag unused function parameters and not get warnings
1209 # about them. Otherwise, define _U_ to be an empty string so that _U_ used
1210 # to flag an unused function parameters will compile with other compilers.
1212 # XXX - similar hints for other compilers?
1214 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
1215 AC_DEFINE(_U_, __attribute__((unused)), [Hint to the compiler that a function parameters is not used])
1217 AC_DEFINE(_U_, , [Hint to the compiler that a function parameters is not used])
1220 # If we're running GCC or CLang, use FORTIFY_SOURCE=2
1221 # (only if the GCC 'optimization level' > 0).
1223 # See: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
1224 # See: http://sourceware.org/bugzilla/show_bug.cgi?id=13979
1226 # Note: FORTIFY_SOURCE is only effective for gcc optimization level > 0 (-O1, etc)
1227 AC_WIRESHARK_GCC_FORTIFY_SOURCE_CHECK
1230 # If the compiler supports GCC-style flags, enable a barrier "stop on
1232 # This barrier is set for a very large part of the code. However, it is
1233 # typically not set for "generated" code (flex, ans2wrs, idl2wrs, ...)
1235 warnings_as_errors_default="yes"
1236 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
1237 AC_ARG_ENABLE(warnings-as-errors,
1238 AC_HELP_STRING( [--enable-warnings-as-errors],
1239 [treat warnings as errors (only for GCC or clang) @<:@default=yes, unless extra compiler warnings are enabled@:>@]),
1241 if test "x$ac_supports_gcc_flags" = "xyes" -a "x$enableval" = "xyes"; then
1242 with_warnings_as_errors="yes"
1245 with_warnings_as_errors="no"
1250 if test "x$ac_supports_gcc_flags" = "xyes" -a "x$wireshark_extra_flags" = "x" -a "x$warnings_as_errors_default" = "xyes"; then
1251 with_warnings_as_errors="yes"
1254 with_warnings_as_errors="no"
1259 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
1262 # Add any platform-specific compiler flags needed.
1264 AC_MSG_CHECKING(for platform-specific compiler flags)
1265 if test "x$GCC" = "xyes" ; then
1267 # GCC - do any platform-specific tweaking necessary.
1271 # the X11 headers don't automatically include prototype info
1272 # and a lot don't include the return type
1273 CPPFLAGS="$CPPFLAGS -DFUNCPROTO=15"
1274 CFLAGS="$CFLAGS -Wno-return-type"
1275 CXXFLAGS="$CXXFLAGS -Wno-return-type"
1276 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
1279 AC_MSG_RESULT(none needed)
1284 # Not GCC - assume it's the vendor's compiler.
1289 # AC_PROG_CC_STDC should already have added whatever
1290 # flags are necessary for ISO C - C99 if available,
1291 # otherwise C89 - with extensions.
1293 # Add +O2, for optimization, as suggested by Jost Martin.
1294 # XXX - works with "-g"?
1296 # +O2 is supported both by the C and C++ compiler.
1298 CFLAGS="+O2 $CFLAGS"
1299 if test "$CC" = "$CC_FOR_BUILD"; then
1301 # We're building the build tools with the same
1302 # compiler as the one with which we're building
1303 # Wireshark, so add the flags to the flags for
1304 # that compiler as well.
1306 CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
1308 CXXFLAGS="+O2 $CXXFLAGS"
1309 AC_MSG_RESULT(HP C/C++ compiler - added +O2)
1313 # Crank up the warning level.
1316 CXXFLAGS="$CXXFLAGS +w2"
1319 AC_MSG_RESULT(none needed)
1325 # Add any platform-specific linker flags needed.
1327 AC_MSG_CHECKING(for platform-specific linker flags)
1331 # Add -Wl,-single_module to the LDFLAGS used with shared
1332 # libraries, to fix some error that show up in some cases;
1333 # some Apple documentation recommends it for most shared
1336 LDFLAGS_SHAREDLIB="-Wl,-single_module"
1338 # Add -Wl,-headerpad_max_install_names to the LDFLAGS, as
1339 # code-signing issues is running out of padding space.
1341 # Add -Wl,-search_paths_first to make sure that if we search
1342 # directories A and B, in that order, for a given library, a
1343 # non-shared version in directory A, rather than a shared
1344 # version in directory B, is chosen (so we can use
1345 # --with-pcap=/usr/local to force all programs to be linked
1346 # with a static version installed in /usr/local/lib rather than
1347 # the system version in /usr/lib).
1349 LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first $LDFLAGS"
1350 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])
1354 # Shared libraries in cygwin/Win32 must never contain
1355 # undefined symbols.
1357 LDFLAGS="$LDFLAGS -no-undefined"
1358 AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
1361 AC_MSG_RESULT(none needed)
1364 AC_SUBST(LDFLAGS_SHAREDLIB)
1366 # Enable silent builds by default
1367 # Verbose builds can be enabled with "./configure
1368 # --enable-silent-rules ..." or "make V=1 ..."
1369 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1370 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1373 # On "Darwin", which we assume to mean "OS X" rather than "iOS" or
1374 # "just Darwin" (as we don't currently support iOS, and as I don't
1375 # think you can build and run "just Darwin" as an OS for PCs), we
1376 # arrange to build some programs with Application Services so they
1377 # can launch Web browsers and Finder windows, arrange to build some
1378 # programs with System Configuration so they can get "friendly names"
1379 # and other information about interfaces, and build any programs that
1380 # use either of those frameworks or that report version information
1381 # with Core Foundation as the frameworks in question use it and as we
1382 # get version information from plists and thus need Core Foundation
1383 # to process those plists.
1385 have_os_x_frameworks=no
1388 have_os_x_frameworks=yes
1389 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
1390 APPLICATIONSERVICES_FRAMEWORKS="-framework ApplicationServices"
1391 SYSTEMCONFIGURATION_FRAMEWORKS="-framework SystemConfiguration"
1392 COREFOUNDATION_FRAMEWORKS="-framework CoreFoundation"
1395 # OK, so we have the OS X frameworks; do they include
1396 # CFPropertyListCreateWithStream, or do we have
1397 # to fall back on CFPropertyListCreateFromStream?
1398 # (They only differ in the error return, which we
1399 # don't care about. And, no, we shouldn't just
1400 # use CFPropertyListCreateFromStream, because it's
1401 # deprecated in newer releases.)
1403 ac_save_LIBS="$LIBS"
1404 LIBS="$LIBS $COREFOUNDATION_FRAMEWORKS"
1405 AC_CHECK_FUNCS(CFPropertyListCreateWithStream)
1406 LIBS="$ac_save_LIBS"
1409 AC_SUBST(APPLICATIONSERVICES_FRAMEWORKS)
1410 AC_SUBST(SYSTEMCONFIGURATION_FRAMEWORKS)
1411 AC_SUBST(COREFOUNDATION_FRAMEWORKS)
1412 AM_CONDITIONAL(HAVE_OS_X_FRAMEWORKS, [test "x$have_os_x_frameworks" = "xyes"])
1415 # On Solaris, check whether we have getexecname().
1419 AC_CHECK_FUNC(getexecname)
1423 dnl Look in /usr/local for header files and libraries ?
1424 dnl XXX FIXME don't include /usr/local if it is already in the system
1425 dnl search path as this causes gcc 3.2 on Linux to complain about a change
1426 dnl of the system search order for includes
1427 AC_ARG_ENABLE(usr-local,
1428 AC_HELP_STRING( [--enable-usr-local],
1429 [look for headers and libs in /usr/local tree @<:@default=yes@:>@]),
1430 ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
1432 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
1433 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1434 if test -d "/usr/local"; then
1437 # Arrange that we search for header files in the source directory
1438 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
1439 # as various packages we use ("libpcap", "zlib", "adns")
1440 # may have been installed under "/usr/local/include".
1442 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
1445 # Arrange that we search for libraries in "/usr/local/lib".
1447 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
1456 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
1461 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
1462 if test x$LD_LIBRARY_PATH != x ; then
1463 LIBS="$LIBS -R$LD_LIBRARY_PATH"
1464 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
1466 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
1472 # Check for versions of "sed" inadequate to handle, in libtool, a list
1473 # of object files as large as the list in Wireshark.
1475 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
1476 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
1477 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
1478 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
1479 # is the only "sed" that comes with Solaris that can handle Wireshark.
1481 # Add any checks here that are necessary for other OSes.
1483 AC_PATH_PROG(SED, sed)
1486 AC_MSG_ERROR(I couldn't find sed; make sure it's installed and in your path)
1488 AC_WIRESHARK_GNU_SED_CHECK
1489 if test "$HAVE_GNU_SED" = no ; then
1492 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
1494 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
1496 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
1511 # Enable/disable wireshark
1512 AC_ARG_ENABLE(wireshark,
1513 AC_HELP_STRING( [--enable-wireshark],
1514 [build the Wireshark GUI (with Gtk+, Qt, or both) @<:@default=yes@:>@]),
1515 enable_wireshark=$enableval,enable_wireshark=yes)
1516 AM_CONDITIONAL(BUILDING_WIRESHARK, test x$enable_wireshark = xyes)
1518 AC_ARG_ENABLE(packet-editor,
1519 AC_HELP_STRING( [--enable-packet-editor],
1520 [add support for packet editor in Wireshark @<:@default=yes@:>@]),
1521 enable_packet_editor=$enableval,enable_packet_editor=yes)
1522 if test x$enable_packet_editor = xyes; then
1523 AC_DEFINE(WANT_PACKET_EDITOR, 1, [Support for packet editor])
1526 AC_ARG_ENABLE(profile-build,
1527 AC_HELP_STRING( [--enable-profile-build],
1528 [build profile-ready binaries @<:@default=no@:>@]),
1529 enable_profile_build=$enableval,enable_profile_build=no)
1530 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
1531 AC_MSG_CHECKING(if profile builds must be generated)
1532 if test "x$enable_profile_build" = "xyes" ; then
1533 if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
1535 CFLAGS=" -pg $CFLAGS"
1536 CXXFLAGS=" -pg $CXXFLAGS"
1539 echo "Building profile binaries currently only supported for GCC and clang."
1545 # Create DATAFILE_DIR #define for config.h
1546 datafiledir=$datadir/wireshark
1548 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1549 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1550 # Ugly hack, but I don't see how this problem can be solved
1551 # properly that DATAFILE_DIR had a value starting with
1552 # "${prefix}/" instead of e.g. "/usr/local/"
1553 eval eval echo "$datafiledir"
1555 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
1557 # Create DOC_DIR #define for config.h
1559 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1560 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1561 # Ugly hack, but I don't see how this problem can be solved
1562 # properly that DOC_DIR had a value starting with
1563 # "${prefix}/" instead of e.g. "/usr/local/"
1564 eval eval echo "$docdir"
1566 AC_DEFINE_UNQUOTED(DOC_DIR, "$docdir", [Directory for docs])
1568 GTK2_MIN_VERSION=2.12.0
1569 AC_SUBST(GTK2_MIN_VERSION)
1570 GTK3_MIN_VERSION=3.0.0
1571 AC_SUBST(GTK3_MIN_VERSION)
1572 QT_MIN_VERSION=4.7.0
1573 AC_SUBST(QT_MIN_VERSION)
1574 # GTK+ and Qt checks; we require GTK+ $GTK2_MIN_VERSION or later or
1575 # GTK3_MIN_VERSION or later or Qt $QT_MIN_VERSION or later.
1577 # We only do those if we're going to be building Wireshark;
1578 # otherwise, we don't have any GUI to build, so we don't use
1581 # We don't add $GTK_LIBS or $Qt_LIBS to LIBS, because we don't want to
1582 # force all programs to be built with GTK+ or Qt.
1584 # Release dates for GTK+ versions:
1585 # https://en.wikipedia.org/wiki/GTK+#Releases
1586 # 2.12.0: 14 Sep 2007
1587 # 2.14.0: 04 Sep 2008
1588 # 2.16.0: 13 Mar 2009
1589 # 2.18.0: 23 Sep 2009
1590 # 2.20.0: 23 Mar 2010
1591 # 2.22.0: 23 Sep 2010
1592 # 2.24.0: 30 Jan 2011
1593 # 3.0.0: 10 Feb 2011
1594 # 3.2.0: 25 Sep 2011
1595 # 3.4.0: 26 Mar 2012
1596 # 3.6.0: 24 Sep 2012
1597 # 3.8.0: 25 Mar 2013
1598 # 3.10.0: 23 Sep 2013
1599 # 3.12.0: 25 Mar 2014
1600 # 3.14.0: 30 Sep 2014
1601 # 3.16.0: 22 Mar 2015
1602 # 3.18.0 22 Sep 2015
1604 # Release dates for Qt versions:
1605 # https://en.wikipedia.org/wiki/List_of_Qt_releases
1606 # 4.6.0: 01 Dec 2009
1607 # 4.7.0: 21 Sep 2010
1608 # 4.8.0: 15 Dec 2011
1609 # 5.0.0: 19 Dec 2012
1610 # 5.1.0: 03 Jul 2013
1611 # 5.2.0: 12 Dec 2013
1612 # 5.3.0: 20 May 2014
1613 # 5.4.0: 10 Dec 2015
1614 # 5.5.0: 01 Jul 2015
1618 if test "x$enable_wireshark" = "xyes"; then
1619 if test "x$with_gtk2" = "xunspecified" -a \
1620 "x$with_gtk3" = "xunspecified" -a \
1621 "x$with_qt" = "xunspecified"; then
1623 # No GUI toolkits were explicitly specified; pick Qt
1628 elif test "x$with_gtk2" = "xunspecified" -a \
1629 "x$with_gtk3" = "xunspecified" -a \
1630 "x$with_qt" = "xno"; then
1632 # Qt was explicitly disabled, and neither GTK+ 2 nor
1633 # GTK+ 3 were explicitly specified; pick GTK+ 3.
1637 if test "x$with_qt" != "xno"; then
1639 # Qt was specified; make sure we have a C++ compiler.
1641 if test -z "$CXX"; then
1642 AC_MSG_ERROR(Need a working C++ compiler to build Wireshark with Qt)
1646 # Now make sure we have Qt and, if so, add the flags
1647 # for it to CFLAGS and CXXFLAGS.
1649 AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION, "$with_qt",
1651 CFLAGS="$CFLAGS $Qt_CFLAGS"
1652 CXXFLAGS="$CXXFLAGS $Qt_CFLAGS"
1654 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-qt"
1657 # XXX - greasy hack to make ui/gtk/recent.c
1660 CPPFLAGS="-DQT_GUI_LIB"
1663 # We're building with Qt, so we need the Qt build
1664 # tools in order to build the Wireshark GUI.
1665 # We've found a particular major version of Qt,
1666 # and we want that version's build tools; for
1667 # example, the Qt 4 version of uic produces files
1668 # that include Qt headers with paths that work
1669 # with Qt 4 but not Qt 5, so we can't use the
1670 # Qt 4 version of uic if we're building with Qt 5.
1671 AC_WIRESHARK_QT_TOOL_CHECK(UIC, uic, "$qt_version")
1673 AC_WIRESHARK_QT_TOOL_CHECK(MOC, moc, "$qt_version")
1675 AC_WIRESHARK_QT_TOOL_CHECK(RCC, rcc, "$qt_version")
1679 # On Darwin, find where the Qt frameworks are
1680 # located, and add that to the rpath, just in
1681 # case this is Qt 5.5 or later and the frameworks
1682 # have an install name that begins with @rpath
1683 # and aren't installed in a frameworks directory
1684 # that's searched by default.
1688 if test $qt_version -le 4
1690 Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs QtCore | sed -e 's/-F//' -e 's/ -framework.*//'`
1692 Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs Qt${qt_version}Core | sed -e 's/-F//' -e 's/ -framework.*//'`
1696 AC_SUBST(Qt_LDFLAGS)
1703 # They didn't explicitly ask for Qt,
1704 # so just don't build with it.
1709 AC_MSG_ERROR([Qt is not available])
1713 AC_MSG_ERROR([Qt 4 is not available])
1717 AC_MSG_ERROR([Qt 5 is not available])
1723 if test "x$with_gtk3" = "xyes"; then
1725 # GTK+ 3 was specified; make sure they didn't also
1726 # specify GTK+ 2, as we don't support building both
1727 # GTK+ 2 and GTK+ 3 versions at the same time.
1729 if test "x$with_gtk2" = "xyes"; then
1730 AC_MSG_ERROR([Both GTK+ 2 and GTK+ 3 were specified; choose one but not both])
1734 # Make sure we have GTK+ 3.
1736 AM_PATH_GTK_3_0(3.0.0,
1738 CFLAGS="$CFLAGS $GTK_CFLAGS"
1739 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
1741 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk3"
1743 [AC_MSG_ERROR([GTK+ 3 is not available])])
1744 elif test "x$with_gtk2" = "xyes"; then
1746 # GTK+ 3 wasn't specified, and GTK+ 2 was specified;
1747 # make sure we have GTK+ 2.
1749 AM_PATH_GTK_2_0($GTK2_MIN_VERSION,
1751 CFLAGS="$CFLAGS $GTK_CFLAGS"
1752 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
1754 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk2"
1756 [AC_MSG_ERROR([GTK+ 2 is not available])])
1759 AC_SUBST(GUI_CONFIGURE_FLAGS)
1761 GLIB_MIN_VERSION=2.16.0
1762 AC_SUBST(GLIB_MIN_VERSION)
1763 # GLib checks; we require GLib $GLIB_MIN_VERSION or later, and require gmodule
1764 # support, as we need that for dynamically loading plugins.
1765 # If we found GTK+, this doesn't add GLIB_CFLAGS to CFLAGS, because
1766 # AM_PATH_GTK will add GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a
1767 # superset of GLIB_CFLAGS. If we didn't find GTK+, it does add
1768 # GLIB_CFLAGS to CFLAGS.
1769 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
1770 # set when generating the Makefile, so we can make programs that require
1771 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
1772 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
1773 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
1774 # programs to be built with GLib.
1776 # Release dates for GLib versions:
1777 # 2.14.0: 03 Aug 2007
1778 # 2.16.0: 10 Mar 2008
1779 # 2.18.0: 02 Sep 2008
1780 # 2.20.0: 13 Mar 2009
1781 # 2.22.0: 22 Sep 2009
1782 # 2.24.0: 28 Mar 2010
1783 # 2.26.0: 27 Sep 2010
1784 # 2.28.0: 08 Feb 2011
1785 # 2.30.0: 27 Sep 2011
1786 # 2.32.0: 24 Mar 2012
1787 # 2.34.0: 24 Sep 2012
1788 # 2.36.0: 25 Mar 2013
1789 # 2.38.0: 23 Sep 2013
1790 # 2.40.0: 24 Mar 2014
1791 # 2.42.0: 22 Sep 2014
1792 # 2.44.0: 23 Mar 2014
1793 # 2.46.0: 25 Sep 2015
1795 use_glib_cflags="true"
1796 if test "$have_gtk" = "yes" -a "$have_qt" = "yes" ; then
1797 # We have both GTK and Qt and thus will be building both wireshark
1798 # and wireshark-gtk.
1800 wireshark_bin="wireshark\$(EXEEXT) wireshark-gtk\$(EXEEXT)"
1801 wireshark_man="wireshark.1"
1802 wireshark_SUBDIRS="codecs ui/qt ui/gtk"
1804 if test "$have_gtk" = "no" -a "$have_qt" = "yes" ; then
1805 # We don't have GTK+ but we have Qt.
1807 wireshark_bin="wireshark\$(EXEEXT)"
1808 wireshark_man="wireshark.1"
1809 wireshark_SUBDIRS="codecs ui/qt"
1811 if test "$have_gtk" = "yes" -a "$have_qt" = "no" ; then
1812 # We have GTK+ but not Qt.
1814 wireshark_bin="wireshark-gtk\$(EXEEXT)"
1815 wireshark_man="wireshark.1"
1816 wireshark_SUBDIRS="codecs ui/gtk"
1817 use_glib_cflags="false"
1818 OSX_APP_FLAGS="$OSX_APP_FLAGS -gtk"
1819 OSX_DMG_FLAGS="-gtk"
1821 if test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
1822 # We have neither GTK+ nor Qt.
1824 # If they didn't explicitly say "--disable-wireshark",
1825 # fail (so that, unless they explicitly indicated that
1826 # they don't want Wireshark, we stop so they know they
1827 # won't be getting Wireshark unless they fix the GTK+/Qt
1830 if test "x$enable_wireshark" = "xyes"; then
1831 if test "x$with_gtk3" = "xyes"; then
1832 AC_MSG_ERROR([Neither Qt nor GTK+ $GTK3_MIN_VERSION or later are available, so Wireshark can't be compiled])
1834 AC_MSG_ERROR([Neither Qt nor GTK+ $GTK2_MIN_VERSION or later are available, so Wireshark can't be compiled])
1841 if test "$have_gtk" = "yes" ; then
1842 # If we have GTK then add flags for it.
1844 CPPFLAGS="-DGDK_DISABLE_DEPRECATED $CPPFLAGS"
1845 if test \( $gtk_config_major_version -eq 3 -a $gtk_config_minor_version -ge 10 \) ; then
1846 ## Allow use of deprecated & disable deprecated warnings if Gtk >= 3.10;
1847 ## The deprecations in Gtk 3.10 will not be fixed ...
1848 CPPFLAGS="-DGDK_DISABLE_DEPRECATION_WARNINGS $CPPFLAGS"
1850 CPPFLAGS="-DGTK_DISABLE_DEPRECATED $CPPFLAGS"
1852 CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
1853 if test ! \( $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -lt 20 \) ; then
1854 # Enable GSEAL when building with GTK > 2.20
1855 # (Versions prior to 2.22 lacked some necessary accessors.)
1856 CPPFLAGS="-DGSEAL_ENABLE $CPPFLAGS"
1860 # XXX - Is this really necessary? When we build with both Gtk+ and Qt it works...
1861 if test "$use_glib_cflags" = "true"; then
1863 AM_PATH_GLIB_2_0($GLIB_MIN_VERSION,
1865 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1866 CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS"
1867 ], AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
1869 # Don't use GLIB_CFLAGS
1870 AM_PATH_GLIB_2_0($GLIB_MIN_VERSION, , AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
1873 # Check for GResource support
1874 PKG_CHECK_EXISTS([gio-2.0 >= 2.32 gdk-pixbuf-2.0 >= 2.26], [have_gresource=yes], [have_gresource=no])
1875 AM_CONDITIONAL(HAVE_GRESOURCE, test "x$have_gresource" = "xyes")
1876 if test "x$have_gresource" = "xyes"; then
1877 AC_DEFINE(HAVE_GRESOURCE, 1, [Defined if GLib GResource is supported])
1880 # Error out if a glib header other than a "top level" header
1881 # (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
1883 CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
1885 # Error out on the usage of deprecated glib functions
1886 CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
1889 # Check whether GLib modules are supported, to determine whether we
1890 # can support plugins.
1892 AC_MSG_CHECKING(whether GLib supports loadable modules)
1893 ac_save_CFLAGS="$CFLAGS"
1894 ac_save_LIBS="$LIBS"
1895 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1896 LIBS="$GLIB_LIBS $LIBS"
1899 #include <gmodule.h>
1906 if (g_module_supported())
1907 return 0; /* success */
1909 return 1; /* failure */
1911 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
1912 [echo $ac_n "cross compiling; assumed OK... $ac_c"
1913 ac_cv_glib_supports_modules=yes])
1914 CFLAGS="$ac_save_CFLAGS"
1915 LIBS="$ac_save_LIBS"
1916 if test "$ac_cv_glib_supports_modules" = yes ; then
1919 plugins_dir="plugins"
1925 AC_SUBST(plugins_dir)
1928 # If we have <dlfcn.h>, check whether we have dladdr.
1930 if test "$ac_cv_header_dlfcn_h" = "yes"
1933 # Use GLib compiler flags and linker flags; GLib's gmodule
1934 # stuff uses the dl APIs if available, so it might know
1935 # what flags are needed.
1937 ac_save_CFLAGS="$CFLAGS"
1938 ac_save_LIBS="$LIBS"
1939 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1940 LIBS="$GLIB_LIBS $LIBS"
1941 AC_CHECK_FUNCS(dladdr)
1942 if test x$ac_cv_func_dladdr = xno
1945 # OK, try it with -ldl, in case you need that to get
1946 # dladdr(). For some reason, on Linux, that's not
1947 # part of the GLib flags; perhaps GLib itself is
1948 # linked with libdl, so that you can link with
1949 # Glib and it'll pull libdl in itself.
1952 AC_CHECK_FUNCS(dladdr)
1954 CFLAGS="$ac_save_CFLAGS"
1955 LIBS="$ac_save_LIBS"
1959 # Check whether GLib's printf supports thousands grouping. (This might
1960 # be different from the system's printf since GLib can optionally use
1961 # its own printf implementation.)
1963 AC_MSG_CHECKING(whether GLib supports POSIX/XSI thousands grouping)
1964 ac_save_CFLAGS="$CFLAGS"
1965 ac_save_LIBS="$LIBS"
1966 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1967 LIBS="$GLIB_LIBS $LIBS"
1978 setlocale(LC_ALL, "en_US.UTF-8");
1979 str = g_strdup_printf("%'u", 123456);
1980 return (strcmp (str, "123,456") != 0);
1982 ], ac_cv_glib_supports_printf_grouping=yes, ac_cv_glib_supports_printf_grouping=no,
1983 [echo $ac_n "cross compiling; playing it safe... $ac_c"
1984 ac_cv_glib_supports_printf_grouping=no])
1985 CFLAGS="$ac_save_CFLAGS"
1986 LIBS="$ac_save_LIBS"
1987 if test "$ac_cv_glib_supports_printf_grouping" = yes ; then
1989 AC_DEFINE(HAVE_GLIB_PRINTF_GROUPING, 1, [Define if GLib's printf functions support thousands grouping.])
1994 if test "x$have_gtk" = "xyes"
1997 # We have GTK+; do we want the OS X integration functions and,
1998 # if so, do we have them and, if so, which versions do we have,
1999 # the old Carbon-based ones or the new Cocoa-based ones?
2001 AC_MSG_CHECKING(whether to use OS X integration functions)
2003 AC_ARG_WITH(osx-integration,
2004 AC_HELP_STRING( [--with-osx-integration],
2005 [use OS X integration functions @<:@default=yes, if available@:>@]),
2007 if test $withval = no
2009 want_osx_integration=no
2011 want_osx_integration=yes
2014 want_osx_integration=yes
2016 if test "x$want_osx_integration" = "xno"; then
2020 AC_WIRESHARK_OSX_INTEGRATION_CHECK
2024 AC_SUBST(wireshark_bin)
2025 AC_SUBST(wireshark_man)
2026 AM_CONDITIONAL(HAVE_Qt, test "$have_qt" = "yes")
2027 AM_CONDITIONAL(HAVE_GTK, test "$have_gtk" = "yes")
2028 AC_SUBST(OSX_APP_FLAGS)
2029 AC_SUBST(OSX_DMG_FLAGS)
2031 # Enable/disable tshark
2032 AC_ARG_ENABLE(tshark,
2033 AC_HELP_STRING( [--enable-tshark],
2034 [build tshark @<:@default=yes@:>@]),
2035 tshark=$enableval,enable_tshark=yes)
2037 if test "x$enable_tshark" = "xyes" ; then
2038 tshark_bin="tshark\$(EXEEXT)"
2039 tshark_man="tshark.1"
2040 wiresharkfilter_man="wireshark-filter.4"
2045 AC_SUBST(tshark_bin)
2046 AC_SUBST(tshark_man)
2048 # Enable/disable editcap
2050 AC_ARG_ENABLE(editcap,
2051 AC_HELP_STRING( [--enable-editcap],
2052 [build editcap @<:@default=yes@:>@]),
2053 enable_editcap=$enableval,enable_editcap=yes)
2055 if test "x$enable_editcap" = "xyes" ; then
2056 editcap_bin="editcap\$(EXEEXT)"
2057 editcap_man="editcap.1"
2062 AC_SUBST(editcap_bin)
2063 AC_SUBST(editcap_man)
2066 # Enabling/disabling of dumpcap is done later (after we know if we have PCAP
2069 # Enable/disable capinfos
2071 AC_ARG_ENABLE(capinfos,
2072 AC_HELP_STRING( [--enable-capinfos],
2073 [build capinfos @<:@default=yes@:>@]),
2074 enable_capinfos=$enableval,enable_capinfos=yes)
2076 if test "x$enable_capinfos" = "xyes" ; then
2077 capinfos_bin="capinfos\$(EXEEXT)"
2078 capinfos_man="capinfos.1"
2083 AC_SUBST(capinfos_bin)
2084 AC_SUBST(capinfos_man)
2086 # Enable/disable captype
2088 AC_ARG_ENABLE(captype,
2089 AC_HELP_STRING( [--enable-captype],
2090 [build captype @<:@default=yes@:>@]),
2091 enable_captype=$enableval,enable_captype=yes)
2093 if test "x$enable_captype" = "xyes" ; then
2094 captype_bin="captype\$(EXEEXT)"
2095 captype_man="captype.1"
2100 AC_SUBST(captype_bin)
2101 AC_SUBST(captype_man)
2103 # Enable/disable mergecap
2105 AC_ARG_ENABLE(mergecap,
2106 AC_HELP_STRING( [--enable-mergecap],
2107 [build mergecap @<:@default=yes@:>@]),
2108 enable_mergecap=$enableval,enable_mergecap=yes)
2110 if test "x$enable_mergecap" = "xyes" ; then
2111 mergecap_bin="mergecap\$(EXEEXT)"
2112 mergecap_man="mergecap.1"
2117 AC_SUBST(mergecap_bin)
2118 AC_SUBST(mergecap_man)
2120 # Enable/disable reordercap
2122 AC_ARG_ENABLE(reordercap,
2123 AC_HELP_STRING( [--enable-reordercap],
2124 [build reordercap @<:@default=yes@:>@]),
2125 enable_reordercap=$enableval,enable_reordercap=yes)
2127 if test "x$enable_reordercap" = "xyes" ; then
2128 reordercap_bin="reordercap\$(EXEEXT)"
2129 reordercap_man="reordercap.1"
2134 AC_SUBST(reordercap_bin)
2135 AC_SUBST(reordercap_man)
2137 # Enable/disable text2pcap
2139 AC_ARG_ENABLE(text2pcap,
2140 AC_HELP_STRING( [--enable-text2pcap],
2141 [build text2pcap @<:@default=yes@:>@]),
2142 text2pcap=$enableval,enable_text2pcap=yes)
2144 if test "x$enable_text2pcap" = "xyes" ; then
2145 text2pcap_bin="text2pcap\$(EXEEXT)"
2146 text2pcap_man="text2pcap.1"
2151 AC_SUBST(text2pcap_bin)
2152 AC_SUBST(text2pcap_man)
2154 # Enable/disable dftest
2156 AC_ARG_ENABLE(dftest,
2157 AC_HELP_STRING( [--enable-dftest],
2158 [build dftest @<:@default=yes@:>@]),
2159 enable_dftest=$enableval,enable_dftest=yes)
2161 if test "x$enable_dftest" = "xyes" ; then
2162 dftest_bin="dftest\$(EXEEXT)"
2163 dftest_man="dftest.1"
2168 AC_SUBST(dftest_bin)
2169 AC_SUBST(dftest_man)
2171 # Enable/disable randpkt
2173 AC_ARG_ENABLE(randpkt,
2174 AC_HELP_STRING( [--enable-randpkt],
2175 [build randpkt @<:@default=yes@:>@]),
2176 enable_randpkt=$enableval,enable_randpkt=yes)
2178 if test "x$enable_randpkt" = "xyes" ; then
2179 randpkt_bin="randpkt\$(EXEEXT)"
2180 randpkt_man="randpkt.1"
2185 AC_SUBST(randpkt_bin)
2186 AC_SUBST(randpkt_man)
2188 AC_SUBST(wiresharkfilter_man)
2190 dnl Checks for "connect()", used as a proxy for "socket()" - and
2191 dnl "-lsocket", if we need it to get "connect()".
2192 AC_WIRESHARK_SOCKET_LIB_CHECK
2195 AC_MSG_CHECKING(whether to use libpcap for packet capture)
2198 AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
2199 [use libpcap for packet capturing @<:@default=yes@:>@]),
2201 if test $withval = no
2204 elif test $withval = yes
2215 if test "x$want_pcap" = "xno" ; then
2219 AC_WIRESHARK_PCAP_CHECK
2223 AC_MSG_CHECKING(whether to build dumpcap)
2225 AC_ARG_ENABLE(dumpcap,
2226 AC_HELP_STRING( [--enable-dumpcap],
2227 [build dumpcap @<:@default=yes@:>@]),
2228 enable_dumpcap=$enableval,enable_dumpcap=yes)
2230 if test "x$enable_dumpcap" = "xyes" ; then
2231 if test "x$want_pcap" = "xno" ; then
2233 AC_MSG_RESULT(pcap not available - disabling dumpcap)
2241 if test "x$enable_dumpcap" = "xyes" ; then
2242 dumpcap_bin="dumpcap\$(EXEEXT)"
2243 dumpcap_man="dumpcap.1"
2248 AC_SUBST(dumpcap_bin)
2249 AC_SUBST(dumpcap_man)
2251 # Enable/disable rawshark
2254 AC_MSG_CHECKING(whether to build rawshark)
2256 AC_ARG_ENABLE(rawshark,
2257 AC_HELP_STRING( [--enable-rawshark],
2258 [build rawshark @<:@default=yes@:>@]),
2259 rawshark=$enableval,enable_rawshark=yes)
2261 if test "x$enable_rawshark" = "xyes" ; then
2262 if test "x$want_pcap" = "xno" ; then
2264 AC_MSG_RESULT(pcap not available - disabling rawshark)
2272 if test "x$enable_rawshark" = "xyes" ; then
2273 rawshark_bin="rawshark\$(EXEEXT)"
2274 rawshark_man="rawshark.1"
2279 AC_SUBST(rawshark_bin)
2280 AC_SUBST(rawshark_man)
2282 dnl androiddump check
2283 AC_MSG_CHECKING(whether to build androiddump)
2285 AC_ARG_ENABLE(androiddump,
2286 AC_HELP_STRING( [--enable-androiddump],
2287 [build androiddump @<:@default=yes@:>@]),
2288 androiddump=$enableval,enable_androiddump=yes)
2290 if test "x$enable_androiddump" = "xyes" ; then
2296 AC_ARG_ENABLE(androiddump_use_libpcap,
2297 AC_HELP_STRING( [--enable-androiddump-use-libpcap],
2298 [build androiddump using libpcap @<:@default=no@:>@]),
2299 androiddump_use_libpcap=$enableval,enable_androiddump_use_libpcap=no)
2301 if test "x$enable_androiddump_use_libpcap" = "xyes" ; then
2302 AC_DEFINE(ANDROIDDUMP_USE_LIBPCAP, 1, [Androiddump will use Libpcap])
2305 if test "x$enable_androiddump" = "xyes" ; then
2306 androiddump_bin="androiddump\$(EXEEXT)"
2312 AC_SUBST(androiddump_bin)
2313 AC_SUBST(androiddump_man)
2316 AC_MSG_CHECKING(whether to build sshdump)
2318 AC_ARG_ENABLE(sshdump,
2319 AC_HELP_STRING( [--enable-sshdump],
2320 [build sshdump @<:@default=yes@:>@]),
2321 sshdump=$enableval,enable_sshdump=yes)
2323 if test "x$enable_sshdump" = "xyes" ; then
2329 # Enable/disable echld
2330 AC_ARG_ENABLE(echld,
2331 AC_HELP_STRING( [--enable-echld],
2332 [support echld (Experimental) @<:@default=no@:>@]),
2333 have_echld=$enableval,have_echld=no)
2335 AM_CONDITIONAL(HAVE_ECHLD, test "x$have_echld" = "xyes")
2336 if test "x$have_echld" = "xyes"
2338 AC_DEFINE(HAVE_ECHLD, 1, [Define if echld is enabled])
2339 echld_test_bin="echld_test\$(EXEEXT)"
2346 AC_SUBST(echld_test_bin)
2349 # Enable/disable tfshark
2350 AC_ARG_ENABLE(tfshark,
2351 AC_HELP_STRING( [--enable-tfshark],
2352 [build tfshark (Experimental) @<:@default=no@:>@]),
2353 tfshark=$enableval,enable_tfshark=no)
2355 if test "x$enable_tfshark" = "xyes" ; then
2356 tfshark_bin="tfshark\$(EXEEXT)"
2357 tfshark_man="tfshark.1"
2358 wiresharkfilter_man="wireshark-filter.4"
2363 AC_SUBST(tfshark_bin)
2364 AC_SUBST(tfshark_man)
2367 dnl Use pcap-ng by default
2368 AC_ARG_ENABLE(pcap-ng-default,
2369 AC_HELP_STRING( [--enable-pcap-ng-default],
2370 [use the pcap-ng file format by default instead of pcap @<:@default=yes@:>@]),
2371 enable_pcap_ng_default=$enableval,enable_pcap_ng_default=yes)
2372 if test x$enable_pcap_ng_default = xyes; then
2373 AC_DEFINE(PCAP_NG_DEFAULT, 1, [Support for pcap-ng])
2376 dnl pcap remote check
2377 AC_MSG_CHECKING(whether to use libpcap remote capturing feature)
2379 AC_ARG_WITH(pcap-remote,
2380 AC_HELP_STRING([--with-pcap-remote],
2381 [use libpcap remote capturing (requires libpcap)]),
2383 if test $withval = no
2387 want_pcap_remote=yes
2392 if test "x$want_pcap_remote" = "xno" -o "x$want_pcap" = "xno" ; then
2396 AC_WIRESHARK_PCAP_REMOTE_CHECK
2400 AC_MSG_CHECKING(whether to use zlib for gzip compression and decompression)
2403 AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
2404 [use zlib (located in directory DIR, if supplied) for gzip compression and decompression @<:@default=yes, if available@:>@]),
2406 if test "x$withval" = "xno"
2409 elif test "x$withval" = "xyes"
2418 # Use zlib if it's present, otherwise don't.
2420 want_zlib=ifavailable
2423 if test "x$want_zlib" = "xno" ; then
2427 AC_WIRESHARK_ZLIB_CHECK
2428 if test "x$want_zlib" = "xno" ; then
2429 AC_MSG_RESULT(zlib not found - disabling gzip compression and decompression)
2431 if test "x$ac_cv_func_inflatePrime" = "xno" ; then
2432 AC_MSG_RESULT(inflatePrime not found in zlib - disabling gzipped capture file support)
2439 AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
2440 [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin @<:@default=yes, if available@:>@]),
2442 if test $withval = no
2445 elif test $withval = yes
2450 want_lua_dir=$withval
2453 # By default use Lua if we can find it
2454 want_lua=ifavailable
2457 if test "x$want_lua" != "xno" ; then
2458 AC_WIRESHARK_LIBLUA_CHECK
2460 if test "x$want_lua" = "xyes" -a "x$have_lua" = "xno"
2462 AC_MSG_ERROR([Lua support was requested, but is not available])
2465 if test "x$have_lua" = "xyes"
2467 AC_DEFINE(HAVE_LUA, 1, [Define to use Lua])
2469 AM_CONDITIONAL(HAVE_LIBLUA, test x$have_lua = xyes)
2471 AC_SUBST(LUA_CFLAGS)
2475 AC_MSG_CHECKING(whether to use libportaudio for the GTK+ RTP player)
2477 AC_ARG_WITH(portaudio,
2478 AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
2479 [use libportaudio (located in directory DIR, if supplied) for the GTK+ RTP player @<:@default=yes, if available@:>@]),
2481 if test $withval = no
2484 elif test $withval = yes
2489 portaudio_dir=$withval
2493 # Use libportaudio by default
2495 want_portaudio=ifavailable
2498 if test "x$want_portaudio" = "xno" ; then
2502 AC_WIRESHARK_LIBPORTAUDIO_CHECK
2503 if test "x$want_portaudio" = "xno" ; then
2504 AC_MSG_RESULT(libportaudio not found - disabling support for the GTK+ RTP player)
2507 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
2510 dnl Check if dumpcap should be installed with filesystem capabilities
2511 AC_PATH_PROG(SETCAP, setcap)
2512 AC_ARG_ENABLE(setcap-install,
2513 AC_HELP_STRING( [--enable-setcap-install],
2514 [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
2515 enable_setcap_install=$enableval,enable_setcap_install=no)
2517 AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
2518 if test "x$enable_setcap_install" = "xno" ; then
2521 if test "x$SETCAP" = "x" ; then
2522 AC_MSG_RESULT(setcap not found)
2523 AC_MSG_ERROR([Setcap install was requested, but setcap was not found])
2524 elif test "x$enable_dumpcap" = "xno" ; then
2525 AC_MSG_RESULT(dumpcap disabled)
2526 AC_MSG_ERROR([Setcap install works only with dumpcap, but dumpcap is disabled])
2532 AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
2534 dnl Check if dumpcap should be installed setuid
2535 AC_ARG_ENABLE(setuid-install,
2536 AC_HELP_STRING( [--enable-setuid-install],
2537 [install dumpcap as setuid @<:@default=no@:>@]),
2538 enable_setuid_install=$enableval,enable_setuid_install=no)
2540 AC_MSG_CHECKING(whether to install dumpcap setuid)
2541 if test "x$enable_setuid_install" = "xno" ; then
2544 if test "x$enable_setcap_install" = "xyes" ; then
2545 enable_setuid_install=no
2546 AC_MSG_RESULT(setcap and setuid both selected)
2547 AC_MSG_ERROR(You must choose one of setcap install and setuid install)
2548 elif test "x$enable_dumpcap" = "xno" ; then
2549 AC_MSG_RESULT(dumpcap disabled)
2550 AC_MSG_ERROR([Setuid install works only with dumpcap, but dumpcap is disabled])
2556 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
2557 AC_CHECK_FUNCS(setresuid setresgid)
2559 dnl ...but our Network Operations group is named "no"!
2561 AC_ARG_WITH(dumpcap-group,
2562 AC_HELP_STRING( [--with-dumpcap-group=GROUP],
2563 [restrict dumpcap to GROUP]),
2565 if test "x$withval" = "xyes"; then
2566 AC_MSG_ERROR([No dumpcap group specified.])
2567 elif test "x$withval" != "xno"; then
2568 if test "x$enable_dumpcap" = "xno" ; then
2569 AC_MSG_ERROR(dumpcap group install works only with dumpcap but dumpcap is disabled)
2571 AC_MSG_RESULT($withval)
2572 DUMPCAP_GROUP="$withval"
2575 AC_SUBST(DUMPCAP_GROUP)
2576 AM_CONDITIONAL(HAVE_DUMPCAP_GROUP, test x$DUMPCAP_GROUP != x)
2578 dnl libcap (not libpcap) check
2580 AC_MSG_CHECKING(whether to use the libcap capabilities library)
2583 AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
2584 [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management @<:@default=yes, if present@:>@]),
2586 if test "x$withval" = "xno"; then
2588 elif test "x$withval" = "xyes"; then
2590 elif test -d "$withval"; then
2592 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2595 if test "x$with_libcap" = "xno" ; then
2599 AC_WIRESHARK_LIBCAP_CHECK
2601 AC_SUBST(LIBCAP_LIBS)
2603 dnl Checks for header files.
2604 dnl Some of these may not be needed: http://hacks.owlfolio.org/header-survey/
2605 dnl Note, however, that, whilst this script is generally run only on UN*Xes:
2607 dnl 1) we also support building on and for Windows and not all of those
2608 dnl headers are present on Windows, so the code has to check a
2609 dnl #define *anyway* to determine whether to include the header
2614 dnl 2) this might also be run on Windows with a sufficiently UNIXy
2615 dnl environment such as Cygwin (although Wireshark should be built
2616 dnl natively rather than using Cygwin).
2618 AC_CHECK_HEADERS(fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h unistd.h)
2619 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)
2620 AC_CHECK_HEADERS(netinet/in.h)
2621 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
2624 # On Linux, check for some additional headers, which we need as a
2625 # workaround for a bonding driver bug and for libpcap's current lack
2626 # of its own workaround for that bug.
2630 AC_CHECK_HEADERS(linux/sockios.h linux/if_bonding.h,,,[#include <sys/socket.h>])
2636 AC_MSG_CHECKING(whether to use SSL library)
2639 AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
2640 [use SSL crypto library (located in directory DIR, if supplied) @<:@default=no@:>@]),
2642 if test "x$withval" = "xno"; then
2644 elif test "x$withval" = "xyes"; then
2646 elif test -d "$withval"; then
2648 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2653 if test "x$want_ssl" = "xyes"; then
2655 AC_CHECK_LIB(crypto,EVP_md5,
2660 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
2668 AC_MSG_CHECKING(whether to use Kerberos library)
2671 AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
2672 [use Kerberos library (located in directory DIR, if supplied) to use in Kerberos dissection @<:@default=yes@:>@]),
2674 if test $withval = no
2677 elif test $withval = yes
2686 # Use Kerberos library if available, otherwise don't.
2688 want_krb5=ifavailable
2691 if test "x$want_krb5" = "xno" ; then
2695 AC_WIRESHARK_KRB5_CHECK
2701 AC_MSG_CHECKING(whether to use the c-ares library if available)
2704 AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
2705 [use c-ares (located in directory DIR, if supplied) - supersedes --with-adns @<:@default=yes, if present@:>@]),
2707 if test "x$withval" = "xno"; then
2709 elif test "x$withval" = "xyes"; then
2711 elif test -d "$withval"; then
2713 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2716 if test "x$want_c_ares" = "xno" ; then
2720 AC_WIRESHARK_C_ARES_CHECK
2722 AC_SUBST(C_ARES_LIBS)
2726 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
2729 AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
2730 [use GNU ADNS (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2732 if test "x$withval" = "xno"; then
2734 elif test "x$withval" = "xyes"; then
2736 elif test -d "$withval"; then
2738 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2741 if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
2745 AC_WIRESHARK_ADNS_CHECK
2749 if test "x$have_good_c_ares" != "xyes" -a "x$have_good_adns" != "xyes"; then
2750 # We don't have an asynchronous name resolver, look for a synchronous one
2752 dnl Checks for "getaddrinfo()" - and "-lnsl", if we need it to get
2753 dnl "getaddrinfo()".
2754 AC_WIRESHARK_GETADDRINFO_LIB_CHECK
2756 if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then
2757 # We don't have the modern name resolver, try older stuff
2759 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
2760 dnl "gethostbyname()".
2761 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
2763 if test "x$ac_cv_func_gethostbyname" != "xyes" ; then
2764 # Hopefully this never actually happens.
2765 # The code works even without name resolvers but we
2766 # alert the user to this unusual condition.
2767 AC_MSG_ERROR(Couldn't find any name resolvers!)
2770 AC_CHECK_FUNCS(gethostbyname2)
2776 AC_MSG_CHECKING(whether to use the GeoIP IP address mapping library if available)
2779 AC_HELP_STRING( [--with-geoip@<:@=DIR@:>@],
2780 [use GeoIP (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2782 if test "x$withval" = "xno"; then
2784 elif test "x$withval" = "xyes"; then
2786 elif test -d "$withval"; then
2788 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2791 if test "x$want_geoip" = "xno"; then
2795 AC_WIRESHARK_GEOIP_CHECK
2797 AC_SUBST(GEOIP_LIBS)
2801 AC_MSG_CHECKING(whether to use the libssh library if available)
2804 AC_HELP_STRING( [--with-libssh@<:@=DIR@:>@],
2805 [use libssh (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2807 if test "x$withval" = "xno"; then
2809 elif test "x$withval" = "xyes"; then
2811 elif test -d "$withval"; then
2813 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2816 if test "x$want_libssh" = "xno"; then
2820 AC_WIRESHARK_LIBSSH_CHECK
2822 AC_SUBST(LIBSSH_LIBS)
2825 # Define WS_MSVC_NORETURN appropriately for declarations of routines that
2826 # never return (just like Charlie on the MTA).
2828 # Note that MSVC++ expects __declspec(noreturn) to precede the function
2829 # name and GCC, as far as I know, expects __attribute__((noreturn)) to
2830 # follow the function name, so we need two different flavors of
2833 AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
2835 dnl Checks for typedefs, structures, and compiler characteristics.
2838 # Check how we can get the time zone abbreviation
2839 AC_WIRESHARK_TIMEZONE_ABBREV
2841 # We need to know whether "struct stat" has an "st_flags" member
2842 # for file_user_immutable().
2844 AC_WIRESHARK_STRUCT_ST_FLAGS
2846 # We need to know whether "struct sockaddr" has an "sa_len" member
2847 # for get_interface_list().
2849 AC_WIRESHARK_STRUCT_SA_LEN
2851 # We must know our byte order
2854 # Checks whether "-traditional" is needed when using "ioctl".
2855 # XXX - do we need this?
2856 AC_PROG_GCC_TRADITIONAL
2858 AC_CHECK_FUNC(getopt_long,
2861 AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define to 1 if you have the getopt_long function.])
2864 # Do we have optreset?
2866 AC_MSG_CHECKING(whether optreset is defined)
2869 extern int optreset;
2873 ac_cv_pcap_debug_defined=yes,
2874 ac_cv_pcap_debug_defined=no)
2875 if test "$ac_cv_pcap_debug_defined" = yes ; then
2877 AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable])
2882 GETOPT_LO="wsgetopt.lo")
2885 AC_CHECK_FUNCS(mkstemp mkdtemp)
2887 AC_SEARCH_LIBS(inet_aton, [socket nsl],
2890 AC_DEFINE(HAVE_INET_ATON, 0, [Define to 1 if you have the inet_aton function.])
2892 INET_ATON_LO="inet_aton.lo")
2893 AC_SUBST(INET_ATON_LO)
2895 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
2896 dnl check for pre-BIND82 inet_pton() bug.
2897 AC_MSG_CHECKING(for broken inet_pton)
2898 AC_TRY_RUN([#include <sys/types.h>
2899 #include <sys/socket.h>
2900 #include <netinet/in.h>
2901 #include <arpa/inet.h>
2906 /* this should return 0 (error) */
2907 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
2911 }], [AC_MSG_RESULT(ok);
2912 have_inet_pton=yes], [AC_MSG_RESULT(broken);
2913 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
2914 have_inet_pton=no])],
2916 if test "$have_inet_pton" = no; then
2917 INET_PTON_LO="inet_pton.lo"
2921 AM_CONDITIONAL(NEED_INET_PTON_LO, test "x$have_inet_pton" = "xno")
2922 AC_SUBST(INET_PTON_LO)
2924 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
2925 AC_MSG_CHECKING([for inet_ntop prototype])
2926 AC_TRY_COMPILE([#include <stdio.h>
2927 #include <sys/types.h>
2928 #include <sys/socket.h>
2929 #include <netinet/in.h>
2930 #include <arpa/inet.h>
2932 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
2934 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
2935 [Define if inet_ntop() prototype exists])], [
2936 AC_TRY_COMPILE([#include <stdio.h>
2937 #include <sys/types.h>
2938 #include <sys/socket.h>
2939 #include <netinet/in.h>
2940 #include <arpa/inet.h>
2942 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
2944 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
2945 [Define if inet_ntop() prototype exists])], [
2946 AC_MSG_RESULT(no)])])
2948 INET_NTOP_LO="inet_ntop.lo"
2949 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
2950 [Define if inet/v6defs.h needs to be included])])
2951 AM_CONDITIONAL(NEED_INET_NTOP_LO, test "x$INET_NTOP_LO" != "x")
2952 AC_SUBST(INET_NTOP_LO)
2954 AC_CHECK_FUNC(strptime,
2957 AC_DEFINE(HAVE_STRPTIME, 1, [Define if you have the strptime function.])
2959 STRPTIME_LO="strptime.lo")
2960 AC_SUBST(STRPTIME_LO)
2962 AC_CHECK_FUNC(popcount,
2965 AC_DEFINE(HAVE_POPCOUNT, 1, [Define if you have the popcount function.])
2967 POPCOUNT_LO="popcount.lo")
2968 AC_SUBST(POPCOUNT_LO)
2970 AC_CHECK_FUNCS(getprotobynumber)
2971 AC_CHECK_FUNCS(issetugid)
2972 AC_CHECK_FUNCS(sysconf)
2974 dnl blank for now, but will be used in future
2975 AC_SUBST(wireshark_SUBDIRS)
2977 # Check Bluetooth SBC codec for RTP Player
2978 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
2980 AC_HELP_STRING( [--with-sbc=@<:@yes/no@:>@],
2981 [use SBC codec to play Bluetooth A2DP stream @<:@default=yes, if available@:>@]),
2982 with_sbc="$withval"; want_sbc="yes", with_sbc="yes")
2984 PKG_CHECK_MODULES(SBC, sbc >= 1.0, [have_sbc=yes], [have_sbc=no])
2985 if test "x$with_sbc" != "xno"; then
2986 if (test "${have_sbc}" = "yes"); then
2987 AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
2988 elif test "x$want_sbc" = "xyes"; then
2989 # Error out if the user explicitly requested the sbc library
2990 AC_MSG_ERROR([SBC codec library was requested, but is not available])
2997 dnl check whether plugins should be enabled and, if they should be,
2998 dnl check for plugins directory - stolen from Amanda's configure.ac
3000 dnl we don't wish to expand ${libdir} yet
3001 plugindir='${libdir}/wireshark/plugins/${VERSION}'
3002 AC_ARG_WITH(plugins,
3003 AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
3004 [support plugins (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
3006 if test "x$withval" = "xno"; then
3008 elif test "x$have_plugins" = "xno"; then
3009 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
3010 elif test "x$withval" != "xyes"; then
3011 plugindir="$withval"
3014 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
3015 if test x$have_plugins = xyes
3017 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
3020 CPPFLAGS="$CPPFLAGS '-DPLUGIN_INSTALL_DIR=\"\$(plugindir)\"'"
3023 # The plugin dissectors reside in ./plugins/PROTO/
3026 AC_SUBST(PLUGIN_LIBS)
3029 dnl Use extcap by default
3030 extcapdir='${datadir}/wireshark/extcap/'
3032 AC_HELP_STRING( [--with-extcap@<:@=DIR@:>@],
3033 [use extcap for external capture sources (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
3035 if test "x$withval" = "xno"; then
3037 elif test "x$withval" = "xyes"; then
3039 elif test "x$withval" != "xyes"; then
3041 extcapdir ="$withval"
3046 AM_CONDITIONAL(HAVE_EXTCAP, test "x$have_extcap" = "xyes")
3047 if test "x$have_extcap" = "xyes"
3049 AC_DEFINE(HAVE_EXTCAP, 1, [Define if external capture sources should be enabled])
3050 AC_DEFINE_UNQUOTED(EXTCAP_DIR,"$extcapdir", [Directory for extcap plugins])
3054 if test "x$enable_sshdump" = "xyes" ; then
3055 if test "x$have_good_libssh" = "xyes" ; then
3056 sshdump_bin="sshdump\$(EXEEXT)"
3057 sshdump_man="sshdump.1"
3059 echo "Can't find libssh. Disabling sshdump."
3068 AC_SUBST(sshdump_bin)
3069 AC_SUBST(sshdump_man)
3073 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
3074 # (autoconf? automake? libtool?) - with the newer version(s), it's
3075 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
3077 # With older version(s) of those tool(s), however, it's not just an
3078 # alias, and the configure scripts don't work without it.
3081 AC_SUBST(LIBTOOL_DEPS)
3083 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
3084 if test x$enable_static = xyes -a x$have_plugins = xyes
3086 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
3088 AC_SUBST(ENABLE_STATIC)
3090 # Gather which GUI we're building for rpmbuild
3091 if test "x$have_gtk" = "xyes"; then
3092 if test "x$with_gtk3" = "xyes"; then
3093 RPMBUILD_WITH_ARGS="--with gtk3 --without gtk2"
3095 RPMBUILD_WITH_ARGS="--without gtk3 --with gtk2"
3098 RPMBUILD_WITH_ARGS="--without gtk2 --without gtk3"
3100 if test "x$have_qt" = "xyes" ; then
3101 if test "$qt_version" -eq "5"; then
3102 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt5"
3104 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
3107 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt --without qt5"
3109 if test "x$have_lua" = "xyes" ; then
3110 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with lua"
3112 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without lua"
3114 AC_SUBST(RPMBUILD_WITH_ARGS)
3116 dnl Save the cacheable configure results to config.cache before recursing
3119 sinclude(plugins/Custom.m4) dnl
3120 ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
3122 sinclude(asn1/Custom.m4) dnl
3123 ifdef(_CUSTOM_ASN1_AC_OUTPUT_,, define(_CUSTOM_ASN1_AC_OUTPUT_, )) dnl
3125 AC_CONFIG_HEADERS(config.h)
3130 _CUSTOM_ASN1_AC_OUTPUT_
3131 asn1/acp133/Makefile
3133 asn1/ansi_map/Makefile
3134 asn1/ansi_tcap/Makefile
3135 asn1/atn-cm/Makefile
3136 asn1/atn-cpdlc/Makefile
3137 asn1/atn-ulcs/Makefile
3141 asn1/charging_ase/Makefile
3146 asn1/credssp/Makefile
3154 asn1/gprscdr/Makefile
3155 asn1/gsm_map/Makefile
3164 asn1/h450-ros/Makefile
3167 asn1/HI2Operations/Makefile
3172 asn1/isdn-sup/Makefile
3173 asn1/kerberos/Makefile
3176 asn1/logotypecertextn/Makefile
3180 asn1/lte-rrc/Makefile
3183 asn1/mpeg-audio/Makefile
3184 asn1/mpeg-pes/Makefile
3186 asn1/ns_cert_exts/Makefile
3187 asn1/novell_pkis/Makefile
3195 asn1/pkcs12/Makefile
3196 asn1/pkinit/Makefile
3197 asn1/pkixac/Makefile
3198 asn1/pkix1explicit/Makefile
3199 asn1/pkix1implicit/Makefile
3200 asn1/pkixproxy/Makefile
3201 asn1/pkixqualified/Makefile
3202 asn1/pkixtsp/Makefile
3205 asn1/q932-ros/Makefile
3216 asn1/sbc-ap/Makefile
3219 asn1/spnego/Makefile
3227 asn1/wlancertextn/Makefile
3229 asn1/x509af/Makefile
3230 asn1/x509ce/Makefile
3231 asn1/x509if/Makefile
3232 asn1/x509sat/Makefile
3235 capchild/doxygen.cfg
3237 caputils/doxygen.cfg
3241 epan/compress/Makefile
3244 epan/dfilter/Makefile
3245 epan/dissectors/Makefile
3246 epan/dissectors/dcerpc/Makefile
3247 epan/dissectors/pidl/Makefile
3248 epan/ftypes/Makefile
3249 epan/nghttp2/Makefile
3262 packaging/macosx/Info.plist
3263 packaging/macosx/Makefile
3264 packaging/macosx/osx-dmg.sh
3265 packaging/macosx/Wireshark_package.pmdoc/index.xml
3266 packaging/nsis/Makefile
3267 packaging/rpm/Makefile
3268 packaging/rpm/SPECS/Makefile
3269 packaging/rpm/SPECS/wireshark.spec
3270 packaging/svr4/Makefile
3271 packaging/svr4/checkinstall
3272 packaging/svr4/pkginfo
3274 plugins/docsis/Makefile
3275 plugins/easy_codec/Makefile
3276 plugins/ethercat/Makefile
3277 plugins/gryphon/Makefile
3278 plugins/irda/Makefile
3279 plugins/m2m/Makefile
3280 plugins/mate/Makefile
3281 plugins/opcua/Makefile
3282 plugins/profinet/Makefile
3283 plugins/stats_tree/Makefile
3284 plugins/unistim/Makefile
3285 plugins/wimax/Makefile
3286 plugins/wimaxasncp/Makefile
3287 plugins/wimaxmacphy/Makefile
3289 tools/lemon/Makefile
3295 dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
3300 if test "x$have_gtk" = "xyes"; then
3301 if test "x$with_gtk3" = "xyes"; then
3302 gtk_lib_message=" (with GTK+ 3"
3304 gtk_lib_message=" (with GTK+ 2"
3306 if test "x$have_ige_mac" = "xyes"; then
3307 gtk_lib_message="$gtk_lib_message and OS X integration)"
3309 gtk_lib_message="$gtk_lib_message)"
3313 if test "x$have_qt" = "xyes" ; then
3314 enable_wireshark_qt="yes"
3315 qt_lib_message=" (with Qt $qt_version)"
3317 enable_wireshark_qt="no"
3320 if test "x$enable_setcap_install" = "xyes" ; then
3321 setcap_message="yes"
3326 if test "x$enable_setuid_install" = "xyes" ; then
3327 setuid_message="yes"
3332 if test "x$DUMPCAP_GROUP" = "x" ; then
3333 dumpcap_group_message="(none)"
3335 dumpcap_group_message="$DUMPCAP_GROUP"
3338 if test "x$want_zlib" = "xno" ; then
3344 if test "x$have_lua" = "xyes" ; then
3350 if test "x$have_qt_multimedia_lib" = "xyes" ; then
3351 qt_multimedia_message="yes"
3353 qt_multimedia_message="no"
3356 if test "x$want_portaudio" = "xyes" ; then
3357 portaudio_message="yes"
3359 portaudio_message="no"
3362 if test "x$want_ssl" = "xno" ; then
3368 if test "x$want_krb5" = "xno" ; then
3371 krb5_message="yes ($ac_krb5_version)"
3374 if test "x$have_good_c_ares" = "xyes" ; then
3375 c_ares_message="yes"
3380 if test "x$have_good_adns" = "xyes" ; then
3383 if test "x$have_good_c_ares" = "xyes" ; then
3384 adns_message="no (using c-ares instead)"
3390 if test "x$have_good_libcap" = "xyes" ; then
3391 libcap_message="yes"
3396 if test "x$have_good_geoip" = "xyes" ; then
3402 if test "x$have_good_libssh" = "xyes" ; then
3403 libssh_message="yes"
3408 if test "x$have_ssh_userauth_agent" = "xyes" ; then
3409 ssh_userauth_agent_message="yes"
3411 ssh_userauth_agent_message="no"
3415 echo "The Wireshark package has been configured with the following options."
3416 echo " Build wireshark : $enable_wireshark_qt$qt_lib_message"
3417 echo " Build wireshark-gtk : $have_gtk""$gtk_lib_message"
3418 echo " Build tshark : $enable_tshark"
3419 echo " Build tfshark : $enable_tfshark"
3420 echo " Build capinfos : $enable_capinfos"
3421 echo " Build captype : $enable_captype"
3422 echo " Build editcap : $enable_editcap"
3423 echo " Build dumpcap : $enable_dumpcap"
3424 echo " Build mergecap : $enable_mergecap"
3425 echo " Build reordercap : $enable_reordercap"
3426 echo " Build text2pcap : $enable_text2pcap"
3427 echo " Build randpkt : $enable_randpkt"
3428 echo " Build dftest : $enable_dftest"
3429 echo " Build rawshark : $enable_rawshark"
3430 echo " Build androiddump : $enable_androiddump"
3431 echo " Build sshdump : $enable_sshdump"
3432 echo " Build echld : $have_echld"
3434 echo " Save files as pcap-ng by default : $enable_pcap_ng_default"
3435 echo " Install dumpcap with capabilities : $setcap_message"
3436 echo " Install dumpcap setuid : $setuid_message"
3437 echo " Use dumpcap group : $dumpcap_group_message"
3438 echo " Use plugins : $have_plugins"
3439 echo " Use external capture sources : $have_extcap"
3440 echo " Use Lua library : $lua_message"
3441 echo " Build Qt RTP player : $qt_multimedia_message"
3442 echo " Build GTK+ RTP player : $portaudio_message"
3443 echo " Build profile binaries : $enable_profile_build"
3444 echo " Use pcap library : $want_pcap"
3445 echo " Use zlib library : $zlib_message"
3446 echo " Use kerberos library : $krb5_message"
3447 echo " Use c-ares library : $c_ares_message"
3448 echo " Use GNU ADNS library : $adns_message"
3449 echo " Use SMI MIB library : $libsmi_message"
3450 echo " Use GNU crypto library : $gcrypt_message"
3451 echo " Use SSL crypto library : $ssl_message"
3452 echo " Use gnutls library : $tls_message"
3453 echo " Use POSIX capabilities library : $libcap_message"
3454 echo " Use GeoIP library : $geoip_message"
3455 echo " Use libssh library : $libssh_message"
3456 echo " Have ssh_userauth_agent : $ssh_userauth_agent_message"
3457 echo " Use nl library : $libnl_message"
3458 echo " Use SBC codec library : $have_sbc"
3459 #echo " Use GResource : $have_gresource"