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], [3])
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])
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"
1084 # The compiler supports -msse4.2; use that to enable SSE 4.2.
1086 # Restore CFLAGS. We only want to apply -msse4.2 to
1087 # wsutil/ws_mempbrk_sse42.c, as the SSE4.2 code there
1088 # is run only if the hardware supports it, but other
1089 # code would do no such checks.
1091 CFLAGS="$CFLAGS_before_simd"
1092 ac_sse4_2_flag=-msse4.2
1095 # Try -xarch=sse4_2; that's the flag for Sun's compiler.
1097 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xarch=sse4_2, C)
1098 if test "x$CFLAGS" != "x$CFLAGS_before_simd"
1101 # The compiler supports -xarch=sse4_2; use that to
1104 # Restore CFLAGS; see above.
1106 CFLAGS="$CFLAGS_before_simd"
1107 ac_sse4_2_flag=-xarch=sse4_2
1111 if test "x$ac_sse4_2_flag" != x; then
1113 # OK, we have a compiler flag to enable SSE 4.2.
1115 # Make sure we have the necessary header for the SSE4.2 intrinsics
1116 # and that we can use it.
1118 AC_MSG_CHECKING([whether there is nmmintrin.h header and we can use it])
1121 # Add the SSE4.2 flags to the beginning of CFLAGS, in case the
1122 # user explicitly specified -mno-sse4.2 (or in case Gentoo's build
1123 # tools did so); if they did so, we only want this to work if
1124 # we can use the #pragma to override that for ws_mempbrk_sse42.c,
1125 # and putting it at the beginning means that the CFLAGS setting
1126 # in the environment will come later and override it.
1128 saved_CFLAGS="$CFLAGS"
1129 CFLAGS="$ac_sse4_2_flag $CFLAGS"
1131 [#include <nmmintrin.h>],
1135 AC_DEFINE(HAVE_SSE4_2, 1, [Support SSSE4.2 (Streaming SIMD Extensions 4.2) instructions])
1136 CFLAGS_SSE42="$ac_sse4_2_flag"
1137 AC_MSG_RESULT([yes])
1144 CFLAGS="$saved_CFLAGS"
1148 dnl build libwsutil_sse42 only if there is SSE4.2
1149 AM_CONDITIONAL(SSE42_SUPPORTED, test "x$have_sse42" = "xyes")
1150 AC_SUBST(CFLAGS_SSE42)
1153 # If we're running GCC or clang define _U_ to be "__attribute__((unused))"
1154 # so we can use _U_ to flag unused function parameters and not get warnings
1155 # about them. Otherwise, define _U_ to be an empty string so that _U_ used
1156 # to flag an unused function parameters will compile with other compilers.
1158 # XXX - similar hints for other compilers?
1160 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
1161 AC_DEFINE(_U_, __attribute__((unused)), [Hint to the compiler that a function parameters is not used])
1163 AC_DEFINE(_U_, , [Hint to the compiler that a function parameters is not used])
1166 # If we're running GCC or CLang, use FORTIFY_SOURCE=2
1167 # (only if the GCC 'optimization level' > 0).
1169 # See: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
1170 # See: http://sourceware.org/bugzilla/show_bug.cgi?id=13979
1172 # Note: FORTIFY_SOURCE is only effective for gcc optimization level > 0 (-O1, etc)
1173 AC_WIRESHARK_GCC_FORTIFY_SOURCE_CHECK
1176 # If the compiler supports GCC-style flags, enable a barrier "stop on
1178 # This barrier is set for a very large part of the code. However, it is
1179 # typically not set for "generated" code (flex, ans2wrs, idl2wrs, ...)
1181 warnings_as_errors_default="yes"
1182 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
1183 AC_ARG_ENABLE(warnings-as-errors,
1184 AC_HELP_STRING( [--enable-warnings-as-errors],
1185 [treat warnings as errors (only for GCC or clang) @<:@default=yes, unless extra compiler warnings are enabled@:>@]),
1187 if test "x$ac_supports_gcc_flags" = "xyes" -a "x$enableval" = "xyes"; then
1188 with_warnings_as_errors="yes"
1191 with_warnings_as_errors="no"
1196 if test "x$ac_supports_gcc_flags" = "xyes" -a "x$wireshark_extra_flags" = "x" -a "x$warnings_as_errors_default" = "xyes"; then
1197 with_warnings_as_errors="yes"
1200 with_warnings_as_errors="no"
1205 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
1208 # Add any platform-specific compiler flags needed.
1210 AC_MSG_CHECKING(for platform-specific compiler flags)
1211 if test "x$GCC" = "xyes" ; then
1213 # GCC - do any platform-specific tweaking necessary.
1217 # the X11 headers don't automatically include prototype info
1218 # and a lot don't include the return type
1219 CPPFLAGS="$CPPFLAGS -DFUNCPROTO=15"
1220 CFLAGS="$CFLAGS -Wno-return-type"
1221 CXXFLAGS="$CXXFLAGS -Wno-return-type"
1222 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
1225 AC_MSG_RESULT(none needed)
1230 # Not GCC - assume it's the vendor's compiler.
1235 # HP's ANSI C compiler; flags suggested by Jost Martin.
1236 # "-Ae" for ANSI C plus extensions such as "long long".
1237 # "+O2", for optimization. XXX - works with "-g"?
1239 # HP's ANSI C++ compiler doesn't support "-Ae", but
1240 # does support "+O2", at least according to the
1241 # documentation I can find online.
1243 CFLAGS="-Ae +O2 $CFLAGS"
1244 CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
1245 CXXFLAGS="+O2 $CFLAGS"
1246 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
1249 AC_MSG_RESULT(none needed)
1255 # Add any platform-specific linker flags needed.
1257 AC_MSG_CHECKING(for platform-specific linker flags)
1261 # Add -Wl,-single_module to the LDFLAGS used with shared
1262 # libraries, to fix some error that show up in some cases;
1263 # some Apple documentation recommends it for most shared
1266 LDFLAGS_SHAREDLIB="-Wl,-single_module"
1268 # Add -Wl,-headerpad_max_install_names to the LDFLAGS, as
1269 # code-signing issues is running out of padding space.
1271 # Add -Wl,-search_paths_first to make sure that if we search
1272 # directories A and B, in that order, for a given library, a
1273 # non-shared version in directory A, rather than a shared
1274 # version in directory B, is chosen (so we can use
1275 # --with-pcap=/usr/local to force all programs to be linked
1276 # with a static version installed in /usr/local/lib rather than
1277 # the system version in /usr/lib).
1279 # Also add -Wl,-rpath,@executable_path/../lib and
1280 # -Wl,-rpath,/usr/local/lib, so that, if we build an app
1281 # bundle, we can tweak all the executable images, shared
1282 # libraries, and plugins in the bundle to look for non-system
1283 # libraries in the rpath, rather than having a script tweak
1284 # DYLD_LIBRARY_PATH.
1286 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"
1287 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])
1291 # Shared libraries in cygwin/Win32 must never contain
1292 # undefined symbols.
1294 LDFLAGS="$LDFLAGS -no-undefined"
1295 AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
1298 AC_MSG_RESULT(none needed)
1301 AC_SUBST(LDFLAGS_SHAREDLIB)
1303 # Enable silent builds by default
1304 # Verbose builds can be enabled with "./configure
1305 # --enable-silent-rules ..." or "make V=1 ..."
1306 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1307 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1310 # On "Darwin", which we assume to mean "OS X" rather than "iOS" or
1311 # "just Darwin" (as we don't currently support iOS, and as I don't
1312 # think you can build and run "just Darwin" as an OS for PCs), we
1313 # arrange to build some programs with Application Services so they
1314 # can launch Web browsers and Finder windows, arrange to build some
1315 # programs with System Configuration so they can get "friendly names"
1316 # and other information about interfaces, and build any programs that
1317 # use either of those frameworks or that report version information
1318 # with Core Foundation as the frameworks in question use it and as we
1319 # get version information from plists and thus need Core Foundation
1320 # to process those plists.
1325 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
1326 APPLICATIONSERVICES_FRAMEWORKS="-framework ApplicationServices"
1327 SYSTEMCONFIGURATION_FRAMEWORKS="-framework SystemConfiguration"
1328 COREFOUNDATION_FRAMEWORKS="-framework CoreFoundation"
1331 # OK, so we have the OS X frameworks; do they include
1332 # CFPropertyListCreateWithStream, or do we have
1333 # to fall back on CFPropertyListCreateFromStream?
1334 # (They only differ in the error return, which we
1335 # don't care about. And, no, we shouldn't just
1336 # use CFPropertyListCreateFromStream, because it's
1337 # deprecated in newer releases.)
1339 ac_save_LIBS="$LIBS"
1340 LIBS="$LIBS $COREFOUNDATION_FRAMEWORKS"
1341 AC_CHECK_FUNCS(CFPropertyListCreateWithStream)
1342 LIBS="$ac_save_LIBS"
1345 AC_SUBST(APPLICATIONSERVICES_FRAMEWORKS)
1346 AC_SUBST(SYSTEMCONFIGURATION_FRAMEWORKS)
1347 AC_SUBST(COREFOUNDATION_FRAMEWORKS)
1350 # On Solaris, check whether we have getexecname().
1354 AC_CHECK_FUNC(getexecname)
1358 dnl Look in /usr/local for header files and libraries ?
1359 dnl XXX FIXME don't include /usr/local if it is already in the system
1360 dnl search path as this causes gcc 3.2 on Linux to complain about a change
1361 dnl of the system search order for includes
1362 AC_ARG_ENABLE(usr-local,
1363 AC_HELP_STRING( [--enable-usr-local],
1364 [look for headers and libs in /usr/local tree @<:@default=yes@:>@]),
1365 ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
1367 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
1368 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1369 if test -d "/usr/local"; then
1372 # Arrange that we search for header files in the source directory
1373 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
1374 # as various packages we use ("libpcap", "zlib", "adns")
1375 # may have been installed under "/usr/local/include".
1377 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
1380 # Arrange that we search for libraries in "/usr/local/lib".
1382 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
1391 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
1396 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
1397 if test x$LD_LIBRARY_PATH != x ; then
1398 LIBS="$LIBS -R$LD_LIBRARY_PATH"
1399 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
1401 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
1407 # Check for versions of "sed" inadequate to handle, in libtool, a list
1408 # of object files as large as the list in Wireshark.
1410 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
1411 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
1412 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
1413 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
1414 # is the only "sed" that comes with Solaris that can handle Wireshark.
1416 # Add any checks here that are necessary for other OSes.
1418 AC_PATH_PROG(SED, sed)
1421 AC_MSG_ERROR(I couldn't find sed; make sure it's installed and in your path)
1423 AC_WIRESHARK_GNU_SED_CHECK
1424 if test "$HAVE_GNU_SED" = no ; then
1427 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
1429 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
1431 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
1446 # Enable/disable wireshark
1447 AC_ARG_ENABLE(wireshark,
1448 AC_HELP_STRING( [--enable-wireshark],
1449 [build the Wireshark GUI (with Gtk+, Qt, or both) @<:@default=yes@:>@]),
1450 enable_wireshark=$enableval,enable_wireshark=yes)
1451 AM_CONDITIONAL(BUILDING_WIRESHARK, test x$enable_wireshark = xyes)
1453 AC_ARG_ENABLE(packet-editor,
1454 AC_HELP_STRING( [--enable-packet-editor],
1455 [add support for packet editor in Wireshark @<:@default=yes@:>@]),
1456 enable_packet_editor=$enableval,enable_packet_editor=yes)
1457 if test x$enable_packet_editor = xyes; then
1458 AC_DEFINE(WANT_PACKET_EDITOR, 1, [Support for packet editor])
1461 AC_ARG_ENABLE(profile-build,
1462 AC_HELP_STRING( [--enable-profile-build],
1463 [build profile-ready binaries @<:@default=no@:>@]),
1464 enable_profile_build=$enableval,enable_profile_build=no)
1465 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
1466 AC_MSG_CHECKING(if profile builds must be generated)
1467 if test "x$enable_profile_build" = "xyes" ; then
1468 if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
1470 CFLAGS=" -pg $CFLAGS"
1471 CXXFLAGS=" -pg $CXXFLAGS"
1474 echo "Building profile binaries currently only supported for GCC and clang."
1480 # Create DATAFILE_DIR #define for config.h
1481 datafiledir=$datadir/wireshark
1483 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1484 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1485 # Ugly hack, but I don't see how this problem can be solved
1486 # properly that DATAFILE_DIR had a value starting with
1487 # "${prefix}/" instead of e.g. "/usr/local/"
1488 eval eval echo "$datafiledir"
1490 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
1492 # Create DOC_DIR #define for config.h
1494 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1495 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1496 # Ugly hack, but I don't see how this problem can be solved
1497 # properly that DOC_DIR had a value starting with
1498 # "${prefix}/" instead of e.g. "/usr/local/"
1499 eval eval echo "$docdir"
1501 AC_DEFINE_UNQUOTED(DOC_DIR, "$docdir", [Directory for docs])
1503 GTK2_MIN_VERSION=2.12.0
1504 AC_SUBST(GTK2_MIN_VERSION)
1505 GTK3_MIN_VERSION=3.0.0
1506 AC_SUBST(GTK3_MIN_VERSION)
1507 QT_MIN_VERSION=4.6.0
1508 AC_SUBST(QT_MIN_VERSION)
1509 # GTK+ and Qt checks; we require GTK+ $GTK2_MIN_VERSION or later or
1510 # GTK3_MIN_VERSION or later or Qt $QT_MIN_VERSION or later.
1512 # We only do those if we're going to be building Wireshark;
1513 # otherwise, we don't have any GUI to build, so we don't use
1516 # We don't add $GTK_LIBS or $Qt_LIBS to LIBS, because we don't want to
1517 # force all programs to be built with GTK+ or Qt.
1519 # Release dates for GTK+ versions:
1520 # http://en.wikipedia.org/wiki/GTK+#Releases
1521 # 2.12.0: 14 Sep 2007
1522 # 2.14.0: 04 Sep 2008
1523 # 2.16.0: 13 Mar 2009
1524 # 2.18.0: 23 Sep 2009
1525 # 2.20.0: 23 Mar 2010
1526 # 2.22.0: 23 Sep 2010
1527 # 2.24.0: 30 Jan 2011
1528 # 3.0.0: 10 Feb 2011
1529 # 3.2.0: 25 Sep 2011
1530 # 3.4.0: 26 Mar 2012
1531 # 3.6.0: 24 Sep 2012
1532 # 3.8.0: 25 Mar 2013
1533 # 3.10.0: 23 Sep 2013
1534 # 3.12.0: 25 Mar 2014
1536 # Release dates for Qt versions:
1537 # http://en.wikipedia.org/wiki/List_of_Qt_releases
1538 # 4.6.0: 01 Dec 2009
1539 # 4.7.0: 21 Sep 2010
1540 # 4.8.0: 15 Dec 2011
1541 # 5.0.0: 19 Dec 2012
1542 # 5.1.0: 03 Jul 2013
1543 # 5.2.0: 12 Dec 2013
1544 # 5.3.0: 20 May 2014
1548 if test "x$enable_wireshark" = "xyes"; then
1549 if test "x$with_gtk2" = "xunspecified" -a \
1550 "x$with_gtk3" = "xunspecified" -a \
1551 "x$with_qt" = "xunspecified"; then
1553 # No GUI toolkit was explicitly specified; pick Qt and GTK+ 3.
1558 if test "x$with_qt" = "xyes"; then
1560 # Qt was specified; Make sure we have a C++ compiler.
1562 if test -z "$CXX"; then
1563 AC_MSG_ERROR(Need a working C++ compiler to build Wireshark with Qt)
1567 # Now make sure we have Qt and, if so, add the flags
1568 # for it to CFLAGS and CXXFLAGS.
1570 AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION,
1572 CFLAGS="$CFLAGS $Qt_CFLAGS"
1573 CXXFLAGS="$CXXFLAGS $Qt_CFLAGS"
1575 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-qt"
1577 [AC_MSG_ERROR([Qt is not available])])
1580 # XXX - greasy hack to make ui/gtk/recent.c
1583 CPPFLAGS="-DQT_GUI_LIB"
1586 if test "x$with_gtk3" = "xyes"; then
1588 # GTK+ 3 was specified; make sure they didn't also
1589 # specify GTK+ 2, as we don't support building both
1590 # GTK+ 2 and GTK+ 3 versions at the same time.
1592 if test "x$with_gtk2" = "xyes"; then
1593 AC_MSG_ERROR([Both GTK+ 2 and GTK+ 3 were specified; choose one but not both])
1597 # Make sure we have GTK+ 3.
1599 AM_PATH_GTK_3_0(3.0.0,
1601 CFLAGS="$CFLAGS $GTK_CFLAGS"
1602 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
1604 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk3"
1606 [AC_MSG_ERROR([GTK+ 3 is not available])])
1607 elif test "x$with_gtk2" = "xyes"; then
1609 # GTK+ 3 wasn't specified, and GTK+ 2 was specified;
1610 # make sure we have GTK+ 2.
1612 AM_PATH_GTK_2_0($GTK2_MIN_VERSION,
1614 CFLAGS="$CFLAGS $GTK_CFLAGS"
1615 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
1617 GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk2"
1619 [AC_MSG_ERROR([GTK+ 2 is not available])])
1622 AC_SUBST(GUI_CONFIGURE_FLAGS)
1624 GLIB_MIN_VERSION=2.16.0
1625 AC_SUBST(GLIB_MIN_VERSION)
1626 # GLib checks; we require GLib $GLIB_MIN_VERSION or later, and require gmodule
1627 # support, as we need that for dynamically loading plugins.
1628 # If we found GTK+, this doesn't add GLIB_CFLAGS to CFLAGS, because
1629 # AM_PATH_GTK will add GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a
1630 # superset of GLIB_CFLAGS. If we didn't find GTK+, it does add
1631 # GLIB_CFLAGS to CFLAGS.
1632 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
1633 # set when generating the Makefile, so we can make programs that require
1634 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
1635 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
1636 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
1637 # programs to be built with GLib.
1639 # Release dates for GLib versions:
1640 # 2.14.0: 03 Aug 2007
1641 # 2.16.0: 10 Mar 2008
1642 # 2.18.0: 02 Sep 2008
1643 # 2.20.0: 13 Mar 2009
1644 # 2.22.0: 22 Sep 2009
1645 # 2.24.0: 28 Mar 2010
1646 # 2.26.0: 27 Sep 2010
1647 # 2.28.0: 08 Feb 2011
1648 # 2.30.0: 27 Sep 2011
1649 # 2.32.0: 24 Mar 2012
1650 # 2.34.0: 24 Sep 2012
1651 # 2.36.0: 25 Mar 2013
1652 # 2.38.0: 23 Sep 2013
1653 # 2.40.0: 24 Mar 2014
1655 use_glib_cflags="true"
1656 if test "$have_gtk" = "yes" -a "$have_qt" = "yes" ; then
1657 # We have both GTK and Qt and thus will be building both wireshark
1658 # and wireshark-gtk.
1660 wireshark_bin="wireshark\$(EXEEXT) wireshark-gtk\$(EXEEXT)"
1661 wireshark_man="wireshark.1"
1662 wireshark_SUBDIRS="codecs ui/qt ui/gtk"
1664 if test "$have_gtk" = "no" -a "$have_qt" = "yes" ; then
1665 # We don't have GTK+ but we have Qt.
1667 wireshark_bin="wireshark\$(EXEEXT)"
1668 wireshark_man="wireshark.1"
1669 wireshark_SUBDIRS="codecs ui/qt"
1671 if test "$have_gtk" = "yes" -a "$have_qt" = "no" ; then
1672 # We have GTK+ but not Qt.
1674 wireshark_bin="wireshark-gtk\$(EXEEXT)"
1675 wireshark_man="wireshark.1"
1676 wireshark_SUBDIRS="codecs ui/gtk"
1677 use_glib_cflags="false"
1678 OSX_APP_FLAGS="$OSX_APP_FLAGS -gtk"
1679 OSX_DMG_FLAGS="-gtk"
1681 if test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
1682 # We have neither GTK+ nor Qt.
1684 # If they didn't explicitly say "--disable-wireshark",
1685 # fail (so that, unless they explicitly indicated that
1686 # they don't want Wireshark, we stop so they know they
1687 # won't be getting Wireshark unless they fix the GTK+/Qt
1690 if test "x$enable_wireshark" = "xyes"; then
1691 if test "x$with_gtk3" = "xyes"; then
1692 AC_MSG_ERROR([Neither Qt nor GTK+ $GTK3_MIN_VERSION or later are available, so Wireshark can't be compiled])
1694 AC_MSG_ERROR([Neither Qt nor GTK+ $GTK2_MIN_VERSION or later are available, so Wireshark can't be compiled])
1701 if test "$have_gtk" = "yes" ; then
1702 # If we have GTK then add flags for it.
1704 CPPFLAGS="-DGDK_PIXBUF_DISABLE_DEPRECATED $CPPFLAGS"
1705 CPPFLAGS="-DGDK_DISABLE_DEPRECATED $CPPFLAGS"
1706 if test \( $gtk_config_major_version -eq 3 -a $gtk_config_minor_version -ge 10 \) ; then
1707 ## Allow use of deprecated & disable deprecated warnings if Gtk >= 3.10;
1708 ## The deprecations in Gtk 3.10 will not be fixed ...
1709 CPPFLAGS="-DGDK_DISABLE_DEPRECATION_WARNINGS $CPPFLAGS"
1711 CPPFLAGS="-DGTK_DISABLE_DEPRECATED $CPPFLAGS"
1713 CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
1714 if test ! \( $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -lt 20 \) ; then
1715 # Enable GSEAL when building with GTK > 2.20
1716 # (Versions prior to 2.22 lacked some necessary accessors.)
1717 CPPFLAGS="-DGSEAL_ENABLE $CPPFLAGS"
1721 # XXX - Is this really necessary? When we build with both Gtk+ and Qt it works...
1722 if test "$use_glib_cflags" = "true"; then
1724 AM_PATH_GLIB_2_0($GLIB_MIN_VERSION,
1726 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1727 CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS"
1728 ], AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
1730 # Don't use GLIB_CFLAGS
1731 AM_PATH_GLIB_2_0($GLIB_MIN_VERSION, , AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
1735 # "make dist" requires that we have the Qt build tools.
1737 # Annoyingly, at least on Fedora 16, uic and moc are named XXX-qt4
1738 # rather than just XXX, perhaps to allow Qt 3 and Qt 4 tools to be
1739 # installed; if they're still doing that in current Fedora releases,
1740 # perhaps there will also be XXX-qt5 when they pick up Qt 5.
1742 AC_PATH_PROG(UIC, uic)
1745 AC_PATH_PROG(UIC, uic-qt4)
1748 if test "x$with_qt" = "xyes"; then
1750 # If you want to build with Qt, you'd better
1753 AC_MSG_ERROR(I couldn't find uic or uic-qt4; make sure it's installed and in your path)
1756 # We shouldn't fail here, as the user's not
1757 # building with Qt, and we shouldn't force them
1758 # to have Qt installed if they're not doing so.
1759 # "make dist" will fail if they do that, but
1760 # we don't know whether they'll be doing that,
1761 # so this is the best we can do.
1768 AC_PATH_PROG(MOC, moc)
1771 AC_PATH_PROG(MOC, moc-qt4)
1774 if test "x$with_qt" = "xyes"; then
1776 # If you want to build with Qt, you'd better
1779 AC_MSG_ERROR(I couldn't find moc or moc-qt4; make sure it's installed and in your path)
1782 # We shouldn't fail here, as the user's not
1783 # building with Qt, and we shouldn't force them
1784 # to have Qt installed if they're not doing so.
1785 # "make dist" will fail if they do that, but
1786 # we don't know whether they'll be doing that,
1787 # so this is the best we can do.
1794 AC_PATH_PROG(RCC, rcc)
1797 AC_PATH_PROG(RCC, rcc)
1800 if test "x$with_qt" = "xyes"; then
1802 # If you want to build with Qt, you'd better
1805 AC_MSG_ERROR(I couldn't find rcc; make sure it's installed and in your path)
1808 # We shouldn't fail here, as the user's not
1809 # building with Qt, and we shouldn't force them
1810 # to have Qt installed if they're not doing so.
1811 # "make dist" will fail if they do that, but
1812 # we don't know whether they'll be doing that,
1813 # so this is the best we can do.
1821 # Error out if a glib header other than a "top level" header
1822 # (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
1824 CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
1826 # Error out on the usage of deprecated glib functions
1827 CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
1830 # Check whether GLib modules are supported, to determine whether we
1831 # can support plugins.
1833 AC_MSG_CHECKING(whether GLib supports loadable modules)
1834 ac_save_CFLAGS="$CFLAGS"
1835 ac_save_LIBS="$LIBS"
1836 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1837 LIBS="$GLIB_LIBS $LIBS"
1840 #include <gmodule.h>
1847 if (g_module_supported())
1848 return 0; /* success */
1850 return 1; /* failure */
1852 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
1853 [echo $ac_n "cross compiling; assumed OK... $ac_c"
1854 ac_cv_glib_supports_modules=yes])
1855 CFLAGS="$ac_save_CFLAGS"
1856 LIBS="$ac_save_LIBS"
1857 if test "$ac_cv_glib_supports_modules" = yes ; then
1860 plugins_dir="plugins"
1866 AC_SUBST(plugins_dir)
1869 # If we have <dlfcn.h>, check whether we have dladdr.
1871 if test "$ac_cv_header_dlfcn_h" = "yes"
1874 # Use GLib compiler flags and linker flags; GLib's gmodule
1875 # stuff uses the dl APIs if available, so it might know
1876 # what flags are needed.
1878 ac_save_CFLAGS="$CFLAGS"
1879 ac_save_LIBS="$LIBS"
1880 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1881 LIBS="$GLIB_LIBS $LIBS"
1882 AC_CHECK_FUNCS(dladdr)
1883 if test x$ac_cv_func_dladdr = xno
1886 # OK, try it with -ldl, in case you need that to get
1887 # dladdr(). For some reason, on Linux, that's not
1888 # part of the GLib flags; perhaps GLib itself is
1889 # linked with libdl, so that you can link with
1890 # Glib and it'll pull libdl in itself.
1893 AC_CHECK_FUNCS(dladdr)
1895 CFLAGS="$ac_save_CFLAGS"
1896 LIBS="$ac_save_LIBS"
1900 # Check whether GLib's printf supports thousands grouping. (This might
1901 # be different from the system's printf since GLib can optionally use
1902 # its own printf implementation.)
1904 AC_MSG_CHECKING(whether GLib supports POSIX/XSI thousands grouping)
1905 ac_save_CFLAGS="$CFLAGS"
1906 ac_save_LIBS="$LIBS"
1907 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1908 LIBS="$GLIB_LIBS $LIBS"
1919 setlocale(LC_ALL, "en_US.UTF-8");
1920 str = g_strdup_printf("%'u", 123456);
1921 return (strcmp (str, "123,456") != 0);
1923 ], ac_cv_glib_supports_printf_grouping=yes, ac_cv_glib_supports_printf_grouping=no,
1924 [echo $ac_n "cross compiling; playing it safe... $ac_c"
1925 ac_cv_glib_supports_printf_grouping=no])
1926 CFLAGS="$ac_save_CFLAGS"
1927 LIBS="$ac_save_LIBS"
1928 if test "$ac_cv_glib_supports_printf_grouping" = yes ; then
1930 AC_DEFINE(HAVE_GLIB_PRINTF_GROUPING, 1, [Define if GLib's printf functions support thousands grouping.])
1935 if test "x$have_gtk" = "xyes"
1938 # We have GTK+; do we want the OS X integration functions and,
1939 # if so, do we have them and, if so, which versions do we have,
1940 # the old Carbon-based ones or the new Cocoa-based ones?
1942 AC_MSG_CHECKING(whether to use OS X integration functions)
1944 AC_ARG_WITH(osx-integration,
1945 AC_HELP_STRING( [--with-osx-integration],
1946 [use OS X integration functions @<:@default=yes, if available@:>@]),
1948 if test $withval = no
1950 want_osx_integration=no
1952 want_osx_integration=yes
1955 want_osx_integration=yes
1957 if test "x$want_osx_integration" = "xno"; then
1961 AC_WIRESHARK_OSX_INTEGRATION_CHECK
1965 AC_SUBST(wireshark_bin)
1966 AC_SUBST(wireshark_man)
1967 AM_CONDITIONAL(HAVE_Qt, test "$have_qt" = "yes")
1968 AM_CONDITIONAL(HAVE_GTK, test "$have_gtk" = "yes")
1969 AC_SUBST(OSX_APP_FLAGS)
1970 AC_SUBST(OSX_DMG_FLAGS)
1972 # Enable/disable tshark
1973 AC_ARG_ENABLE(tshark,
1974 AC_HELP_STRING( [--enable-tshark],
1975 [build tshark @<:@default=yes@:>@]),
1976 tshark=$enableval,enable_tshark=yes)
1978 if test "x$enable_tshark" = "xyes" ; then
1979 tshark_bin="tshark\$(EXEEXT)"
1980 tshark_man="tshark.1"
1981 wiresharkfilter_man="wireshark-filter.4"
1986 AC_SUBST(tshark_bin)
1987 AC_SUBST(tshark_man)
1989 # Enable/disable editcap
1991 AC_ARG_ENABLE(editcap,
1992 AC_HELP_STRING( [--enable-editcap],
1993 [build editcap @<:@default=yes@:>@]),
1994 enable_editcap=$enableval,enable_editcap=yes)
1996 if test "x$enable_editcap" = "xyes" ; then
1997 editcap_bin="editcap\$(EXEEXT)"
1998 editcap_man="editcap.1"
2003 AC_SUBST(editcap_bin)
2004 AC_SUBST(editcap_man)
2007 # Enabling/disabling of dumpcap is done later (after we know if we have PCAP
2010 # Enable/disable capinfos
2012 AC_ARG_ENABLE(capinfos,
2013 AC_HELP_STRING( [--enable-capinfos],
2014 [build capinfos @<:@default=yes@:>@]),
2015 enable_capinfos=$enableval,enable_capinfos=yes)
2017 if test "x$enable_capinfos" = "xyes" ; then
2018 capinfos_bin="capinfos\$(EXEEXT)"
2019 capinfos_man="capinfos.1"
2024 AC_SUBST(capinfos_bin)
2025 AC_SUBST(capinfos_man)
2027 # Enable/disable captype
2029 AC_ARG_ENABLE(captype,
2030 AC_HELP_STRING( [--enable-captype],
2031 [build captype @<:@default=yes@:>@]),
2032 enable_captype=$enableval,enable_captype=yes)
2034 if test "x$enable_captype" = "xyes" ; then
2035 captype_bin="captype\$(EXEEXT)"
2036 captype_man="captype.1"
2041 AC_SUBST(captype_bin)
2042 AC_SUBST(captype_man)
2044 # Enable/disable mergecap
2046 AC_ARG_ENABLE(mergecap,
2047 AC_HELP_STRING( [--enable-mergecap],
2048 [build mergecap @<:@default=yes@:>@]),
2049 enable_mergecap=$enableval,enable_mergecap=yes)
2051 if test "x$enable_mergecap" = "xyes" ; then
2052 mergecap_bin="mergecap\$(EXEEXT)"
2053 mergecap_man="mergecap.1"
2058 AC_SUBST(mergecap_bin)
2059 AC_SUBST(mergecap_man)
2061 # Enable/disable reordercap
2063 AC_ARG_ENABLE(reordercap,
2064 AC_HELP_STRING( [--enable-reordercap],
2065 [build reordercap @<:@default=yes@:>@]),
2066 enable_reordercap=$enableval,enable_reordercap=yes)
2068 if test "x$enable_reordercap" = "xyes" ; then
2069 reordercap_bin="reordercap\$(EXEEXT)"
2070 reordercap_man="reordercap.1"
2075 AC_SUBST(reordercap_bin)
2076 AC_SUBST(reordercap_man)
2078 # Enable/disable text2pcap
2080 AC_ARG_ENABLE(text2pcap,
2081 AC_HELP_STRING( [--enable-text2pcap],
2082 [build text2pcap @<:@default=yes@:>@]),
2083 text2pcap=$enableval,enable_text2pcap=yes)
2085 if test "x$enable_text2pcap" = "xyes" ; then
2086 text2pcap_bin="text2pcap\$(EXEEXT)"
2087 text2pcap_man="text2pcap.1"
2092 AC_SUBST(text2pcap_bin)
2093 AC_SUBST(text2pcap_man)
2095 # Enable/disable dftest
2097 AC_ARG_ENABLE(dftest,
2098 AC_HELP_STRING( [--enable-dftest],
2099 [build dftest @<:@default=yes@:>@]),
2100 enable_dftest=$enableval,enable_dftest=yes)
2102 if test "x$enable_dftest" = "xyes" ; then
2103 dftest_bin="dftest\$(EXEEXT)"
2104 dftest_man="dftest.1"
2109 AC_SUBST(dftest_bin)
2110 AC_SUBST(dftest_man)
2112 # Enable/disable randpkt
2114 AC_ARG_ENABLE(randpkt,
2115 AC_HELP_STRING( [--enable-randpkt],
2116 [build randpkt @<:@default=yes@:>@]),
2117 enable_randpkt=$enableval,enable_randpkt=yes)
2119 if test "x$enable_randpkt" = "xyes" ; then
2120 randpkt_bin="randpkt\$(EXEEXT)"
2121 randpkt_man="randpkt.1"
2126 AC_SUBST(randpkt_bin)
2127 AC_SUBST(randpkt_man)
2129 AC_SUBST(wiresharkfilter_man)
2131 dnl Checks for "getaddrinfo()" - and "-lnsl", if we need it to get
2132 dnl "getaddrinfo()".
2133 AC_WIRESHARK_GETADDRINFO_LIB_CHECK
2135 dnl Checks for "connect()", used as a proxy for "socket()" - and
2136 dnl "-lsocket", if we need it to get "connect()".
2137 AC_WIRESHARK_SOCKET_LIB_CHECK
2140 AC_MSG_CHECKING(whether to use libpcap for packet capture)
2143 AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
2144 [use libpcap for packet capturing @<:@default=yes@:>@]),
2146 if test $withval = no
2149 elif test $withval = yes
2160 if test "x$want_pcap" = "xno" ; then
2164 AC_WIRESHARK_PCAP_CHECK
2168 dnl Check for airpcap
2169 AC_MSG_CHECKING(whether to include airpcap support)
2170 AC_ARG_ENABLE(airpcap,
2171 AC_HELP_STRING( [--enable-airpcap],
2172 [use AirPcap in Wireshark @<:@default=yes@:>@]),
2173 enable_airpcap=$enableval, enable_airpcap=yes)
2175 if test x$enable_airpcap = xyes; then
2176 if test "x$want_pcap" = "xno" ; then
2178 AC_MSG_RESULT(pcap not available - disabling airpcap)
2181 AC_DEFINE(HAVE_AIRPCAP, 1, [Enable AirPcap])
2189 AC_MSG_CHECKING(whether to build dumpcap)
2191 AC_ARG_ENABLE(dumpcap,
2192 AC_HELP_STRING( [--enable-dumpcap],
2193 [build dumpcap @<:@default=yes@:>@]),
2194 enable_dumpcap=$enableval,enable_dumpcap=yes)
2196 if test "x$enable_dumpcap" = "xyes" ; then
2197 if test "x$want_pcap" = "xno" ; then
2199 AC_MSG_RESULT(pcap not available - disabling dumpcap)
2207 if test "x$enable_dumpcap" = "xyes" ; then
2208 dumpcap_bin="dumpcap\$(EXEEXT)"
2209 dumpcap_man="dumpcap.1"
2214 AC_SUBST(dumpcap_bin)
2215 AC_SUBST(dumpcap_man)
2217 # Enable/disable rawshark
2220 AC_MSG_CHECKING(whether to build rawshark)
2222 AC_ARG_ENABLE(rawshark,
2223 AC_HELP_STRING( [--enable-rawshark],
2224 [build rawshark @<:@default=yes@:>@]),
2225 rawshark=$enableval,enable_rawshark=yes)
2227 if test "x$enable_rawshark" = "xyes" ; then
2228 if test "x$want_pcap" = "xno" ; then
2230 AC_MSG_RESULT(pcap not available - disabling rawshark)
2238 if test "x$enable_rawshark" = "xyes" ; then
2239 rawshark_bin="rawshark\$(EXEEXT)"
2240 rawshark_man="rawshark.1"
2245 AC_SUBST(rawshark_bin)
2246 AC_SUBST(rawshark_man)
2249 # Enable/disable echld
2250 AC_ARG_ENABLE(echld,
2251 AC_HELP_STRING( [--enable-echld],
2252 [support echld (Experimental) @<:@default=no@:>@]),
2253 have_echld=$enableval,have_echld=no)
2255 AM_CONDITIONAL(HAVE_ECHLD, test "x$have_echld" = "xyes")
2256 if test "x$have_echld" = "xyes"
2258 AC_DEFINE(HAVE_ECHLD, 1, [Define if echld is enabled])
2259 echld_test_bin="echld_test\$(EXEEXT)"
2266 AC_SUBST(echld_test_bin)
2269 # Enable/disable tfshark
2270 AC_ARG_ENABLE(tfshark,
2271 AC_HELP_STRING( [--enable-tfshark],
2272 [build tfshark (Experimental) @<:@default=no@:>@]),
2273 tfshark=$enableval,enable_tfshark=no)
2275 if test "x$enable_tfshark" = "xyes" ; then
2276 tfshark_bin="tfshark\$(EXEEXT)"
2277 tfshark_man="tfshark.1"
2278 wiresharkfilter_man="wireshark-filter.4"
2283 AC_SUBST(tfshark_bin)
2284 AC_SUBST(tfshark_man)
2287 dnl Use pcap-ng by default
2288 AC_ARG_ENABLE(pcap-ng-default,
2289 AC_HELP_STRING( [--enable-pcap-ng-default],
2290 [use the pcap-ng file format by default instead of pcap @<:@default=yes@:>@]),
2291 enable_pcap_ng_default=$enableval,enable_pcap_ng_default=yes)
2292 if test x$enable_pcap_ng_default = xyes; then
2293 AC_DEFINE(PCAP_NG_DEFAULT, 1, [Support for pcap-ng])
2296 dnl pcap remote check
2297 AC_MSG_CHECKING(whether to use libpcap remote capturing feature)
2299 AC_ARG_WITH(pcap-remote,
2300 AC_HELP_STRING([--with-pcap-remote],
2301 [use libpcap remote capturing (requires libpcap)]),
2303 if test $withval = no
2307 want_pcap_remote=yes
2312 if test "x$want_pcap_remote" = "xno" -o "x$want_pcap" = "xno" ; then
2316 AC_WIRESHARK_PCAP_REMOTE_CHECK
2320 AC_MSG_CHECKING(whether to use zlib for gzip compression and decompression)
2323 AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
2324 [use zlib (located in directory DIR, if supplied) for gzip compression and decompression @<:@default=yes, if available@:>@]),
2326 if test "x$withval" = "xno"
2329 elif test "x$withval" = "xyes"
2338 # Use zlib if it's present, otherwise don't.
2340 want_zlib=ifavailable
2343 if test "x$want_zlib" = "xno" ; then
2347 AC_WIRESHARK_ZLIB_CHECK
2348 if test "x$want_zlib" = "xno" ; then
2349 AC_MSG_RESULT(zlib not found - disabling gzip compression and decompression)
2351 if test "x$ac_cv_func_inflatePrime" = "xno" ; then
2352 AC_MSG_RESULT(inflatePrime not found in zlib - disabling gzipped capture file support)
2359 AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
2360 [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin @<:@default=yes, if available@:>@]),
2362 if test $withval = no
2365 elif test $withval = yes
2370 want_lua_dir=$withval
2373 # By default use Lua if we can find it
2374 want_lua=ifavailable
2377 if test "x$want_lua" != "xno" ; then
2378 AC_WIRESHARK_LIBLUA_CHECK
2380 if test "x$want_lua" = "xyes" -a "x$have_lua" = "xno"
2382 AC_MSG_ERROR([Lua support was requested, but is not available])
2385 if test "x$have_lua" = "xyes"
2387 AC_DEFINE(HAVE_LUA, 1, [Define to use Lua])
2389 AM_CONDITIONAL(HAVE_LIBLUA, test x$have_lua = xyes)
2391 AC_SUBST(LUA_CFLAGS)
2395 AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
2397 AC_ARG_WITH(portaudio,
2398 AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
2399 [use libportaudio (located in directory DIR, if supplied) for the rtp_player @<:@default=yes, if available@:>@]),
2401 if test $withval = no
2404 elif test $withval = yes
2409 portaudio_dir=$withval
2413 # Use libportaudio by default
2415 want_portaudio=ifavailable
2418 if test "x$want_portaudio" = "xno" ; then
2422 AC_WIRESHARK_LIBPORTAUDIO_CHECK
2423 if test "x$want_portaudio" = "xno" ; then
2424 AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
2427 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
2432 AC_HELP_STRING( [--enable-ipv6],
2433 [use IPv6 name resolution, if available @<:@default=yes@:>@]),
2434 enable_ipv6=$enableval,enable_ipv6=yes)
2436 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
2437 if test "x$enable_ipv6" = "xno" ; then
2441 AC_WIRESHARK_IPV6_STACK
2445 dnl Check if dumpcap should be installed with filesystem capabilities
2446 AC_PATH_PROG(SETCAP, setcap)
2447 AC_ARG_ENABLE(setcap-install,
2448 AC_HELP_STRING( [--enable-setcap-install],
2449 [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
2450 enable_setcap_install=$enableval,enable_setcap_install=no)
2452 AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
2453 if test "x$enable_setcap_install" = "xno" ; then
2456 if test "x$SETCAP" = "x" ; then
2457 AC_MSG_RESULT(setcap not found)
2458 AC_MSG_ERROR([Setcap install was requested, but setcap was not found])
2459 elif test "x$enable_dumpcap" = "xno" ; then
2460 AC_MSG_RESULT(dumpcap disabled)
2461 AC_MSG_ERROR([Setcap install works only with dumpcap, but dumpcap is disabled])
2467 AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
2469 dnl Check if dumpcap should be installed setuid
2470 AC_ARG_ENABLE(setuid-install,
2471 AC_HELP_STRING( [--enable-setuid-install],
2472 [install dumpcap as setuid @<:@default=no@:>@]),
2473 enable_setuid_install=$enableval,enable_setuid_install=no)
2475 AC_MSG_CHECKING(whether to install dumpcap setuid)
2476 if test "x$enable_setuid_install" = "xno" ; then
2479 if test "x$enable_setcap_install" = "xyes" ; then
2480 enable_setuid_install=no
2481 AC_MSG_RESULT(setcap and setuid both selected)
2482 AC_MSG_ERROR(You must choose one of setcap install and setuid install)
2483 elif test "x$enable_dumpcap" = "xno" ; then
2484 AC_MSG_RESULT(dumpcap disabled)
2485 AC_MSG_ERROR([Setuid install works only with dumpcap, but dumpcap is disabled])
2491 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
2492 AC_CHECK_FUNCS(setresuid setresgid)
2494 dnl ...but our Network Operations group is named "no"!
2496 AC_ARG_WITH(dumpcap-group,
2497 AC_HELP_STRING( [--with-dumpcap-group=GROUP],
2498 [restrict dumpcap to GROUP]),
2500 if test "x$withval" = "xyes"; then
2501 AC_MSG_ERROR([No dumpcap group specified.])
2502 elif test "x$withval" != "xno"; then
2503 if test "x$enable_dumpcap" = "xno" ; then
2504 AC_MSG_ERROR(dumpcap group install works only with dumpcap but dumpcap is disabled)
2506 AC_MSG_RESULT($withval)
2507 DUMPCAP_GROUP="$withval"
2510 AC_SUBST(DUMPCAP_GROUP)
2511 AM_CONDITIONAL(HAVE_DUMPCAP_GROUP, test x$DUMPCAP_GROUP != x)
2513 dnl libcap (not libpcap) check
2515 AC_MSG_CHECKING(whether to use the libcap capabilities library)
2518 AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
2519 [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management @<:@default=yes, if present@:>@]),
2521 if test "x$withval" = "xno"; then
2523 elif test "x$withval" = "xyes"; then
2525 elif test -d "$withval"; then
2527 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2530 if test "x$with_libcap" = "xno" ; then
2534 AC_WIRESHARK_LIBCAP_CHECK
2536 AC_SUBST(LIBCAP_LIBS)
2538 dnl Checks for header files.
2539 dnl Some of these may not be needed: http://hacks.owlfolio.org/header-survey/
2540 AC_CHECK_HEADERS(fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h unistd.h)
2541 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)
2542 AC_CHECK_HEADERS(netinet/in.h)
2543 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
2547 AC_MSG_CHECKING(whether to use SSL library)
2550 AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
2551 [use SSL crypto library (located in directory DIR, if supplied) @<:@default=no@:>@]),
2553 if test "x$withval" = "xno"; then
2555 elif test "x$withval" = "xyes"; then
2557 elif test -d "$withval"; then
2559 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2564 if test "x$want_ssl" = "xyes"; then
2566 AC_CHECK_LIB(crypto,EVP_md5,
2571 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
2579 AC_MSG_CHECKING(whether to use Kerberos library)
2582 AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
2583 [use Kerberos library (located in directory DIR, if supplied) to use in Kerberos dissection @<:@default=yes@:>@]),
2585 if test $withval = no
2588 elif test $withval = yes
2597 # Use Kerberos library if available, otherwise don't.
2599 want_krb5=ifavailable
2602 if test "x$want_krb5" = "xno" ; then
2606 AC_WIRESHARK_KRB5_CHECK
2612 AC_MSG_CHECKING(whether to use the c-ares library if available)
2615 AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
2616 [use c-ares (located in directory DIR, if supplied) - supersedes --with-adns @<:@default=yes, if present@:>@]),
2618 if test "x$withval" = "xno"; then
2620 elif test "x$withval" = "xyes"; then
2622 elif test -d "$withval"; then
2624 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2627 if test "x$want_c_ares" = "xno" ; then
2631 AC_WIRESHARK_C_ARES_CHECK
2633 AC_SUBST(C_ARES_LIBS)
2637 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
2640 AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
2641 [use GNU ADNS (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2643 if test "x$withval" = "xno"; then
2645 elif test "x$withval" = "xyes"; then
2647 elif test -d "$withval"; then
2649 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2652 if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
2656 AC_WIRESHARK_ADNS_CHECK
2662 AC_MSG_CHECKING(whether to use the GeoIP IP address mapping library if available)
2665 AC_HELP_STRING( [--with-geoip@<:@=DIR@:>@],
2666 [use GeoIP (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2668 if test "x$withval" = "xno"; then
2670 elif test "x$withval" = "xyes"; then
2672 elif test -d "$withval"; then
2674 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
2677 if test "x$want_geoip" = "xno"; then
2681 AC_WIRESHARK_GEOIP_CHECK
2683 AC_SUBST(GEOIP_LIBS)
2686 # Define WS_MSVC_NORETURN appropriately for declarations of routines that
2687 # never return (just like Charlie on the MTA).
2689 # Note that MSVC++ expects __declspec(noreturn) to precede the function
2690 # name and GCC, as far as I know, expects __attribute__((noreturn)) to
2691 # follow the function name, so we need two different flavors of
2694 AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
2696 dnl Checks for typedefs, structures, and compiler characteristics.
2699 # Check how we can get the time zone abbreviation
2700 AC_WIRESHARK_TIMEZONE_ABBREV
2702 # We need to know whether "struct stat" has an "st_flags" member
2703 # for file_user_immutable().
2705 AC_WIRESHARK_STRUCT_ST_FLAGS
2707 # We need to know whether "struct sockaddr" has an "sa_len" member
2708 # for get_interface_list().
2710 AC_WIRESHARK_STRUCT_SA_LEN
2712 # We must know our byte order
2715 # Checks whether "-traditional" is needed when using "ioctl".
2716 # XXX - do we need this?
2717 AC_PROG_GCC_TRADITIONAL
2719 AC_CHECK_FUNC(getopt_long,
2722 AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define to 1 if you have the getopt_long function.])
2725 # Do we have optreset?
2727 AC_MSG_CHECKING(whether optreset is defined)
2730 extern int optreset;
2734 ac_cv_pcap_debug_defined=yes,
2735 ac_cv_pcap_debug_defined=no)
2736 if test "$ac_cv_pcap_debug_defined" = yes ; then
2738 AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable])
2743 GETOPT_LO="wsgetopt.lo")
2746 AC_CHECK_FUNCS(mkstemp mkdtemp)
2748 AC_SEARCH_LIBS(inet_aton, [socket nsl],
2751 AC_DEFINE(HAVE_INET_ATON, 0, [Define to 1 if you have the inet_aton function.])
2753 INET_ATON_LO="inet_aton.lo")
2754 AC_SUBST(INET_ATON_LO)
2756 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
2757 dnl check for pre-BIND82 inet_pton() bug.
2758 AC_MSG_CHECKING(for broken inet_pton)
2759 AC_TRY_RUN([#include <sys/types.h>
2760 #include <sys/socket.h>
2761 #include <netinet/in.h>
2762 #include <arpa/inet.h>
2767 /* this should return 0 (error) */
2768 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
2772 }], [AC_MSG_RESULT(ok);
2773 have_inet_pton=yes], [AC_MSG_RESULT(broken);
2774 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
2775 have_inet_pton=no])],
2777 if test "$have_inet_pton" = no; then
2778 INET_PTON_LO="inet_pton.lo"
2782 AM_CONDITIONAL(NEED_INET_PTON_LO, test "x$have_inet_pton" = "xno")
2783 AC_SUBST(INET_PTON_LO)
2785 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
2786 AC_MSG_CHECKING([for inet_ntop prototype])
2787 AC_TRY_COMPILE([#include <stdio.h>
2788 #include <sys/types.h>
2789 #include <sys/socket.h>
2790 #include <netinet/in.h>
2791 #include <arpa/inet.h>
2793 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
2795 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
2796 [Define if inet_ntop() prototype exists])], [
2797 AC_TRY_COMPILE([#include <stdio.h>
2798 #include <sys/types.h>
2799 #include <sys/socket.h>
2800 #include <netinet/in.h>
2801 #include <arpa/inet.h>
2803 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
2805 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
2806 [Define if inet_ntop() prototype exists])], [
2807 AC_MSG_RESULT(no)])])
2809 INET_NTOP_LO="inet_ntop.lo"
2810 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
2811 [Define if inet/v6defs.h needs to be included])])
2812 AM_CONDITIONAL(NEED_INET_NTOP_LO, test "x$INET_NTOP_LO" != "x")
2813 AC_SUBST(INET_NTOP_LO)
2815 AC_CHECK_FUNC(strptime,
2818 AC_DEFINE(HAVE_STRPTIME, 1, [Define if you have the strptime function.])
2820 STRPTIME_LO="strptime.lo")
2821 AC_SUBST(STRPTIME_LO)
2823 AC_CHECK_FUNC(popcount,
2826 AC_DEFINE(HAVE_POPCOUNT, 1, [Define if you have the popcount function.])
2828 POPCOUNT_LO="popcount.lo")
2829 AC_SUBST(POPCOUNT_LO)
2831 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
2832 AC_CHECK_FUNCS(issetugid)
2833 AC_CHECK_FUNCS(mmap mprotect sysconf)
2835 dnl blank for now, but will be used in future
2836 AC_SUBST(wireshark_SUBDIRS)
2838 # Check Bluetooth SBC codec for RTP Player
2839 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
2841 AC_HELP_STRING( [--with-sbc=@<:@yes/no@:>@],
2842 [use SBC codec to play Bluetooth A2DP stream @<:@default=yes, if available@:>@]),
2843 with_sbc="$withval"; want_sbc="yes", with_sbc="yes")
2845 PKG_CHECK_MODULES(SBC, sbc >= 1.0, [have_sbc=yes], [have_sbc=no])
2846 if test "x$with_sbc" != "xno"; then
2847 if (test "${have_sbc}" = "yes"); then
2848 AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
2849 elif test "x$want_sbc" = "xyes"; then
2850 # Error out if the user explicitly requested the sbc library
2851 AC_MSG_ERROR([SBC codec library was requested, but is not available])
2858 dnl check whether plugins should be enabled and, if they should be,
2859 dnl check for plugins directory - stolen from Amanda's configure.ac
2861 dnl we don't wish to expand ${libdir} yet
2862 plugindir='${libdir}/wireshark/plugins/${VERSION}'
2863 AC_ARG_WITH(plugins,
2864 AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
2865 [support plugins (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
2867 if test "x$withval" = "xno"; then
2869 elif test "x$have_plugins" = "xno"; then
2870 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
2871 elif test "x$withval" != "xyes"; then
2872 plugindir="$withval"
2875 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
2876 if test x$have_plugins = xyes
2878 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
2881 CPPFLAGS="$CPPFLAGS '-DPLUGIN_INSTALL_DIR=\"\$(plugindir)\"'"
2884 # The plugin dissectors reside in ./plugins/PROTO/
2887 AC_SUBST(PLUGIN_LIBS)
2890 dnl Use extcap by default
2891 extcapdir='${datadir}/wireshark/extcap/'
2893 AC_HELP_STRING( [--with-extcap@<:@=DIR@:>@],
2894 [use extcap for external capture sources (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
2896 if test "x$withval" = "xno"; then
2898 elif test "x$withval" = "xyes"; then
2900 elif test "x$withval" != "xyes"; then
2902 extcapdir ="$withval"
2907 AM_CONDITIONAL(HAVE_EXTCAP, test "x$have_extcap" = "xyes")
2908 if test "x$have_extcap" = "xyes"
2910 AC_DEFINE(HAVE_EXTCAP, 1, [Define if external capture sources should be enabled])
2911 AC_DEFINE_UNQUOTED(EXTCAP_DIR,"$extcapdir", [Directory for extcap plugins])
2917 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
2918 # (autoconf? automake? libtool?) - with the newer version(s), it's
2919 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
2921 # With older version(s) of those tool(s), however, it's not just an
2922 # alias, and the configure scripts don't work without it.
2925 AC_SUBST(LIBTOOL_DEPS)
2927 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
2928 if test x$enable_static = xyes -a x$have_plugins = xyes
2930 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
2932 AC_SUBST(ENABLE_STATIC)
2934 # Gather which GUI we're building for rpmbuild
2935 if test "x$have_gtk" = "xyes"; then
2936 if test "x$with_gtk3" = "xyes"; then
2937 RPMBUILD_WITH_ARGS="--with gtk3 --without gtk2"
2939 RPMBUILD_WITH_ARGS="--without gtk3 --with gtk2"
2942 RPMBUILD_WITH_ARGS="--without gtk2 --without gtk3"
2944 if test "x$have_qt" = "xyes" ; then
2945 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
2947 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt"
2949 AC_SUBST(RPMBUILD_WITH_ARGS)
2951 dnl Save the cacheable configure results to config.cache before recursing
2954 sinclude(plugins/Custom.m4) dnl
2955 ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
2957 sinclude(asn1/Custom.m4) dnl
2958 ifdef(_CUSTOM_ASN1_AC_OUTPUT_,, define(_CUSTOM_ASN1_AC_OUTPUT_, )) dnl
2960 AC_CONFIG_HEADERS(config.h)
2965 _CUSTOM_ASN1_AC_OUTPUT_
2966 asn1/acp133/Makefile
2968 asn1/ansi_map/Makefile
2969 asn1/ansi_tcap/Makefile
2970 asn1/atn-cm/Makefile
2971 asn1/atn-cpdlc/Makefile
2972 asn1/atn-ulcs/Makefile
2976 asn1/charging_ase/Makefile
2981 asn1/credssp/Makefile
2989 asn1/gprscdr/Makefile
2990 asn1/gsm_map/Makefile
2999 asn1/h450-ros/Makefile
3002 asn1/HI2Operations/Makefile
3007 asn1/isdn-sup/Makefile
3008 asn1/kerberos/Makefile
3011 asn1/logotypecertextn/Makefile
3015 asn1/lte-rrc/Makefile
3018 asn1/mpeg-audio/Makefile
3019 asn1/mpeg-pes/Makefile
3021 asn1/ns_cert_exts/Makefile
3022 asn1/novell_pkis/Makefile
3030 asn1/pkcs12/Makefile
3031 asn1/pkinit/Makefile
3032 asn1/pkixac/Makefile
3033 asn1/pkix1explicit/Makefile
3034 asn1/pkix1implicit/Makefile
3035 asn1/pkixproxy/Makefile
3036 asn1/pkixqualified/Makefile
3037 asn1/pkixtsp/Makefile
3040 asn1/q932-ros/Makefile
3051 asn1/sbc-ap/Makefile
3054 asn1/spnego/Makefile
3062 asn1/wlancertextn/Makefile
3064 asn1/x509af/Makefile
3065 asn1/x509ce/Makefile
3066 asn1/x509if/Makefile
3067 asn1/x509sat/Makefile
3070 capchild/doxygen.cfg
3072 caputils/doxygen.cfg
3076 epan/compress/Makefile
3079 epan/dfilter/Makefile
3080 epan/dissectors/Makefile
3081 epan/dissectors/dcerpc/Makefile
3082 epan/dissectors/pidl/Makefile
3083 epan/ftypes/Makefile
3085 epan/nghttp2/Makefile
3098 packaging/macosx/Info.plist
3099 packaging/macosx/Makefile
3100 packaging/macosx/osx-dmg.sh
3101 packaging/macosx/Wireshark_package.pmdoc/index.xml
3102 packaging/nsis/Makefile
3103 packaging/rpm/Makefile
3104 packaging/rpm/SPECS/Makefile
3105 packaging/rpm/SPECS/wireshark.spec
3106 packaging/svr4/Makefile
3107 packaging/svr4/checkinstall
3108 packaging/svr4/pkginfo
3110 plugins/docsis/Makefile
3111 plugins/easy_codec/Makefile
3112 plugins/ethercat/Makefile
3113 plugins/gryphon/Makefile
3114 plugins/irda/Makefile
3115 plugins/m2m/Makefile
3116 plugins/mate/Makefile
3117 plugins/opcua/Makefile
3118 plugins/profinet/Makefile
3119 plugins/stats_tree/Makefile
3120 plugins/unistim/Makefile
3121 plugins/wimax/Makefile
3122 plugins/wimaxasncp/Makefile
3123 plugins/wimaxmacphy/Makefile
3125 tools/lemon/Makefile
3131 dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
3136 if test "x$have_gtk" = "xyes"; then
3137 if test "x$with_gtk3" = "xyes"; then
3138 gtk_lib_message=" (with GTK+ 3"
3140 gtk_lib_message=" (with GTK+ 2"
3142 if test "x$have_ige_mac" = "xyes"; then
3143 gtk_lib_message="$gtk_lib_message and Mac OS X integration)"
3145 gtk_lib_message="$gtk_lib_message)"
3149 if test "x$have_qt" = "xyes" ; then
3150 enable_wireshark_qt="yes"
3152 enable_wireshark_qt="no"
3155 if test "x$enable_setcap_install" = "xyes" ; then
3156 setcap_message="yes"
3161 if test "x$enable_setuid_install" = "xyes" ; then
3162 setuid_message="yes"
3167 if test "x$DUMPCAP_GROUP" = "x" ; then
3168 dumpcap_group_message="(none)"
3170 dumpcap_group_message="$DUMPCAP_GROUP"
3173 if test "x$want_zlib" = "xno" ; then
3179 if test "x$have_lua" = "xyes" ; then
3185 if test "x$want_portaudio" = "xyes" ; then
3186 portaudio_message="yes"
3188 portaudio_message="no"
3191 if test "x$want_ssl" = "xno" ; then
3197 if test "x$want_krb5" = "xno" ; then
3200 krb5_message="yes ($ac_krb5_version)"
3203 if test "x$have_good_c_ares" = "xyes" ; then
3204 c_ares_message="yes"
3209 if test "x$have_good_adns" = "xyes" ; then
3212 if test "x$have_good_c_ares" = "xyes" ; then
3213 adns_message="no (using c-ares instead)"
3219 if test "x$have_good_libcap" = "xyes" ; then
3220 libcap_message="yes"
3225 if test "x$have_good_geoip" = "xyes" ; then
3232 echo "The Wireshark package has been configured with the following options."
3233 echo " Build wireshark : $enable_wireshark_qt"
3234 echo " Build wireshark-gtk : $have_gtk""$gtk_lib_message"
3235 echo " Build tshark : $enable_tshark"
3236 echo " Build tfshark : $enable_tfshark"
3237 echo " Build capinfos : $enable_capinfos"
3238 echo " Build captype : $enable_captype"
3239 echo " Build editcap : $enable_editcap"
3240 echo " Build dumpcap : $enable_dumpcap"
3241 echo " Build mergecap : $enable_mergecap"
3242 echo " Build reordercap : $enable_reordercap"
3243 echo " Build text2pcap : $enable_text2pcap"
3244 echo " Build randpkt : $enable_randpkt"
3245 echo " Build dftest : $enable_dftest"
3246 echo " Build rawshark : $enable_rawshark"
3247 echo " Build echld : $have_echld"
3249 echo " Save files as pcap-ng by default : $enable_pcap_ng_default"
3250 echo " Install dumpcap with capabilities : $setcap_message"
3251 echo " Install dumpcap setuid : $setuid_message"
3252 echo " Use dumpcap group : $dumpcap_group_message"
3253 echo " Use plugins : $have_plugins"
3254 echo " Use external capture sources : $have_extcap"
3255 echo " Use Lua library : $lua_message"
3256 echo " Build rtp_player : $portaudio_message"
3257 echo " Build profile binaries : $enable_profile_build"
3258 echo " Use pcap library : $want_pcap"
3259 echo " Use zlib library : $zlib_message"
3260 echo " Use kerberos library : $krb5_message"
3261 echo " Use c-ares library : $c_ares_message"
3262 echo " Use GNU ADNS library : $adns_message"
3263 echo " Use SMI MIB library : $libsmi_message"
3264 echo " Use GNU crypto library : $gcrypt_message"
3265 echo " Use SSL crypto library : $ssl_message"
3266 echo " Use IPv6 name resolution : $enable_ipv6"
3267 echo " Use gnutls library : $tls_message"
3268 echo " Use POSIX capabilities library : $libcap_message"
3269 echo " Use GeoIP library : $geoip_message"
3270 echo " Use nl library : $libnl_message"
3271 echo " Use SBC codec library : $have_sbc"