2 # Autoconf script for Wireshark
6 # Define variables for the components of the Wireshark version number.
8 m4_define([version_major], [1])
9 m4_define([version_minor], [99])
10 m4_define([version_micro], [2])
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])
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])
58 # Checks for programs used in the main build process.
66 dnl Work around libtool bug (fixed in the version 1.5a?)
67 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
70 if test ! -z "$CXX"; then
72 # OK, we found something AC_LANG_CXX thinks is a C++ compiler,
75 # Some UN*Xes have, by default, a case-insensitive file
76 # system, and AC_PROG_CXX looks for, among other things,
77 # "CC" as a C++ compiler, and, if you have a case-insensitive
78 # file system and a C compiler named "cc" (both true, by
79 # default, on OS X), AC_PROG_CXX may end up thinking it's
82 # So we check by feeding the purported C++ compiler a
83 # program using C++ features (iostream).
85 # We do this after AC_PROG_LIBTOOL; if we did so before, and
86 # cleared CXX if what we had isn't a C++ compiler, that'd
87 # get undone by AC_PROG_LIBTOOL for some reason.
89 AC_MSG_CHECKING(whether $CXX is a C++ compiler)
91 AC_LINK_IFELSE([AC_LANG_PROGRAM(
96 std::cout << "Hello World! ";
106 AC_PATH_PROG(PERL, perl)
109 AC_PATH_PROGS(PYTHON, python, python3)
110 if test ! -z "$PYTHON"; then
112 # OK, we found Python; is it Python 2.5 or later?
113 # Note: we don't use named components for sys.version_info to get
114 # the major version number, as named components for version_info
115 # were apparently introduced in Python 2.7.
117 AC_MSG_CHECKING([whether $PYTHON is Python 2.5 or later])
118 python_major_version=`$PYTHON -c 'import sys; print (sys.version_info[[0]])'`
119 python_minor_version=`$PYTHON -c 'import sys; print (sys.version_info[[1]])'`
120 if test "$python_major_version" -eq 2 -a "$python_minor_version" -lt 5 ; then
122 AC_MSG_WARN([Building with Python $python_major_version.$python_minor_version may not work])
127 AC_MSG_ERROR(I couldn't find python; make sure it's installed and in your path)
131 # XXX - should autogen.sh check for YACC/Bison and Flex? A user building
132 # from a distribution tarball shouldn't have to have YACC/Bison or Flex,
133 # as the tarball should contain the results of running YACC/Bison on .y
134 # files and running Flex on .l files, but a user building from SVN
135 # will have to run YACC/Bison and Flex to process those files.
137 # On the other hand, what about users who use a distribution tarball to
138 # do development? They *shouldn't* - that's what the SVN repository is
139 # for - but they might. They'd get errors if they modify a .y or .l
140 # file and try to do a build - but the error should tell them that they
141 # need to get YACC/Bison and/or Flex.
143 # Then again, getting them shouldn't be too big of a burden.
145 # XXX - is the same true of pod2man and pod2html, or are they needed
146 # even when building from a distribution tarball?
150 AC_PATH_PROG(YACCDUMMY, $YACC)
151 if test "x$YACCDUMMY" = x
153 AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
156 AC_PATH_PROG(LEX, flex)
159 AC_MSG_ERROR(I couldn't find flex; make sure it's installed and in your path)
161 AC_PATH_PROG(POD2MAN, pod2man)
162 if test "x$POD2MAN" = x
165 # The alternative is not to build the man pages....
167 AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
169 AC_PATH_PROG(POD2HTML, pod2html)
170 if test "x$POD2HTML" = x
173 # The alternative is not to build the HTML man pages....
175 AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
179 # Checks for programs used by Wireshark/TShark/etc.
183 # XXX - this looks for various HTML viewers on the host, not the target;
184 # we really want to know what's available on the target, for cross-builds.
185 # That would probably require us to, at run time, look for xdg-open and,
186 # if we don't find it, look for mozilla, htmlview, etc.
188 AC_PATH_PROG(HTML_VIEWER, xdg-open)
189 if test "x$HTML_VIEWER" != x
192 # XXX - the HTML_VIEWER shell variable is the full path of xdg-open.
193 # Define some variable to be that, so we just run that?
195 AC_DEFINE(HAVE_XDG_OPEN, 1, [Define if we have xdg-open])
198 # XXX - we have to define HTML_VIEWER for the prefs.c code that
199 # sets the default value of the Web browser preference, even
200 # though that preference won't be offered.
202 AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
204 AC_PATH_PROG(HTML_VIEWER, htmlview)
205 if test "x$HTML_VIEWER" = x
207 AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
209 AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
214 # Set "ac_supports_gcc_flags" if the compiler is known to support GCC-style
215 # flags such as -pedantic, -W warning flags and -f feature flags. Currently,
216 # we assume GCC and clang do; other compilers should be added here.
218 # This is done to avoid getting tripped up by compilers that support
219 # those flags but give them a different meaning.
221 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
222 ac_supports_gcc_flags=yes
225 if test "x$CC_FOR_BUILD" = x
229 AC_SUBST(CC_FOR_BUILD)
230 AC_SUBST(CFLAGS_FOR_BUILD)
233 AC_PATH_PROG(DOXYGEN, doxygen)
234 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
235 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
238 # Check for pkg-config and set PKG_CONFIG accordingly.
240 # This is referenced via AC_REQUIRE([PKG_PROG_PKG_CONFIG] in some macros
241 # like PKG_CHECK_MODULES. If the first call to such a macro is under an
242 # "if" statement, it's safer to call PKG_PROG_PKG_CONFIG directly, see
243 # the comments in acolocal.m4
246 if test -z "$PKG_CONFIG"; then
247 AC_MSG_ERROR(I couldn't find pkg-config; make sure it's installed and in your path)
250 AC_ARG_ENABLE(osx-deploy-target,
251 AC_HELP_STRING( [--enable-osx-deploy-target],
252 [choose an OS X deployment target @<:@default=major release on which you're building@:>@]),
262 # Let the user specify an OS X release to use as a
263 # deplayment target; if they specify that we should
264 # have a deployment target but don't specify the
265 # deployment target, then, if we have SDKs available,
266 # pick the OS version on which the build is being done.
267 # This also causes the build to be done against an SDK
268 # rather than against the headers and libraries in
269 # /usr/include and /usr/lib.
271 # Check for an OS X deployment target early, so that
272 # as many tests using the compiler are done using the
273 # flags that we'll be using when building.
275 if test $enableval = no
278 # The user explicitly said
279 # --disable-osx-deploy-target, so don't build
283 elif test $enableval = yes
286 # The user said --enable-osx-deploy-target, but
287 # didn't say what version to target; target the
288 # major version number of the version of OS X on
289 # which we're running.
291 # (We quote the command so that we can use
292 # autoconf's M4 quoting characters, [ and ], in
293 # the sed expression.)
295 [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
297 deploy_target="$enableval"
303 # No. Fail, because whatever the user intended for us to
304 # do, we can't do it.
306 AC_MSG_ERROR([--enable-osx-deploy-target specified on an OS other than OS X])
318 # If we have SDKs available, default to targeting the major
319 # version number of the version of OS X on which we're
322 # (We quote the command so that we can use autoconf's
323 # M4 quoting characters, [ and ], in the sed expression.)
325 for i in /Developer/SDKs \
326 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
327 /Library/Developer/CommandLineTools/SDKs
331 [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
339 # No. There's nothing to do.
345 if test ! -z "$deploy_target"
347 AC_MSG_CHECKING([whether we can build for OS X $deploy_target])
348 case $deploy_target in
352 # I'm not sure this would even work.
355 AC_ERROR([We don't support building for OS X $deploy_target])
360 # XXX - never tested.
363 SDKPATH="/Developer/SDKs/MacOSX10.3.9.sdk"
368 # Look for the oldest SDK we can find that's
369 # for an OS equal to or later than this one.
371 # XXX - for 10.4, do we need 10.4u? We're
372 # not currently doing fat builds (we'd need
373 # fat versions of the support libraries for
374 # that to be useful), but, if we do, we'd
379 # Get the real version - strip off the "10.".
380 # We'll worry about that if, as, and when there's ever
383 deploy_real_version=`echo "$deploy_target" | sed -n 's/10\.\(.*\)/\1/p'`
386 # Search each directory that might contain SDKs.
389 for sdksdir in /Developer/SDKs \
390 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
391 /Library/Developer/CommandLineTools/SDKs
394 # Get a list of all the SDKs.
396 if ! test -d "$sdksdir"
399 # There is no directory with that name.
400 # Move on to the next one in the list,
407 # Get a list of all the SDKs in that directory,
410 # We have to use @<:@ for [ and @:>@ for ] to
411 # avoid m4 removing the square brackets.
413 sdklist=`(cd "$sdksdir"; ls -d MacOSX10.@<:@0-9@:>@*.sdk 2>/dev/null)`
418 # Get the real version for this SDK.
420 sdk_real_version=`echo "$sdk" | sed -n 's/MacOSX10\.\(.*\)\.sdk/\1/p'`
423 # Is it for the deployment target or
424 # some later release?
426 if test "$sdk_real_version" -ge "$deploy_real_version"
431 sdkpath="$sdksdir/$sdk"
436 if test -z "$sdkpath"
439 AC_MSG_ERROR([We couldn't find an SDK for OS X $deploy_target or later])
442 AC_MSG_RESULT([yes, with the 10.$sdk_real_version SDK])
447 # Add a -mmacosx-version-min flag to force tests that
448 # use the compiler, as well as the build itself, not to,
449 # for example, use compiler or linker features not supported
450 # by the minimum targeted version of the OS.
452 # Add an -isysroot flag to use the SDK.
454 CFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $CFLAGS"
455 CXXFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $CXXFLAGS"
456 LDFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $LDFLAGS"
459 # Add a -sdkroot flag to use with osx-app.sh.
461 OSX_APP_FLAGS="-sdkroot $SDKPATH"
464 # XXX - do we need this to build the Wireshark wrapper?
465 # XXX - is this still necessary with the -mmacosx-version-min
468 OSX_DEPLOY_TARGET="MACOSX_DEPLOYMENT_TARGET=$deploy_target"
471 # In the installer package XML file, give the deployment target
472 # as the minimum version.
474 OSX_MIN_VERSION="$deploy_target"
476 case $deploy_target in
480 # Only 32-bit builds are supported. 10.5
481 # (and 10.4?) had a bug that causes some BPF
482 # functions not to work with 64-bit userland
483 # code, so capturing won't work.
485 CFLAGS="-m32 $CFLAGS"
486 CXXFLAGS="-m32 $CXXFLAGS"
487 LDFLAGS="-m32 $LDFLAGS"
499 # In the installer package XML file, give the current OS
500 # version, minor version and all, as the minimum version.
501 # We can't guarantee that the resulting binary will work
502 # on older OS versions, not even older minor versions
503 # (original release or earlier software updates).
505 OSX_MIN_VERSION=`sw_vers -productVersion`
509 AC_SUBST(OSX_MIN_VERSION)
512 # Try to arrange for large file support.
517 # Look for math functions; use libm if necessary.
519 AC_SEARCH_LIBS(floor, m)
520 AC_SEARCH_LIBS(ceil, m)
521 AC_SEARCH_LIBS(exp, m)
522 AC_SEARCH_LIBS(log, m)
523 AC_SEARCH_LIBS(log10, m)
524 AC_SEARCH_LIBS(floorl, m,
527 AC_DEFINE(HAVE_FLOORL, 1, [Define if you have the floorl function.])
529 FLOORL_LO="floorl.lo")
534 # GUI toolkit options
537 AC_HELP_STRING( [--with-qt=@<:@yes/no@:>@],
538 [use Qt @<:@default=yes@:>@]),
539 with_qt="$withval", with_qt="unspecified")
542 AC_HELP_STRING( [--with-gtk2=@<:@yes/no@:>@],
543 [use GTK+ 2.0 @<:@default=no@:>@]),
544 with_gtk2="$withval", with_gtk2="unspecified")
547 AC_HELP_STRING( [--with-gtk3=@<:@yes/no@:>@],
548 [use GTK+ 3.0 instead of 2.0 @<:@default=yes@:>@]),
549 with_gtk3="$withval", with_gtk3="unspecified")
552 # Version 3.0 switched from LGPLv2.1+ to LGPLv3+, then switched back to
553 # LGPLv2.1+ in version 3.1.10.
554 # GnuTLS depends on GMP which switched from LGPLv2.1+ to LGPLv3+ in
555 # version 4.2.2, the switched to LGPLv3+ / GPLv2+ in version 6.0.0.
558 want_gnutls="if_available"
559 AC_ARG_WITH([gnutls],
560 AC_HELP_STRING( [--with-gnutls=@<:@yes/no@:>@],
561 [use GnuTLS library @<:@default=yes, if available@:>@]),
562 [ with_gnutls="$withval"; want_gnutls="yes" ], with_gnutls="yes")
564 if test "x$with_gnutls" = "xyes"; then
565 have_license_compatible_gnutls="no"
566 PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.10 ],
567 [ have_license_compatible_gnutls="yes" ], [ echo "GnuTLS >= 3.1.10 not found " ]
570 if test "x$have_license_compatible_gnutls" != "xyes"; then
571 PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0 gnutls < 3],
572 [ have_license_compatible_gnutls="yes" ] , [ echo "GnuTLS >= 1.2.0, < 3.0 not found " ]
576 if test "x$have_license_compatible_gnutls" = "xyes"; then
577 echo "GnuTLS found, enabling SSL decryption"
578 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use GnuTLS library])
581 echo "GnuTLS with compatible license not found, disabling SSL decryption"
584 # Error out if the user explicitly requested gnutls
585 if test "x$want_gnutls" = "xyes"; then
586 AC_MSG_ERROR([GnuTLS crypto library was requested, but is not available])
593 want_gcrypt="if_available"
594 AC_ARG_WITH([gcrypt],
595 AC_HELP_STRING( [--with-gcrypt=@<:@yes/no@:>@],
596 [use gcrypt library @<:@default=yes, if available@:>@]),
597 [ with_gcrypt="$withval"; want_gcrypt="yes" ], with_gcrypt="yes")
599 if test "x$with_gcrypt" = "xyes"; then
600 AM_PATH_LIBGCRYPT(1.1.92,
602 echo "libgcrypt found, enabling ipsec decryption"
603 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
607 if test x$libgcrypt_config_prefix != x ; then
608 AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
610 echo "libgcrypt not found, disabling ipsec decryption"
614 # Error out if the user explicitly requested gcrypt
615 if test "x$want_gcrypt" = "xyes"; then
616 AC_MSG_ERROR([libgcrypt library was requested, but is not available])
623 AC_HELP_STRING([--with-libnl@<:@=VERSION@:>@],
624 [use libnl (force version VERSION, if supplied) @<:@default: yes, if available@:>@]),
626 if test "x$withval" = "xno"
629 elif test "x$withval" = "xyes"
633 elif test "x$withval" = "x1"
637 elif test "x$withval" = "x2"
641 elif test "x$withval" = "x3"
646 AC_MSG_ERROR(["$withval" is not a valid argument to --with-libnl])
650 # Use libnl if it's present, otherwise don't.
652 want_libnl=ifavailable
656 # Libnl is Linux-specific.
661 AC_MSG_CHECKING(whether to use libnl for various network interface purposes)
663 if test x$want_libnl = "xno"; then
668 # Test for specific libnl versions only if no version
669 # was specified by the user or if the version in question
670 # was requested by the user.
672 if test x$libnl_version = "xany" -o x$libnl_version = "x3"; then
673 PKG_CHECK_MODULES(LIBNL3, [libnl-route-3.0 >= 3.0 libnl-genl-3.0] >= 3.0, [have_libnl3=yes], [have_libnl3=no])
675 if test x$libnl_version = "xany" -o x$libnl_version = "x2"; then
676 PKG_CHECK_MODULES(LIBNL2, libnl-2.0 >= 2.0, [have_libnl2=yes], [have_libnl2=no])
678 if test x$libnl_version = "xany" -o x$libnl_version = "x1"; then
679 PKG_CHECK_MODULES(LIBNL1, libnl-1 >= 1.0, [have_libnl1=yes], [have_libnl1=no])
681 if (test "${have_libnl3}" = "yes"); then
682 CFLAGS="$CFLAGS $LIBNL3_CFLAGS"
683 LIBS="$LIBS $LIBNL3_LIBS"
684 AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
685 AC_DEFINE(HAVE_LIBNL3, 1, [libnl version 3])
686 libnl_message="yes (v3)"
688 elif (test "${have_libnl2}" = "yes"); then
689 CFLAGS="$CFLAGS $LIBNL2_CFLAGS"
690 LIBS="$LIBS $LIBNL2_LIBS"
691 AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
692 AC_DEFINE(HAVE_LIBNL2, 1, [libnl version 2])
693 libnl_message="yes (v2)"
695 elif (test "${have_libnl1}" = "yes"); then
696 CFLAGS="$CFLAGS $LIBNL1_CFLAGS"
697 LIBS="$LIBS $LIBNL1_LIBS"
698 AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
699 AC_DEFINE(HAVE_LIBNL1, 1, [libnl version 1])
700 libnl_message="yes (v1)"
703 if test x$want_libnl = "xyes"; then
704 case "$libnl_version" in
707 AC_MSG_ERROR("I couldn't find libnl even though you manually enabled it.")
711 AC_MSG_ERROR("I couldn't find libnl version $libnl_version even though you manually enabled it.")
718 AC_MSG_CHECKING([if nl80211.h is new enough])
719 AC_TRY_COMPILE([#include <linux/nl80211.h>],
720 [int x = NL80211_FREQUENCY_ATTR_MAX_TX_POWER;
721 x = NL80211_ATTR_SUPPORTED_IFTYPES;
722 x = NL80211_ATTR_SUPPORTED_COMMANDS;
723 x = NL80211_ATTR_WIPHY_FREQ;
724 x = NL80211_CHAN_NO_HT;],
725 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211, 1, [nl80211.h is new enough])],
728 AC_MSG_CHECKING([for NL80211_SET_CHANNEL])
729 AC_TRY_COMPILE([#include <linux/nl80211.h>],
730 [enum nl80211_commands x = NL80211_CMD_SET_CHANNEL;],
731 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_CMD_SET_CHANNEL, 1, [SET_CHANNEL is supported])],
734 AC_MSG_CHECKING([for NL80211_SPLIT_WIPHY_DUMP])
735 AC_TRY_COMPILE([#include <linux/nl80211.h>],
736 [enum nl80211_protocol_features x = NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP;],
737 [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_SPLIT_WIPHY_DUMP, 1, [SPLIT_WIPHY_DUMP is supported])],
742 if test x$want_libnl != "xno" -a x$want_libnl != "xifavailable"; then
743 AC_MSG_WARN([libnl is Linux-specific, ignoring --with-libnl])
748 # FIXME: currently the path argument to with-libsmi is being ignored
752 # Check for programs used when building DocBook documentation.
755 # Check for a2x (convert asciidoc to another format)
756 AC_PATH_PROG(A2X, a2x)
757 AC_CHECK_PROG(HAVE_A2X, a2x, "yes", "no")
758 AM_CONDITIONAL(HAVE_A2X, test x$HAVE_A2X = xyes)
760 # Want to control a tape drive? Use mt. Want to convert HTML to text?
761 # Uhhhhh... elinks? lynx? w3m? pandoc? html2text?
762 AC_PATH_PROG(ELINKS, elinks)
763 AC_CHECK_PROG(HAVE_ELINKS, elinks, "yes", "no")
764 AM_CONDITIONAL(HAVE_ELINKS, test x$HAVE_ELINKS = xyes)
766 # Check for fop (translate .fo to e.g. pdf)
767 AC_PATH_PROG(FOP, fop)
768 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
769 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
771 # Check for lynx (html -> text)
772 AC_PATH_PROG(LYNX, lynx)
773 AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no")
774 AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes)
776 # Check for w3m (html -> text)
777 AC_PATH_PROG(W3M, w3m)
778 AC_CHECK_PROG(HAVE_W3M, w3m, "yes", "no")
779 AM_CONDITIONAL(HAVE_W3M, test x$HAVE_W3M = xyes)
782 AC_PATH_PROG(XMLLINT, xmllint)
783 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
784 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
787 AC_PATH_PROG(XSLTPROC, xsltproc)
788 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
789 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
792 # Check for packaging utilities
793 # For now, we check to see if the various packaging utilites are in our
794 # path. I'm too lazy to write code to go hunt for them. - Gerald
798 # (Lets you install the desktop files.)
800 AC_PATH_PROG(DESKTOP_FILE_INSTALL, desktop-file-install)
803 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
804 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
805 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
807 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
808 -a x$HAVE_PKGTRANS = xyes ; then
809 HAVE_SVR4_PACKAGING=yes
811 HAVE_SVR4_PACKAGING=no
813 AC_SUBST(HAVE_SVR4_PACKAGING)
816 AC_WIRESHARK_RPM_CHECK
820 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
823 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
824 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
825 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
827 if test x$HAVE_XCODEBUILD = xyes -a x$HAVE_HDIUTIL = xyes \
828 -a x$HAVE_BLESS = xyes ; then
829 HAVE_OSX_PACKAGING=yes
831 HAVE_OSX_PACKAGING=no
833 AC_SUBST(HAVE_OSX_PACKAGING)
836 # Use this as a proxy for "is this OS X" (just in case somebody actually
837 # built and installed Darwin as an OS, perhaps with some X11-based GUI,
838 # don't look for Darwin).
840 AC_CHECK_PROG(have_sw_vers, sw_vers, "yes", "no")
841 AM_CONDITIONAL(NOT_OS_X, test "x$have_sw_vers" = "xno")
844 # Some compilers have to be told to fail when passed an unknown -W flag;
845 # make sure we do that.
847 AC_WIRESHARK_CHECK_UNKNOWN_WARNING_OPTION_ERROR
850 # Some C++ compilers have to be told to fail when passed a -W flag that
851 # they don't think should apply to C++; make sure we do that.
853 AC_WIRESHARK_CHECK_NON_CXX_WARNING_OPTION_ERROR
856 # Try to add some additional checks to CFLAGS.
857 # These are not enabled by default, because the warnings they produce
858 # are very hard or impossible to eliminate.
860 AC_ARG_ENABLE(extra-compiler-warnings,
861 AC_HELP_STRING( [--enable-extra-compiler-warnings],
862 [do additional compiler warnings @<:@default=no@:>@]),
864 wireshark_extra_flags=$enableval
865 if test $enableval != no
868 # The following are for C and C++
870 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-pedantic)
872 # Various code blocks this one.
874 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Woverflow)
875 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
877 # Due to various places where APIs we don't control
878 # require us to cast away constness, we can probably
879 # never enable this one with -Werror.
881 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-qual)
883 # Some generated ASN.1 dissectors block this one;
884 # multiple function declarations for the same
885 # function are being generated.
887 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wredundant-decls)
889 # Some loops are safe, but it's hard to convince the
892 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunsafe-loop-optimizations)
894 # All the registration functions block these for now.
896 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-prototypes)
897 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-declarations)
899 # A bunch of "that might not work on SPARC" code blocks
902 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-align)
904 # Works only with Clang
906 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunreachable-code)
908 # Works only with Clang but generates a lot of warnings
909 # (about glib library not using Doxygen)
911 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdocumentation)
914 # The following are C only, not C++
916 # Due to various places where APIs we don't control
917 # require us to cast away constness, we can probably
918 # never enable this one with -Werror.
920 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C)
925 # The following are for C and C++
927 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wall -W) # -W is now known as -Wextra
928 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wextra) # -W is now known as -Wextra
929 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wendif-labels)
930 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpointer-arith)
931 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Warray-bounds)
932 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wformat-security)
933 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fwrapv)
934 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-strict-overflow)
935 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-delete-null-pointer-checks)
936 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wvla)
937 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Waddress)
938 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wattributes)
939 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdiv-by-zero)
940 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wignored-qualifiers)
941 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpragmas)
942 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-overlength-strings)
943 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wwrite-strings)
944 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
945 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
946 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable)
948 # The following are C only, not C++
950 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wc++-compat, C)
951 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdeclaration-after-statement, C)
956 # Make sure -Wshadow doesn't complain about variables in function and
957 # function pointer declarations shadowing other variables; if not, don't
958 # turn it on, as some versions of GCC (including the one in at least
959 # some Xcode versions that came with Mac OS X 10.5) complain about
962 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshadow, C,
964 extern int bar(int a);
970 int (*fptr)(int a) = bar;
975 [warns about variables in function declarations shadowing other variables])
977 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-pointer-sign, C)
978 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wold-style-definition, C)
979 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wstrict-prototypes, C)
981 # Unfortunately some versions of gcc generate logical-op warnings when strchr()
982 # is given a constant string.
983 # gcc versions 4.3.2 and 4.4.5 are known to have the problem.
984 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wlogical-op, C,
988 int foo(const char *, int);
992 foo(const char *sep, int c)
994 if (strchr (sep, c) != NULL)
1003 return foo("<", 'a');
1006 [generates warnings from strchr()])
1008 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wjump-misses-init, C)
1009 # The Qt headers generate a ton of shortening errors on 64-bit systems
1010 # so only enable this for C for now.
1011 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshorten-64-to-32, C)
1014 # Use the faster pre gcc 4.5 floating point precision if available.
1016 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fexcess-precision=fast)
1019 # Try to have the compiler default to hiding symbols, so that only
1020 # symbols explicitly exported with WS_DLL_PUBLIC will be visible
1021 # outside (shared) libraries; that way, more UN*X builds will catch
1022 # failures to export symbols, rather than having that fail only on
1025 CFLAGS_before_fvhidden="$CFLAGS"
1027 # GCC and GCC-compatible compilers
1029 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fvisibility=hidden)
1030 if test "x$CFLAGS" = "x$CFLAGS_before_fvhidden"
1035 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xldscope=hidden)
1036 if test "x$CFLAGS" = "x$CFLAGS_before_fvhidden"
1038 # TODO add other ways of hiding symbols
1039 AC_MSG_WARN(Compiler will export all symbols from shared libraries)
1043 AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
1044 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,-M])
1045 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--cref])
1046 # AC_WIRESHARK_LDFLAGS_CHECK([-flto])
1047 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhopr])
1048 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhole-program])
1051 # Put -fPIE in PIE_CFLAGS and -pie in PIE_LDFLAGS if we can use them,
1052 # so that we can build dumpcap PIE - it may run with elevated
1053 # privileges, and using PIE means the OS can run it at random locations
1054 # in the address space to make attacks more difficult.
1056 CFLAGS_before_pie="$CFLAGS"
1057 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE)
1058 if test "x$CFLAGS" != "x$CFLAGS_before_pie"
1061 CFLAGS="$CFLAGS_before_pie"
1063 LDFLAGS_before_pie="$LDFLAGS"
1064 AC_WIRESHARK_LDFLAGS_CHECK([-fPIE -pie])
1065 if test "x$LDFLAGS" != "x$LDFLAGS_before_pie"
1072 LDFLAGS="$LDFLAGS_before_pie"
1076 AC_SUBST(PIE_CFLAGS)
1077 AC_SUBST(PIE_LDFLAGS)
1079 CFLAGS_before_simd="$CFLAGS"
1080 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-msse4.2, C)
1081 if test "x$CFLAGS" != "x$CFLAGS_before_simd"
1083 AC_MSG_CHECKING([whether there is nmmintrin.h header])
1086 [#include <nmmintrin.h>],
1090 AC_DEFINE(HAVE_SSE4_2, 1, [Support SSSE4.2 (Streaming SIMD Extensions 4.2) instructions])
1091 CFLAGS_SSE42="-msse4.2"
1092 AC_MSG_RESULT([yes])
1101 CFLAGS="$CFLAGS_before_simd"
1105 dnl build libwsutil_sse42 only if there is SSE4.2
1106 AM_CONDITIONAL(SSE42_SUPPORTED, test "x$have_sse42" = "xyes")
1107 AC_SUBST(CFLAGS_SSE42)
1110 # If we're running GCC or clang define _U_ to be "__attribute__((unused))"
1111 # so we can use _U_ to flag unused function parameters and not get warnings
1112 # about them. Otherwise, define _U_ to be an empty string so that _U_ used
1113 # to flag an unused function parameters will compile with other compilers.
1115 # XXX - similar hints for other compilers?
1117 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
1118 AC_DEFINE(_U_, __attribute__((unused)), [Hint to the compiler that a function parameters is not used])
1120 AC_DEFINE(_U_, , [Hint to the compiler that a function parameters is not used])
1123 # If we're running GCC or CLang, use FORTIFY_SOURCE=2
1124 # (only if the GCC 'optimization level' > 0).
1126 # See: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
1127 # See: http://sourceware.org/bugzilla/show_bug.cgi?id=13979
1129 # Note: FORTIFY_SOURCE is only effective for gcc optimization level > 0 (-O1, etc)
1130 AC_WIRESHARK_GCC_FORTIFY_SOURCE_CHECK
1133 # If the compiler supports GCC-style flags, enable a barrier "stop on
1135 # This barrier is set for a very large part of the code. However, it is
1136 # typically not set for "generated" code (flex, ans2wrs, idl2wrs, ...)
1138 warnings_as_errors_default="yes"
1139 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
1140 AC_ARG_ENABLE(warnings-as-errors,
1141 AC_HELP_STRING( [--enable-warnings-as-errors],
1142 [treat warnings as errors (only for GCC or clang) @<:@default=yes, unless extra compiler warnings are enabled@:>@]),
1144 if test "x$ac_supports_gcc_flags" = "xyes" -a "x$enableval" = "xyes"; then
1145 with_warnings_as_errors="yes"
1148 with_warnings_as_errors="no"
1153 if test "x$ac_supports_gcc_flags" = "xyes" -a "x$wireshark_extra_flags" = "x" -a "x$warnings_as_errors_default" = "xyes"; then
1154 with_warnings_as_errors="yes"
1157 with_warnings_as_errors="no"
1162 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
1165 # Add any platform-specific compiler flags needed.
1167 AC_MSG_CHECKING(for platform-specific compiler flags)
1168 if test "x$GCC" = "xyes" ; then
1170 # GCC - do any platform-specific tweaking necessary.
1174 # the X11 headers don't automatically include prototype info
1175 # and a lot don't include the return type
1176 CPPFLAGS="$CPPFLAGS -DFUNCPROTO=15"
1177 CFLAGS="$CFLAGS -Wno-return-type"
1178 CXXFLAGS="$CXXFLAGS -Wno-return-type"
1179 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
1182 AC_MSG_RESULT(none needed)
1187 # Not GCC - assume it's the vendor's compiler.
1192 # HP's ANSI C compiler; flags suggested by Jost Martin.
1193 # "-Ae" for ANSI C plus extensions such as "long long".
1194 # "+O2", for optimization. XXX - works with "-g"?
1196 # HP's ANSI C++ compiler doesn't support "-Ae", but
1197 # does support "+O2", at least according to the
1198 # documentation I can find online.
1200 CFLAGS="-Ae +O2 $CFLAGS"
1201 CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
1202 CXXFLAGS="+O2 $CFLAGS"
1203 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
1206 AC_MSG_RESULT(none needed)
1212 # Add any platform-specific linker flags needed.
1214 AC_MSG_CHECKING(for platform-specific linker flags)
1218 # Add -Wl,-single_module to the LDFLAGS used with shared
1219 # libraries, to fix some error that show up in some cases;
1220 # some Apple documentation recommends it for most shared
1223 LDFLAGS_SHAREDLIB="-Wl,-single_module"
1225 # Add -Wl,-headerpad_max_install_names to the LDFLAGS, as
1226 # code-signing issues is running out of padding space.
1228 # Add -Wl,-search_paths_first to make sure that if we search
1229 # directories A and B, in that order, for a given library, a
1230 # non-shared version in directory A, rather than a shared
1231 # version in directory B, is chosen (so we can use
1232 # --with-pcap=/usr/local to force all programs to be linked
1233 # with a static version installed in /usr/local/lib rather than
1234 # the system version in /usr/lib).
1236 # Also add -Wl,-rpath,@executable_path/../lib and
1237 # -Wl,-rpath,/usr/local/lib, so that, if we build an app
1238 # bundle, we can tweak all the executable images, shared
1239 # libraries, and plugins in the bundle to look for non-system
1240 # libraries in the rpath, rather than having a script tweak
1241 # DYLD_LIBRARY_PATH.
1243 LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first -Wl,-rpath,@executable_path/../lib -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,/usr/local/lib $LDFLAGS"
1244 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 rpaths to all linker flags])
1248 # Shared libraries in cygwin/Win32 must never contain
1249 # undefined symbols.
1251 LDFLAGS="$LDFLAGS -no-undefined"
1252 AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
1255 AC_MSG_RESULT(none needed)
1258 AC_SUBST(LDFLAGS_SHAREDLIB)
1260 # Enable silent builds by default
1261 # Verbose builds can be enabled with "./configure
1262 # --enable-silent-rules ..." or "make V=1 ..."
1263 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1264 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1267 # On "Darwin", which we assume to mean "OS X" rather than "iOS" or
1268 # "just Darwin" (as we don't currently support iOS, and as I don't
1269 # think you can build and run "just Darwin" as an OS for PCs), we
1270 # arrange to build some programs with Application Services so they
1271 # can launch Web browsers and Finder windows, arrange to build some
1272 # programs with System Configuration so they can get "friendly names"
1273 # and other information about interfaces, and build any programs that
1274 # use either of those frameworks or that report version information
1275 # with Core Foundation as the frameworks in question use it and as we
1276 # get version information from plists and thus need Core Foundation
1277 # to process those plists.
1282 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
1283 APPLICATIONSERVICES_FRAMEWORKS="-framework ApplicationServices"
1284 SYSTEMCONFIGURATION_FRAMEWORKS="-framework SystemConfiguration"
1285 COREFOUNDATION_FRAMEWORKS="-framework CoreFoundation"
1288 # OK, so we have the OS X frameworks; do they include
1289 # CFPropertyListCreateWithStream, or do we have
1290 # to fall back on CFPropertyListCreateFromStream?
1291 # (They only differ in the error return, which we
1292 # don't care about. And, no, we shouldn't just
1293 # use CFPropertyListCreateFromStream, because it's
1294 # deprecated in newer releases.)
1296 ac_save_LIBS="$LIBS"
1297 LIBS="$LIBS $COREFOUNDATION_FRAMEWORKS"
1298 AC_CHECK_FUNCS(CFPropertyListCreateWithStream)
1299 LIBS="$ac_save_LIBS"
1302 AC_SUBST(APPLICATIONSERVICES_FRAMEWORKS)
1303 AC_SUBST(SYSTEMCONFIGURATION_FRAMEWORKS)
1304 AC_SUBST(COREFOUNDATION_FRAMEWORKS)
1307 # On Solaris, check whether we have getexecname().
1311 AC_CHECK_FUNC(getexecname)
1315 dnl Look in /usr/local for header files and libraries ?
1316 dnl XXX FIXME don't include /usr/local if it is already in the system
1317 dnl search path as this causes gcc 3.2 on Linux to complain about a change
1318 dnl of the system search order for includes
1319 AC_ARG_ENABLE(usr-local,
1320 AC_HELP_STRING( [--enable-usr-local],
1321 [look for headers and libs in /usr/local tree @<:@default=yes@:>@]),
1322 ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
1324 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
1325 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1326 if test -d "/usr/local"; then
1329 # Arrange that we search for header files in the source directory
1330 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
1331 # as various packages we use ("libpcap", "zlib", "adns")
1332 # may have been installed under "/usr/local/include".
1334 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
1337 # Arrange that we search for libraries in "/usr/local/lib".
1339 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
1348 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
1353 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
1354 if test x$LD_LIBRARY_PATH != x ; then
1355 LIBS="$LIBS -R$LD_LIBRARY_PATH"
1356 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
1358 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
1364 # Check for versions of "sed" inadequate to handle, in libtool, a list
1365 # of object files as large as the list in Wireshark.
1367 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
1368 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
1369 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
1370 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
1371 # is the only "sed" that comes with Solaris that can handle Wireshark.
1373 # Add any checks here that are necessary for other OSes.
1375 AC_PATH_PROG(SED, sed)
1378 AC_MSG_ERROR(I couldn't find sed; make sure it's installed and in your path)
1380 AC_WIRESHARK_GNU_SED_CHECK
1381 if test "$HAVE_GNU_SED" = no ; then
1384 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
1386 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
1388 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
1403 # Enable/disable wireshark
1404 AC_ARG_ENABLE(wireshark,
1405 AC_HELP_STRING( [--enable-wireshark],
1406 [build the Wireshark GUI (with Gtk+, Qt, or both) @<:@default=yes@:>@]),
1407 enable_wireshark=$enableval,enable_wireshark=yes)
1408 AM_CONDITIONAL(BUILDING_WIRESHARK, test x$enable_wireshark = xyes)
1410 AC_ARG_ENABLE(packet-editor,
1411 AC_HELP_STRING( [--enable-packet-editor],
1412 [add support for packet editor in Wireshark @<:@default=yes@:>@]),
1413 enable_packet_editor=$enableval,enable_packet_editor=yes)
1414 if test x$enable_packet_editor = xyes; then
1415 AC_DEFINE(WANT_PACKET_EDITOR, 1, [Support for packet editor])
1418 AC_ARG_ENABLE(profile-build,
1419 AC_HELP_STRING( [--enable-profile-build],
1420 [build profile-ready binaries @<:@default=no@:>@]),
1421 enable_profile_build=$enableval,enable_profile_build=no)
1422 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
1423 AC_MSG_CHECKING(if profile builds must be generated)
1424 if test "x$enable_profile_build" = "xyes" ; then
1425 if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
1427 CFLAGS=" -pg $CFLAGS"
1428 CXXFLAGS=" -pg $CXXFLAGS"
1431 echo "Building profile binaries currently only supported for GCC and clang."
1437 # Create DATAFILE_DIR #define for config.h
1438 datafiledir=$datadir/wireshark
1440 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1441 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1442 # Ugly hack, but I don't see how this problem can be solved
1443 # properly that DATAFILE_DIR had a value starting with
1444 # "${prefix}/" instead of e.g. "/usr/local/"
1445 eval eval echo "$datafiledir"
1447 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
1449 # Create DOC_DIR #define for config.h
1451 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1452 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1453 # Ugly hack, but I don't see how this problem can be solved
1454 # properly that DOC_DIR had a value starting with
1455 # "${prefix}/" instead of e.g. "/usr/local/"
1456 eval eval echo "$docdir"
1458 AC_DEFINE_UNQUOTED(DOC_DIR, "$docdir", [Directory for docs])
1460 GTK2_MIN_VERSION=2.12.0
1461 AC_SUBST(GTK2_MIN_VERSION)
1462 GTK3_MIN_VERSION=3.0.0
1463 AC_SUBST(GTK3_MIN_VERSION)
1464 QT_MIN_VERSION=4.6.0
1465 AC_SUBST(QT_MIN_VERSION)
1466 # GTK+ and Qt checks; we require GTK+ $GTK2_MIN_VERSION or later or
1467 # GTK3_MIN_VERSION or later or Qt $QT_MIN_VERSION or later.
1469 # We only do those if we're going to be building Wireshark;
1470 # otherwise, we don't have any GUI to build, so we don't use
1473 # We don't add $GTK_LIBS or $Qt_LIBS to LIBS, because we don't want to
1474 # force all programs to be built with GTK+ or Qt.
1476 # Release dates for GTK+ versions:
1477 # http://en.wikipedia.org/wiki/GTK+#Releases
1478 # 2.12.0: 14 Sep 2007
1479 # 2.14.0: 04 Sep 2008
1480 # 2.16.0: 13 Mar 2009
1481 # 2.18.0: 23 Sep 2009
1482 # 2.20.0: 23 Mar 2010
1483 # 2.22.0: 23 Sep 2010
1484 # 2.24.0: 30 Jan 2011
1485 # 3.0.0: 10 Feb 2011
1486 # 3.2.0: 25 Sep 2011
1487 # 3.4.0: 26 Mar 2012
1488 # 3.6.0: 24 Sep 2012
1489 # 3.8.0: 25 Mar 2013
1490 # 3.10.0: 23 Sep 2013
1491 # 3.12.0: 25 Mar 2014
1493 # Release dates for Qt versions:
1494 # http://en.wikipedia.org/wiki/List_of_Qt_releases
1495 # 4.6.0: 01 Dec 2009
1496 # 4.7.0: 21 Sep 2010
1497 # 4.8.0: 15 Dec 2011
1498 # 5.0.0: 19 Dec 2012
1499 # 5.1.0: 03 Jul 2013
1500 # 5.2.0: 12 Dec 2013
1501 # 5.3.0: 20 May 2014
1505 if test "x$enable_wireshark" = "xyes"; then
1506 if test "x$with_gtk2" = "xunspecified" -a \
1507 "x$with_gtk3" = "xunspecified" -a \
1508 "x$with_qt" = "xunspecified"; then
1510 # No GUI toolkit was explicitly specified; pick Qt and GTK+ 3.
1515 if test "x$with_qt" = "xyes"; then
1517 # Qt was specified; Make sure we have a C++ compiler.
1519 if test -z "$CXX"; then
1520 AC_MSG_ERROR(Need a working C++ compiler to build Wireshark with Qt)
1524 # Now make sure we have Qt and, if so, add the flags
1525 # for it to CFLAGS and CXXFLAGS.
1527 AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION,
1529 CFLAGS="$CFLAGS $Qt_CFLAGS"
1530 CXXFLAGS="$CXXFLAGS $Qt_CFLAGS"
1532 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-qt"
1534 [AC_MSG_ERROR([Qt is not available])])
1537 # XXX - greasy hack to make ui/gtk/recent.c
1540 CPPFLAGS="-DQT_GUI_LIB"
1543 if test "x$with_gtk3" = "xyes"; then
1545 # GTK+ 3 was specified; make sure they didn't also
1546 # specify GTK+ 2, as we don't support building both
1547 # GTK+ 2 and GTK+ 3 versions at the same time.
1549 if test "x$with_gtk2" = "xyes"; then
1550 AC_MSG_ERROR([Both GTK+ 2 and GTK+ 3 were specified; choose one but not both])
1554 # Make sure we have GTK+ 3.
1556 AM_PATH_GTK_3_0(3.0.0,
1558 CFLAGS="$CFLAGS $GTK_CFLAGS"
1559 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
1561 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk3"
1563 [AC_MSG_ERROR([GTK+ 3 is not available])])
1564 elif test "x$with_gtk2" = "xyes"; then
1566 # GTK+ 3 wasn't specified, and GTK+ 2 was specified;
1567 # make sure we have GTK+ 2.
1569 AM_PATH_GTK_2_0($GTK2_MIN_VERSION,
1571 CFLAGS="$CFLAGS $GTK_CFLAGS"
1572 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
1574 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk2"
1576 [AC_MSG_ERROR([GTK+ 2 is not available])])
1579 AC_SUBST(GUI_CONFIGURE_FLAGS)
1581 GLIB_MIN_VERSION=2.16.0
1582 AC_SUBST(GLIB_MIN_VERSION)
1583 # GLib checks; we require GLib $GLIB_MIN_VERSION or later, and require gmodule
1584 # support, as we need that for dynamically loading plugins.
1585 # If we found GTK+, this doesn't add GLIB_CFLAGS to CFLAGS, because
1586 # AM_PATH_GTK will add GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a
1587 # superset of GLIB_CFLAGS. If we didn't find GTK+, it does add
1588 # GLIB_CFLAGS to CFLAGS.
1589 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
1590 # set when generating the Makefile, so we can make programs that require
1591 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
1592 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
1593 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
1594 # programs to be built with GLib.
1596 # Release dates for GLib versions:
1597 # 2.14.0: 03 Aug 2007
1598 # 2.16.0: 10 Mar 2008
1599 # 2.18.0: 02 Sep 2008
1600 # 2.20.0: 13 Mar 2009
1601 # 2.22.0: 22 Sep 2009
1602 # 2.24.0: 28 Mar 2010
1603 # 2.26.0: 27 Sep 2010
1604 # 2.28.0: 08 Feb 2011
1605 # 2.30.0: 27 Sep 2011
1606 # 2.32.0: 24 Mar 2012
1607 # 2.34.0: 24 Sep 2012
1608 # 2.36.0: 25 Mar 2013
1609 # 2.38.0: 23 Sep 2013
1610 # 2.40.0: 24 Mar 2014
1612 use_glib_cflags="true"
1613 if test "$have_gtk" = "yes" -a "$have_qt" = "yes" ; then
1614 # We have both GTK and Qt and thus will be building both wireshark
1615 # and wireshark-gtk.
1617 wireshark_bin="wireshark\$(EXEEXT) wireshark-gtk\$(EXEEXT)"
1618 wireshark_man="wireshark.1"
1619 wireshark_SUBDIRS="codecs ui/qt ui/gtk"
1621 if test "$have_gtk" = "no" -a "$have_qt" = "yes" ; then
1622 # We don't have GTK+ but we have Qt.
1624 wireshark_bin="wireshark\$(EXEEXT)"
1625 wireshark_man="wireshark.1"
1626 wireshark_SUBDIRS="codecs ui/qt"
1628 if test "$have_gtk" = "yes" -a "$have_qt" = "no" ; then
1629 # We have GTK+ but not Qt.
1631 wireshark_bin="wireshark-gtk\$(EXEEXT)"
1632 wireshark_man="wireshark.1"
1633 wireshark_SUBDIRS="codecs ui/gtk"
1634 use_glib_cflags="false"
1635 OSX_APP_FLAGS="$OSX_APP_FLAGS -gtk"
1636 OSX_DMG_FLAGS="-gtk"
1638 if test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
1639 # We have neither GTK+ nor Qt.
1641 # If they didn't explicitly say "--disable-wireshark",
1642 # fail (so that, unless they explicitly indicated that
1643 # they don't want Wireshark, we stop so they know they
1644 # won't be getting Wireshark unless they fix the GTK+/Qt
1647 if test "x$enable_wireshark" = "xyes"; then
1648 if test "x$with_gtk3" = "xyes"; then
1649 AC_MSG_ERROR([Neither Qt nor GTK+ $GTK3_MIN_VERSION or later are available, so Wireshark can't be compiled])
1651 AC_MSG_ERROR([Neither Qt nor GTK+ $GTK2_MIN_VERSION or later are available, so Wireshark can't be compiled])
1658 if test "$have_gtk" = "yes" ; then
1659 # If we have GTK then add flags for it.
1661 CPPFLAGS="-DGDK_PIXBUF_DISABLE_DEPRECATED $CPPFLAGS"
1662 CPPFLAGS="-DGDK_DISABLE_DEPRECATED $CPPFLAGS"
1663 if test \( $gtk_config_major_version -eq 3 -a $gtk_config_minor_version -ge 10 \) ; then
1664 ## Allow use of deprecated & disable deprecated warnings if Gtk >= 3.10;
1665 ## The deprecations in Gtk 3.10 will not be fixed ...
1666 CPPFLAGS="-DGDK_DISABLE_DEPRECATION_WARNINGS $CPPFLAGS"
1668 CPPFLAGS="-DGTK_DISABLE_DEPRECATED $CPPFLAGS"
1670 CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
1671 if test ! \( $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -lt 20 \) ; then
1672 # Enable GSEAL when building with GTK > 2.20
1673 # (Versions prior to 2.22 lacked some necessary accessors.)
1674 CPPFLAGS="-DGSEAL_ENABLE $CPPFLAGS"
1678 # XXX - Is this really necessary? When we build with both Gtk+ and Qt it works...
1679 if test "$use_glib_cflags" = "true"; then
1681 AM_PATH_GLIB_2_0($GLIB_MIN_VERSION,
1683 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1684 CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS"
1685 ], AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
1687 # Don't use GLIB_CFLAGS
1688 AM_PATH_GLIB_2_0($GLIB_MIN_VERSION, , AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
1692 # "make dist" requires that we have the Qt build tools.
1694 # Annoyingly, at least on Fedora 16, uic and moc are named XXX-qt4
1695 # rather than just XXX, perhaps to allow Qt 3 and Qt 4 tools to be
1696 # installed; if they're still doing that in current Fedora releases,
1697 # perhaps there will also be XXX-qt5 when they pick up Qt 5.
1699 AC_PATH_PROG(UIC, uic)
1702 AC_PATH_PROG(UIC, uic-qt4)
1705 if test "x$with_qt" = "xyes"; then
1707 # If you want to build with Qt, you'd better
1710 AC_MSG_ERROR(I couldn't find uic or uic-qt4; make sure it's installed and in your path)
1713 # We shouldn't fail here, as the user's not
1714 # building with Qt, and we shouldn't force them
1715 # to have Qt installed if they're not doing so.
1716 # "make dist" will fail if they do that, but
1717 # we don't know whether they'll be doing that,
1718 # so this is the best we can do.
1725 AC_PATH_PROG(MOC, moc)
1728 AC_PATH_PROG(MOC, moc-qt4)
1731 if test "x$with_qt" = "xyes"; then
1733 # If you want to build with Qt, you'd better
1736 AC_MSG_ERROR(I couldn't find moc or moc-qt4; make sure it's installed and in your path)
1739 # We shouldn't fail here, as the user's not
1740 # building with Qt, and we shouldn't force them
1741 # to have Qt installed if they're not doing so.
1742 # "make dist" will fail if they do that, but
1743 # we don't know whether they'll be doing that,
1744 # so this is the best we can do.
1751 AC_PATH_PROG(RCC, rcc)
1754 AC_PATH_PROG(RCC, rcc)
1757 if test "x$with_qt" = "xyes"; then
1759 # If you want to build with Qt, you'd better
1762 AC_MSG_ERROR(I couldn't find rcc; make sure it's installed and in your path)
1765 # We shouldn't fail here, as the user's not
1766 # building with Qt, and we shouldn't force them
1767 # to have Qt installed if they're not doing so.
1768 # "make dist" will fail if they do that, but
1769 # we don't know whether they'll be doing that,
1770 # so this is the best we can do.
1778 # Error out if a glib header other than a "top level" header
1779 # (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
1781 CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
1783 # Error out on the usage of deprecated glib functions
1784 CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
1787 # Check whether GLib modules are supported, to determine whether we
1788 # can support plugins.
1790 AC_MSG_CHECKING(whether GLib supports loadable modules)
1791 ac_save_CFLAGS="$CFLAGS"
1792 ac_save_LIBS="$LIBS"
1793 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1794 LIBS="$GLIB_LIBS $LIBS"
1797 #include <gmodule.h>
1804 if (g_module_supported())
1805 return 0; /* success */
1807 return 1; /* failure */
1809 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
1810 [echo $ac_n "cross compiling; assumed OK... $ac_c"
1811 ac_cv_glib_supports_modules=yes])
1812 CFLAGS="$ac_save_CFLAGS"
1813 LIBS="$ac_save_LIBS"
1814 if test "$ac_cv_glib_supports_modules" = yes ; then
1817 plugins_dir="plugins"
1823 AC_SUBST(plugins_dir)
1826 # If we have <dlfcn.h>, check whether we have dladdr.
1828 if test "$ac_cv_header_dlfcn_h" = "yes"
1831 # Use GLib compiler flags and linker flags; GLib's gmodule
1832 # stuff uses the dl APIs if available, so it might know
1833 # what flags are needed.
1835 ac_save_CFLAGS="$CFLAGS"
1836 ac_save_LIBS="$LIBS"
1837 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1838 LIBS="$GLIB_LIBS $LIBS"
1839 AC_CHECK_FUNCS(dladdr)
1840 if test x$ac_cv_func_dladdr = xno
1843 # OK, try it with -ldl, in case you need that to get
1844 # dladdr(). For some reason, on Linux, that's not
1845 # part of the GLib flags; perhaps GLib itself is
1846 # linked with libdl, so that you can link with
1847 # Glib and it'll pull libdl in itself.
1850 AC_CHECK_FUNCS(dladdr)
1852 CFLAGS="$ac_save_CFLAGS"
1853 LIBS="$ac_save_LIBS"
1857 # Check whether GLib's printf supports thousands grouping. (This might
1858 # be different from the system's printf since GLib can optionally use
1859 # its own printf implementation.)
1861 AC_MSG_CHECKING(whether GLib supports POSIX/XSI thousands grouping)
1862 ac_save_CFLAGS="$CFLAGS"
1863 ac_save_LIBS="$LIBS"
1864 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1865 LIBS="$GLIB_LIBS $LIBS"
1876 setlocale(LC_ALL, "en_US.UTF-8");
1877 str = g_strdup_printf("%'u", 123456);
1878 return (strcmp (str, "123,456") != 0);
1880 ], ac_cv_glib_supports_printf_grouping=yes, ac_cv_glib_supports_printf_grouping=no,
1881 [echo $ac_n "cross compiling; playing it safe... $ac_c"
1882 ac_cv_glib_supports_printf_grouping=no])
1883 CFLAGS="$ac_save_CFLAGS"
1884 LIBS="$ac_save_LIBS"
1885 if test "$ac_cv_glib_supports_printf_grouping" = yes ; then
1887 AC_DEFINE(HAVE_GLIB_PRINTF_GROUPING, 1, [Define if GLib's printf functions support thousands grouping.])
1892 if test "x$have_gtk" = "xyes"
1895 # We have GTK+; do we want the OS X integration functions and,
1896 # if so, do we have them and, if so, which versions do we have,
1897 # the old Carbon-based ones or the new Cocoa-based ones?
1899 AC_MSG_CHECKING(whether to use OS X integration functions)
1901 AC_ARG_WITH(osx-integration,
1902 AC_HELP_STRING( [--with-osx-integration],
1903 [use OS X integration functions @<:@default=yes, if available@:>@]),
1905 if test $withval = no
1907 want_osx_integration=no
1909 want_osx_integration=yes
1912 want_osx_integration=yes
1914 if test "x$want_osx_integration" = "xno"; then
1918 AC_WIRESHARK_OSX_INTEGRATION_CHECK
1922 AC_SUBST(wireshark_bin)
1923 AC_SUBST(wireshark_man)
1924 AM_CONDITIONAL(HAVE_Qt, test "$have_qt" = "yes")
1925 AM_CONDITIONAL(HAVE_GTK, test "$have_gtk" = "yes")
1926 AC_SUBST(OSX_APP_FLAGS)
1927 AC_SUBST(OSX_DMG_FLAGS)
1929 # Enable/disable tshark
1930 AC_ARG_ENABLE(tshark,
1931 AC_HELP_STRING( [--enable-tshark],
1932 [build tshark @<:@default=yes@:>@]),
1933 tshark=$enableval,enable_tshark=yes)
1935 if test "x$enable_tshark" = "xyes" ; then
1936 tshark_bin="tshark\$(EXEEXT)"
1937 tshark_man="tshark.1"
1938 wiresharkfilter_man="wireshark-filter.4"
1943 AC_SUBST(tshark_bin)
1944 AC_SUBST(tshark_man)
1946 # Enable/disable editcap
1948 AC_ARG_ENABLE(editcap,
1949 AC_HELP_STRING( [--enable-editcap],
1950 [build editcap @<:@default=yes@:>@]),
1951 enable_editcap=$enableval,enable_editcap=yes)
1953 if test "x$enable_editcap" = "xyes" ; then
1954 editcap_bin="editcap\$(EXEEXT)"
1955 editcap_man="editcap.1"
1960 AC_SUBST(editcap_bin)
1961 AC_SUBST(editcap_man)
1964 # Enabling/disabling of dumpcap is done later (after we know if we have PCAP
1967 # Enable/disable capinfos
1969 AC_ARG_ENABLE(capinfos,
1970 AC_HELP_STRING( [--enable-capinfos],
1971 [build capinfos @<:@default=yes@:>@]),
1972 enable_capinfos=$enableval,enable_capinfos=yes)
1974 if test "x$enable_capinfos" = "xyes" ; then
1975 capinfos_bin="capinfos\$(EXEEXT)"
1976 capinfos_man="capinfos.1"
1981 AC_SUBST(capinfos_bin)
1982 AC_SUBST(capinfos_man)
1984 # Enable/disable captype
1986 AC_ARG_ENABLE(captype,
1987 AC_HELP_STRING( [--enable-captype],
1988 [build captype @<:@default=yes@:>@]),
1989 enable_captype=$enableval,enable_captype=yes)
1991 if test "x$enable_captype" = "xyes" ; then
1992 captype_bin="captype\$(EXEEXT)"
1993 captype_man="captype.1"
1998 AC_SUBST(captype_bin)
1999 AC_SUBST(captype_man)
2001 # Enable/disable mergecap
2003 AC_ARG_ENABLE(mergecap,
2004 AC_HELP_STRING( [--enable-mergecap],
2005 [build mergecap @<:@default=yes@:>@]),
2006 enable_mergecap=$enableval,enable_mergecap=yes)
2008 if test "x$enable_mergecap" = "xyes" ; then
2009 mergecap_bin="mergecap\$(EXEEXT)"
2010 mergecap_man="mergecap.1"
2015 AC_SUBST(mergecap_bin)
2016 AC_SUBST(mergecap_man)
2018 # Enable/disable reordercap
2020 AC_ARG_ENABLE(reordercap,
2021 AC_HELP_STRING( [--enable-reordercap],
2022 [build reordercap @<:@default=yes@:>@]),
2023 enable_reordercap=$enableval,enable_reordercap=yes)
2025 if test "x$enable_reordercap" = "xyes" ; then
2026 reordercap_bin="reordercap\$(EXEEXT)"
2027 reordercap_man="reordercap.1"
2032 AC_SUBST(reordercap_bin)
2033 AC_SUBST(reordercap_man)
2035 # Enable/disable text2pcap
2037 AC_ARG_ENABLE(text2pcap,
2038 AC_HELP_STRING( [--enable-text2pcap],
2039 [build text2pcap @<:@default=yes@:>@]),
2040 text2pcap=$enableval,enable_text2pcap=yes)
2042 if test "x$enable_text2pcap" = "xyes" ; then
2043 text2pcap_bin="text2pcap\$(EXEEXT)"
2044 text2pcap_man="text2pcap.1"
2049 AC_SUBST(text2pcap_bin)
2050 AC_SUBST(text2pcap_man)
2052 # Enable/disable dftest
2054 AC_ARG_ENABLE(dftest,
2055 AC_HELP_STRING( [--enable-dftest],
2056 [build dftest @<:@default=yes@:>@]),
2057 enable_dftest=$enableval,enable_dftest=yes)
2059 if test "x$enable_dftest" = "xyes" ; then
2060 dftest_bin="dftest\$(EXEEXT)"
2061 dftest_man="dftest.1"
2066 AC_SUBST(dftest_bin)
2067 AC_SUBST(dftest_man)
2069 # Enable/disable randpkt
2071 AC_ARG_ENABLE(randpkt,
2072 AC_HELP_STRING( [--enable-randpkt],
2073 [build randpkt @<:@default=yes@:>@]),
2074 enable_randpkt=$enableval,enable_randpkt=yes)
2076 if test "x$enable_randpkt" = "xyes" ; then
2077 randpkt_bin="randpkt\$(EXEEXT)"
2078 randpkt_man="randpkt.1"
2083 AC_SUBST(randpkt_bin)
2084 AC_SUBST(randpkt_man)
2086 AC_SUBST(wiresharkfilter_man)
2088 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
2089 dnl "gethostbyname()".
2090 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
2092 dnl Checks for "connect()", used as a proxy for "socket()" - and
2093 dnl "-lsocket", if we need it to get "connect()".
2094 AC_WIRESHARK_SOCKET_LIB_CHECK
2097 AC_MSG_CHECKING(whether to use libpcap for packet capture)
2100 AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
2101 [use libpcap for packet capturing @<:@default=yes@:>@]),
2103 if test $withval = no
2106 elif test $withval = yes
2117 if test "x$want_pcap" = "xno" ; then
2121 AC_WIRESHARK_PCAP_CHECK
2125 dnl Check for airpcap
2126 AC_MSG_CHECKING(whether to include airpcap support)
2127 AC_ARG_ENABLE(airpcap,
2128 AC_HELP_STRING( [--enable-airpcap],
2129 [use AirPcap in Wireshark @<:@default=yes@:>@]),
2130 enable_airpcap=$enableval, enable_airpcap=yes)
2132 if test x$enable_airpcap = xyes; then
2133 if test "x$want_pcap" = "xno" ; then
2135 AC_MSG_RESULT(pcap not available - disabling airpcap)
2138 AC_DEFINE(HAVE_AIRPCAP, 1, [Enable AirPcap])
2146 AC_MSG_CHECKING(whether to build dumpcap)
2148 AC_ARG_ENABLE(dumpcap,
2149 AC_HELP_STRING( [--enable-dumpcap],
2150 [build dumpcap @<:@default=yes@:>@]),
2151 enable_dumpcap=$enableval,enable_dumpcap=yes)
2153 if test "x$enable_dumpcap" = "xyes" ; then
2154 if test "x$want_pcap" = "xno" ; then
2156 AC_MSG_RESULT(pcap not available - disabling dumpcap)
2164 if test "x$enable_dumpcap" = "xyes" ; then
2165 dumpcap_bin="dumpcap\$(EXEEXT)"
2166 dumpcap_man="dumpcap.1"
2171 AC_SUBST(dumpcap_bin)
2172 AC_SUBST(dumpcap_man)
2174 # Enable/disable rawshark
2177 AC_MSG_CHECKING(whether to build rawshark)
2179 AC_ARG_ENABLE(rawshark,
2180 AC_HELP_STRING( [--enable-rawshark],
2181 [build rawshark @<:@default=yes@:>@]),
2182 rawshark=$enableval,enable_rawshark=yes)
2184 if test "x$enable_rawshark" = "xyes" ; then
2185 if test "x$want_pcap" = "xno" ; then
2187 AC_MSG_RESULT(pcap not available - disabling rawshark)
2195 if test "x$enable_rawshark" = "xyes" ; then
2196 rawshark_bin="rawshark\$(EXEEXT)"
2197 rawshark_man="rawshark.1"
2202 AC_SUBST(rawshark_bin)
2203 AC_SUBST(rawshark_man)
2206 # Enable/disable echld
2207 AC_ARG_ENABLE(echld,
2208 AC_HELP_STRING( [--enable-echld],
2209 [support echld (Experimental) @<:@default=no@:>@]),
2210 have_echld=$enableval,have_echld=no)
2212 AM_CONDITIONAL(HAVE_ECHLD, test "x$have_echld" = "xyes")
2213 if test "x$have_echld" = "xyes"
2215 AC_DEFINE(HAVE_ECHLD, 1, [Define if echld is enabled])
2216 echld_test_bin="echld_test\$(EXEEXT)"
2223 AC_SUBST(echld_test_bin)
2226 # Enable/disable tfshark
2227 AC_ARG_ENABLE(tfshark,
2228 AC_HELP_STRING( [--enable-tfshark],
2229 [build tfshark (Experimental) @<:@default=no@:>@]),
2230 tfshark=$enableval,enable_tfshark=no)
2232 if test "x$enable_tfshark" = "xyes" ; then
2233 tfshark_bin="tfshark\$(EXEEXT)"
2234 tfshark_man="tfshark.1"
2235 wiresharkfilter_man="wireshark-filter.4"
2240 AC_SUBST(tfshark_bin)
2241 AC_SUBST(tfshark_man)
2244 dnl Use pcap-ng by default
2245 AC_ARG_ENABLE(pcap-ng-default,
2246 AC_HELP_STRING( [--enable-pcap-ng-default],
2247 [use the pcap-ng file format by default instead of pcap @<:@default=yes@:>@]),
2248 enable_pcap_ng_default=$enableval,enable_pcap_ng_default=yes)
2249 if test x$enable_pcap_ng_default = xyes; then
2250 AC_DEFINE(PCAP_NG_DEFAULT, 1, [Support for pcap-ng])
2253 dnl pcap remote check
2254 AC_MSG_CHECKING(whether to use libpcap remote capturing feature)
2256 AC_ARG_WITH(pcap-remote,
2257 AC_HELP_STRING([--with-pcap-remote],
2258 [use libpcap remote capturing (requires libpcap)]),
2260 if test $withval = no
2264 want_pcap_remote=yes
2269 if test "x$want_pcap_remote" = "xno" -o "x$want_pcap" = "xno" ; then
2273 AC_WIRESHARK_PCAP_REMOTE_CHECK
2277 AC_MSG_CHECKING(whether to use zlib for gzip compression and decompression)
2280 AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
2281 [use zlib (located in directory DIR, if supplied) for gzip compression and decompression @<:@default=yes, if available@:>@]),
2283 if test "x$withval" = "xno"
2286 elif test "x$withval" = "xyes"
2295 # Use zlib if it's present, otherwise don't.
2297 want_zlib=ifavailable
2300 if test "x$want_zlib" = "xno" ; then
2304 AC_WIRESHARK_ZLIB_CHECK
2305 if test "x$want_zlib" = "xno" ; then
2306 AC_MSG_RESULT(zlib not found - disabling gzip compression and decompression)
2308 if test "x$ac_cv_func_inflatePrime" = "xno" ; then
2309 AC_MSG_RESULT(inflatePrime not found in zlib - disabling gzipped capture file support)
2315 AC_MSG_CHECKING(whether to use liblua for the Lua scripting plugin)
2318 AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
2319 [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin @<:@default=yes, if available@:>@]),
2321 if test $withval = no
2324 elif test $withval = yes
2333 # Use liblua by default
2335 want_lua=ifavailable
2338 if test "x$want_lua" = "xno" ; then
2342 AC_WIRESHARK_LIBLUA_CHECK
2343 if test "x$want_lua" = "xno" ; then
2344 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
2347 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
2351 AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
2353 AC_ARG_WITH(portaudio,
2354 AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
2355 [use libportaudio (located in directory DIR, if supplied) for the rtp_player @<:@default=yes, if available@:>@]),
2357 if test $withval = no
2360 elif test $withval = yes
2365 portaudio_dir=$withval
2369 # Use libportaudio by default
2371 want_portaudio=ifavailable
2374 if test "x$want_portaudio" = "xno" ; then
2378 AC_WIRESHARK_LIBPORTAUDIO_CHECK
2379 if test "x$want_portaudio" = "xno" ; then
2380 AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
2383 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
2388 AC_HELP_STRING( [--enable-ipv6],
2389 [use IPv6 name resolution, if available @<:@default=yes@:>@]),
2390 enable_ipv6=$enableval,enable_ipv6=yes)
2392 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
2393 if test "x$enable_ipv6" = "xno" ; then
2397 AC_WIRESHARK_IPV6_STACK
2401 dnl Check if dumpcap should be installed with filesystem capabilities
2402 AC_PATH_PROG(SETCAP, setcap)
2403 AC_ARG_ENABLE(setcap-install,
2404 AC_HELP_STRING( [--enable-setcap-install],
2405 [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
2406 enable_setcap_install=$enableval,enable_setcap_install=no)
2408 AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
2409 if test "x$enable_setcap_install" = "xno" ; then
2412 if test "x$SETCAP" = "x" ; then
2413 AC_MSG_RESULT(setcap not found)
2414 AC_MSG_ERROR([Setcap install was requested, but setcap was not found])
2415 elif test "x$enable_dumpcap" = "xno" ; then
2416 AC_MSG_RESULT(dumpcap disabled)
2417 AC_MSG_ERROR([Setcap install works only with dumpcap, but dumpcap is disabled])
2423 AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
2425 dnl Check if dumpcap should be installed setuid
2426 AC_ARG_ENABLE(setuid-install,
2427 AC_HELP_STRING( [--enable-setuid-install],
2428 [install dumpcap as setuid @<:@default=no@:>@]),
2429 enable_setuid_install=$enableval,enable_setuid_install=no)
2431 AC_MSG_CHECKING(whether to install dumpcap setuid)
2432 if test "x$enable_setuid_install" = "xno" ; then
2435 if test "x$enable_setcap_install" = "xyes" ; then
2436 enable_setuid_install=no
2437 AC_MSG_RESULT(setcap and setuid both selected)
2438 AC_MSG_ERROR(You must choose one of setcap install and setuid install)
2439 elif test "x$enable_dumpcap" = "xno" ; then
2440 AC_MSG_RESULT(dumpcap disabled)
2441 AC_MSG_ERROR([Setuid install works only with dumpcap, but dumpcap is disabled])
2447 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
2448 AC_CHECK_FUNCS(setresuid setresgid)
2450 dnl ...but our Network Operations group is named "no"!
2452 AC_ARG_WITH(dumpcap-group,
2453 AC_HELP_STRING( [--with-dumpcap-group=GROUP],
2454 [restrict dumpcap to GROUP]),
2456 if test "x$withval" = "xyes"; then
2457 AC_MSG_ERROR([No dumpcap group specified.])
2458 elif test "x$withval" != "xno"; then
2459 if test "x$enable_dumpcap" = "xno" ; then
2460 AC_MSG_ERROR(dumpcap group install works only with dumpcap but dumpcap is disabled)
2462 AC_MSG_RESULT($withval)
2463 DUMPCAP_GROUP="$withval"
2466 AC_SUBST(DUMPCAP_GROUP)
2467 AM_CONDITIONAL(HAVE_DUMPCAP_GROUP, test x$DUMPCAP_GROUP != x)
2469 dnl libcap (not libpcap) check
2471 AC_MSG_CHECKING(whether to use the libcap capabilities library)
2474 AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
2475 [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management @<:@default=yes, if present@:>@]),
2477 if test "x$withval" = "xno"; then
2479 elif test "x$withval" = "xyes"; then
2481 elif test -d "$withval"; then
2483 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2486 if test "x$with_libcap" = "xno" ; then
2490 AC_WIRESHARK_LIBCAP_CHECK
2492 AC_SUBST(LIBCAP_LIBS)
2494 dnl Checks for header files.
2495 dnl Some of these may not be needed: http://hacks.owlfolio.org/header-survey/
2496 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h stdarg.h stddef.h unistd.h)
2497 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)
2498 AC_CHECK_HEADERS(netinet/in.h)
2499 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
2503 AC_MSG_CHECKING(whether to use SSL library)
2506 AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
2507 [use SSL crypto library (located in directory DIR, if supplied) @<:@default=no@:>@]),
2509 if test "x$withval" = "xno"; then
2511 elif test "x$withval" = "xyes"; then
2513 elif test -d "$withval"; then
2515 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2520 if test "x$want_ssl" = "xyes"; then
2522 AC_CHECK_LIB(crypto,EVP_md5,
2527 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
2535 AC_MSG_CHECKING(whether to use Kerberos library)
2538 AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
2539 [use Kerberos library (located in directory DIR, if supplied) to use in Kerberos dissection @<:@default=yes@:>@]),
2541 if test $withval = no
2544 elif test $withval = yes
2553 # Use Kerberos library if available, otherwise don't.
2555 want_krb5=ifavailable
2558 if test "x$want_krb5" = "xno" ; then
2562 AC_WIRESHARK_KRB5_CHECK
2568 AC_MSG_CHECKING(whether to use the c-ares library if available)
2571 AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
2572 [use c-ares (located in directory DIR, if supplied) - supersedes --with-adns @<:@default=yes, if present@:>@]),
2574 if test "x$withval" = "xno"; then
2576 elif test "x$withval" = "xyes"; then
2578 elif test -d "$withval"; then
2580 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2583 if test "x$want_c_ares" = "xno" ; then
2587 AC_WIRESHARK_C_ARES_CHECK
2589 AC_SUBST(C_ARES_LIBS)
2593 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
2596 AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
2597 [use GNU ADNS (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2599 if test "x$withval" = "xno"; then
2601 elif test "x$withval" = "xyes"; then
2603 elif test -d "$withval"; then
2605 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2608 if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
2612 AC_WIRESHARK_ADNS_CHECK
2618 AC_MSG_CHECKING(whether to use the GeoIP IP address mapping library if available)
2621 AC_HELP_STRING( [--with-geoip@<:@=DIR@:>@],
2622 [use GeoIP (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2624 if test "x$withval" = "xno"; then
2626 elif test "x$withval" = "xyes"; then
2628 elif test -d "$withval"; then
2630 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2633 if test "x$want_geoip" = "xno"; then
2637 AC_WIRESHARK_GEOIP_CHECK
2639 AC_SUBST(GEOIP_LIBS)
2642 # Define WS_MSVC_NORETURN appropriately for declarations of routines that
2643 # never return (just like Charlie on the MTA).
2645 # Note that MSVC++ expects __declspec(noreturn) to precede the function
2646 # name and GCC, as far as I know, expects __attribute__((noreturn)) to
2647 # follow the function name, so we need two different flavors of
2650 AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
2652 dnl Checks for typedefs, structures, and compiler characteristics.
2655 # Check how we can get the time zone abbreviation
2656 AC_WIRESHARK_TIMEZONE_ABBREV
2658 # We need to know whether "struct stat" has an "st_flags" member
2659 # for file_user_immutable().
2661 AC_WIRESHARK_STRUCT_ST_FLAGS
2663 # We need to know whether "struct sockaddr" has an "sa_len" member
2664 # for get_interface_list().
2666 AC_WIRESHARK_STRUCT_SA_LEN
2668 # We must know our byte order
2671 # Checks whether "-traditional" is needed when using "ioctl".
2672 # XXX - do we need this?
2673 AC_PROG_GCC_TRADITIONAL
2675 AC_CHECK_FUNC(getopt_long,
2678 AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define to 1 if you have the getopt_long function.])
2681 # Do we have optreset?
2683 AC_MSG_CHECKING(whether optreset is defined)
2686 extern int optreset;
2690 ac_cv_pcap_debug_defined=yes,
2691 ac_cv_pcap_debug_defined=no)
2692 if test "$ac_cv_pcap_debug_defined" = yes ; then
2694 AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable])
2699 GETOPT_LO="wsgetopt.lo")
2702 AC_CHECK_FUNCS(mkstemp mkdtemp)
2704 AC_SEARCH_LIBS(inet_aton, [socket nsl],
2707 AC_DEFINE(HAVE_INET_ATON, 0, [Define to 1 if you have the inet_aton function.])
2709 INET_ATON_LO="inet_aton.lo")
2710 AC_SUBST(INET_ATON_LO)
2712 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
2713 dnl check for pre-BIND82 inet_pton() bug.
2714 AC_MSG_CHECKING(for broken inet_pton)
2715 AC_TRY_RUN([#include <sys/types.h>
2716 #include <sys/socket.h>
2717 #include <netinet/in.h>
2718 #include <arpa/inet.h>
2723 /* this should return 0 (error) */
2724 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
2728 }], [AC_MSG_RESULT(ok);
2729 have_inet_pton=yes], [AC_MSG_RESULT(broken);
2730 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
2731 have_inet_pton=no])],
2733 if test "$have_inet_pton" = no; then
2734 INET_PTON_LO="inet_pton.lo"
2738 AM_CONDITIONAL(NEED_INET_PTON_LO, test "x$have_inet_pton" = "xno")
2739 AC_SUBST(INET_PTON_LO)
2741 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
2742 AC_MSG_CHECKING([for inet_ntop prototype])
2743 AC_TRY_COMPILE([#include <stdio.h>
2744 #include <sys/types.h>
2745 #include <sys/socket.h>
2746 #include <netinet/in.h>
2747 #include <arpa/inet.h>
2749 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
2751 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
2752 [Define if inet_ntop() prototype exists])], [
2753 AC_TRY_COMPILE([#include <stdio.h>
2754 #include <sys/types.h>
2755 #include <sys/socket.h>
2756 #include <netinet/in.h>
2757 #include <arpa/inet.h>
2759 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
2761 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
2762 [Define if inet_ntop() prototype exists])], [
2763 AC_MSG_RESULT(no)])])
2765 INET_NTOP_LO="inet_ntop.lo"
2766 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
2767 [Define if inet/v6defs.h needs to be included])])
2768 AM_CONDITIONAL(NEED_INET_NTOP_LO, test "x$INET_NTOP_LO" != "x")
2769 AC_SUBST(INET_NTOP_LO)
2771 AC_CHECK_FUNC(strptime,
2774 AC_DEFINE(HAVE_STRPTIME, 1, [Define if you have the strptime function.])
2776 STRPTIME_LO="strptime.lo")
2777 AC_SUBST(STRPTIME_LO)
2779 AC_CHECK_FUNC(popcount,
2782 AC_DEFINE(HAVE_POPCOUNT, 1, [Define if you have the popcount function.])
2784 POPCOUNT_LO="popcount.lo")
2785 AC_SUBST(POPCOUNT_LO)
2787 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
2788 AC_CHECK_FUNCS(issetugid)
2789 AC_CHECK_FUNCS(mmap mprotect sysconf)
2791 dnl blank for now, but will be used in future
2792 AC_SUBST(wireshark_SUBDIRS)
2794 # Check Bluetooth SBC codec for RTP Player
2795 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
2796 PKG_CHECK_MODULES(SBC, sbc >= 1.0, [have_sbc=yes], [have_sbc=no])
2797 if (test "${have_sbc}" = "yes"); then
2798 AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
2799 CFLAGS="$CFLAGS $(pkg-config sbc --cflags)"
2800 LIBS="$LIBS $(pkg-config sbc --libs)"
2804 dnl check whether plugins should be enabled and, if they should be,
2805 dnl check for plugins directory - stolen from Amanda's configure.ac
2807 dnl we don't wish to expand ${libdir} yet
2808 plugindir='${libdir}/wireshark/plugins/${VERSION}'
2809 AC_ARG_WITH(plugins,
2810 AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
2811 [support plugins (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
2813 if test "x$withval" = "xno"; then
2815 elif test "x$have_plugins" = "xno"; then
2816 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
2817 elif test "x$withval" != "xyes"; then
2818 plugindir="$withval"
2821 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
2822 if test x$have_plugins = xyes
2824 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
2827 CPPFLAGS="$CPPFLAGS '-DPLUGIN_INSTALL_DIR=\"\$(plugindir)\"'"
2830 # The plugin dissectors reside in ./plugins/PROTO/
2833 AC_SUBST(PLUGIN_LIBS)
2836 dnl Use extcap by default
2837 extcapdir='${datadir}/wireshark/extcap/'
2839 AC_HELP_STRING( [--with-extcap@<:@=DIR@:>@],
2840 [use extcap for external capture sources (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
2842 if test "x$withval" = "xno"; then
2844 elif test "x$withval" = "xyes"; then
2846 elif test "x$withval" != "xyes"; then
2848 extcapdir ="$withval"
2853 AM_CONDITIONAL(HAVE_EXTCAP, test "x$have_extcap" = "xyes")
2854 if test "x$have_extcap" = "xyes"
2856 AC_DEFINE(HAVE_EXTCAP, 1, [Define if external capture sources should be enabled])
2857 AC_DEFINE_UNQUOTED(EXTCAP_DIR,"$extcapdir", [Directory for extcap plugins])
2862 # Check if (emem) memory allocations must be 8-byte aligned.
2863 # I haven't been able to write C code that reliably makes that determination
2864 # (different versions of GCC with or without optimization give different
2865 # results) so just assume everything except (32-bit) x86 needs 8-byte
2866 # alignment (64-bit platforms either require 8-byte alignment for pointers
2867 # and 64-bit integral data types or may get better performance from that;
2868 # 64-bit x86 will get 8-byte alignment from G_MEM_ALIGN anyway. 32-bit
2869 # platforms would only require it, or get better performance from it,
2870 # for 64-bit floating-point values.).
2872 AC_MSG_CHECKING(whether we need memory allocations to be 8-byte aligned)
2874 i386|i486|i586|i686)
2879 AC_DEFINE(NEED_8_BYTE_ALIGNMENT, 1, [Define if we need memory allocations to be 8-byte aligned])
2885 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
2886 # (autoconf? automake? libtool?) - with the newer version(s), it's
2887 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
2889 # With older version(s) of those tool(s), however, it's not just an
2890 # alias, and the configure scripts don't work without it.
2893 AC_SUBST(LIBTOOL_DEPS)
2895 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
2896 if test x$enable_static = xyes -a x$have_plugins = xyes
2898 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
2900 AC_SUBST(ENABLE_STATIC)
2902 # Gather which GUI we're building for rpmbuild
2903 if test "x$have_gtk" = "xyes"; then
2904 if test "x$with_gtk3" = "xyes"; then
2905 RPMBUILD_WITH_ARGS="--with gtk3 --without gtk2"
2907 RPMBUILD_WITH_ARGS="--without gtk3 --with gtk2"
2910 RPMBUILD_WITH_ARGS="--without gtk2 --without gtk3"
2912 if test "x$have_qt" = "xyes" ; then
2913 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
2915 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt"
2917 AC_SUBST(RPMBUILD_WITH_ARGS)
2919 dnl Save the cacheable configure results to config.cache before recursing
2922 sinclude(plugins/Custom.m4) dnl
2923 ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
2925 sinclude(asn1/Custom.m4) dnl
2926 ifdef(_CUSTOM_ASN1_AC_OUTPUT_,, define(_CUSTOM_ASN1_AC_OUTPUT_, )) dnl
2928 AC_CONFIG_HEADERS(config.h)
2933 _CUSTOM_ASN1_AC_OUTPUT_
2934 asn1/acp133/Makefile
2936 asn1/ansi_map/Makefile
2937 asn1/ansi_tcap/Makefile
2938 asn1/atn-cm/Makefile
2939 asn1/atn-cpdlc/Makefile
2940 asn1/atn-ulcs/Makefile
2944 asn1/charging_ase/Makefile
2949 asn1/credssp/Makefile
2957 asn1/gprscdr/Makefile
2958 asn1/gsm_map/Makefile
2967 asn1/h450-ros/Makefile
2970 asn1/HI2Operations/Makefile
2975 asn1/isdn-sup/Makefile
2976 asn1/kerberos/Makefile
2979 asn1/logotypecertextn/Makefile
2983 asn1/lte-rrc/Makefile
2986 asn1/mpeg-audio/Makefile
2987 asn1/mpeg-pes/Makefile
2989 asn1/ns_cert_exts/Makefile
2990 asn1/novell_pkis/Makefile
2998 asn1/pkcs12/Makefile
2999 asn1/pkinit/Makefile
3000 asn1/pkixac/Makefile
3001 asn1/pkix1explicit/Makefile
3002 asn1/pkix1implicit/Makefile
3003 asn1/pkixproxy/Makefile
3004 asn1/pkixqualified/Makefile
3005 asn1/pkixtsp/Makefile
3008 asn1/q932-ros/Makefile
3019 asn1/sbc-ap/Makefile
3022 asn1/spnego/Makefile
3030 asn1/wlancertextn/Makefile
3032 asn1/x509af/Makefile
3033 asn1/x509ce/Makefile
3034 asn1/x509if/Makefile
3035 asn1/x509sat/Makefile
3038 capchild/doxygen.cfg
3040 caputils/doxygen.cfg
3044 epan/compress/Makefile
3047 epan/dfilter/Makefile
3048 epan/dissectors/Makefile
3049 epan/dissectors/dcerpc/Makefile
3050 epan/dissectors/pidl/Makefile
3051 epan/ftypes/Makefile
3052 epan/nghttp2/Makefile
3065 packaging/macosx/Info.plist
3066 packaging/macosx/Makefile
3067 packaging/macosx/osx-dmg.sh
3068 packaging/macosx/Wireshark_package.pmdoc/index.xml
3069 packaging/nsis/Makefile
3070 packaging/rpm/Makefile
3071 packaging/rpm/SPECS/Makefile
3072 packaging/rpm/SPECS/wireshark.spec
3073 packaging/svr4/Makefile
3074 packaging/svr4/checkinstall
3075 packaging/svr4/pkginfo
3077 plugins/docsis/Makefile
3078 plugins/easy_codec/Makefile
3079 plugins/ethercat/Makefile
3080 plugins/gryphon/Makefile
3081 plugins/irda/Makefile
3082 plugins/m2m/Makefile
3083 plugins/mate/Makefile
3084 plugins/opcua/Makefile
3085 plugins/profinet/Makefile
3086 plugins/stats_tree/Makefile
3087 plugins/unistim/Makefile
3088 plugins/wimax/Makefile
3089 plugins/wimaxasncp/Makefile
3090 plugins/wimaxmacphy/Makefile
3092 tools/lemon/Makefile
3098 dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
3103 if test "x$have_gtk" = "xyes"; then
3104 if test "x$with_gtk3" = "xyes"; then
3105 gtk_lib_message=" (with GTK+ 3"
3107 gtk_lib_message=" (with GTK+ 2"
3109 if test "x$have_ige_mac" = "xyes"; then
3110 gtk_lib_message="$gtk_lib_message and Mac OS X integration)"
3112 gtk_lib_message="$gtk_lib_message)"
3116 if test "x$have_qt" = "xyes" ; then
3117 enable_wireshark_qt="yes"
3119 enable_wireshark_qt="no"
3122 if test "x$enable_setcap_install" = "xyes" ; then
3123 setcap_message="yes"
3128 if test "x$enable_setuid_install" = "xyes" ; then
3129 setuid_message="yes"
3134 if test "x$DUMPCAP_GROUP" = "x" ; then
3135 dumpcap_group_message="(none)"
3137 dumpcap_group_message="$DUMPCAP_GROUP"
3140 if test "x$want_zlib" = "xno" ; then
3146 if test "x$want_lua" = "xyes" ; then
3152 if test "x$want_portaudio" = "xyes" ; then
3153 portaudio_message="yes"
3155 portaudio_message="no"
3158 if test "x$want_ssl" = "xno" ; then
3164 if test "x$want_krb5" = "xno" ; then
3167 krb5_message="yes ($ac_krb5_version)"
3170 if test "x$have_good_c_ares" = "xyes" ; then
3171 c_ares_message="yes"
3176 if test "x$have_good_adns" = "xyes" ; then
3179 if test "x$have_good_c_ares" = "xyes" ; then
3180 adns_message="no (using c-ares instead)"
3186 if test "x$have_good_libcap" = "xyes" ; then
3187 libcap_message="yes"
3192 if test "x$have_good_geoip" = "xyes" ; then
3199 echo "The Wireshark package has been configured with the following options."
3200 echo " Build wireshark : $enable_wireshark_qt"
3201 echo " Build wireshark-gtk : $have_gtk""$gtk_lib_message"
3202 echo " Build tshark : $enable_tshark"
3203 echo " Build tfshark : $enable_tfshark"
3204 echo " Build capinfos : $enable_capinfos"
3205 echo " Build captype : $enable_captype"
3206 echo " Build editcap : $enable_editcap"
3207 echo " Build dumpcap : $enable_dumpcap"
3208 echo " Build mergecap : $enable_mergecap"
3209 echo " Build reordercap : $enable_reordercap"
3210 echo " Build text2pcap : $enable_text2pcap"
3211 echo " Build randpkt : $enable_randpkt"
3212 echo " Build dftest : $enable_dftest"
3213 echo " Build rawshark : $enable_rawshark"
3214 echo " Build echld : $have_echld"
3216 echo " Save files as pcap-ng by default : $enable_pcap_ng_default"
3217 echo " Install dumpcap with capabilities : $setcap_message"
3218 echo " Install dumpcap setuid : $setuid_message"
3219 echo " Use dumpcap group : $dumpcap_group_message"
3220 echo " Use plugins : $have_plugins"
3221 echo " Use external capture sources : $have_extcap"
3222 echo " Use Lua library : $lua_message"
3223 echo " Build rtp_player : $portaudio_message"
3224 echo " Build profile binaries : $enable_profile_build"
3225 echo " Use pcap library : $want_pcap"
3226 echo " Use zlib library : $zlib_message"
3227 echo " Use kerberos library : $krb5_message"
3228 echo " Use c-ares library : $c_ares_message"
3229 echo " Use GNU ADNS library : $adns_message"
3230 echo " Use SMI MIB library : $libsmi_message"
3231 echo " Use GNU crypto library : $gcrypt_message"
3232 echo " Use SSL crypto library : $ssl_message"
3233 echo " Use IPv6 name resolution : $enable_ipv6"
3234 echo " Use gnutls library : $tls_message"
3235 echo " Use POSIX capabilities library : $libcap_message"
3236 echo " Use GeoIP library : $geoip_message"
3237 echo " Use nl library : $libnl_message"
3238 echo " Use SBC codec library : $have_sbc"