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.5)
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 # If we're running gcc, add '-Wall -W' to CFLAGS, and add
152 # '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
153 # flag unused function arguments and not get warnings about them.
154 # If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
155 # -Wcast-align" as well. (Add more checks here in the future?)
157 # Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
158 # argument will compile with non-GCC compilers.
160 AC_ARG_WITH(extra-gcc-checks,
161 [ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
163 if test $withval != no
165 wireshark_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings"
168 AC_MSG_CHECKING(to see if we can add '-Wall -W $wireshark_extra_gcc_flags' to CFLAGS)
169 if test x$GCC != x ; then
170 CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -Wpointer-arith -W $wireshark_extra_gcc_flags $CFLAGS"
173 CFLAGS="-D_U_=\"\" $CFLAGS"
178 # Add any platform-specific compiler flags needed.
180 AC_MSG_CHECKING(for platform-specific compiler flags)
184 # Not GCC - assume it's the vendor's compiler.
189 # HP's ANSI C compiler; flags suggested by Jost Martin.
190 # "-Ae" for ANSI C plus extensions such as "long long".
191 # "+O2", for optimization. XXX - works with "-g"?
193 CFLAGS="-Ae +O2 $CFLAGS"
194 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
198 # It may be called "cc", but it's really a GCC derivative
199 # with a problematic special precompiler and precompiled
200 # headers; turn off the special precompiler, as some
201 # apparently-legal code won't compile with its precompiled
204 CFLAGS="-no-cpp-precomp $CFLAGS"
205 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
208 AC_MSG_RESULT(none needed)
214 # the X11 headers don't automatically include prototype info
215 # and a lot don't include the return type
216 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
217 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
221 # See comments above about Apple's lovely C compiler.
223 CFLAGS="-no-cpp-precomp $CFLAGS"
224 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
227 AC_MSG_RESULT(none needed)
233 # Add any platform-specific linker flags needed.
235 AC_MSG_CHECKING(for platform-specific linker flags)
239 # Add -Wl,-single_module to the LDFLAGS used with shared
240 # libraries, to fix some error that show up in some cases;
241 # some Apple documentation recommends it for most shared
244 SHAREDLIB_LDFLAGS="-Wl,-single_module"
246 # Add -Wl,-search_paths_first to make sure that if we search
247 # directories A and B, in that order, for a given library, a
248 # non-shared version in directory A, rather than a shared
249 # version in directory B, is chosen (so we can use
250 # --with-pcap=/usr/local to force all programs to be linked
251 # with a static version installed in /usr/local/lib rather than
252 # the system version in /usr/lib).
254 LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
255 AC_MSG_RESULT(Apple linker - added -Wl,-single_module and -Wl,-search_paths_first)
259 # Shared libraries in cygwin/Win32 must never contain
262 LDFLAGS="$LDFLAGS -no-undefined"
263 AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
266 AC_MSG_RESULT(none needed)
269 AC_SUBST(SHAREDLIB_LDFLAGS)
272 # On OS X, if we find the headers for Core Foundation and Launch Services,
273 # add -framework options to link with Application Services (of which
274 # Launch Services is a subframework) and Core Foundation (required by
275 # the Launch Services APIs), so we can use that to launch a Web browser
276 # from the Help menu.
278 # (Do those headers exist on pure Darwin? If so, does the CoreFoundation
279 # *and* Launch Services code exist there, or are those headers just stubs?
280 # If the frameworks aren't present on Darwin, how *should* we check for
286 AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
288 ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
289 LIBS="$LIBS $ac_frameworks"
292 # include <CoreFoundation/CFBase.h>
293 # include <CoreFoundation/CFString.h>
294 # include <CoreFoundation/CFURL.h>
295 # include <ApplicationServices/ApplicationServices.h>
298 CFStringRef url_CFString;
302 url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
303 url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
304 status = LSOpenCFURLRef(url_CFURL, NULL);
306 ac_cv_can_use_cf_and_ls=yes,
307 ac_cv_can_use_cf_and_ls=no,
308 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
309 if test "$ac_cv_can_use_cf_and_ls" = yes ; then
310 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
311 FRAMEWORKS="$ac_frameworks"
321 dnl Look in /usr/local for header files and libraries ?
322 dnl XXX FIXME don't include /usr/local if it is already in the system
323 dnl search path as this causes gcc 3.2 on Linux to complain about a change
324 dnl of the system search order for includes
325 AC_ARG_ENABLE(usr-local,
326 [ --enable-usr-local look for headers and libs in /usr/local tree. [default=yes]],ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
328 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
329 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
332 # Arrange that we search for header files in the source directory
333 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
334 # as various packages we use ("libpcap", "zlib", an SNMP library)
335 # may have been installed under "/usr/local/include".
337 CFLAGS="$CFLAGS -I/usr/local/include"
338 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
341 # Arrange that we search for libraries in "/usr/local/lib".
343 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
349 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
354 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
355 if test x$LD_LIBRARY_PATH != x ; then
356 LIBS="$LIBS -R$LD_LIBRARY_PATH"
357 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
359 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
365 # Check for versions of "sed" inadequate to handle, in libtool, a list
366 # of object files as large as the list in Wireshark.
368 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
369 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
370 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
371 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
372 # is the only "sed" that comes with Solaris that can handle Wireshark.
374 # Add any checks here that are necessary for other OSes.
376 AC_WIRESHARK_GNU_SED_CHECK
377 if test "$HAVE_GNU_SED" = no ; then
380 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
382 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
384 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
399 # Enable/disable tshark
401 AC_ARG_ENABLE(wireshark,
402 [ --enable-wireshark build GTK+-based wireshark. [default=yes]],enable_wireshark=$enableval,enable_wireshark=yes)
405 [ --disable-gtk2 build Glib1/Gtk1+-based wireshark. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
406 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
408 AC_ARG_ENABLE(threads,
409 [ --enable-threads use threads in wireshark. [default=no]],enable_threads=$enableval,enable_threads=no)
410 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
412 AC_ARG_ENABLE(profile-build,
413 [ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
414 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
415 AC_MSG_CHECKING(if profile builds must be generated)
416 if test "x$enable_profile_build" = "xyes" ; then
417 if test -n "$GCC" ; then
419 CFLAGS=" -pg $CFLAGS"
422 echo "Building profile binaries currently only supported for GCC."
428 # Create DATAFILE_DIR #define for config.h
429 datafiledir=$datadir/wireshark
431 test "x$prefix" = xNONE && prefix=$ac_default_prefix
432 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
433 # Ugly hack, but I don't see how this problem can be solved
434 # properly that DATAFILE_DIR had a value starting with
435 # "${prefix}/" instead of e.g. "/usr/local/"
436 eval eval echo "$datafiledir"
438 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
441 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
442 # programs to be built with GTK+.
444 if test "x$enable_gtk2" = "xyes" -a "x$enable_wireshark" = "xyes" ; then
446 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
447 elif test "x$enable_gtk2" != "xyes" -a "x$enable_wireshark" = "xyes" ; then
449 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
455 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
456 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
457 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
458 # set when generating the Makefile, so we can make programs that require
459 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
460 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
461 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
462 # programs to be built with GLib.
464 if test "$GTK_OK" = "no" ; then
465 enable_wireshark="no"
469 if test "x$enable_gtk2" = "xyes" ; then
470 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
472 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
475 wireshark_bin="wireshark\$(EXEEXT)"
476 wireshark_man="wireshark.1"
477 wireshark_SUBDIRS="codecs gtk"
479 if test "$GTK_OK" = "two" ; then
480 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
482 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
487 # Check whether GLib modules are supported, to determine whether we
488 # can support plugins.
490 AC_MSG_CHECKING(whether GLib supports loadable modules)
491 ac_save_CFLAGS="$CFLAGS"
493 CFLAGS="$CFLAGS $GLIB_CFLAGS"
494 LIBS="$GLIB_LIBS $LIBS"
504 if (g_module_supported())
505 return 0; /* success */
507 return 1; /* failure */
509 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
510 [echo $ac_n "cross compiling; assumed OK... $ac_c"
511 ac_cv_glib_supports_modules=yes])
512 CFLAGS="$ac_save_CFLAGS"
514 if test "$ac_cv_glib_supports_modules" = yes ; then
523 # We can't just check for <inttypes.h> - some systems have one that
524 # doesn't define all the PRI[doxu]64 macros.
526 AC_CHECK_HEADERS(inttypes.h,
529 # OK, we have inttypes.h, but does it define those macros?
531 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
536 #include <inttypes.h>
539 #include <sys/types.h>
543 printf("%" PRId64 "\n", (gint64)1);
544 printf("%" PRIo64 "\n", (guint64)1);
545 printf("%" PRIx64 "\n", (guint64)1);
546 printf("%" PRIX64 "\n", (guint64)1);
547 printf("%" PRIu64 "\n", (guint64)1);
553 ac_wireshark_inttypes_h_defines_formats=yes
557 ac_wireshark_inttypes_h_defines_formats=no
562 # We don't have inttypes.h, so it obviously can't define those
565 ac_wireshark_inttypes_h_defines_formats=no
567 if test "$ac_wireshark_inttypes_h_defines_formats" = yes; then
568 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
570 AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
572 AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
574 AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
576 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
582 AC_SUBST(wireshark_bin)
583 AC_SUBST(wireshark_man)
585 rdps_bin="rdps\$(EXEEXT)"
589 # Enable/disable tshark
591 AC_ARG_ENABLE(tshark,
592 [ --enable-tshark build tshark. [default=yes]],tshark=$enableval,enable_tshark=yes)
594 if test "x$enable_tshark" = "xyes" ; then
595 tshark_bin="tshark\$(EXEEXT)"
596 tshark_man="tshark.1"
597 wiresharkfilter_man="wireshark-filter.4"
604 AC_SUBST(wiresharkfilter_man)
608 # Enable/disable editcap
610 AC_ARG_ENABLE(editcap,
611 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
613 if test "x$enable_editcap" = "xyes" ; then
614 editcap_bin="editcap\$(EXEEXT)"
615 editcap_man="editcap.1"
620 AC_SUBST(editcap_bin)
621 AC_SUBST(editcap_man)
624 # Enable/disable dumpcap
626 AC_ARG_ENABLE(dumpcap,
627 [ --enable-dumpcap build dumpcap. [default=yes]],enable_dumpcap=$enableval,enable_dumpcap=yes)
629 if test "x$enable_dumpcap" = "xyes" ; then
630 dumpcap_bin="dumpcap\$(EXEEXT)"
631 dumpcap_man="dumpcap.1"
636 AC_SUBST(dumpcap_bin)
637 AC_SUBST(dumpcap_man)
640 # Enable/disable capinfos
642 AC_ARG_ENABLE(capinfos,
643 [ --enable-capinfos build capinfos. [default=yes]],enable_capinfos=$enableval,enable_capinfos=yes)
645 if test "x$enable_capinfos" = "xyes" ; then
646 capinfos_bin="capinfos\$(EXEEXT)"
647 capinfos_man="capinfos.1"
652 AC_SUBST(capinfos_bin)
653 AC_SUBST(capinfos_man)
656 # Enable/disable mergecap
658 AC_ARG_ENABLE(mergecap,
659 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
661 if test "x$enable_mergecap" = "xyes" ; then
662 mergecap_bin="mergecap\$(EXEEXT)"
663 mergecap_man="mergecap.1"
668 AC_SUBST(mergecap_bin)
669 AC_SUBST(mergecap_man)
672 # Enable/disable text2pcap
674 AC_ARG_ENABLE(text2pcap,
675 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
677 if test "x$enable_text2pcap" = "xyes" ; then
678 text2pcap_bin="text2pcap\$(EXEEXT)"
679 text2pcap_man="text2pcap.1"
684 AC_SUBST(text2pcap_bin)
685 AC_SUBST(text2pcap_man)
687 # Enable/disable idl2wrs
689 AC_ARG_ENABLE(idl2wrs,
690 [ --enable-idl2wrs build idl2wrs. [default=yes]],enable_idl2wrs=$enableval,enable_idl2wrs=yes)
692 if test "x$enable_idl2wrs" = "xyes" ; then
693 idl2wrs_bin="idl2wrs"
694 idl2wrs_man="idl2wrs.1"
699 AC_SUBST(idl2wrs_bin)
700 AC_SUBST(idl2wrs_man)
703 # Enable/disable dftest
705 AC_ARG_ENABLE(dftest,
706 [ --enable-dftest build dftest. [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
708 if test "x$enable_dftest" = "xyes" ; then
709 dftest_bin="dftest\$(EXEEXT)"
716 # Enable/disable randpkt
718 AC_ARG_ENABLE(randpkt,
719 [ --enable-randpkt build randpkt. [default=yes]],enable_randpkt=$enableval,enable_randpkt=yes)
721 if test "x$enable_randpkt" = "xyes" ; then
722 randpkt_bin="randpkt\$(EXEEXT)"
726 AC_SUBST(randpkt_bin)
729 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
730 dnl "gethostbyname()".
731 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
733 dnl Checks for "connect()", used as a proxy for "socket()" - and
734 dnl "-lsocket", if we need it to get "connect()".
735 AC_WIRESHARK_SOCKET_LIB_CHECK
738 AC_MSG_CHECKING(whether to use libpcap for packet capture)
741 [ --with-pcap[[=DIR]] use libpcap for packet capturing. [[default=yes]]],
743 if test $withval = no
746 elif test $withval = yes
757 if test "x$want_pcap" = "xno" ; then
761 AC_WIRESHARK_PCAP_CHECK
765 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
768 [ --with-zlib[[=DIR]] use zlib (located in directory DIR, if supplied) to read compressed data. [[default=yes, if available]]],
770 if test $withval = no
773 elif test $withval = yes
782 # Use zlib if it's present, otherwise don't.
784 want_zlib=ifavailable
787 if test "x$want_zlib" = "xno" ; then
791 AC_WIRESHARK_ZLIB_CHECK
792 if test "x$want_zlib" = "xno" ; then
793 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
799 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
802 [ --with-pcre[[=DIR]] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [[default=yes, if available]]],
804 if test $withval = no
807 elif test $withval = yes
816 # Use libpcre if it's present, otherwise don't.
818 want_pcre=ifavailable
821 if test "x$want_pcre" = "xno" ; then
825 AC_WIRESHARK_LIBPCRE_CHECK
826 if test "x$want_pcre" = "xno" ; then
827 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
833 AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
836 [ --with-lua[[=DIR]] use liblua (located in directory DIR, if supplied) for the lua scripting plugin. [[default=no]]],
838 if test $withval = no
841 elif test $withval = yes
850 # Don't use liblua by default (it isn't ready yet)
855 if test "x$want_lua" = "xno" ; then
859 AC_WIRESHARK_LIBLUA_CHECK
860 if test "x$want_lua" = "xno" ; then
861 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
864 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
868 AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
870 AC_ARG_WITH(portaudio,
871 [ --with-portaudio[[=DIR]] use libportaudio (located in directory DIR, if supplied) for the rtp_player. [[default=yes, if available]]],
873 if test $withval = no
876 elif test $withval = yes
881 portaudio_dir=$withval
885 # Use libportaudio by default
887 want_portaudio=ifavailable
890 if test "x$want_portaudio" = "xno" ; then
894 AC_WIRESHARK_LIBPORTAUDIO_CHECK
895 if test "x$want_portaudio" = "xno" ; then
896 AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
899 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
904 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
906 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
907 if test "x$enable_ipv6" = "xno" ; then
911 AC_WIRESHARK_IPV6_STACK
915 dnl Check if wireshark should be installed setuid
916 AC_ARG_ENABLE(setuid-install,
917 [ --enable-setuid-install install wireshark as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
919 AC_MSG_CHECKING(whether to install wireshark setuid)
920 if test "x$enable_setuid_install" = "xno" ; then
923 if test "x$enable_dumpcap" = "xno" ; then
924 AC_MSG_ERROR(Setuid install works only with --enable-dumpcap, but dumpcap disabled)
930 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
932 dnl Checks for header files.
934 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
935 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)
936 AC_CHECK_HEADERS(netinet/in.h)
937 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
944 AC_MSG_CHECKING(whether to use SSL library)
947 [ --with-ssl[[=DIR]] use SSL crypto library (located in directory DIR, if supplied). [[default=no]]],
949 if test "x$withval" = "xno"; then
951 elif test "x$withval" = "xyes"; then
953 elif test -d "$withval"; then
955 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
960 if test "x$want_ssl" = "xyes"; then
962 AC_CHECK_LIB(crypto,EVP_md5,
967 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
977 AC_ARG_WITH(net-snmp,
978 [ --with-net-snmp[[=PATH]] 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]]],
980 if test $withval = no
983 elif test $withval = yes
988 netsnmpconfig="$withval"
992 # Set "want_netsnmp" to "ifavailable" to make the default "use it
993 # if you find it, otherwise don't".
995 want_netsnmp=ifavailable
1001 AC_MSG_CHECKING(whether to use Net-SNMP library)
1002 if test "x$want_netsnmp" = "xno" ; then
1005 if test "x$want_netsnmp" = "xifavailable" ; then
1006 AC_MSG_RESULT([yes, if available])
1010 AC_WIRESHARK_NETSNMP_CHECK
1013 if test "x$have_net_snmp" = "xyes"; then
1014 AC_DEFINE(HAVE_NET_SNMP, 1, [Define to 1 if Net-SNMP support is to be used])
1021 AC_MSG_CHECKING(whether to use kerberos)
1024 [ --with-krb5[[=DIR]] use kerberos (located in directory DIR, if supplied) to use in kerberos dissection [[default=yes]]],
1026 if test $withval = no
1029 elif test $withval = yes
1038 # Use kerberos if specified, otherwise don't.
1040 want_krb5=ifavailable
1043 if test "x$want_krb5" = "xno" ; then
1047 AC_WIRESHARK_KRB5_CHECK
1053 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
1056 [ --with-adns[[=DIR]] use GNU ADNS (located in directory DIR, if supplied). [[default=yes, if present]]],
1058 if test "x$withval" = "xno"; then
1060 elif test "x$withval" = "xyes"; then
1062 elif test -d "$withval"; then
1064 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1067 if test "x$with_adns" = "xno" ; then
1071 AC_WIRESHARK_ADNS_CHECK
1076 # Define WS_VAR_IMPORT appropriately for declarations of external
1077 # variables exported from dynamically-linked libraries.
1079 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
1082 # Define HAVE_AIRPDCAP
1083 # We'll want to remove this eventually.
1085 AC_DEFINE(HAVE_AIRPDCAP, 1, [Enable AirPDcap (WPA/WPA2 decryption)])
1087 dnl Checks for typedefs, structures, and compiler characteristics.
1090 # We need to know whether "struct sockaddr" has an "sa_len" member
1091 # for get_interface_list().
1093 AC_WIRESHARK_STRUCT_SA_LEN
1095 # We must know our byte order
1098 # Checks whether "-traditional" is needed when using "ioctl".
1099 # XXX - do we need this?
1100 AC_PROG_GCC_TRADITIONAL
1104 AC_CHECK_FUNC(getopt, GETOPT_O="",
1105 [GETOPT_O="getopt.o"
1106 AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h needs to be included])
1108 if test "$ac_cv_func_getopt" = no ; then
1115 AC_CHECK_FUNC(strerror, STRERROR_O="",
1116 [STRERROR_O="strerror.o"
1117 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
1119 if test "$ac_cv_func_strerror" = no ; then
1120 STRERROR_C="strerror.c"
1121 STRERROR_O="strerror.o"
1123 AC_SUBST(STRERROR_C)
1124 AC_SUBST(STRERROR_O)
1126 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
1127 STRCASECMP_O="strcasecmp.o")
1128 if test "$ac_cv_func_strcasecmp" = no ; then
1129 STRCASECMP_C="strcasecmp.c"
1130 STRCASECMP_O="strcasecmp.o"
1132 AC_SUBST(STRCASECMP_C)
1133 AC_SUBST(STRCASECMP_O)
1135 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
1136 STRNCASECMP_O="strncasecmp.o")
1137 if test "$ac_cv_func_strncasecmp" = no ; then
1138 STRNCASECMP_C="strncasecmp.c"
1139 STRNCASECMP_O="strncasecmp.o"
1141 AC_SUBST(STRNCASECMP_C)
1142 AC_SUBST(STRNCASECMP_O)
1144 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1145 MKSTEMP_O="mkstemp.o")
1146 if test "$ac_cv_func_mkstemp" = no ; then
1147 MKSTEMP_C="mkstemp.c"
1148 MKSTEMP_O="mkstemp.o"
1153 ac_save_LIBS="$LIBS"
1154 LIBS="$GLIB_LIBS $LIBS"
1155 G_ASCII_STRTOULL_C=""
1156 G_ASCII_STRTOULL_O=""
1157 G_ASCII_STRTOULL_LO=""
1158 AC_CHECK_FUNC(g_ascii_strtoull,
1159 [G_ASCII_STRTOULL_O=""
1160 G_ASCII_STRTOULL_LO=""],
1161 [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1162 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1163 AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1165 LIBS="$ac_save_LIBS"
1166 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1167 G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1168 G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1169 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1171 AC_SUBST(G_ASCII_STRTOULL_C)
1172 AC_SUBST(G_ASCII_STRTOULL_O)
1173 AC_SUBST(G_ASCII_STRTOULL_LO)
1175 AC_CHECK_FUNC(inet_aton,
1178 [INET_ATON_O="inet_aton.o"
1179 INET_ATON_LO="inet_aton.lo"
1181 if test "$ac_cv_func_inet_aton" = no ; then
1182 INET_ATON_C="inet_aton.c"
1183 INET_ATON_O="inet_aton.o"
1184 INET_ATON_LO="inet_aton.lo"
1185 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1187 AC_SUBST(INET_ATON_C)
1188 AC_SUBST(INET_ATON_O)
1189 AC_SUBST(INET_ATON_LO)
1191 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1192 dnl check for pre-BIND82 inet_pton() bug.
1193 AC_MSG_CHECKING(for broken inet_pton)
1194 AC_TRY_RUN([#include <sys/types.h>
1195 #include <sys/socket.h>
1196 #include <netinet/in.h>
1197 #include <arpa/inet.h>
1202 /* this should return 0 (error) */
1203 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1207 }], [AC_MSG_RESULT(ok);
1208 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1209 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1210 have_inet_pton=no])],
1212 if test "$have_inet_pton" = no; then
1213 INET_PTON_C="inet_pton.c"
1214 INET_PTON_O="inet_pton.o"
1215 INET_PTON_LO="inet_pton.lo"
1221 AC_SUBST(INET_PTON_C)
1222 AC_SUBST(INET_PTON_O)
1223 AC_SUBST(INET_PTON_LO)
1225 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1226 AC_MSG_CHECKING([for inet_ntop prototype])
1227 AC_TRY_COMPILE([#include <stdio.h>
1228 #include <sys/types.h>
1229 #include <sys/socket.h>
1230 #include <netinet/in.h>
1231 #include <arpa/inet.h>
1233 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1235 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1236 [Define if inet_ntop() prototype exists])], [
1237 AC_TRY_COMPILE([#include <stdio.h>
1238 #include <sys/types.h>
1239 #include <sys/socket.h>
1240 #include <netinet/in.h>
1241 #include <arpa/inet.h>
1243 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1245 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1246 [Define if inet_ntop() prototype exists])], [
1247 AC_MSG_RESULT(no)])])
1250 INET_NTOP_C="inet_ntop.c"
1251 INET_NTOP_O="inet_ntop.o"
1252 INET_NTOP_LO="inet_ntop.lo"
1253 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1254 [Define if inet/v6defs.h needs to be included])])
1255 AC_SUBST(INET_NTOP_C)
1256 AC_SUBST(INET_NTOP_O)
1257 AC_SUBST(INET_NTOP_LO)
1259 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1260 [STRPTIME_O="strptime.o"
1261 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1263 if test "$ac_cv_func_strptime" = no ; then
1264 STRPTIME_C="strptime.c"
1265 STRPTIME_O="strptime.o"
1267 AC_SUBST(STRPTIME_C)
1268 AC_SUBST(STRPTIME_O)
1270 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1271 AC_CHECK_FUNCS(issetugid)
1272 AC_CHECK_FUNCS(mmap mprotect sysconf)
1274 dnl blank for now, but will be used in future
1275 AC_SUBST(wireshark_SUBDIRS)
1278 dnl check whether plugins should be enabled and, if they should be,
1279 dnl check for plugins directory - stolen from Amanda's configure.in
1281 plugindir="$libdir/wireshark/plugins/$VERSION"
1282 AC_ARG_WITH(plugins,
1283 [ --with-plugins[[=DIR]] support plugins (installed in DIR, if supplied).],
1287 if test x$have_plugins = xno
1289 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1296 if test x$have_plugins = xno
1298 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1300 plugindir="$withval"
1305 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1306 if test x$have_plugins = xyes
1308 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1310 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1311 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1312 eval echo "$plugindir"
1314 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1316 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1321 # The plugin dissectors reside in ./plugins/PROTO/
1323 PLUGIN_LIBS="-L../../epan -lwireshark $GLIB_LIBS"
1324 AC_SUBST(PLUGIN_LIBS)
1328 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1329 # (autoconf? automake? libtool?) - with the newer version(s), it's
1330 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1332 # With older version(s) of those tool(s), however, it's not just an
1333 # alias, and the configure scripts don't work without it.
1336 AC_SUBST(LIBTOOL_DEPS)
1338 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1339 if test x$enable_static = xyes -a x$have_plugins = xyes
1341 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
1343 AC_SUBST(ENABLE_STATIC)
1345 dnl Save the cacheable configure results to config.cache before recursing
1348 AM_CONFIG_HEADER(config.h)
1349 AC_CONFIG_SUBDIRS(wiretap)
1358 epan/dfilter/Makefile
1359 epan/dissectors/Makefile
1360 epan/ftypes/Makefile
1367 packaging/nsis/Makefile
1368 packaging/rpm/Makefile
1369 packaging/rpm/SPECS/Makefile
1370 packaging/rpm/SPECS/wireshark.spec
1371 packaging/svr4/Makefile
1372 packaging/svr4/checkinstall
1373 packaging/svr4/pkginfo
1375 plugins/agentx/Makefile
1376 plugins/artnet/Makefile
1377 plugins/asn1/Makefile
1378 plugins/ciscosm/Makefile
1379 plugins/docsis/Makefile
1380 plugins/enttec/Makefile
1381 plugins/giop/Makefile
1382 plugins/gryphon/Makefile
1383 plugins/h223/Makefile
1384 plugins/irda/Makefile
1385 plugins/lwres/Makefile
1386 plugins/mate/Makefile
1387 plugins/megaco/Makefile
1388 plugins/mgcp/Makefile
1389 plugins/opsi/Makefile
1390 plugins/pcli/Makefile
1391 plugins/profinet/Makefile
1392 plugins/rlm/Makefile
1393 plugins/rtnet/Makefile
1394 plugins/rudp/Makefile
1395 plugins/sbus/Makefile
1396 plugins/stats_tree/Makefile
1397 plugins/v5ua/Makefile
1400 tools/lemon/Makefile
1406 if test "x$enable_setuid_install" = "xyes" ; then
1407 setuid_message="yes (DANGEROUS!!!)"
1412 if test "x$want_zlib" = "xno" ; then
1418 if test "x$want_pcre" = "xno" ; then
1424 if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
1430 if test "x$want_portaudio" = "xyes" ; then
1431 portaudio_message="yes"
1433 portaudio_message="no"
1436 if test "x$want_ssl" = "xno" ; then
1442 if test "x$want_krb5" = "xno" ; then
1445 krb5_message="yes ($ac_krb5_version)"
1448 if test "x$have_good_adns" = "xyes" ; then
1454 if test "x$have_net_snmp" = "xyes" ; then
1455 snmp_libs_message="yes"
1457 snmp_libs_message="no"
1461 echo "The Wireshark package has been configured with the following options."
1462 echo " Build wireshark : $enable_wireshark"
1463 echo " Build tshark : $enable_tshark"
1464 echo " Build capinfos : $enable_capinfos"
1465 echo " Build editcap : $enable_editcap"
1466 echo " Build dumpcap : $enable_dumpcap"
1467 echo " Build mergecap : $enable_mergecap"
1468 echo " Build text2pcap : $enable_text2pcap"
1469 echo " Build idl2wrs : $enable_idl2wrs"
1470 echo " Build randpkt : $enable_randpkt"
1471 echo " Build dftest : $enable_dftest"
1473 echo " Install setuid : $setuid_message"
1474 echo " Use plugins : $have_plugins"
1475 echo " Build lua plugin : $lua_message"
1476 echo " Build rtp_player : $portaudio_message"
1477 echo " Use GTK+ v2 library : $enable_gtk2"
1478 if test "x$enable_gtk2" = "xyes" ; then
1479 echo " Use threads : $enable_threads"
1480 echo " Build profile binaries : $enable_profile_build"
1482 echo " Use pcap library : $want_pcap"
1483 echo " Use zlib library : $zlib_message"
1484 echo " Use pcre library : $pcre_message"
1485 echo " Use kerberos library : $krb5_message"
1486 echo " Use GNU ADNS library : $adns_message"
1487 echo " Use GNU crypto library : $gcrypt_message"
1488 echo " Use SSL crypto library : $ssl_message"
1489 echo " Use IPv6 name resolution : $enable_ipv6"
1490 echo " Use Net-SNMP library : $snmp_libs_message"
1491 echo " Use gnutls library : $tls_message"