5 AC_INIT(wireshark, 1.5.2)
7 dnl Check for CPU / vendor / OS
8 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
9 dnl `AC_CANONICAL_HOST', or `AC_CANONICAL_TARGET', depending on the
10 dnl needs. Using `AC_CANONICAL_TARGET' is enough to run the two other
13 dnl As nothing in the Wireshark is itself a build tool (we are not,
14 dnl for example, a compiler that generates machine code), we probably
15 dnl don't need AC_CANONICAL_TARGET, so, in theory, we should be able
16 dnl to use AC_CANONICAL_BUILD and AC_CANONICAL_HOST - or perhaps just
17 dnl AC_CANONICAL_HOST - instead. Note that we do have tools, such as
18 dnl lemon, that need to be built for the build machine, not for the
19 dnl host machine, so we might need both.
21 dnl This has to be done *after* AC_INIT, otherwise autogen.sh fails.
23 dnl AC_CANONICAL_BUILD
27 AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2 no-dist-gzip])
31 dnl Checks for programs.
36 dnl Work around libtool bug (fixed in the version 1.5a?)
37 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
40 AC_PATH_PROG(PERL, perl)
42 # XXX - should autogen.sh check for YACC/Bison and Flex? A user building
43 # from a distribution tarball shouldn't have to have YACC/Bison or Flex,
44 # as the tarball should contain the results of running YACC/Bison on .y
45 # files and running Flex on .l files, but a user building from SVN
46 # will have to run YACC/Bison and Flex to process those files.
48 # On the other hand, what about users who use a distribution tarball to
49 # do development? They *shouldn't* - that's what the SVN repository is
50 # for - but they might. They'd get errors if they modify a .y or .l
51 # file and try to do a build - but the error should tell them that they
52 # need to get YACC/Bison and/or Flex.
54 # Then again, getting them shouldn't be too big of a burden.
56 # XXX - is the same true of pod2man and pod2html, or are they needed
57 # even when building from a distribution tarball?
61 AC_PATH_PROG(YACCDUMMY, $YACC)
62 if test "x$YACCDUMMY" = x
64 AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
67 AC_PATH_PROG(LEX, flex)
70 AC_MSG_ERROR(I couldn't find flex; make sure it's installed and in your path)
72 AC_PATH_PROG(POD2MAN, pod2man)
73 if test "x$POD2MAN" = x
76 # The alternative is not to build the man pages....
78 AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
80 AC_PATH_PROG(POD2HTML, pod2html)
81 if test "x$POD2HTML" = x
84 # The alternative is not to build the HTML man pages....
86 AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
90 # XXX - this looks for various HTML viewers on the host, not the target;
91 # we really want to know what's available on the target, for cross-builds.
92 # That would probably require us to, at run time, look for xdg-open and,
93 # if we don't find it, look for mozilla, htmlview, etc.
95 AC_PATH_PROG(HTML_VIEWER, xdg-open)
96 if test "x$HTML_VIEWER" != x
99 # XXX - the HTML_VIEWER shell variable is the full path of xdg-open.
100 # Define some variable to be that, so we just run that?
102 AC_DEFINE(HAVE_XDG_OPEN, 1, [Define if we have xdg-open])
105 # XXX - we have to define HTML_VIEWER for the prefs.c code that
106 # sets the default value of the Web browser preference, even
107 # though that preference won't be offered.
109 AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
111 AC_PATH_PROG(HTML_VIEWER, htmlview)
112 if test "x$HTML_VIEWER" = x
114 AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
116 AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
120 AC_PATH_PROG(PYTHON, python)
131 # Set CLANG if the compiler is clang, to handle compiler options
132 # supported both by GCC and clang. (This does *not* include
133 # -no-cpp-precomp; clang says "clang: warning: argument unused during
134 # compilation: '-no-cpp-precomp'" if you use it.)
136 if test "x$GCC" != "xyes" ; then
137 if test "x$CC" = "xclang" ; then
142 if test "x$CC_FOR_BUILD" = x
146 AC_SUBST(CC_FOR_BUILD)
149 AC_PATH_PROG(DOXYGEN, doxygen)
150 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
151 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
154 # Try to arrange for large file support.
160 AC_ARG_WITH([gnutls],
161 AC_HELP_STRING( [--with-gnutls=@<:@yes/no@:>@],
162 [use gnutls library @<:@default=yes@:>@]),
163 with_gnutls="$withval", with_gnutls="yes")
164 if test "x$with_gnutls" = "xyes"; then
165 PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0],
167 echo "gnuTLS found, enabling ssl decryption"
168 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use gnutls library])
172 echo "gnuTLS not found, disabling ssl decryption"
180 AC_ARG_WITH([gcrypt],
181 AC_HELP_STRING( [--with-gcrypt=@<:@yes/no@:>@],
182 [use gcrypt library @<:@default=yes@:>@]),
183 with_gcrypt="$withval", with_gcrypt="yes")
184 if test "x$with_gcrypt" = "xyes"; then
185 AM_PATH_LIBGCRYPT(1.1.92,
187 echo "libgcrypt found, enabling ipsec decryption"
188 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
192 if test x$libgcrypt_config_prefix != x ; then
193 AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
195 echo "libgcrypt not found, disabling ipsec decryption"
203 AC_HELP_STRING( [--with-gtk3=@<:@yes/no@:>@],
204 [use GTK+ 3.0 instead of 2.0 @<:@default=no@:>@]),
205 with_gtk3="$withval", with_gtk="no")
209 # FIXME: currently the path argument to with-libsmi is being ignored
213 AC_PATH_PROG(XSLTPROC, xsltproc)
214 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
215 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
218 AC_PATH_PROG(XMLLINT, xmllint)
219 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
220 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
222 # Check for fop (translate .fo to e.g. pdf)
223 AC_PATH_PROG(FOP, fop)
224 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
225 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
228 # Look for something to convert HTML to text (for docbook/)
230 AC_PATH_PROG(ELINKS, elinks)
231 AC_CHECK_PROG(HAVE_ELINKS, elinks, "yes", "no")
232 AM_CONDITIONAL(HAVE_ELINKS, test x$HAVE_ELINKS = xyes)
234 ## links: Fails as used in docbook/Makefile.am
235 ## (Rather than fixing things we'll just disable the use of links).
236 ##AC_PATH_PROG(LINKS, links)
237 ##AC_CHECK_PROG(HAVE_LINKS, links, "yes", "no")
238 ##AM_CONDITIONAL(HAVE_LINKS, test x$HAVE_LINKS = xyes)
240 AC_PATH_PROG(LYNX, lynx)
241 AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no")
242 AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes)
245 # Check for hhc (html help compiler)
246 AC_PATH_PROG(HHC, hhc.exe)
247 AC_CHECK_PROG(HAVE_HHC, hhc.exe, "yes", "no")
248 AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
250 # Check for packaging utilities
251 # For now, we check to see if the various packaging utilites are in our
252 # path. I'm too lazy to write code to go hunt for them. - Gerald
255 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
256 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
257 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
259 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
260 -a x$HAVE_PKGTRANS = xyes ; then
261 HAVE_SVR4_PACKAGING=yes
263 HAVE_SVR4_PACKAGING=no
265 AC_SUBST(HAVE_SVR4_PACKAGING)
268 AC_WIRESHARK_RPM_CHECK
272 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
275 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
276 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
277 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
279 if test x$HAVE_XCODEBUILD = xyes -a x$HAVE_HDIUTIL = xyes \
280 -a x$HAVE_BLESS = xyes ; then
281 HAVE_OSX_PACKAGING=yes
283 HAVE_OSX_PACKAGING=no
285 AC_SUBST(HAVE_OSX_PACKAGING)
288 # Try to add some additional gcc checks to CFLAGS
290 AC_ARG_ENABLE(extra-gcc-checks,
291 AC_HELP_STRING( [--enable-extra-gcc-checks],
292 [Do additional -W checks in GCC. @<:@default=no@:>@]),
294 wireshark_extra_gcc_flags=$enableval
295 if test $enableval != no
297 AC_WIRESHARK_GCC_CFLAGS_CHECK(-pedantic)
298 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Woverflow)
299 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wlogical-op)
300 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-overlength-strings)
301 # AC_WIRESHARK_GCC_CFLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
302 # AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wunreachable-code)
303 # AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wunsafe-loop-optimizations)
304 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-long-long)
305 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wbad-function-cast)
306 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-qual)
307 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Waddress)
308 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
309 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wattributes)
310 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdeclaration-after-statement)
311 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdiv-by-zero)
312 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
313 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wignored-qualifiers)
314 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpragmas)
315 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wredundant-decls)
316 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wvla)
317 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wc++-compat)
318 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wjump-misses-init)
320 # epan/dissectors/packet-ncp2222.inc blocks this one
323 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wwrite-strings)
324 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wstrict-prototypes)
325 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wmissing-declarations)
327 # epan/dissectors/packet-afs.c blocks this one for now.
329 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshadow)
331 # More cleanup needed for this on LP64.
333 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshorten-64-to-32)
336 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wall -W) # -W is now known as -Wextra
337 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wextra) # -W is now known as -Wextra
338 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdeclaration-after-statement)
339 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wendif-labels)
340 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpointer-arith)
341 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-pointer-sign)
342 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
343 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
344 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
345 # Use the faster pre gcc 4.5 floating point precision
346 AC_WIRESHARK_GCC_CFLAGS_CHECK(-fexcess-precision=fast)
348 AC_WIRESHARK_GCC_LDFLAGS_CHECK([-Wl,--as-needed])
349 ###AC_WIRESHARK_GCC_LDFLAGS_CHECK([-Wl,-M])
350 ###AC_WIRESHARK_GCC_LDFLAGS_CHECK([-Wl,--cref])
351 # AC_WIRESHARK_GCC_LDFLAGS_CHECK([-flto])
352 # AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhopr])
353 # AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhole-program])
356 # If we're running GCC or clang, add '-D_U_="__attribute__((unused))"' to
357 # CFLAGS as well, so we can use _U_ to flag unused function arguments and
358 # not get warnings about them. Otherwise, add '-D_U_=""', so that _U_ used
359 # to flag an unused function argument will compile with non-GCC, non-clang
362 # XXX - other compilers?
364 if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
365 CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
367 CFLAGS="-D_U_=\"\" $CFLAGS"
371 # If we're running GCC or clang, enable a barrier "stop on warning".
372 # This barrier is set for a very large part of the code. However, it is
373 # typically not set for "generated" code (flex, ans2wrs, idl2wrs, ...)
375 warnings_as_errors_default="yes"
376 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
377 AC_ARG_ENABLE(warnings-as-errors,
378 AC_HELP_STRING( [--enable-warnings-as-errors],
379 [Treat warnings as errors (only for GCC or clang). @<:@default=yes@:>@]),
381 if test \( "x$GCC" = "xyes" -o "x$CLANG" = "xyes" \) -a "x$enableval" == "xyes" -a "x$wireshark_extra_gcc_flags" != "xyes"; then
382 with_warnings_as_errors="yes"
385 with_warnings_as_errors="no"
389 if test \( "x$GCC" = "xyes" -o "x$CLANG" = "xyes" \) -a "x$wireshark_extra_gcc_flags" = "x" -a "x$warnings_as_errors_default" = "xyes"; then
390 with_warnings_as_errors="yes"
393 with_warnings_as_errors="no"
397 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
400 # Add any platform-specific compiler flags needed.
402 AC_MSG_CHECKING(for platform-specific compiler flags)
403 if test "x$GCC" = "xyes" ; then
405 # GCC - do any platform-specific tweaking necessary.
409 # the X11 headers don't automatically include prototype info
410 # and a lot don't include the return type
411 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
412 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
416 # See comments above about Apple's lovely C compiler.
418 CFLAGS="-no-cpp-precomp $CFLAGS"
419 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
422 AC_MSG_RESULT(none needed)
427 # Not GCC - assume it's the vendor's compiler.
432 # HP's ANSI C compiler; flags suggested by Jost Martin.
433 # "-Ae" for ANSI C plus extensions such as "long long".
434 # "+O2", for optimization. XXX - works with "-g"?
436 CFLAGS="-Ae +O2 $CFLAGS"
437 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
441 # It may be called "cc", but it's really a GCC derivative
442 # with a problematic special precompiler and precompiled
443 # headers; turn off the special precompiler, as some
444 # apparently-legal code won't compile with its precompiled
447 CFLAGS="-no-cpp-precomp $CFLAGS"
448 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
451 AC_MSG_RESULT(none needed)
457 # Add any platform-specific linker flags needed.
459 AC_MSG_CHECKING(for platform-specific linker flags)
463 # Add -Wl,-single_module to the LDFLAGS used with shared
464 # libraries, to fix some error that show up in some cases;
465 # some Apple documentation recommends it for most shared
468 LDFLAGS_SHAREDLIB="-Wl,-single_module"
470 # Add -Wl,-search_paths_first to make sure that if we search
471 # directories A and B, in that order, for a given library, a
472 # non-shared version in directory A, rather than a shared
473 # version in directory B, is chosen (so we can use
474 # --with-pcap=/usr/local to force all programs to be linked
475 # with a static version installed in /usr/local/lib rather than
476 # the system version in /usr/lib).
478 LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
479 AC_MSG_RESULT([Apple linker - added -Wl,-single_module and -Wl,-search_paths_first])
483 # Shared libraries in cygwin/Win32 must never contain
486 LDFLAGS="$LDFLAGS -no-undefined"
487 AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
490 AC_MSG_RESULT(none needed)
493 AC_SUBST(LDFLAGS_SHAREDLIB)
495 # Control silent compiling
496 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
499 # On OS X, if we find the headers for Core Foundation, Launch Services,
500 # and Core Services, add -framework options to link with Application
501 # Services (of which Launch Services is a subframework), Core Foundation
502 # (required by the Launch Services APIs), and Core Services, so we can
503 # use them to launch a Web browser from the Help menu and to use
504 # Gestalt() to get the Mac OS X version number.
509 AC_MSG_CHECKING([whether we can build with Core Foundation, Launch Services, and Core Services])
511 ac_coreservices_frameworks="-framework CoreServices"
512 ac_launchservices_frameworks="-framework ApplicationServices -framework CoreFoundation $ac_coreservices_frameworks"
513 LIBS="$LIBS $ac_launchservices_frameworks $ac_coreservices_frameworks"
516 # include <CoreFoundation/CFBase.h>
517 # include <CoreFoundation/CFString.h>
518 # include <CoreFoundation/CFURL.h>
519 # include <ApplicationServices/ApplicationServices.h>
520 # include <CoreServices/CoreServices.h>
523 CFStringRef url_CFString;
528 url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
529 url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
530 status = LSOpenCFURLRef(url_CFURL, NULL);
532 Gestalt(gestaltSystemVersion, &os_version);
534 ac_cv_can_use_osx_frameworks=yes,
535 ac_cv_can_use_osx_frameworks=no,
536 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
537 if test "$ac_cv_can_use_osx_frameworks" = yes ; then
538 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
539 CORESERVICES_FRAMEWORKS="$ac_coreservices_frameworks"
540 LAUNCHSERVICES_FRAMEWORKS="$ac_launchservices_frameworks"
548 AC_SUBST(CORESERVICES_FRAMEWORKS)
549 AC_SUBST(LAUNCHSERVICES_FRAMEWORKS)
552 # If using $prefix we add "$prefix/include" to the include search path
553 # and "$prefix/lib" to the library search path.
555 if test "x$prefix" != "x" ; then
556 AC_MSG_CHECKING(whether to use $prefix for headers and libraries)
557 if test -d $prefix/include ; then
560 # Arrange that we search for header files in "$prefix/include", as
561 # various packages we use may have been installed under "$prefix/include".
563 CFLAGS="$CFLAGS -I$prefix/include"
564 CPPFLAGS="$CPPFLAGS -I$prefix/include"
567 # Arrange that we search for libraries in "$prefix/lib".
569 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, $prefix/lib)
575 dnl Look in /usr/local for header files and libraries ?
576 dnl XXX FIXME don't include /usr/local if it is already in the system
577 dnl search path as this causes gcc 3.2 on Linux to complain about a change
578 dnl of the system search order for includes
579 AC_ARG_ENABLE(usr-local,
580 AC_HELP_STRING( [--enable-usr-local],
581 [look for headers and libs in /usr/local tree. @<:@default=yes@:>@]),
582 ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
584 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
585 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
586 if test -d "/usr/local"; then
589 # Arrange that we search for header files in the source directory
590 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
591 # as various packages we use ("libpcap", "zlib", "adns", "pcre")
592 # may have been installed under "/usr/local/include".
594 CFLAGS="$CFLAGS -I/usr/local/include"
595 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
598 # Arrange that we search for libraries in "/usr/local/lib".
600 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
609 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
614 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
615 if test x$LD_LIBRARY_PATH != x ; then
616 LIBS="$LIBS -R$LD_LIBRARY_PATH"
617 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
619 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
625 # Check for versions of "sed" inadequate to handle, in libtool, a list
626 # of object files as large as the list in Wireshark.
628 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
629 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
630 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
631 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
632 # is the only "sed" that comes with Solaris that can handle Wireshark.
634 # Add any checks here that are necessary for other OSes.
636 AC_WIRESHARK_GNU_SED_CHECK
637 if test "$HAVE_GNU_SED" = no ; then
640 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
642 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
644 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
659 # Enable/disable tshark
661 AC_ARG_ENABLE(wireshark,
662 AC_HELP_STRING( [--enable-wireshark],
663 [build GTK+-based wireshark. @<:@default=yes, if GTK+ available@:>@]),
664 enable_wireshark=$enableval,enable_wireshark=yes)
666 AC_ARG_ENABLE(threads,
667 AC_HELP_STRING( [--enable-threads],
668 [use threads in wireshark. @<:@default=no@:>@]),
669 enable_threads=$enableval,enable_threads=no)
670 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
672 AC_ARG_ENABLE(profile-build,
673 AC_HELP_STRING( [--enable-profile-build],
674 [build profile-ready binaries. @<:@default=no@:>@]),
675 enable_profile_build=$enableval,enable_profile_build=no)
676 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
677 AC_MSG_CHECKING(if profile builds must be generated)
678 if test "x$enable_profile_build" = "xyes" ; then
679 if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
681 CFLAGS=" -pg $CFLAGS"
684 echo "Building profile binaries currently only supported for GCC and clang."
690 # Create DATAFILE_DIR #define for config.h
691 datafiledir=$datadir/wireshark
693 test "x$prefix" = xNONE && prefix=$ac_default_prefix
694 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
695 # Ugly hack, but I don't see how this problem can be solved
696 # properly that DATAFILE_DIR had a value starting with
697 # "${prefix}/" instead of e.g. "/usr/local/"
698 eval eval echo "$datafiledir"
700 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
702 # Create DOC_DIR #define for config.h
704 test "x$prefix" = xNONE && prefix=$ac_default_prefix
705 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
706 # Ugly hack, but I don't see how this problem can be solved
707 # properly that DOC_DIR had a value starting with
708 # "${prefix}/" instead of e.g. "/usr/local/"
709 eval eval echo "$docdir"
711 AC_DEFINE_UNQUOTED(DOC_DIR, "$docdir", [Directory for docs])
713 # GTK checks; we require GTK+ 2.4 or later.
714 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
715 # programs to be built with GTK+.
717 if test "x$enable_wireshark" = "xyes"; then
718 if test "x$with_gtk3" = "xyes"; then
719 AM_PATH_GTK_3_0(3.0.0,
721 CFLAGS="$CFLAGS $GTK_CFLAGS"
722 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
723 AC_DEFINE(HAVE_GTK, 1, [Define to 1 if compiling with GTK])
724 ], GTK_OK=no, gthread)
727 AM_PATH_GTK_2_0(2.4.0,
729 CFLAGS="$CFLAGS $GTK_CFLAGS"
730 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
731 AC_DEFINE(HAVE_GTK, 1, [Define to 1 if compiling with GTK])
732 ], GTK_OK=no, gthread)
738 # GLib checks; we require GLib 2.4 or later, and require gmodule
739 # support, as we need that for dynamically loading plugins.
740 # If we found GTK+, this doesn't add GLIB_CFLAGS to CFLAGS, because
741 # AM_PATH_GTK will add GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a
742 # superset of GLIB_CFLAGS. If we didn't find GTK+, it does add
743 # GLIB_CFLAGS to CFLAGS.
744 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
745 # set when generating the Makefile, so we can make programs that require
746 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
747 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
748 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
749 # programs to be built with GLib.
751 if test "$GTK_OK" = "no" ; then
753 # We don't have GTK+.
754 # If they didn't explicitly say "--disable-wireshark", fail (so
755 # that, unless they explicitly indicated that they don't want
756 # Wireshark, we stop so they know they won't be getting
757 # Wireshark unless they fix the GTK+ problem).
759 if test "x$enable_wireshark" = "xyes"; then
760 AC_MSG_ERROR([GTK+ 2.4 or later isn't available, so Wireshark can't be compiled])
765 AM_PATH_GLIB_2_0(2.4.0,
767 CFLAGS="$CFLAGS $GLIB_CFLAGS"
768 CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS"
769 ], AC_MSG_ERROR(GLib 2.4 or later distribution not found.), gmodule)
772 # We have GTK+, and thus will be building Wireshark unless the
773 # user explicitly disabled it.
775 wireshark_bin="wireshark\$(EXEEXT)"
776 wireshark_man="wireshark.1"
777 wireshark_SUBDIRS="codecs gtk"
778 # Don't use GLIB_CFLAGS
779 AM_PATH_GLIB_2_0(2.4.0, , AC_MSG_ERROR(GLib 2.4 or later distribution not found.), gmodule)
783 # Check whether GLib includes GRegex support.
784 # We just assume that everybody builds GLib 2.14.0 and later
785 # with GRegex support; it's possible to compile GLib without
786 # GRegex but it doesn't look as if anyone does.
788 AC_MSG_CHECKING(for GLIB - version >= 2.14.0)
789 if test x$PKG_CONFIG != xno ; then
790 ## don't try to run the test against uninstalled libtool libs
791 if $PKG_CONFIG --uninstalled $pkg_config_args; then
792 echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
796 if $PKG_CONFIG --atleast-version 2.14.0 glib-2.0; then
801 AC_MSG_RESULT($have_gregex)
805 # Check whether GLib modules are supported, to determine whether we
806 # can support plugins.
808 AC_MSG_CHECKING(whether GLib supports loadable modules)
809 ac_save_CFLAGS="$CFLAGS"
811 CFLAGS="$CFLAGS $GLIB_CFLAGS"
812 LIBS="$GLIB_LIBS $LIBS"
822 if (g_module_supported())
823 return 0; /* success */
825 return 1; /* failure */
827 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
828 [echo $ac_n "cross compiling; assumed OK... $ac_c"
829 ac_cv_glib_supports_modules=yes])
830 CFLAGS="$ac_save_CFLAGS"
832 if test "$ac_cv_glib_supports_modules" = yes ; then
841 # If we have <dlfcn.h>, check whether we can use dladdr to find a
842 # filename (hopefully, a full pathname, but no guarantees) for
845 if test "$ac_cv_header_dlfcn_h" = "yes"
847 AC_MSG_CHECKING(whether dladdr can be used to find the pathname of an executable)
848 ac_save_CFLAGS="$CFLAGS"
850 CFLAGS="$CFLAGS $GLIB_CFLAGS"
851 LIBS="$GLIB_LIBS $LIBS"
853 #define _GNU_SOURCE /* required on Linux, sigh */
861 if (!dladdr((void *)main, &info))
862 return 1; /* failure */
863 return 0; /* assume success */
865 ], ac_cv_dladdr_finds_executable_path=yes, ac_cv_dladdr_finds_executable_path=no,
866 [echo $ac_n "cross compiling; assumed OK... $ac_c"
867 ac_cv_dladdr_finds_executable_path=yes])
868 CFLAGS="$ac_save_CFLAGS"
870 if test x$ac_cv_dladdr_finds_executable_path = xyes
872 AC_DEFINE(DLADDR_FINDS_EXECUTABLE_PATH, 1, [Define if dladdr can be used to find the path of the executable])
874 AC_MSG_RESULT($ac_cv_dladdr_finds_executable_path)
877 if test "x$no_gtk" != "xyes"
880 # We have GTK+; do we want the OS X integration functions and,
881 # if so, do we have them and, if so, which versions do we have,
882 # the old Carbon-based ones or the new Cocoa-based ones?
884 AC_MSG_CHECKING(whether to use OS X integration functions)
886 AC_ARG_WITH(osx-integration,
887 AC_HELP_STRING( [--with-osx-integration],
888 [use OS X integration functions (@<:@default=yes, if available@:>@]),
890 if test $withval = no
892 want_osx_integration=no
894 want_osx_integration=yes
897 want_osx_integration=yes
899 if test "x$want_osx_integration" = "xno"; then
903 AC_WIRESHARK_OSX_INTEGRATION_CHECK
907 AC_SUBST(wireshark_bin)
908 AC_SUBST(wireshark_man)
911 # Enable/disable tshark
913 AC_ARG_ENABLE(tshark,
914 AC_HELP_STRING( [--enable-tshark],
915 [build tshark. @<:@default=yes@:>@]),
916 tshark=$enableval,enable_tshark=yes)
918 if test "x$enable_tshark" = "xyes" ; then
919 tshark_bin="tshark\$(EXEEXT)"
920 tshark_man="tshark.1"
921 wiresharkfilter_man="wireshark-filter.4"
928 AC_SUBST(wiresharkfilter_man)
932 # Enable/disable editcap
934 AC_ARG_ENABLE(editcap,
935 AC_HELP_STRING( [--enable-editcap],
936 [build editcap. @<:@default=yes@:>@]),
937 enable_editcap=$enableval,enable_editcap=yes)
939 if test "x$enable_editcap" = "xyes" ; then
940 editcap_bin="editcap\$(EXEEXT)"
941 editcap_man="editcap.1"
946 AC_SUBST(editcap_bin)
947 AC_SUBST(editcap_man)
949 # Enabling/disabling of dumpcap is done later (after we know if we have PCAP
952 # Enable/disable capinfos
954 AC_ARG_ENABLE(capinfos,
955 AC_HELP_STRING( [--enable-capinfos],
956 [build capinfos. @<:@default=yes@:>@]),
957 enable_capinfos=$enableval,enable_capinfos=yes)
959 if test "x$enable_capinfos" = "xyes" ; then
960 capinfos_bin="capinfos\$(EXEEXT)"
961 capinfos_man="capinfos.1"
966 AC_SUBST(capinfos_bin)
967 AC_SUBST(capinfos_man)
970 # Enable/disable mergecap
972 AC_ARG_ENABLE(mergecap,
973 AC_HELP_STRING( [--enable-mergecap],
974 [build mergecap. @<:@default=yes@:>@]),
975 enable_mergecap=$enableval,enable_mergecap=yes)
977 if test "x$enable_mergecap" = "xyes" ; then
978 mergecap_bin="mergecap\$(EXEEXT)"
979 mergecap_man="mergecap.1"
984 AC_SUBST(mergecap_bin)
985 AC_SUBST(mergecap_man)
988 # Enable/disable text2pcap
990 AC_ARG_ENABLE(text2pcap,
991 AC_HELP_STRING( [--enable-text2pcap],
992 [build text2pcap. @<:@default=yes@:>@]),
993 text2pcap=$enableval,enable_text2pcap=yes)
995 if test "x$enable_text2pcap" = "xyes" ; then
996 text2pcap_bin="text2pcap\$(EXEEXT)"
997 text2pcap_man="text2pcap.1"
1002 AC_SUBST(text2pcap_bin)
1003 AC_SUBST(text2pcap_man)
1005 # Enable/disable idl2wrs
1007 AC_ARG_ENABLE(idl2wrs,
1008 AC_HELP_STRING( [--enable-idl2wrs],
1009 [build idl2wrs. @<:@default=yes@:>@]),
1010 enable_idl2wrs=$enableval,enable_idl2wrs=yes)
1012 if test "x$enable_idl2wrs" = "xyes" ; then
1013 idl2wrs_bin="idl2wrs"
1014 idl2wrs_man="idl2wrs.1"
1019 AC_SUBST(idl2wrs_bin)
1020 AC_SUBST(idl2wrs_man)
1023 # Enable/disable dftest
1025 AC_ARG_ENABLE(dftest,
1026 AC_HELP_STRING( [--enable-dftest],
1027 [build dftest. @<:@default=yes@:>@]),
1028 enable_dftest=$enableval,enable_dftest=yes)
1030 if test "x$enable_dftest" = "xyes" ; then
1031 dftest_bin="dftest\$(EXEEXT)"
1032 dftest_man="dftest.1"
1037 AC_SUBST(dftest_bin)
1038 AC_SUBST(dftest_man)
1041 # Enable/disable randpkt
1043 AC_ARG_ENABLE(randpkt,
1044 AC_HELP_STRING( [--enable-randpkt],
1045 [build randpkt. @<:@default=yes@:>@]),
1046 enable_randpkt=$enableval,enable_randpkt=yes)
1048 if test "x$enable_randpkt" = "xyes" ; then
1049 randpkt_bin="randpkt\$(EXEEXT)"
1050 randpkt_man="randpkt.1"
1055 AC_SUBST(randpkt_bin)
1056 AC_SUBST(randpkt_man)
1060 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
1061 dnl "gethostbyname()".
1062 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
1064 dnl Checks for "connect()", used as a proxy for "socket()" - and
1065 dnl "-lsocket", if we need it to get "connect()".
1066 AC_WIRESHARK_SOCKET_LIB_CHECK
1069 AC_MSG_CHECKING(whether to use libpcap for packet capture)
1072 AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
1073 [use libpcap for packet capturing. @<:@default=yes@:>@]),
1075 if test $withval = no
1078 elif test $withval = yes
1089 if test "x$want_pcap" = "xno" ; then
1093 AC_WIRESHARK_PCAP_CHECK
1096 # Enable/disable dumpcap
1099 AC_MSG_CHECKING(whether to build dumpcap)
1101 AC_ARG_ENABLE(dumpcap,
1102 AC_HELP_STRING( [--enable-dumpcap],
1103 [build dumpcap. @<:@default=yes@:>@]),
1104 enable_dumpcap=$enableval,enable_dumpcap=yes)
1106 if test "x$enable_dumpcap" = "xyes" ; then
1107 if test "x$want_pcap" = "xno" ; then
1109 AC_MSG_RESULT(pcap not available - disabling dumpcap)
1117 if test "x$enable_dumpcap" = "xyes" ; then
1118 dumpcap_bin="dumpcap\$(EXEEXT)"
1119 dumpcap_man="dumpcap.1"
1124 AC_SUBST(dumpcap_bin)
1125 AC_SUBST(dumpcap_man)
1127 # Enable/disable rawshark
1130 AC_MSG_CHECKING(whether to build rawshark)
1132 AC_ARG_ENABLE(rawshark,
1133 AC_HELP_STRING( [--enable-rawshark],
1134 [build rawshark. @<:@default=yes@:>@]),
1135 rawshark=$enableval,enable_rawshark=yes)
1137 if test "x$enable_rawshark" = "xyes" ; then
1138 if test "x$want_pcap" = "xno" ; then
1140 AC_MSG_RESULT(pcap not available - disabling rawshark)
1148 if test "x$enable_rawshark" = "xyes" ; then
1149 rawshark_bin="rawshark\$(EXEEXT)"
1150 rawshark_man="rawshark.1"
1155 AC_SUBST(rawshark_bin)
1156 AC_SUBST(rawshark_man)
1159 dnl pcap remote check
1160 AC_MSG_CHECKING(whether to use libpcap remote capturing feature)
1162 AC_ARG_WITH(pcap-remote,
1163 AC_HELP_STRING([--with-pcap-remote],
1164 [use libpcap remote capturing (requires libpcap)]),
1166 if test $withval = no
1170 want_pcap_remote=yes
1175 if test "x$want_pcap_remote" = "xno" -o "x$want_pcap" = "xno" ; then
1179 AC_WIRESHARK_PCAP_REMOTE_CHECK
1183 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
1186 AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
1187 [use zlib (located in directory DIR, if supplied) to read compressed data. @<:@default=yes, if available@:>@]),
1189 if test $withval = no
1192 elif test $withval = yes
1201 # Use zlib if it's present, otherwise don't.
1203 want_zlib=ifavailable
1206 if test "x$want_zlib" = "xno" ; then
1210 AC_WIRESHARK_ZLIB_CHECK
1211 if test "x$want_zlib" = "xno" ; then
1212 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
1216 if test "x$want_zlib" != "xno" ; then
1217 AC_CHECK_LIB(z, gzclearerr,
1219 AC_DEFINE(HAVE_GZCLEARERR, 1, [Define if we have gzclearerr])
1224 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
1227 AC_HELP_STRING( [--with-pcre@<:@=DIR@:>@],
1228 [use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. Not needed if you have GLib 2.14 or later. @<:@default=yes, if available and GLib < 2.14@:>@]),
1230 if test $withval = no
1233 elif test $withval = yes
1242 # Use libpcre if it's present and GRegex isn't, otherwise don't.
1244 if test $have_gregex = yes ; then
1247 want_pcre=ifavailable
1251 if test "x$want_pcre" = "xno" ; then
1255 AC_WIRESHARK_LIBPCRE_CHECK
1256 if test "x$want_pcre" = "xno" ; then
1257 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
1263 AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
1266 AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
1267 [use liblua (located in directory DIR, if supplied) for the lua scripting plugin. @<:@default=yes, if available@:>@]),
1269 if test $withval = no
1272 elif test $withval = yes
1281 # Use liblua by default
1283 want_lua=ifavailable
1286 if test "x$want_lua" = "xno" ; then
1290 AC_WIRESHARK_LIBLUA_CHECK
1291 if test "x$want_lua" = "xno" ; then
1292 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
1295 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
1299 AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
1301 AC_ARG_WITH(portaudio,
1302 AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
1303 [use libportaudio (located in directory DIR, if supplied) for the rtp_player. @<:@default=yes, if available@:>@]),
1305 if test $withval = no
1308 elif test $withval = yes
1313 portaudio_dir=$withval
1317 # Use libportaudio by default
1319 want_portaudio=ifavailable
1322 if test "x$want_portaudio" = "xno" ; then
1326 AC_WIRESHARK_LIBPORTAUDIO_CHECK
1327 if test "x$want_portaudio" = "xno" ; then
1328 AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
1331 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
1336 AC_HELP_STRING( [--enable-ipv6],
1337 [use ipv6 name resolution, if available. @<:@default=yes@:>@]),
1338 enable_ipv6=$enableval,enable_ipv6=yes)
1340 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
1341 if test "x$enable_ipv6" = "xno" ; then
1345 AC_WIRESHARK_IPV6_STACK
1349 dnl Check if dumpcap should be installed with filesystem capabilities
1350 AC_PATH_PROG(SETCAP, setcap)
1351 AC_ARG_ENABLE(setcap-install,
1352 AC_HELP_STRING( [--enable-setcap-install],
1353 [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
1354 enable_setcap_install=$enableval,enable_setcap_install=no)
1356 AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
1357 if test "x$enable_setcap_install" = "xno" ; then
1360 if test "x$SETCAP" = "x" ; then
1361 AC_MSG_RESULT(no. Setcap not found)
1362 elif test "x$enable_dumpcap" = "xno" ; then
1363 AC_MSG_ERROR(Setcap install works only with dumpcap but dumpcap is disabled)
1369 AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
1371 dnl Check if dumpcap should be installed setuid
1372 AC_ARG_ENABLE(setuid-install,
1373 AC_HELP_STRING( [--enable-setuid-install],
1374 [install dumpcap as setuid @<:@default=no@:>@]),
1375 enable_setuid_install=$enableval,enable_setuid_install=no)
1377 AC_MSG_CHECKING(whether to install dumpcap setuid)
1378 if test "x$enable_setuid_install" = "xno" ; then
1381 if test "x$enable_setcap_install" = "xyes" ; then
1382 enable_setuid_install=no
1383 AC_MSG_RESULT(no; using setcap instead)
1384 elif test "x$enable_dumpcap" = "xno" ; then
1385 AC_MSG_ERROR(Setuid install works only with dumpcap but dumpcap is disabled)
1391 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
1392 AC_CHECK_FUNCS(setresuid setresgid)
1394 dnl ...but our Network Operations group is named "no"!
1396 AC_ARG_WITH(dumpcap-group,
1397 AC_HELP_STRING( [--with-dumpcap-group=GROUP],
1398 [restrict dumpcap to GROUP]),
1400 if test "x$withval" = "xyes"; then
1401 AC_MSG_ERROR([No dumpcap group specified.])
1402 elif test "x$withval" != "xno"; then
1403 AC_MSG_RESULT($withval)
1404 DUMPCAP_GROUP="$withval"
1407 AC_SUBST(DUMPCAP_GROUP)
1408 AM_CONDITIONAL(HAVE_DUMPCAP_GROUP, test x$DUMPCAP_GROUP != x)
1410 dnl libcap (not libpcap) check
1412 AC_MSG_CHECKING(whether to use the libcap capabilities library)
1415 AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
1416 [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management. @<:@default=yes, if present@:>@]),
1418 if test "x$withval" = "xno"; then
1420 elif test "x$withval" = "xyes"; then
1422 elif test -d "$withval"; then
1424 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1427 if test "x$with_libcap" = "xno" ; then
1431 AC_WIRESHARK_LIBCAP_CHECK
1433 AC_SUBST(LIBCAP_LIBS)
1435 dnl Checks for header files.
1436 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h grp.h inttypes.h netdb.h pwd.h stdarg.h stddef.h unistd.h)
1437 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)
1438 AC_CHECK_HEADERS(netinet/in.h)
1439 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
1443 AC_MSG_CHECKING(whether to use SSL library)
1446 AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
1447 [use SSL crypto library (located in directory DIR, if supplied). @<:@default=no@:>@]),
1449 if test "x$withval" = "xno"; then
1451 elif test "x$withval" = "xyes"; then
1453 elif test -d "$withval"; then
1455 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1460 if test "x$want_ssl" = "xyes"; then
1462 AC_CHECK_LIB(crypto,EVP_md5,
1467 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
1475 AC_MSG_CHECKING(whether to use kerberos)
1478 AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
1479 [use kerberos (located in directory DIR, if supplied) to use in kerberos dissection @<:@default=yes@:>@]),
1481 if test $withval = no
1484 elif test $withval = yes
1493 # Use kerberos if specified, otherwise don't.
1495 want_krb5=ifavailable
1498 if test "x$want_krb5" = "xno" ; then
1502 AC_WIRESHARK_KRB5_CHECK
1508 AC_MSG_CHECKING(whether to use the c-ares library if available)
1511 AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
1512 [use c-ares (located in directory DIR, if supplied). Supersedes --with-adns. @<:@default=yes, if present@:>@]),
1514 if test "x$withval" = "xno"; then
1516 elif test "x$withval" = "xyes"; then
1518 elif test -d "$withval"; then
1520 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1523 if test "x$want_c_ares" = "xno" ; then
1527 AC_WIRESHARK_C_ARES_CHECK
1529 AC_SUBST(C_ARES_LIBS)
1533 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
1536 AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
1537 [use GNU ADNS (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1539 if test "x$withval" = "xno"; then
1541 elif test "x$withval" = "xyes"; then
1543 elif test -d "$withval"; then
1545 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1548 if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
1552 AC_WIRESHARK_ADNS_CHECK
1558 AC_MSG_CHECKING(whether to use the GeoIP IP address mapping library if available)
1561 AC_HELP_STRING( [--with-geoip@<:@=DIR@:>@],
1562 [use GeoIP (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1564 if test "x$withval" = "xno"; then
1566 elif test "x$withval" = "xyes"; then
1568 elif test -d "$withval"; then
1570 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1573 if test "x$want_geoip" = "xno"; then
1577 AC_WIRESHARK_GEOIP_CHECK
1579 AC_SUBST(GEOIP_LIBS)
1581 dnl Python devel Check
1583 AC_HELP_STRING( [--with-python@<:@=DIR@:>@],
1584 [use python interpreter (installed in DIR, if supplied). @<:@default=yes@:>@ (EXPERIMENTAL)]),
1586 pythondir='${libdir}/wireshark/python/${VERSION}'
1587 if test "x$withval" = "xno"; then
1589 elif test "x$withval" != "xyes"; then
1590 pythondir="$withval"
1592 AC_WIRESHARK_PYTHON_CHECK
1595 AC_WIRESHARK_PYTHON_CHECK
1598 AM_CONDITIONAL(HAVE_LIBPY, test x$want_python = xyes)
1602 # Define WS_VAR_IMPORT appropriately for declarations of external
1603 # variables exported from dynamically-linked libraries.
1605 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
1608 # Define WS_MSVC_NORETURN appropriately for declarations of routines that
1609 # never return (just like Charlie on the MTA).
1611 # Note that MSVC++ expects __declspec(noreturn) to precede the function
1612 # name and GCC, as far as I know, expects __attribute__((noreturn)) to
1613 # follow the function name, so we need two different flavors of
1616 AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
1618 AC_ARG_ENABLE(airpcap,
1619 AC_HELP_STRING( [--enable-airpcap],
1620 [use airpcap in wireshark. @<:@default=yes@:>@]),
1621 enable_airpcap=$enableval
1622 if test x$enable_airpcap != xno; then
1623 AC_DEFINE(HAVE_AIRPCAP, 1, [Enable AirPcap])
1627 # Define HAVE_AIRPDCAP
1628 # We'll want to remove this eventually.
1630 AC_DEFINE(HAVE_AIRPDCAP, 1, [Enable AirPDcap (WPA/WPA2 decryption)])
1632 dnl Checks for typedefs, structures, and compiler characteristics.
1635 # Check how we can get the time zone abbreviation
1636 AC_WIRESHARK_TIMEZONE_ABBREV
1638 # We need to know whether "struct sockaddr" has an "sa_len" member
1639 # for get_interface_list().
1641 AC_WIRESHARK_STRUCT_SA_LEN
1643 # We must know our byte order
1646 # Checks whether "-traditional" is needed when using "ioctl".
1647 # XXX - do we need this?
1648 AC_PROG_GCC_TRADITIONAL
1651 AC_CHECK_FUNC(getopt,
1653 AC_DEFINE(HAVE_GETOPT_H, 1, [Define to 1 if you have the <getopt.h> header file.])
1655 GETOPT_LO="wsgetopt.lo"
1657 if test "$ac_cv_func_getopt" = no ; then
1658 GETOPT_LO="wsgetopt.lo"
1660 AM_CONDITIONAL(NEED_GETOPT_LO, test "x$ac_cv_func_getopt" = "xno")
1663 AC_CHECK_FUNC(strerror, STRERROR_LO="",
1664 [STRERROR_LO="strerror.lo"
1665 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
1667 if test "$ac_cv_func_strerror" = no ; then
1668 STRERROR_LO="strerror.lo"
1670 AM_CONDITIONAL(NEED_STRERROR_LO, test "x$ac_cv_func_strerror" = "xno")
1671 AC_SUBST(STRERROR_LO)
1673 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_LO="",
1674 STRNCASECMP_LO="strncasecmp.lo")
1675 if test "$ac_cv_func_strncasecmp" = no ; then
1676 STRNCASECMP_LO="strncasecmp.lo"
1678 AM_CONDITIONAL(NEED_STRNCASECMP_LO, test "x$ac_cv_func_strncasecmp" = "xno")
1679 AC_SUBST(STRNCASECMP_LO)
1681 AC_CHECK_FUNCS(mkstemp mkdtemp)
1683 AC_SEARCH_LIBS(inet_aton, [socket nsl], have_inet_aton=yes,
1685 if test "$have_inet_aton" = no; then
1686 INET_ATON_LO="inet_aton.lo"
1687 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1691 AM_CONDITIONAL(NEED_INET_ATON_LO, test "x$have_inet_aton" = "xno")
1692 AC_SUBST(INET_ATON_LO)
1694 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1695 dnl check for pre-BIND82 inet_pton() bug.
1696 AC_MSG_CHECKING(for broken inet_pton)
1697 AC_TRY_RUN([#include <sys/types.h>
1698 #include <sys/socket.h>
1699 #include <netinet/in.h>
1700 #include <arpa/inet.h>
1705 /* this should return 0 (error) */
1706 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1710 }], [AC_MSG_RESULT(ok);
1711 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1712 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1713 have_inet_pton=no])],
1715 if test "$have_inet_pton" = no; then
1716 INET_PTON_LO="inet_pton.lo"
1720 AM_CONDITIONAL(NEED_INET_PTON_LO, test "x$have_inet_pton" = "xno")
1721 AC_SUBST(INET_PTON_LO)
1723 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1724 AC_MSG_CHECKING([for inet_ntop prototype])
1725 AC_TRY_COMPILE([#include <stdio.h>
1726 #include <sys/types.h>
1727 #include <sys/socket.h>
1728 #include <netinet/in.h>
1729 #include <arpa/inet.h>
1731 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1733 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1734 [Define if inet_ntop() prototype exists])], [
1735 AC_TRY_COMPILE([#include <stdio.h>
1736 #include <sys/types.h>
1737 #include <sys/socket.h>
1738 #include <netinet/in.h>
1739 #include <arpa/inet.h>
1741 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1743 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1744 [Define if inet_ntop() prototype exists])], [
1745 AC_MSG_RESULT(no)])])
1747 INET_NTOP_LO="inet_ntop.lo"
1748 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1749 [Define if inet/v6defs.h needs to be included])])
1750 AM_CONDITIONAL(NEED_INET_NTOP_LO, test "x$INET_NTOP_LO" != "x")
1751 AC_SUBST(INET_NTOP_LO)
1753 AC_CHECK_FUNC(strptime, STRPTIME_LO="",
1754 [STRPTIME_LO="strptime.lo"
1755 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1757 if test "$ac_cv_func_strptime" = no ; then
1758 STRPTIME_LO="strptime.lo"
1760 AC_SUBST(STRPTIME_C)
1761 AM_CONDITIONAL(NEED_STRPTIME_LO, test "x$ac_cv_func_strptime" = "no")
1762 AC_SUBST(STRPTIME_LO)
1764 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1765 AC_CHECK_FUNCS(issetugid)
1766 AC_CHECK_FUNCS(mmap mprotect sysconf)
1767 AC_CHECK_FUNCS(strtoll)
1769 dnl blank for now, but will be used in future
1770 AC_SUBST(wireshark_SUBDIRS)
1773 dnl check whether plugins should be enabled and, if they should be,
1774 dnl check for plugins directory - stolen from Amanda's configure.in
1776 dnl we don't wish to expand ${libdir} yet
1777 plugindir='${libdir}/wireshark/plugins/${VERSION}'
1778 AC_ARG_WITH(plugins,
1779 AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
1780 [support plugins (installed in DIR, if supplied). @<:@default=yes, if possible@:>@]),
1782 if test "x$withval" = "xno"; then
1784 elif test "x$have_plugins" = "xno"; then
1785 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1786 elif test "x$withval" != "xyes"; then
1787 plugindir="$withval"
1790 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
1791 if test x$have_plugins = xyes
1793 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1796 CPPFLAGS="$CPPFLAGS '-DPLUGIN_DIR=\"\$(plugindir)\"'"
1799 # The plugin dissectors reside in ./plugins/PROTO/
1802 AC_SUBST(PLUGIN_LIBS)
1806 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1807 # (autoconf? automake? libtool?) - with the newer version(s), it's
1808 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1810 # With older version(s) of those tool(s), however, it's not just an
1811 # alias, and the configure scripts don't work without it.
1814 AC_SUBST(LIBTOOL_DEPS)
1816 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1817 if test x$enable_static = xyes -a x$have_plugins = xyes
1819 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
1821 AC_SUBST(ENABLE_STATIC)
1823 dnl Save the cacheable configure results to config.cache before recursing
1826 sinclude(plugins/Custom.m4) dnl
1827 ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
1829 AM_CONFIG_HEADER(config.h)
1834 asn1/acp133/Makefile
1836 asn1/ansi_map/Makefile
1837 asn1/ansi_tcap/Makefile
1840 asn1/charging_ase/Makefile
1853 asn1/gprscdr/Makefile
1854 asn1/gsm_map/Makefile
1863 asn1/h450-ros/Makefile
1866 asn1/HI2Operations/Makefile
1870 asn1/kerberos/Makefile
1872 asn1/logotypecertextn/Makefile
1873 asn1/lte-rrc/Makefile
1875 asn1/mpeg-audio/Makefile
1876 asn1/mpeg-pes/Makefile
1878 asn1/ns_cert_exts/Makefile
1886 asn1/pkcs12/Makefile
1887 asn1/pkinit/Makefile
1888 asn1/pkixac/Makefile
1889 asn1/pkix1explicit/Makefile
1890 asn1/pkix1implicit/Makefile
1891 asn1/pkixproxy/Makefile
1892 asn1/pkixqualified/Makefile
1893 asn1/pkixtsp/Makefile
1896 asn1/q932-ros/Makefile
1909 asn1/spnego/Makefile
1916 asn1/wlancertextn/Makefile
1918 asn1/x509af/Makefile
1919 asn1/x509ce/Makefile
1920 asn1/x509if/Makefile
1921 asn1/x509sat/Makefile
1929 epan/dfilter/Makefile
1930 epan/dissectors/Makefile
1931 epan/dissectors/dcerpc/Makefile
1932 epan/dissectors/pidl/Makefile
1933 epan/ftypes/Makefile
1935 epan/wspython/Makefile
1941 packaging/macosx/Info.plist
1942 packaging/macosx/Makefile
1943 packaging/nsis/Makefile
1944 packaging/rpm/Makefile
1945 packaging/rpm/SPECS/Makefile
1946 packaging/rpm/SPECS/wireshark.spec
1947 packaging/svr4/Makefile
1948 packaging/svr4/checkinstall
1949 packaging/svr4/pkginfo
1951 plugins/asn1/Makefile
1952 plugins/docsis/Makefile
1953 plugins/ethercat/Makefile
1954 plugins/giop/Makefile
1955 plugins/gryphon/Makefile
1956 plugins/interlink/Makefile
1957 plugins/irda/Makefile
1958 plugins/m2m/Makefile
1959 plugins/mate/Makefile
1960 plugins/opcua/Makefile
1961 plugins/profinet/Makefile
1962 plugins/sercosiii/Makefile
1963 plugins/stats_tree/Makefile
1964 plugins/unistim/Makefile
1965 plugins/wimax/Makefile
1966 plugins/wimaxasncp/Makefile
1969 tools/lemon/Makefile
1974 dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
1979 if test "x$enable_setcap_install" = "xyes" ; then
1980 setcap_message="yes"
1986 if test "x$enable_setuid_install" = "xyes" ; then
1987 setuid_message="yes"
1992 if test "x$DUMPCAP_GROUP" = "x" ; then
1993 dumpcap_group_message="(none)"
1995 dumpcap_group_message="$DUMPCAP_GROUP"
1998 if test "x$want_zlib" = "xno" ; then
2004 if test "x$want_pcre" = "xno" ; then
2005 if test $have_gregex = yes
2007 pcre_message="no (using GRegex instead)"
2015 if test "x$want_lua" = "xyes" ; then
2021 if test "x$want_python" = "xyes"; then
2022 python_message="yes"
2027 if test "x$want_portaudio" = "xyes" ; then
2028 portaudio_message="yes"
2030 portaudio_message="no"
2033 if test "x$want_ssl" = "xno" ; then
2039 if test "x$want_krb5" = "xno" ; then
2042 krb5_message="yes ($ac_krb5_version)"
2045 if test "x$have_good_c_ares" = "xyes" ; then
2046 c_ares_message="yes"
2051 if test "x$have_good_adns" = "xyes" ; then
2054 if test "x$have_good_c_ares" = "xyes" ; then
2055 adns_message="no (using c-ares instead)"
2061 if test "x$have_good_libcap" = "xyes" ; then
2062 libcap_message="yes"
2067 if test "x$have_good_geoip" = "xyes" ; then
2074 echo "The Wireshark package has been configured with the following options."
2075 echo " Build wireshark : $enable_wireshark"
2076 echo " Build tshark : $enable_tshark"
2077 echo " Build capinfos : $enable_capinfos"
2078 echo " Build editcap : $enable_editcap"
2079 echo " Build dumpcap : $enable_dumpcap"
2080 echo " Build mergecap : $enable_mergecap"
2081 echo " Build text2pcap : $enable_text2pcap"
2082 echo " Build idl2wrs : $enable_idl2wrs"
2083 echo " Build randpkt : $enable_randpkt"
2084 echo " Build dftest : $enable_dftest"
2085 echo " Build rawshark : $enable_rawshark"
2087 echo " Install dumpcap with capabilities : $setcap_message"
2088 echo " Install dumpcap setuid : $setuid_message"
2089 echo " Use dumpcap group : $dumpcap_group_message"
2090 echo " Use plugins : $have_plugins"
2091 echo " Use lua library : $lua_message"
2092 echo " Use python binding : $python_message"
2093 echo " Build rtp_player : $portaudio_message"
2094 echo " Use threads : $enable_threads"
2095 echo " Build profile binaries : $enable_profile_build"
2096 echo " Use pcap library : $want_pcap"
2097 echo " Use zlib library : $zlib_message"
2098 echo " Use pcre library : $pcre_message"
2099 echo " Use kerberos library : $krb5_message"
2100 echo " Use c-ares library : $c_ares_message"
2101 echo " Use GNU ADNS library : $adns_message"
2102 echo " Use SMI MIB library : $libsmi_message"
2103 echo " Use GNU crypto library : $gcrypt_message"
2104 echo " Use SSL crypto library : $ssl_message"
2105 echo " Use IPv6 name resolution : $enable_ipv6"
2106 echo " Use gnutls library : $tls_message"
2107 echo " Use POSIX capabilities library : $libcap_message"
2108 echo " Use GeoIP library : $geoip_message"