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
14 dnl AC_CANONICAL_BUILD
17 AM_INIT_AUTOMAKE(wireshark, 0.99.6)
21 dnl Checks for programs.
24 dnl Work around libtool bug (fixed in the version 1.5a?)
25 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
30 AC_PATH_PROG(PERL, perl)
31 AC_PATH_PROG(POD2MAN, pod2man)
32 if test "x$POD2MAN" = x
35 # The alternative is not to build the man pages....
37 AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
39 AC_PATH_PROG(POD2HTML, pod2html)
40 if test "x$POD2HTML" = x
43 # The alternative is not to build the HTML man pages....
45 AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
47 AC_PATH_PROG(HTML_VIEWER, htmlview)
48 if test "x$HTML_VIEWER" = x
50 AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
52 AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
55 AC_PATH_PROG(LEX, flex)
56 AC_PATH_PROG(PYTHON, python)
67 if test "x$CC_FOR_BUILD" = x
71 AC_SUBST(CC_FOR_BUILD)
74 AC_PATH_PROG(DOXYGEN, doxygen)
75 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
76 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
79 AM_PATH_LIBGNUTLS(1.0.0,
81 echo "gnuTLS found, enabling ssl decryption"
82 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use gnutls library])
86 if test x$libgnutls_config_prefix != x ; then
87 AC_MSG_ERROR([[gnuTLS not found; install gnuTLS-devel package for your system]])
89 echo echo "gnuTLS not found, disabling ssl decryption"
96 AM_PATH_LIBGCRYPT(1.1.42,
98 echo "libgcrypt found, enabling ipsec decryption"
99 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
103 if test x$libgcrypt_config_prefix != x ; then
104 AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
106 echo echo "libgcrypt not found, disabling ipsec decryption"
113 AC_PATH_PROG(XSLTPROC, xsltproc)
114 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
115 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
118 AC_PATH_PROG(XMLLINT, xmllint)
119 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
120 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
122 # Check for fop (translate .fo to e.g. pdf)
123 AC_PATH_PROG(FOP, fop)
124 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
125 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
127 # Check for hhc (html help compiler)
128 AC_PATH_PROG(HHC, hhc.exe)
129 AC_CHECK_PROG(HAVE_HHC, hhc.exe, "yes", "no")
130 AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
132 # Check for packaging utilities
133 # For now, we check to see if the various packaging utilites are in our
134 # path. I'm too lazy to write code to go hunt for them. - Gerald
135 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
136 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
137 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
139 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
140 -a x$HAVE_PKGTRANS = xyes ; then
141 HAVE_SVR4_PACKAGING=yes
143 HAVE_SVR4_PACKAGING=no
145 AC_SUBST(HAVE_SVR4_PACKAGING)
147 AC_WIRESHARK_RPM_CHECK
151 # Try to add some additional gcc checks to CFLAGS
153 AC_ARG_ENABLE(extra-gcc-checks,
154 AC_HELP_STRING( [--enable-extra-gcc-checks],
155 [Do additional -W checks in GCC. @<:@default=no@:>@]),
157 wireshark_extra_gcc_flags=$enableval
158 if test $enableval != no
160 AC_WIRESHARK_GCC_CFLAGS_CHECK(-pedantic)
161 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-long-long)
162 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wbad-function-cast)
163 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-qual)
164 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wwrite-strings)
165 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshorten-64-to-32)
166 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wstrict-prototypes)
167 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wmissing-declarations)
170 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wall -W)
171 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdeclaration-after-statement)
172 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wendif-labels)
173 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpointer-arith)
174 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-pointer-sign)
175 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
178 # If we're running gcc add '-D_U_="__attribute__((unused))"' to CFLAGS as well,
179 # so we can use _U_ to flag unused function arguments and not get warnings
180 # about them. Otherwise, add '-D_U_=""', so that _U_ used to flag an unused
181 # function argument will compile with non-GCC compilers.
183 if test "x$GCC" = "xyes" ; then
184 CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
186 CFLAGS="-D_U_=\"\" $CFLAGS"
190 # If we're running gcc, will enable a barrier "stop on warning".
191 # This barrier is set for a very large part of the code. However, it is
192 # typically not set for "generated" code (lex, ans2wrs, idl2wrs, ...)
194 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
195 AC_ARG_ENABLE(warnings-as-errors,
196 AC_HELP_STRING( [--enable-warnings-as-errors],
197 [Treat warnings as errors (only for gcc). @<:@default=yes@:>@]),
199 if test "x$GCC" = "xyes" -a "x$enableval" == "xyes" -a "x$wireshark_extra_gcc_flags" != "xyes"; then
200 with_warnings_as_errors="yes"
203 with_warnings_as_errors="no"
207 if test "x$GCC" = "xyes" -a "x$wireshark_extra_gcc_flags" = "x"; then
208 with_warnings_as_errors="yes"
211 with_warnings_as_errors="no"
215 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
218 # Add any platform-specific compiler flags needed.
220 AC_MSG_CHECKING(for platform-specific compiler flags)
221 if test "x$GCC" = "xyes" ; then
223 # GCC - do any platform-specific tweaking necessary.
227 # the X11 headers don't automatically include prototype info
228 # and a lot don't include the return type
229 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
230 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
234 # See comments above about Apple's lovely C compiler.
236 CFLAGS="-no-cpp-precomp $CFLAGS"
237 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
240 AC_MSG_RESULT(none needed)
245 # Not GCC - assume it's the vendor's compiler.
250 # HP's ANSI C compiler; flags suggested by Jost Martin.
251 # "-Ae" for ANSI C plus extensions such as "long long".
252 # "+O2", for optimization. XXX - works with "-g"?
254 CFLAGS="-Ae +O2 $CFLAGS"
255 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
259 # It may be called "cc", but it's really a GCC derivative
260 # with a problematic special precompiler and precompiled
261 # headers; turn off the special precompiler, as some
262 # apparently-legal code won't compile with its precompiled
265 CFLAGS="-no-cpp-precomp $CFLAGS"
266 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
269 AC_MSG_RESULT(none needed)
275 # Add any platform-specific linker flags needed.
277 AC_MSG_CHECKING(for platform-specific linker flags)
281 # Add -Wl,-single_module to the LDFLAGS used with shared
282 # libraries, to fix some error that show up in some cases;
283 # some Apple documentation recommends it for most shared
286 LDFLAGS_SHAREDLIB="-Wl,-single_module"
288 # Add -Wl,-search_paths_first to make sure that if we search
289 # directories A and B, in that order, for a given library, a
290 # non-shared version in directory A, rather than a shared
291 # version in directory B, is chosen (so we can use
292 # --with-pcap=/usr/local to force all programs to be linked
293 # with a static version installed in /usr/local/lib rather than
294 # the system version in /usr/lib).
296 LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
297 AC_MSG_RESULT([Apple linker - added -Wl,-single_module and -Wl,-search_paths_first])
301 # Shared libraries in cygwin/Win32 must never contain
304 LDFLAGS="$LDFLAGS -no-undefined"
305 AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
308 AC_MSG_RESULT(none needed)
311 AC_SUBST(LDFLAGS_SHAREDLIB)
314 # On OS X, if we find the headers for Core Foundation and Launch Services,
315 # add -framework options to link with Application Services (of which
316 # Launch Services is a subframework) and Core Foundation (required by
317 # the Launch Services APIs), so we can use that to launch a Web browser
318 # from the Help menu.
320 # (Do those headers exist on pure Darwin? If so, does the CoreFoundation
321 # *and* Launch Services code exist there, or are those headers just stubs?
322 # If the frameworks aren't present on Darwin, how *should* we check for
328 AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
330 ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
331 LIBS="$LIBS $ac_frameworks"
334 # include <CoreFoundation/CFBase.h>
335 # include <CoreFoundation/CFString.h>
336 # include <CoreFoundation/CFURL.h>
337 # include <ApplicationServices/ApplicationServices.h>
340 CFStringRef url_CFString;
344 url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
345 url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
346 status = LSOpenCFURLRef(url_CFURL, NULL);
348 ac_cv_can_use_cf_and_ls=yes,
349 ac_cv_can_use_cf_and_ls=no,
350 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
351 if test "$ac_cv_can_use_cf_and_ls" = yes ; then
352 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
353 FRAMEWORKS="$ac_frameworks"
363 dnl Look in /usr/local for header files and libraries ?
364 dnl XXX FIXME don't include /usr/local if it is already in the system
365 dnl search path as this causes gcc 3.2 on Linux to complain about a change
366 dnl of the system search order for includes
367 AC_ARG_ENABLE(usr-local,
368 AC_HELP_STRING( [--enable-usr-local],
369 [look for headers and libs in /usr/local tree. @<:@default=yes@:>@]),
370 ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
372 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
373 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
376 # Arrange that we search for header files in the source directory
377 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
378 # as various packages we use ("libpcap", "zlib", an SNMP library)
379 # may have been installed under "/usr/local/include".
381 CFLAGS="$CFLAGS -I/usr/local/include"
382 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
385 # Arrange that we search for libraries in "/usr/local/lib".
387 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
393 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
398 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
399 if test x$LD_LIBRARY_PATH != x ; then
400 LIBS="$LIBS -R$LD_LIBRARY_PATH"
401 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
403 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
409 # Check for versions of "sed" inadequate to handle, in libtool, a list
410 # of object files as large as the list in Wireshark.
412 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
413 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
414 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
415 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
416 # is the only "sed" that comes with Solaris that can handle Wireshark.
418 # Add any checks here that are necessary for other OSes.
420 AC_WIRESHARK_GNU_SED_CHECK
421 if test "$HAVE_GNU_SED" = no ; then
424 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
426 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
428 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
443 # Enable/disable tshark
445 AC_ARG_ENABLE(wireshark,
446 AC_HELP_STRING( [--enable-wireshark],
447 [build GTK+-based wireshark. @<:@default=yes@:>@]),
448 enable_wireshark=$enableval,enable_wireshark=yes)
451 AC_HELP_STRING( [--disable-gtk2],
452 [build Glib1/Gtk1+-based wireshark/tshark. @<:@default=no@:>@]),
453 enable_gtk2=$enableval,enable_gtk2=yes)
454 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
456 AC_ARG_ENABLE(threads,
457 AC_HELP_STRING( [--enable-threads],
458 [use threads in wireshark. @<:@default=no@:>@]),
459 enable_threads=$enableval,enable_threads=no)
460 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
462 AC_ARG_ENABLE(profile-build,
463 AC_HELP_STRING( [--enable-profile-build],
464 [build profile-ready binaries. @<:@default=no@:>@]),
465 enable_profile_build=$enableval,enable_profile_build=no)
466 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
467 AC_MSG_CHECKING(if profile builds must be generated)
468 if test "x$enable_profile_build" = "xyes" ; then
469 if test "x$GCC" = "xyes" ; then
471 CFLAGS=" -pg $CFLAGS"
474 echo "Building profile binaries currently only supported for GCC."
480 # Create DATAFILE_DIR #define for config.h
481 datafiledir=$datadir/wireshark
483 test "x$prefix" = xNONE && prefix=$ac_default_prefix
484 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
485 # Ugly hack, but I don't see how this problem can be solved
486 # properly that DATAFILE_DIR had a value starting with
487 # "${prefix}/" instead of e.g. "/usr/local/"
488 eval eval echo "$datafiledir"
490 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
493 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
494 # programs to be built with GTK+.
496 if test "x$enable_gtk2" = "xyes" -a "x$enable_wireshark" = "xyes" ; then
498 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
499 elif test "x$enable_gtk2" != "xyes" -a "x$enable_wireshark" = "xyes" ; then
501 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
507 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
508 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
509 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
510 # set when generating the Makefile, so we can make programs that require
511 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
512 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
513 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
514 # programs to be built with GLib.
516 if test "$GTK_OK" = "no" ; then
517 enable_wireshark="no"
521 if test "x$enable_gtk2" = "xyes" ; then
522 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
524 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
527 wireshark_bin="wireshark\$(EXEEXT)"
528 wireshark_man="wireshark.1"
529 wireshark_SUBDIRS="codecs gtk"
531 if test "$GTK_OK" = "two" ; then
532 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
534 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
539 # Check whether GLib modules are supported, to determine whether we
540 # can support plugins.
542 AC_MSG_CHECKING(whether GLib supports loadable modules)
543 ac_save_CFLAGS="$CFLAGS"
545 CFLAGS="$CFLAGS $GLIB_CFLAGS"
546 LIBS="$GLIB_LIBS $LIBS"
556 if (g_module_supported())
557 return 0; /* success */
559 return 1; /* failure */
561 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
562 [echo $ac_n "cross compiling; assumed OK... $ac_c"
563 ac_cv_glib_supports_modules=yes])
564 CFLAGS="$ac_save_CFLAGS"
566 if test "$ac_cv_glib_supports_modules" = yes ; then
575 # We can't just check for <inttypes.h> - some systems have one that
576 # doesn't define all the PRI[doxu]64 macros.
578 AC_CHECK_HEADERS(inttypes.h,
581 # OK, we have inttypes.h, but does it define those macros?
583 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
588 #include <inttypes.h>
591 #include <sys/types.h>
595 printf("%" PRId64 "\n", (gint64)1);
596 printf("%" PRIo64 "\n", (guint64)1);
597 printf("%" PRIx64 "\n", (guint64)1);
598 printf("%" PRIX64 "\n", (guint64)1);
599 printf("%" PRIu64 "\n", (guint64)1);
605 ac_wireshark_inttypes_h_defines_formats=yes
609 ac_wireshark_inttypes_h_defines_formats=no
614 # We don't have inttypes.h, so it obviously can't define those
617 ac_wireshark_inttypes_h_defines_formats=no
619 if test "$ac_wireshark_inttypes_h_defines_formats" = yes; then
620 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
622 AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
624 AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
626 AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
628 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
634 AC_SUBST(wireshark_bin)
635 AC_SUBST(wireshark_man)
637 rdps_bin="rdps\$(EXEEXT)"
641 # Enable/disable tshark
643 AC_ARG_ENABLE(tshark,
644 AC_HELP_STRING( [--enable-tshark],
645 [build tshark. @<:@default=yes@:>@]),
646 tshark=$enableval,enable_tshark=yes)
648 if test "x$enable_tshark" = "xyes" ; then
649 tshark_bin="tshark\$(EXEEXT)"
650 tshark_man="tshark.1"
651 wiresharkfilter_man="wireshark-filter.4"
658 AC_SUBST(wiresharkfilter_man)
662 # Enable/disable editcap
664 AC_ARG_ENABLE(editcap,
665 AC_HELP_STRING( [--enable-editcap],
666 [build editcap. @<:@default=yes@:>@]),
667 enable_editcap=$enableval,enable_editcap=yes)
669 if test "x$enable_editcap" = "xyes" ; then
670 editcap_bin="editcap\$(EXEEXT)"
671 editcap_man="editcap.1"
676 AC_SUBST(editcap_bin)
677 AC_SUBST(editcap_man)
680 # Enable/disable dumpcap
682 AC_ARG_ENABLE(dumpcap,
683 AC_HELP_STRING( [--enable-dumpcap],
684 [build dumpcap. @<:@default=yes@:>@]),
685 enable_dumpcap=$enableval,enable_dumpcap=yes)
687 if test "x$enable_dumpcap" = "xyes" ; then
688 dumpcap_bin="dumpcap\$(EXEEXT)"
689 dumpcap_man="dumpcap.1"
694 AC_SUBST(dumpcap_bin)
695 AC_SUBST(dumpcap_man)
698 # Enable/disable capinfos
700 AC_ARG_ENABLE(capinfos,
701 AC_HELP_STRING( [--enable-capinfos],
702 [build capinfos. @<:@default=yes@:>@]),
703 enable_capinfos=$enableval,enable_capinfos=yes)
705 if test "x$enable_capinfos" = "xyes" ; then
706 capinfos_bin="capinfos\$(EXEEXT)"
707 capinfos_man="capinfos.1"
712 AC_SUBST(capinfos_bin)
713 AC_SUBST(capinfos_man)
716 # Enable/disable mergecap
718 AC_ARG_ENABLE(mergecap,
719 AC_HELP_STRING( [--enable-mergecap],
720 [build mergecap. @<:@default=yes@:>@]),
721 enable_mergecap=$enableval,enable_mergecap=yes)
723 if test "x$enable_mergecap" = "xyes" ; then
724 mergecap_bin="mergecap\$(EXEEXT)"
725 mergecap_man="mergecap.1"
730 AC_SUBST(mergecap_bin)
731 AC_SUBST(mergecap_man)
734 # Enable/disable text2pcap
736 AC_ARG_ENABLE(text2pcap,
737 AC_HELP_STRING( [--enable-text2pcap],
738 [build text2pcap. @<:@default=yes@:>@]),
739 text2pcap=$enableval,enable_text2pcap=yes)
741 if test "x$enable_text2pcap" = "xyes" ; then
742 text2pcap_bin="text2pcap\$(EXEEXT)"
743 text2pcap_man="text2pcap.1"
748 AC_SUBST(text2pcap_bin)
749 AC_SUBST(text2pcap_man)
751 # Enable/disable idl2wrs
753 AC_ARG_ENABLE(idl2wrs,
754 AC_HELP_STRING( [--enable-idl2wrs],
755 [build idl2wrs. @<:@default=yes@:>@]),
756 enable_idl2wrs=$enableval,enable_idl2wrs=yes)
758 if test "x$enable_idl2wrs" = "xyes" ; then
759 idl2wrs_bin="idl2wrs"
760 idl2wrs_man="idl2wrs.1"
765 AC_SUBST(idl2wrs_bin)
766 AC_SUBST(idl2wrs_man)
769 # Enable/disable dftest
771 AC_ARG_ENABLE(dftest,
772 AC_HELP_STRING( [--enable-dftest],
773 [build dftest. @<:@default=yes@:>@]),
774 enable_dftest=$enableval,enable_dftest=yes)
776 if test "x$enable_dftest" = "xyes" ; then
777 dftest_bin="dftest\$(EXEEXT)"
784 # Enable/disable randpkt
786 AC_ARG_ENABLE(randpkt,
787 AC_HELP_STRING( [--enable-randpkt],
788 [build randpkt. @<:@default=yes@:>@]),
789 enable_randpkt=$enableval,enable_randpkt=yes)
791 if test "x$enable_randpkt" = "xyes" ; then
792 randpkt_bin="randpkt\$(EXEEXT)"
796 AC_SUBST(randpkt_bin)
799 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
800 dnl "gethostbyname()".
801 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
803 dnl Checks for "connect()", used as a proxy for "socket()" - and
804 dnl "-lsocket", if we need it to get "connect()".
805 AC_WIRESHARK_SOCKET_LIB_CHECK
808 AC_MSG_CHECKING(whether to use libpcap for packet capture)
811 AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
812 [use libpcap for packet capturing. @<:@default=yes@:>@]),
814 if test $withval = no
817 elif test $withval = yes
828 if test "x$want_pcap" = "xno" ; then
832 AC_WIRESHARK_PCAP_CHECK
836 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
839 AC_HELP_STRING( [--with-zlib@<:@=DIR@:>@],
840 [use zlib (located in directory DIR, if supplied) to read compressed data. @<:@default=yes, if available@:>@]),
842 if test $withval = no
845 elif test $withval = yes
854 # Use zlib if it's present, otherwise don't.
856 want_zlib=ifavailable
859 if test "x$want_zlib" = "xno" ; then
863 AC_WIRESHARK_ZLIB_CHECK
864 if test "x$want_zlib" = "xno" ; then
865 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
871 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
874 AC_HELP_STRING( [--with-pcre@<:@=DIR@:>@],
875 [use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. @<:@default=yes, if available@:>@]),
877 if test $withval = no
880 elif test $withval = yes
889 # Use libpcre if it's present, otherwise don't.
891 want_pcre=ifavailable
894 if test "x$want_pcre" = "xno" ; then
898 AC_WIRESHARK_LIBPCRE_CHECK
899 if test "x$want_pcre" = "xno" ; then
900 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
906 AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
909 AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
910 [use liblua (located in directory DIR, if supplied) for the lua scripting plugin. @<:@default=no@:>@]),
912 if test $withval = no
915 elif test $withval = yes
924 # Don't use liblua by default (it isn't ready yet)
929 if test "x$want_lua" = "xno" ; then
933 AC_WIRESHARK_LIBLUA_CHECK
934 if test "x$want_lua" = "xno" ; then
935 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
938 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
942 AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
944 AC_ARG_WITH(portaudio,
945 AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
946 [use libportaudio (located in directory DIR, if supplied) for the rtp_player. @<:@default=yes, if available@:>@]),
948 if test $withval = no
951 elif test $withval = yes
956 portaudio_dir=$withval
960 # Use libportaudio by default
962 want_portaudio=ifavailable
965 if test "x$want_portaudio" = "xno" ; then
969 AC_WIRESHARK_LIBPORTAUDIO_CHECK
970 if test "x$want_portaudio" = "xno" ; then
971 AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
974 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
979 AC_HELP_STRING( [--enable-ipv6],
980 [use ipv6 name resolution, if available. @<:@default=yes@:>@]),
981 enable_ipv6=$enableval,enable_ipv6=yes)
983 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
984 if test "x$enable_ipv6" = "xno" ; then
988 AC_WIRESHARK_IPV6_STACK
992 dnl Check if wireshark should be installed setuid
993 AC_ARG_ENABLE(setuid-install,
994 AC_HELP_STRING( [--enable-setuid-install],
995 [install wireshark as setuid. DANGEROUS!!! @<:@default=no@:>@]),
996 enable_setuid_install=$enableval,enable_setuid_install=no)
998 AC_MSG_CHECKING(whether to install wireshark setuid)
999 if test "x$enable_setuid_install" = "xno" ; then
1002 if test "x$enable_dumpcap" = "xno" ; then
1003 AC_MSG_ERROR(Setuid install works only with --enable-dumpcap, but dumpcap disabled)
1009 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
1011 dnl Checks for header files.
1013 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
1014 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)
1015 AC_CHECK_HEADERS(netinet/in.h)
1016 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
1023 AC_MSG_CHECKING(whether to use SSL library)
1026 AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
1027 [use SSL crypto library (located in directory DIR, if supplied). @<:@default=no@:>@]),
1029 if test "x$withval" = "xno"; then
1031 elif test "x$withval" = "xyes"; then
1033 elif test -d "$withval"; then
1035 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1040 if test "x$want_ssl" = "xyes"; then
1042 AC_CHECK_LIB(crypto,EVP_md5,
1047 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
1057 AC_ARG_WITH(net-snmp,
1058 AC_HELP_STRING( [--with-net-snmp@<:@=PATH@:>@],
1059 [use Net-SNMP library (with PATH as the location of the net-snmp-config shell script that comes with the net-snmp package, if supplied) @<:@default=yes, if available@:>@]),
1061 if test $withval = no
1064 elif test $withval = yes
1069 netsnmpconfig="$withval"
1073 # Set "want_netsnmp" to "ifavailable" to make the default "use it
1074 # if you find it, otherwise don't".
1076 want_netsnmp=ifavailable
1082 AC_MSG_CHECKING(whether to use Net-SNMP library)
1083 if test "x$want_netsnmp" = "xno" ; then
1086 if test "x$want_netsnmp" = "xifavailable" ; then
1087 AC_MSG_RESULT([yes, if available])
1091 AC_WIRESHARK_NETSNMP_CHECK
1094 if test "x$have_net_snmp" = "xyes"; then
1095 AC_DEFINE(HAVE_NET_SNMP, 1, [Define to 1 if Net-SNMP support is to be used])
1102 AC_MSG_CHECKING(whether to use kerberos)
1105 AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
1106 [use kerberos (located in directory DIR, if supplied) to use in kerberos dissection @<:@default=yes@:>@]),
1108 if test $withval = no
1111 elif test $withval = yes
1120 # Use kerberos if specified, otherwise don't.
1122 want_krb5=ifavailable
1125 if test "x$want_krb5" = "xno" ; then
1129 AC_WIRESHARK_KRB5_CHECK
1135 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
1138 AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
1139 [use GNU ADNS (located in directory DIR, if supplied). @<:@default=yes, if present@:>@]),
1141 if test "x$withval" = "xno"; then
1143 elif test "x$withval" = "xyes"; then
1145 elif test -d "$withval"; then
1147 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1150 if test "x$with_adns" = "xno" ; then
1154 AC_WIRESHARK_ADNS_CHECK
1159 # Define WS_VAR_IMPORT appropriately for declarations of external
1160 # variables exported from dynamically-linked libraries.
1162 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
1165 # Define HAVE_AIRPDCAP
1166 # We'll want to remove this eventually.
1168 AC_DEFINE(HAVE_AIRPDCAP, 1, [Enable AirPDcap (WPA/WPA2 decryption)])
1170 dnl Checks for typedefs, structures, and compiler characteristics.
1173 # We need to know whether "struct sockaddr" has an "sa_len" member
1174 # for get_interface_list().
1176 AC_WIRESHARK_STRUCT_SA_LEN
1178 # We must know our byte order
1181 # Checks whether "-traditional" is needed when using "ioctl".
1182 # XXX - do we need this?
1183 AC_PROG_GCC_TRADITIONAL
1187 AC_CHECK_FUNC(getopt, GETOPT_O="",
1188 [GETOPT_O="getopt.o"
1189 AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h needs to be included])
1191 if test "$ac_cv_func_getopt" = no ; then
1198 AC_CHECK_FUNC(strerror, STRERROR_O="",
1199 [STRERROR_O="strerror.o"
1200 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
1202 if test "$ac_cv_func_strerror" = no ; then
1203 STRERROR_C="strerror.c"
1204 STRERROR_O="strerror.o"
1206 AC_SUBST(STRERROR_C)
1207 AC_SUBST(STRERROR_O)
1209 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
1210 STRCASECMP_O="strcasecmp.o")
1211 if test "$ac_cv_func_strcasecmp" = no ; then
1212 STRCASECMP_C="strcasecmp.c"
1213 STRCASECMP_O="strcasecmp.o"
1215 AC_SUBST(STRCASECMP_C)
1216 AC_SUBST(STRCASECMP_O)
1218 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
1219 STRNCASECMP_O="strncasecmp.o")
1220 if test "$ac_cv_func_strncasecmp" = no ; then
1221 STRNCASECMP_C="strncasecmp.c"
1222 STRNCASECMP_O="strncasecmp.o"
1224 AC_SUBST(STRNCASECMP_C)
1225 AC_SUBST(STRNCASECMP_O)
1227 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1228 MKSTEMP_O="mkstemp.o")
1229 if test "$ac_cv_func_mkstemp" = no ; then
1230 MKSTEMP_C="mkstemp.c"
1231 MKSTEMP_O="mkstemp.o"
1236 ac_save_LIBS="$LIBS"
1237 LIBS="$GLIB_LIBS $LIBS"
1238 G_ASCII_STRTOULL_C=""
1239 G_ASCII_STRTOULL_O=""
1240 G_ASCII_STRTOULL_LO=""
1241 AC_CHECK_FUNC(g_ascii_strtoull,
1242 [G_ASCII_STRTOULL_O=""
1243 G_ASCII_STRTOULL_LO=""],
1244 [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1245 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1246 AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1248 LIBS="$ac_save_LIBS"
1249 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1250 G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1251 G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1252 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1254 AC_SUBST(G_ASCII_STRTOULL_C)
1255 AC_SUBST(G_ASCII_STRTOULL_O)
1256 AC_SUBST(G_ASCII_STRTOULL_LO)
1258 AC_CHECK_FUNC(inet_aton,
1261 [INET_ATON_O="inet_aton.o"
1262 INET_ATON_LO="inet_aton.lo"
1264 if test "$ac_cv_func_inet_aton" = no ; then
1265 INET_ATON_C="inet_aton.c"
1266 INET_ATON_O="inet_aton.o"
1267 INET_ATON_LO="inet_aton.lo"
1268 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1270 AC_SUBST(INET_ATON_C)
1271 AC_SUBST(INET_ATON_O)
1272 AC_SUBST(INET_ATON_LO)
1274 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1275 dnl check for pre-BIND82 inet_pton() bug.
1276 AC_MSG_CHECKING(for broken inet_pton)
1277 AC_TRY_RUN([#include <sys/types.h>
1278 #include <sys/socket.h>
1279 #include <netinet/in.h>
1280 #include <arpa/inet.h>
1285 /* this should return 0 (error) */
1286 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1290 }], [AC_MSG_RESULT(ok);
1291 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1292 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1293 have_inet_pton=no])],
1295 if test "$have_inet_pton" = no; then
1296 INET_PTON_C="inet_pton.c"
1297 INET_PTON_O="inet_pton.o"
1298 INET_PTON_LO="inet_pton.lo"
1304 AC_SUBST(INET_PTON_C)
1305 AC_SUBST(INET_PTON_O)
1306 AC_SUBST(INET_PTON_LO)
1308 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1309 AC_MSG_CHECKING([for inet_ntop prototype])
1310 AC_TRY_COMPILE([#include <stdio.h>
1311 #include <sys/types.h>
1312 #include <sys/socket.h>
1313 #include <netinet/in.h>
1314 #include <arpa/inet.h>
1316 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1318 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1319 [Define if inet_ntop() prototype exists])], [
1320 AC_TRY_COMPILE([#include <stdio.h>
1321 #include <sys/types.h>
1322 #include <sys/socket.h>
1323 #include <netinet/in.h>
1324 #include <arpa/inet.h>
1326 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1328 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1329 [Define if inet_ntop() prototype exists])], [
1330 AC_MSG_RESULT(no)])])
1333 INET_NTOP_C="inet_ntop.c"
1334 INET_NTOP_O="inet_ntop.o"
1335 INET_NTOP_LO="inet_ntop.lo"
1336 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1337 [Define if inet/v6defs.h needs to be included])])
1338 AC_SUBST(INET_NTOP_C)
1339 AC_SUBST(INET_NTOP_O)
1340 AC_SUBST(INET_NTOP_LO)
1342 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1343 [STRPTIME_O="strptime.o"
1344 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1346 if test "$ac_cv_func_strptime" = no ; then
1347 STRPTIME_C="strptime.c"
1348 STRPTIME_O="strptime.o"
1350 AC_SUBST(STRPTIME_C)
1351 AC_SUBST(STRPTIME_O)
1353 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1354 AC_CHECK_FUNCS(issetugid)
1355 AC_CHECK_FUNCS(mmap mprotect sysconf)
1357 dnl blank for now, but will be used in future
1358 AC_SUBST(wireshark_SUBDIRS)
1361 dnl check whether plugins should be enabled and, if they should be,
1362 dnl check for plugins directory - stolen from Amanda's configure.in
1364 plugindir="$libdir/wireshark/plugins/$VERSION"
1365 AC_ARG_WITH(plugins,
1366 AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
1367 [support plugins (installed in DIR, if supplied). @<:@default=yes, if possible@:>@]),
1371 if test x$have_plugins = xno
1373 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1380 if test x$have_plugins = xno
1382 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1384 plugindir="$withval"
1389 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1390 if test x$have_plugins = xyes
1392 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1394 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1395 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1396 eval echo "$plugindir"
1398 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1400 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1405 # The plugin dissectors reside in ./plugins/PROTO/
1407 PLUGIN_LIBS="-L../../epan -lwireshark $GLIB_LIBS"
1408 AC_SUBST(PLUGIN_LIBS)
1412 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1413 # (autoconf? automake? libtool?) - with the newer version(s), it's
1414 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1416 # With older version(s) of those tool(s), however, it's not just an
1417 # alias, and the configure scripts don't work without it.
1420 AC_SUBST(LIBTOOL_DEPS)
1422 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1423 if test x$enable_static = xyes -a x$have_plugins = xyes
1425 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
1427 AC_SUBST(ENABLE_STATIC)
1429 dnl Save the cacheable configure results to config.cache before recursing
1432 AM_CONFIG_HEADER(config.h)
1433 AC_CONFIG_SUBDIRS(wiretap)
1442 epan/dfilter/Makefile
1443 epan/dissectors/Makefile
1444 epan/ftypes/Makefile
1451 packaging/nsis/Makefile
1452 packaging/rpm/Makefile
1453 packaging/rpm/SPECS/Makefile
1454 packaging/rpm/SPECS/wireshark.spec
1455 packaging/svr4/Makefile
1456 packaging/svr4/checkinstall
1457 packaging/svr4/pkginfo
1459 plugins/agentx/Makefile
1460 plugins/artnet/Makefile
1461 plugins/asn1/Makefile
1462 plugins/ciscosm/Makefile
1463 plugins/docsis/Makefile
1464 plugins/enttec/Makefile
1465 plugins/giop/Makefile
1466 plugins/gryphon/Makefile
1467 plugins/h223/Makefile
1468 plugins/irda/Makefile
1469 plugins/lwres/Makefile
1470 plugins/mate/Makefile
1471 plugins/mgcp/Makefile
1472 plugins/opsi/Makefile
1473 plugins/pcli/Makefile
1474 plugins/profinet/Makefile
1475 plugins/rlm/Makefile
1476 plugins/rtnet/Makefile
1477 plugins/rudp/Makefile
1478 plugins/sbus/Makefile
1479 plugins/stats_tree/Makefile
1480 plugins/v5ua/Makefile
1483 tools/lemon/Makefile
1489 if test "x$enable_setuid_install" = "xyes" ; then
1490 setuid_message="yes (DANGEROUS!!!)"
1495 if test "x$want_zlib" = "xno" ; then
1501 if test "x$want_pcre" = "xno" ; then
1507 if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
1513 if test "x$want_portaudio" = "xyes" ; then
1514 portaudio_message="yes"
1516 portaudio_message="no"
1519 if test "x$want_ssl" = "xno" ; then
1525 if test "x$want_krb5" = "xno" ; then
1528 krb5_message="yes ($ac_krb5_version)"
1531 if test "x$have_good_adns" = "xyes" ; then
1537 if test "x$have_net_snmp" = "xyes" ; then
1538 snmp_libs_message="yes"
1540 snmp_libs_message="no"
1544 echo "The Wireshark package has been configured with the following options."
1545 echo " Build wireshark : $enable_wireshark"
1546 echo " Build tshark : $enable_tshark"
1547 echo " Build capinfos : $enable_capinfos"
1548 echo " Build editcap : $enable_editcap"
1549 echo " Build dumpcap : $enable_dumpcap"
1550 echo " Build mergecap : $enable_mergecap"
1551 echo " Build text2pcap : $enable_text2pcap"
1552 echo " Build idl2wrs : $enable_idl2wrs"
1553 echo " Build randpkt : $enable_randpkt"
1554 echo " Build dftest : $enable_dftest"
1556 echo " Install setuid : $setuid_message"
1557 echo " Use plugins : $have_plugins"
1558 echo " Build lua plugin : $lua_message"
1559 echo " Build rtp_player : $portaudio_message"
1560 echo " Use GTK+ v2 library : $enable_gtk2"
1561 if test "x$enable_gtk2" = "xyes" ; then
1562 echo " Use threads : $enable_threads"
1563 echo " Build profile binaries : $enable_profile_build"
1565 echo " Use pcap library : $want_pcap"
1566 echo " Use zlib library : $zlib_message"
1567 echo " Use pcre library : $pcre_message"
1568 echo " Use kerberos library : $krb5_message"
1569 echo " Use GNU ADNS library : $adns_message"
1570 echo " Use GNU crypto library : $gcrypt_message"
1571 echo " Use SSL crypto library : $ssl_message"
1572 echo " Use IPv6 name resolution : $enable_ipv6"
1573 echo " Use Net-SNMP library : $snmp_libs_message"
1574 echo " Use gnutls library : $tls_message"