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)
228 # Shared libraries in cygwin/Win32 must never contain
231 LDFLAGS="$LDFLAGS -no-undefined"
232 AC_MSG_RESULT(CygWin GCC - added -no-undefined to LDFLAGS)
235 AC_MSG_RESULT(none needed)
241 # On OS X, if we find the headers for Core Foundation and Launch Services,
242 # add -framework options to link with Application Services (of which
243 # Launch Services is a subframework) and Core Foundation (required by
244 # the Launch Services APIs), so we can use that to launch a Web browser
245 # from the Help menu.
247 # (Do those headers exist on pure Darwin? If so, does the CoreFoundation
248 # *and* Launch Services code exist there, or are those headers just stubs?
249 # If the frameworks aren't present on Darwin, how *should* we check for
255 AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
257 ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
258 LIBS="$LIBS $ac_frameworks"
261 # include <CoreFoundation/CFBase.h>
262 # include <CoreFoundation/CFString.h>
263 # include <CoreFoundation/CFURL.h>
264 # include <ApplicationServices/ApplicationServices.h>
267 CFStringRef url_CFString;
271 url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
272 url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
273 status = LSOpenCFURLRef(url_CFURL, NULL);
275 ac_cv_can_use_cf_and_ls=yes,
276 ac_cv_can_use_cf_and_ls=no,
277 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
278 if test "$ac_cv_can_use_cf_and_ls" = yes ; then
279 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
280 FRAMEWORKS="$ac_frameworks"
290 dnl Look in /usr/local for header files and libraries ?
291 dnl XXX FIXME don't include /usr/local if it is already in the system
292 dnl search path as this causes gcc 3.2 on Linux to complain about a change
293 dnl of the system search order for includes
294 AC_ARG_ENABLE(usr-local,
295 [ --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)
297 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
298 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
301 # Arrange that we search for header files in the source directory
302 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
303 # as various packages we use ("libpcap", "zlib", an SNMP library)
304 # may have been installed under "/usr/local/include".
306 CFLAGS="$CFLAGS -I/usr/local/include"
307 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
310 # Arrange that we search for libraries in "/usr/local/lib".
312 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
318 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
323 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
324 if test x$LD_LIBRARY_PATH != x ; then
325 LIBS="$LIBS -R$LD_LIBRARY_PATH"
326 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
328 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
334 # Check for versions of "sed" inadequate to handle, in libtool, a list
335 # of object files as large as the list in Wireshark.
337 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
338 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
339 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
340 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
341 # is the only "sed" that comes with Solaris that can handle Wireshark.
343 # Add any checks here that are necessary for other OSes.
345 AC_WIRESHARK_GNU_SED_CHECK
346 if test "$HAVE_GNU_SED" = no ; then
349 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
351 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
353 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
368 # Enable/disable tshark
370 AC_ARG_ENABLE(wireshark,
371 [ --enable-wireshark build GTK+-based wireshark. [default=yes]],enable_wireshark=$enableval,enable_wireshark=yes)
374 [ --disable-gtk2 build Glib1/Gtk1+-based wireshark. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
375 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
377 AC_ARG_ENABLE(threads,
378 [ --enable-threads use threads in wireshark. [default=no]],enable_threads=$enableval,enable_threads=no)
379 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
381 AC_ARG_ENABLE(profile-build,
382 [ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
383 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
384 AC_MSG_CHECKING(if profile builds must be generated)
385 if test "x$enable_profile_build" = "xyes" ; then
386 if test -n "$GCC" ; then
388 CFLAGS=" -pg $CFLAGS"
391 echo "Building profile binaries currently only supported for GCC."
397 # Create DATAFILE_DIR #define for config.h
398 datafiledir=$datadir/wireshark
400 test "x$prefix" = xNONE && prefix=$ac_default_prefix
401 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
402 # Ugly hack, but I don't see how this problem can be solved
403 # properly that DATAFILE_DIR had a value starting with
404 # "${prefix}/" instead of e.g. "/usr/local/"
405 eval eval echo "$datafiledir"
407 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
410 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
411 # programs to be built with GTK+.
413 if test "x$enable_gtk2" = "xyes" -a "x$enable_wireshark" = "xyes" ; then
415 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
416 elif test "x$enable_gtk2" != "xyes" -a "x$enable_wireshark" = "xyes" ; then
418 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
424 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
425 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
426 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
427 # set when generating the Makefile, so we can make programs that require
428 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
429 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
430 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
431 # programs to be built with GLib.
433 if test "$GTK_OK" = "no" ; then
434 enable_wireshark="no"
438 if test "x$enable_gtk2" = "xyes" ; then
439 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
441 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
444 wireshark_bin="wireshark\$(EXEEXT)"
445 wireshark_man="wireshark.1"
446 wireshark_SUBDIRS="codecs gtk"
448 if test "$GTK_OK" = "two" ; then
449 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
451 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
456 # Check whether GLib modules are supported, to determine whether we
457 # can support plugins.
459 AC_MSG_CHECKING(whether GLib supports loadable modules)
460 ac_save_CFLAGS="$CFLAGS"
462 CFLAGS="$CFLAGS $GLIB_CFLAGS"
463 LIBS="$GLIB_LIBS $LIBS"
473 if (g_module_supported())
474 return 0; /* success */
476 return 1; /* failure */
478 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
479 [echo $ac_n "cross compiling; assumed OK... $ac_c"
480 ac_cv_glib_supports_modules=yes])
481 CFLAGS="$ac_save_CFLAGS"
483 if test "$ac_cv_glib_supports_modules" = yes ; then
492 # We can't just check for <inttypes.h> - some systems have one that
493 # doesn't define all the PRI[doxu]64 macros.
495 AC_CHECK_HEADERS(inttypes.h,
498 # OK, we have inttypes.h, but does it define those macros?
500 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
505 #include <inttypes.h>
508 #include <sys/types.h>
512 printf("%" PRId64 "\n", (gint64)1);
513 printf("%" PRIo64 "\n", (guint64)1);
514 printf("%" PRIx64 "\n", (guint64)1);
515 printf("%" PRIX64 "\n", (guint64)1);
516 printf("%" PRIu64 "\n", (guint64)1);
522 ac_wireshark_inttypes_h_defines_formats=yes
526 ac_wireshark_inttypes_h_defines_formats=no
531 # We don't have inttypes.h, so it obviously can't define those
534 ac_wireshark_inttypes_h_defines_formats=no
536 if test "$ac_wireshark_inttypes_h_defines_formats" = yes; then
537 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
539 AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
541 AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
543 AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
545 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
551 AC_SUBST(wireshark_bin)
552 AC_SUBST(wireshark_man)
554 rdps_bin="rdps\$(EXEEXT)"
558 # Enable/disable tshark
560 AC_ARG_ENABLE(tshark,
561 [ --enable-tshark build tshark. [default=yes]],tshark=$enableval,enable_tshark=yes)
563 if test "x$enable_tshark" = "xyes" ; then
564 tshark_bin="tshark\$(EXEEXT)"
565 tshark_man="tshark.1"
566 wiresharkfilter_man="wireshark-filter.4"
573 AC_SUBST(wiresharkfilter_man)
577 # Enable/disable editcap
579 AC_ARG_ENABLE(editcap,
580 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
582 if test "x$enable_editcap" = "xyes" ; then
583 editcap_bin="editcap\$(EXEEXT)"
584 editcap_man="editcap.1"
589 AC_SUBST(editcap_bin)
590 AC_SUBST(editcap_man)
593 # Enable/disable dumpcap
595 AC_ARG_ENABLE(dumpcap,
596 [ --enable-dumpcap build dumpcap. [default=yes]],enable_dumpcap=$enableval,enable_dumpcap=yes)
598 if test "x$enable_dumpcap" = "xyes" ; then
599 dumpcap_bin="dumpcap\$(EXEEXT)"
600 dumpcap_man="dumpcap.1"
605 AC_SUBST(dumpcap_bin)
606 AC_SUBST(dumpcap_man)
609 # Enable/disable capinfos
611 AC_ARG_ENABLE(capinfos,
612 [ --enable-capinfos build capinfos. [default=yes]],enable_capinfos=$enableval,enable_capinfos=yes)
614 if test "x$enable_capinfos" = "xyes" ; then
615 capinfos_bin="capinfos\$(EXEEXT)"
616 capinfos_man="capinfos.1"
621 AC_SUBST(capinfos_bin)
622 AC_SUBST(capinfos_man)
625 # Enable/disable mergecap
627 AC_ARG_ENABLE(mergecap,
628 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
630 if test "x$enable_mergecap" = "xyes" ; then
631 mergecap_bin="mergecap\$(EXEEXT)"
632 mergecap_man="mergecap.1"
637 AC_SUBST(mergecap_bin)
638 AC_SUBST(mergecap_man)
641 # Enable/disable text2pcap
643 AC_ARG_ENABLE(text2pcap,
644 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
646 if test "x$enable_text2pcap" = "xyes" ; then
647 text2pcap_bin="text2pcap\$(EXEEXT)"
648 text2pcap_man="text2pcap.1"
653 AC_SUBST(text2pcap_bin)
654 AC_SUBST(text2pcap_man)
656 # Enable/disable idl2wrs
658 AC_ARG_ENABLE(idl2wrs,
659 [ --enable-idl2wrs build idl2wrs. [default=yes]],enable_idl2wrs=$enableval,enable_idl2wrs=yes)
661 if test "x$enable_idl2wrs" = "xyes" ; then
662 idl2wrs_bin="idl2wrs"
663 idl2wrs_man="idl2wrs.1"
668 AC_SUBST(idl2wrs_bin)
669 AC_SUBST(idl2wrs_man)
672 # Enable/disable dftest
674 AC_ARG_ENABLE(dftest,
675 [ --enable-dftest build dftest. [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
677 if test "x$enable_dftest" = "xyes" ; then
678 dftest_bin="dftest\$(EXEEXT)"
685 # Enable/disable randpkt
687 AC_ARG_ENABLE(randpkt,
688 [ --enable-randpkt build randpkt. [default=yes]],enable_randpkt=$enableval,enable_randpkt=yes)
690 if test "x$enable_randpkt" = "xyes" ; then
691 randpkt_bin="randpkt\$(EXEEXT)"
695 AC_SUBST(randpkt_bin)
698 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
699 dnl "gethostbyname()".
700 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
702 dnl Checks for "connect()", used as a proxy for "socket()" - and
703 dnl "-lsocket", if we need it to get "connect()".
704 AC_WIRESHARK_SOCKET_LIB_CHECK
707 AC_MSG_CHECKING(whether to use libpcap for packet capture)
710 [ --with-pcap[[=DIR]] use libpcap for packet capturing. [[default=yes]]],
712 if test $withval = no
715 elif test $withval = yes
726 if test "x$want_pcap" = "xno" ; then
730 AC_WIRESHARK_PCAP_CHECK
734 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
737 [ --with-zlib[[=DIR]] use zlib (located in directory DIR, if supplied) to read compressed data. [[default=yes, if available]]],
739 if test $withval = no
742 elif test $withval = yes
751 # Use zlib if it's present, otherwise don't.
753 want_zlib=ifavailable
756 if test "x$want_zlib" = "xno" ; then
760 AC_WIRESHARK_ZLIB_CHECK
761 if test "x$want_zlib" = "xno" ; then
762 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
768 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
771 [ --with-pcre[[=DIR]] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [[default=yes, if available]]],
773 if test $withval = no
776 elif test $withval = yes
785 # Use libpcre if it's present, otherwise don't.
787 want_pcre=ifavailable
790 if test "x$want_pcre" = "xno" ; then
794 AC_WIRESHARK_LIBPCRE_CHECK
795 if test "x$want_pcre" = "xno" ; then
796 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
802 AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
805 [ --with-lua[[=DIR]] use liblua (located in directory DIR, if supplied) for the lua scripting plugin. [[default=no]]],
807 if test $withval = no
810 elif test $withval = yes
819 # Don't use liblua by default (it isn't ready yet)
824 if test "x$want_lua" = "xno" ; then
828 AC_WIRESHARK_LIBLUA_CHECK
829 if test "x$want_lua" = "xno" ; then
830 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
833 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
837 AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
839 AC_ARG_WITH(portaudio,
840 [ --with-portaudio[[=DIR]] use libportaudio (located in directory DIR, if supplied) for the rtp_player. [[default=yes, if available]]],
842 if test $withval = no
845 elif test $withval = yes
850 portaudio_dir=$withval
854 # Use libportaudio by default
856 want_portaudio=ifavailable
859 if test "x$want_portaudio" = "xno" ; then
863 AC_WIRESHARK_LIBPORTAUDIO_CHECK
864 if test "x$want_portaudio" = "xno" ; then
865 AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
868 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
873 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
875 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
876 if test "x$enable_ipv6" = "xno" ; then
880 AC_WIRESHARK_IPV6_STACK
884 dnl Check if wireshark should be installed setuid
885 AC_ARG_ENABLE(setuid-install,
886 [ --enable-setuid-install install wireshark as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
888 AC_MSG_CHECKING(whether to install wireshark setuid)
889 if test "x$enable_setuid_install" = "xno" ; then
892 if test "x$enable_dumpcap" = "xno" ; then
893 AC_MSG_ERROR(Setuid install works only with --enable-dumpcap, but dumpcap disabled)
899 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
901 dnl Checks for header files.
903 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
904 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)
905 AC_CHECK_HEADERS(netinet/in.h)
906 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
913 AC_MSG_CHECKING(whether to use SSL library)
916 [ --with-ssl[[=DIR]] use SSL crypto library (located in directory DIR, if supplied). [[default=no]]],
918 if test "x$withval" = "xno"; then
920 elif test "x$withval" = "xyes"; then
922 elif test -d "$withval"; then
924 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
929 if test "x$want_ssl" = "xyes"; then
931 AC_CHECK_LIB(crypto,EVP_md5,
936 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
946 AC_ARG_WITH(net-snmp,
947 [ --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]]],
949 if test $withval = no
952 elif test $withval = yes
957 netsnmpconfig="$withval"
961 # Set "want_netsnmp" to "ifavailable" to make the default "use it
962 # if you find it, otherwise don't".
964 want_netsnmp=ifavailable
970 AC_MSG_CHECKING(whether to use Net-SNMP library)
971 if test "x$want_netsnmp" = "xno" ; then
974 if test "x$want_netsnmp" = "xifavailable" ; then
975 AC_MSG_RESULT([yes, if available])
979 AC_WIRESHARK_NETSNMP_CHECK
982 if test "x$have_net_snmp" = "xyes"; then
983 AC_DEFINE(HAVE_NET_SNMP, 1, [Define to 1 if Net-SNMP support is to be used])
990 AC_MSG_CHECKING(whether to use kerberos)
993 [ --with-krb5[[=DIR]] use kerberos (located in directory DIR, if supplied) to use in kerberos dissection [[default=yes]]],
995 if test $withval = no
998 elif test $withval = yes
1007 # Use kerberos if specified, otherwise don't.
1009 want_krb5=ifavailable
1012 if test "x$want_krb5" = "xno" ; then
1016 AC_WIRESHARK_KRB5_CHECK
1022 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
1025 [ --with-adns[[=DIR]] use GNU ADNS (located in directory DIR, if supplied). [[default=yes, if present]]],
1027 if test "x$withval" = "xno"; then
1029 elif test "x$withval" = "xyes"; then
1031 elif test -d "$withval"; then
1033 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1036 if test "x$with_adns" = "xno" ; then
1040 AC_WIRESHARK_ADNS_CHECK
1045 # Define WS_VAR_IMPORT appropriately for declarations of external
1046 # variables exported from dynamically-linked libraries.
1048 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
1050 dnl Checks for typedefs, structures, and compiler characteristics.
1053 # We need to know whether "struct sockaddr" has an "sa_len" member
1054 # for get_interface_list().
1056 AC_WIRESHARK_STRUCT_SA_LEN
1058 # We must know our byte order
1061 # Checks whether "-traditional" is needed when using "ioctl".
1062 # XXX - do we need this?
1063 AC_PROG_GCC_TRADITIONAL
1067 AC_CHECK_FUNC(getopt, GETOPT_O="",
1068 [GETOPT_O="getopt.o"
1069 AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h needs to be included])
1071 if test "$ac_cv_func_getopt" = no ; then
1078 AC_CHECK_FUNC(strerror, STRERROR_O="",
1079 [STRERROR_O="strerror.o"
1080 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
1082 if test "$ac_cv_func_strerror" = no ; then
1083 STRERROR_C="strerror.c"
1084 STRERROR_O="strerror.o"
1086 AC_SUBST(STRERROR_C)
1087 AC_SUBST(STRERROR_O)
1089 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
1090 STRCASECMP_O="strcasecmp.o")
1091 if test "$ac_cv_func_strcasecmp" = no ; then
1092 STRCASECMP_C="strcasecmp.c"
1093 STRCASECMP_O="strcasecmp.o"
1095 AC_SUBST(STRCASECMP_C)
1096 AC_SUBST(STRCASECMP_O)
1098 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
1099 STRNCASECMP_O="strncasecmp.o")
1100 if test "$ac_cv_func_strncasecmp" = no ; then
1101 STRNCASECMP_C="strncasecmp.c"
1102 STRNCASECMP_O="strncasecmp.o"
1104 AC_SUBST(STRNCASECMP_C)
1105 AC_SUBST(STRNCASECMP_O)
1107 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1108 MKSTEMP_O="mkstemp.o")
1109 if test "$ac_cv_func_mkstemp" = no ; then
1110 MKSTEMP_C="mkstemp.c"
1111 MKSTEMP_O="mkstemp.o"
1116 ac_save_LIBS="$LIBS"
1117 LIBS="$GLIB_LIBS $LIBS"
1118 G_ASCII_STRTOULL_C=""
1119 G_ASCII_STRTOULL_O=""
1120 G_ASCII_STRTOULL_LO=""
1121 AC_CHECK_FUNC(g_ascii_strtoull,
1122 [G_ASCII_STRTOULL_O=""
1123 G_ASCII_STRTOULL_LO=""],
1124 [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1125 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1126 AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1128 LIBS="$ac_save_LIBS"
1129 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1130 G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1131 G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1132 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1134 AC_SUBST(G_ASCII_STRTOULL_C)
1135 AC_SUBST(G_ASCII_STRTOULL_O)
1136 AC_SUBST(G_ASCII_STRTOULL_LO)
1138 AC_CHECK_FUNC(inet_aton,
1141 [INET_ATON_O="inet_aton.o"
1142 INET_ATON_LO="inet_aton.lo"
1144 if test "$ac_cv_func_inet_aton" = no ; then
1145 INET_ATON_C="inet_aton.c"
1146 INET_ATON_O="inet_aton.o"
1147 INET_ATON_LO="inet_aton.lo"
1148 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1150 AC_SUBST(INET_ATON_C)
1151 AC_SUBST(INET_ATON_O)
1152 AC_SUBST(INET_ATON_LO)
1154 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1155 dnl check for pre-BIND82 inet_pton() bug.
1156 AC_MSG_CHECKING(for broken inet_pton)
1157 AC_TRY_RUN([#include <sys/types.h>
1158 #include <sys/socket.h>
1159 #include <netinet/in.h>
1160 #include <arpa/inet.h>
1165 /* this should return 0 (error) */
1166 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1170 }], [AC_MSG_RESULT(ok);
1171 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1172 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1173 have_inet_pton=no])],
1175 if test "$have_inet_pton" = no; then
1176 INET_PTON_C="inet_pton.c"
1177 INET_PTON_O="inet_pton.o"
1178 INET_PTON_LO="inet_pton.lo"
1184 AC_SUBST(INET_PTON_C)
1185 AC_SUBST(INET_PTON_O)
1186 AC_SUBST(INET_PTON_LO)
1188 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1189 AC_MSG_CHECKING([for inet_ntop prototype])
1190 AC_TRY_COMPILE([#include <stdio.h>
1191 #include <sys/types.h>
1192 #include <sys/socket.h>
1193 #include <netinet/in.h>
1194 #include <arpa/inet.h>
1196 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1198 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1199 [Define if inet_ntop() prototype exists])], [
1200 AC_TRY_COMPILE([#include <stdio.h>
1201 #include <sys/types.h>
1202 #include <sys/socket.h>
1203 #include <netinet/in.h>
1204 #include <arpa/inet.h>
1206 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1208 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1209 [Define if inet_ntop() prototype exists])], [
1210 AC_MSG_RESULT(no)])])
1213 INET_NTOP_C="inet_ntop.c"
1214 INET_NTOP_O="inet_ntop.o"
1215 INET_NTOP_LO="inet_ntop.lo"
1216 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1217 [Define if inet/v6defs.h needs to be included])])
1218 AC_SUBST(INET_NTOP_C)
1219 AC_SUBST(INET_NTOP_O)
1220 AC_SUBST(INET_NTOP_LO)
1222 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1223 [STRPTIME_O="strptime.o"
1224 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1226 if test "$ac_cv_func_strptime" = no ; then
1227 STRPTIME_C="strptime.c"
1228 STRPTIME_O="strptime.o"
1230 AC_SUBST(STRPTIME_C)
1231 AC_SUBST(STRPTIME_O)
1233 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1234 AC_CHECK_FUNCS(issetugid)
1235 AC_CHECK_FUNCS(mmap mprotect sysconf)
1237 dnl blank for now, but will be used in future
1238 AC_SUBST(wireshark_SUBDIRS)
1241 dnl check whether plugins should be enabled and, if they should be,
1242 dnl check for plugins directory - stolen from Amanda's configure.in
1244 plugindir="$libdir/wireshark/plugins/$VERSION"
1245 AC_ARG_WITH(plugins,
1246 [ --with-plugins[[=DIR]] support plugins (installed in DIR, if supplied).],
1250 if test x$have_plugins = xno
1252 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1259 if test x$have_plugins = xno
1261 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1263 plugindir="$withval"
1268 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1269 if test x$have_plugins = xyes
1271 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1273 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1274 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1275 eval echo "$plugindir"
1277 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1279 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1284 # The plugin dissectors reside in ./plugins/PROTO/
1286 PLUGIN_LIBS="-L../../epan -lwireshark $GLIB_LIBS"
1287 AC_SUBST(PLUGIN_LIBS)
1291 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1292 # (autoconf? automake? libtool?) - with the newer version(s), it's
1293 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1295 # With older version(s) of those tool(s), however, it's not just an
1296 # alias, and the configure scripts don't work without it.
1299 AC_SUBST(LIBTOOL_DEPS)
1301 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1302 if test x$enable_static = xyes -a x$have_plugins = xyes
1304 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
1306 AC_SUBST(ENABLE_STATIC)
1308 dnl Save the cacheable configure results to config.cache before recursing
1311 AM_CONFIG_HEADER(config.h)
1312 AC_CONFIG_SUBDIRS(wiretap)
1320 epan/dfilter/Makefile
1321 epan/dissectors/Makefile
1322 epan/ftypes/Makefile
1329 packaging/nsis/Makefile
1330 packaging/rpm/Makefile
1331 packaging/rpm/SPECS/Makefile
1332 packaging/rpm/SPECS/wireshark.spec
1333 packaging/svr4/Makefile
1334 packaging/svr4/checkinstall
1335 packaging/svr4/pkginfo
1337 plugins/agentx/Makefile
1338 plugins/artnet/Makefile
1339 plugins/asn1/Makefile
1340 plugins/ciscosm/Makefile
1341 plugins/docsis/Makefile
1342 plugins/enttec/Makefile
1343 plugins/giop/Makefile
1344 plugins/gryphon/Makefile
1345 plugins/h223/Makefile
1346 plugins/irda/Makefile
1347 plugins/lwres/Makefile
1348 plugins/mate/Makefile
1349 plugins/megaco/Makefile
1350 plugins/mgcp/Makefile
1351 plugins/opsi/Makefile
1352 plugins/pcli/Makefile
1353 plugins/profinet/Makefile
1354 plugins/rlm/Makefile
1355 plugins/rtnet/Makefile
1356 plugins/rudp/Makefile
1357 plugins/sbus/Makefile
1358 plugins/stats_tree/Makefile
1359 plugins/v5ua/Makefile
1362 tools/lemon/Makefile
1368 if test "x$enable_setuid_install" = "xyes" ; then
1369 setuid_message="yes (DANGEROUS!!!)"
1374 if test "x$want_zlib" = "xno" ; then
1380 if test "x$want_pcre" = "xno" ; then
1386 if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
1392 if test "x$want_portaudio" = "xyes" ; then
1393 portaudio_message="yes"
1395 portaudio_message="no"
1398 if test "x$want_ssl" = "xno" ; then
1404 if test "x$want_krb5" = "xno" ; then
1407 krb5_message="yes ($ac_krb5_version)"
1410 if test "x$have_good_adns" = "xyes" ; then
1416 if test "x$have_net_snmp" = "xyes" ; then
1417 snmp_libs_message="yes"
1419 snmp_libs_message="no"
1423 echo "The Wireshark package has been configured with the following options."
1424 echo " Build wireshark : $enable_wireshark"
1425 echo " Build tshark : $enable_tshark"
1426 echo " Build capinfos : $enable_capinfos"
1427 echo " Build editcap : $enable_editcap"
1428 echo " Build dumpcap : $enable_dumpcap"
1429 echo " Build mergecap : $enable_mergecap"
1430 echo " Build text2pcap : $enable_text2pcap"
1431 echo " Build idl2wrs : $enable_idl2wrs"
1432 echo " Build randpkt : $enable_randpkt"
1433 echo " Build dftest : $enable_dftest"
1435 echo " Install setuid : $setuid_message"
1436 echo " Use plugins : $have_plugins"
1437 echo " Build lua plugin : $lua_message"
1438 echo " Build rtp_player : $portaudio_message"
1439 echo " Use GTK+ v2 library : $enable_gtk2"
1440 if test "x$enable_gtk2" = "xyes" ; then
1441 echo " Use threads : $enable_threads"
1442 echo " Build profile binaries : $enable_profile_build"
1444 echo " Use pcap library : $want_pcap"
1445 echo " Use zlib library : $zlib_message"
1446 echo " Use pcre library : $pcre_message"
1447 echo " Use kerberos library : $krb5_message"
1448 echo " Use GNU ADNS library : $adns_message"
1449 echo " Use GNU crypto library : $gcrypt_message"
1450 echo " Use SSL crypto library : $ssl_message"
1451 echo " Use IPv6 name resolution : $enable_ipv6"
1452 echo " Use Net-SNMP library : $snmp_libs_message"
1453 echo " Use gnutls library : $tls_message"