7 dnl Check for CPU / vendor / OS
11 AM_INIT_AUTOMAKE(wireshark, 0.99.4)
15 dnl Checks for programs.
18 dnl Work around libtool bug (fixed in the version 1.5a?)
19 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
24 AC_PATH_PROG(PERL, perl)
25 AC_PATH_PROG(POD2MAN, pod2man)
26 if test "x$POD2MAN" = x
29 # The alternative is not to build the man pages....
31 AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
33 AC_PATH_PROG(POD2HTML, pod2html)
34 if test "x$POD2HTML" = x
37 # The alternative is not to build the HTML man pages....
39 AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
41 AC_PATH_PROG(HTML_VIEWER, htmlview)
42 if test "x$HTML_VIEWER" = x
44 AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
46 AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
49 AC_PATH_PROG(LEX, flex)
50 AC_PATH_PROG(PYTHON, python)
62 AC_PATH_PROG(DOXYGEN, doxygen)
63 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
64 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
67 AM_PATH_LIBGNUTLS(1.0.0,
69 echo "gnuTLS found, enabling ssl decryption"
70 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use gnutls library])
74 if test x$libgnutls_config_prefix != x ; then
75 AC_MSG_ERROR([[gnuTLS not found; install gnuTLS-devel package for your system]])
77 echo echo "gnuTLS not found, disabling ssl decryption"
84 AM_PATH_LIBGCRYPT(1.1.42,
86 echo "libgcrypt found, enabling ipsec decryption"
87 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
91 if test x$libgcrypt_config_prefix != x ; then
92 AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
94 echo echo "libgcrypt not found, disabling ipsec decryption"
101 AC_PATH_PROG(XSLTPROC, xsltproc)
102 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
103 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
106 AC_PATH_PROG(XMLLINT, xmllint)
107 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
108 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
110 # Check for fop (translate .fo to e.g. pdf)
111 AC_PATH_PROG(FOP, fop)
112 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
113 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
115 # Check for hhc (html help compiler)
116 AC_PATH_PROG(HHC, hhc.exe)
117 AC_CHECK_PROG(HAVE_HHC, hhc.exe, "yes", "no")
118 AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
120 # Check for packaging utilities
121 # For now, we check to see if the various packaging utilites are in our
122 # path. I'm too lazy to write code to go hunt for them. - Gerald
123 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
124 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
125 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
127 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
128 -a x$HAVE_PKGTRANS = xyes ; then
129 HAVE_SVR4_PACKAGING=yes
131 HAVE_SVR4_PACKAGING=no
133 AC_SUBST(HAVE_SVR4_PACKAGING)
135 AC_WIRESHARK_RPM_CHECK
139 # If we're running gcc, add '-Wall -W' to CFLAGS, and add
140 # '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
141 # flag unused function arguments and not get warnings about them.
142 # If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
143 # -Wcast-align" as well. (Add more checks here in the future?)
145 # Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
146 # argument will compile with non-GCC compilers.
148 AC_ARG_WITH(extra-gcc-checks,
149 [ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
151 if test $withval != no
153 wireshark_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings"
156 AC_MSG_CHECKING(to see if we can add '-Wall -W $wireshark_extra_gcc_flags' to CFLAGS)
157 if test x$GCC != x ; then
158 CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -Wpointer-arith -W $wireshark_extra_gcc_flags $CFLAGS"
161 CFLAGS="-D_U_=\"\" $CFLAGS"
166 # Add any platform-specific compiler flags needed.
168 AC_MSG_CHECKING(for platform-specific compiler flags)
172 # Not GCC - assume it's the vendor's compiler.
177 # HP's ANSI C compiler; flags suggested by Jost Martin.
178 # "-Ae" for ANSI C plus extensions such as "long long".
179 # "+O2", for optimization. XXX - works with "-g"?
181 CFLAGS="-Ae +O2 $CFLAGS"
182 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
186 # It may be called "cc", but it's really a GCC derivative
187 # with a problematic special precompiler and precompiled
188 # headers; turn off the special precompiler, as some
189 # apparently-legal code won't compile with its precompiled
192 CFLAGS="-no-cpp-precomp $CFLAGS"
193 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
196 AC_MSG_RESULT(none needed)
202 # the X11 headers don't automatically include prototype info
203 # and a lot don't include the return type
204 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
205 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
209 # See comments above about Apple's lovely C compiler.
211 CFLAGS="-no-cpp-precomp $CFLAGS"
212 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
216 # Shared libraries in cygwin/Win32 must never contain
219 LDFLAGS="$LDFLAGS -no-undefined"
220 AC_MSG_RESULT(CygWin GCC - added -no-undefined to LDFLAGS)
223 AC_MSG_RESULT(none needed)
229 # On OS X, if we find the headers for Core Foundation and Launch Services,
230 # add -framework options to link with Application Services (of which
231 # Launch Services is a subframework) and Core Foundation (required by
232 # the Launch Services APIs), so we can use that to launch a Web browser
233 # from the Help menu.
235 # (Do those headers exist on pure Darwin? If so, does the CoreFoundation
236 # *and* Launch Services code exist there, or are those headers just stubs?
237 # If the frameworks aren't present on Darwin, how *should* we check for
243 AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
245 ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
246 LIBS="$LIBS $ac_frameworks"
249 # include <CoreFoundation/CFBase.h>
250 # include <CoreFoundation/CFString.h>
251 # include <CoreFoundation/CFURL.h>
252 # include <ApplicationServices/ApplicationServices.h>
255 CFStringRef url_CFString;
259 url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
260 url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
261 status = LSOpenCFURLRef(url_CFURL, NULL);
263 ac_cv_can_use_cf_and_ls=yes,
264 ac_cv_can_use_cf_and_ls=no,
265 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
266 if test "$ac_cv_can_use_cf_and_ls" = yes ; then
267 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
268 FRAMEWORKS="$ac_frameworks"
278 dnl Look in /usr/local for header files and libraries ?
279 dnl XXX FIXME don't include /usr/local if it is already in the system
280 dnl search path as this causes gcc 3.2 on Linux to complain about a change
281 dnl of the system search order for includes
282 AC_ARG_ENABLE(usr-local,
283 [ --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)
285 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
286 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
289 # Arrange that we search for header files in the source directory
290 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
291 # as various packages we use ("libpcap", "zlib", an SNMP library)
292 # may have been installed under "/usr/local/include".
294 CFLAGS="$CFLAGS -I/usr/local/include"
295 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
298 # Arrange that we search for libraries in "/usr/local/lib".
300 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
306 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
311 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
312 if test x$LD_LIBRARY_PATH != x ; then
313 LIBS="$LIBS -R$LD_LIBRARY_PATH"
314 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
316 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
322 # Check for versions of "sed" inadequate to handle, in libtool, a list
323 # of object files as large as the list in Wireshark.
325 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
326 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
327 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
328 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
329 # is the only "sed" that comes with Solaris that can handle Wireshark.
331 # Add any checks here that are necessary for other OSes.
333 AC_WIRESHARK_GNU_SED_CHECK
334 if test "$HAVE_GNU_SED" = no ; then
337 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
339 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
341 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
356 # Enable/disable tshark
358 AC_ARG_ENABLE(wireshark,
359 [ --enable-wireshark build GTK+-based wireshark. [default=yes]],enable_wireshark=$enableval,enable_wireshark=yes)
362 [ --disable-gtk2 build Glib1/Gtk1+-based wireshark. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
363 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
365 AC_ARG_ENABLE(threads,
366 [ --enable-threads use threads in wireshark. [default=no]],enable_threads=$enableval,enable_threads=no)
367 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
369 AC_ARG_ENABLE(profile-build,
370 [ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
371 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
372 AC_MSG_CHECKING(if profile builds must be generated)
373 if test "x$enable_profile_build" = "xyes" ; then
374 if test -n "$GCC" ; then
376 CFLAGS=" -pg $CFLAGS"
379 echo "Building profile binaries currently only supported for GCC."
385 # Create DATAFILE_DIR #define for config.h
386 datafiledir=$datadir/wireshark
388 test "x$prefix" = xNONE && prefix=$ac_default_prefix
389 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
390 # Ugly hack, but I don't see how this problem can be solved
391 # properly that DATAFILE_DIR had a value starting with
392 # "${prefix}/" instead of e.g. "/usr/local/"
393 eval eval echo "$datafiledir"
395 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
398 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
399 # programs to be built with GTK+.
401 if test "x$enable_gtk2" = "xyes" -a "x$enable_wireshark" = "xyes" ; then
403 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
404 elif test "x$enable_gtk2" != "xyes" -a "x$enable_wireshark" = "xyes" ; then
406 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
412 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
413 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
414 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
415 # set when generating the Makefile, so we can make programs that require
416 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
417 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
418 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
419 # programs to be built with GLib.
421 if test "$GTK_OK" = "no" ; then
422 enable_wireshark="no"
426 if test "x$enable_gtk2" = "xyes" ; then
427 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
429 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
432 wireshark_bin="wireshark\$(EXEEXT)"
433 wireshark_man="wireshark.1"
434 wireshark_SUBDIRS="codecs gtk"
436 if test "$GTK_OK" = "two" ; then
437 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
439 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
444 # Check whether GLib modules are supported, to determine whether we
445 # can support plugins.
447 AC_MSG_CHECKING(whether GLib supports loadable modules)
448 ac_save_CFLAGS="$CFLAGS"
450 CFLAGS="$CFLAGS $GLIB_CFLAGS"
451 LIBS="$GLIB_LIBS $LIBS"
461 if (g_module_supported())
462 return 0; /* success */
464 return 1; /* failure */
466 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
467 [echo $ac_n "cross compiling; assumed OK... $ac_c"
468 ac_cv_glib_supports_modules=yes])
469 CFLAGS="$ac_save_CFLAGS"
471 if test "$ac_cv_glib_supports_modules" = yes ; then
480 # We can't just check for <inttypes.h> - some systems have one that
481 # doesn't define all the PRI[doxu]64 macros.
483 AC_CHECK_HEADERS(inttypes.h,
486 # OK, we have inttypes.h, but does it define those macros?
488 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
493 #include <inttypes.h>
496 #include <sys/types.h>
500 printf("%" PRId64 "\n", (gint64)1);
501 printf("%" PRIo64 "\n", (guint64)1);
502 printf("%" PRIx64 "\n", (guint64)1);
503 printf("%" PRIX64 "\n", (guint64)1);
504 printf("%" PRIu64 "\n", (guint64)1);
510 ac_wireshark_inttypes_h_defines_formats=yes
514 ac_wireshark_inttypes_h_defines_formats=no
519 # We don't have inttypes.h, so it obviously can't define those
522 ac_wireshark_inttypes_h_defines_formats=no
524 if test "$ac_wireshark_inttypes_h_defines_formats" = yes; then
525 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
527 AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
529 AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
531 AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
533 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
539 AC_SUBST(wireshark_bin)
540 AC_SUBST(wireshark_man)
542 rdps_bin="rdps\$(EXEEXT)"
546 # Enable/disable tshark
548 AC_ARG_ENABLE(tshark,
549 [ --enable-tshark build tshark. [default=yes]],tshark=$enableval,enable_tshark=yes)
551 if test "x$enable_tshark" = "xyes" ; then
552 tshark_bin="tshark\$(EXEEXT)"
553 tshark_man="tshark.1"
554 wiresharkfilter_man="wireshark-filter.4"
561 AC_SUBST(wiresharkfilter_man)
565 # Enable/disable editcap
567 AC_ARG_ENABLE(editcap,
568 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
570 if test "x$enable_editcap" = "xyes" ; then
571 editcap_bin="editcap\$(EXEEXT)"
572 editcap_man="editcap.1"
577 AC_SUBST(editcap_bin)
578 AC_SUBST(editcap_man)
581 # Enable/disable dumpcap
583 AC_ARG_ENABLE(dumpcap,
584 [ --enable-dumpcap build dumpcap. [default=yes]],enable_dumpcap=$enableval,enable_dumpcap=yes)
586 if test "x$enable_dumpcap" = "xyes" ; then
587 dumpcap_bin="dumpcap\$(EXEEXT)"
588 dumpcap_man="dumpcap.1"
593 AC_SUBST(dumpcap_bin)
594 AC_SUBST(dumpcap_man)
597 # Enable/disable capinfos
599 AC_ARG_ENABLE(capinfos,
600 [ --enable-capinfos build capinfos. [default=yes]],enable_capinfos=$enableval,enable_capinfos=yes)
602 if test "x$enable_capinfos" = "xyes" ; then
603 capinfos_bin="capinfos\$(EXEEXT)"
604 capinfos_man="capinfos.1"
609 AC_SUBST(capinfos_bin)
610 AC_SUBST(capinfos_man)
613 # Enable/disable mergecap
615 AC_ARG_ENABLE(mergecap,
616 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
618 if test "x$enable_mergecap" = "xyes" ; then
619 mergecap_bin="mergecap\$(EXEEXT)"
620 mergecap_man="mergecap.1"
625 AC_SUBST(mergecap_bin)
626 AC_SUBST(mergecap_man)
629 # Enable/disable text2pcap
631 AC_ARG_ENABLE(text2pcap,
632 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
634 if test "x$enable_text2pcap" = "xyes" ; then
635 text2pcap_bin="text2pcap\$(EXEEXT)"
636 text2pcap_man="text2pcap.1"
641 AC_SUBST(text2pcap_bin)
642 AC_SUBST(text2pcap_man)
644 # Enable/disable idl2wrs
646 AC_ARG_ENABLE(idl2wrs,
647 [ --enable-idl2wrs build idl2wrs. [default=yes]],enable_idl2wrs=$enableval,enable_idl2wrs=yes)
649 if test "x$enable_idl2wrs" = "xyes" ; then
650 idl2wrs_bin="idl2wrs"
651 idl2wrs_man="idl2wrs.1"
656 AC_SUBST(idl2wrs_bin)
657 AC_SUBST(idl2wrs_man)
660 # Enable/disable dftest
662 AC_ARG_ENABLE(dftest,
663 [ --enable-dftest build dftest. [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
665 if test "x$enable_dftest" = "xyes" ; then
666 dftest_bin="dftest\$(EXEEXT)"
673 # Enable/disable randpkt
675 AC_ARG_ENABLE(randpkt,
676 [ --enable-randpkt build randpkt. [default=yes]],enable_randpkt=$enableval,enable_randpkt=yes)
678 if test "x$enable_randpkt" = "xyes" ; then
679 randpkt_bin="randpkt\$(EXEEXT)"
683 AC_SUBST(randpkt_bin)
686 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
687 dnl "gethostbyname()".
688 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
690 dnl Checks for "connect()", used as a proxy for "socket()" - and
691 dnl "-lsocket", if we need it to get "connect()".
692 AC_WIRESHARK_SOCKET_LIB_CHECK
695 AC_MSG_CHECKING(whether to use libpcap for packet capture)
698 [ --with-pcap[[=DIR]] use libpcap for packet capturing. [[default=yes]]],
700 if test $withval = no
703 elif test $withval = yes
714 if test "x$want_pcap" = "xno" ; then
718 AC_WIRESHARK_PCAP_CHECK
722 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
725 [ --with-zlib[[=DIR]] use zlib (located in directory DIR, if supplied) to read compressed data. [[default=yes, if available]]],
727 if test $withval = no
730 elif test $withval = yes
739 # Use zlib if it's present, otherwise don't.
741 want_zlib=ifavailable
744 if test "x$want_zlib" = "xno" ; then
748 AC_WIRESHARK_ZLIB_CHECK
749 if test "x$want_zlib" = "xno" ; then
750 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
756 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
759 [ --with-pcre[[=DIR]] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [[default=yes, if available]]],
761 if test $withval = no
764 elif test $withval = yes
773 # Use libpcre if it's present, otherwise don't.
775 want_pcre=ifavailable
778 if test "x$want_pcre" = "xno" ; then
782 AC_WIRESHARK_LIBPCRE_CHECK
783 if test "x$want_pcre" = "xno" ; then
784 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
790 AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
793 [ --with-lua[[=DIR]] use liblua (located in directory DIR, if supplied) for the lua scripting plugin. [[default=no]]],
795 if test $withval = no
798 elif test $withval = yes
807 # Don't use liblua by default (it isn't ready yet)
812 if test "x$want_lua" = "xno" ; then
816 AC_WIRESHARK_LIBLUA_CHECK
817 if test "x$want_lua" = "xno" ; then
818 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
821 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
825 AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
827 AC_ARG_WITH(portaudio,
828 [ --with-portaudio[[=DIR]] use libportaudio (located in directory DIR, if supplied) for the rtp_player. [[default=yes, if available]]],
830 if test $withval = no
833 elif test $withval = yes
838 portaudio_dir=$withval
842 # Use libportaudio by default
844 want_portaudio=ifavailable
847 if test "x$want_portaudio" = "xno" ; then
851 AC_WIRESHARK_LIBPORTAUDIO_CHECK
852 if test "x$want_portaudio" = "xno" ; then
853 AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
856 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
861 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
863 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
864 if test "x$enable_ipv6" = "xno" ; then
868 AC_WIRESHARK_IPV6_STACK
872 dnl Check if wireshark should be installed setuid
873 AC_ARG_ENABLE(setuid-install,
874 [ --enable-setuid-install install wireshark as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
876 AC_MSG_CHECKING(whether to install wireshark setuid)
877 if test "x$enable_setuid_install" = "xno" ; then
880 if test "x$enable_dumpcap" = "xno" ; then
881 AC_MSG_ERROR(Setuid install works only with --enable-dumpcap, but dumpcap disabled)
887 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
889 dnl Checks for header files.
891 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
892 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)
893 AC_CHECK_HEADERS(netinet/in.h)
894 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
901 AC_MSG_CHECKING(whether to use SSL library)
904 [ --with-ssl[[=DIR]] use SSL crypto library (located in directory DIR, if supplied). [[default=no]]],
906 if test "x$withval" = "xno"; then
908 elif test "x$withval" = "xyes"; then
910 elif test -d "$withval"; then
912 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
917 if test "x$want_ssl" = "xyes"; then
919 AC_CHECK_LIB(crypto,EVP_md5,
924 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
931 dnl UCD SNMP/Net-SNMP Check
934 AC_ARG_WITH(net-snmp,
935 [ --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]]],
937 if test $withval = no
940 elif test $withval = yes
945 netsnmpconfig="$withval"
949 # Set "want_netsnmp" to "ifavailable" to make the default "use it
950 # if you find it, otherwise don't".
952 want_netsnmp=ifavailable
955 AC_ARG_WITH(ucd-snmp,
956 [ --with-ucd-snmp[[=DIR]] use UCD SNMP client library (located in directory DIR, if supplied). [[default=yes, if available]]],
958 if test $withval = no
961 elif test $withval = yes
970 # Set "want_ucdsnmp" to "ifavailable" to make the default "use it
971 # if you find it, otherwise don't".
973 want_ucdsnmp=ifavailable
978 # Try Net-SNMP first.
980 AC_MSG_CHECKING(whether to use Net-SNMP library)
981 if test "x$want_netsnmp" = "xno" ; then
984 if test "x$want_netsnmp" = "xifavailable" ; then
985 AC_MSG_RESULT([yes, if available])
989 AC_WIRESHARK_NETSNMP_CHECK
993 # If that didn't find Net-SNMP, try UCD SNMP.
995 if test "x$have_net_snmp" != "xyes" ; then
996 AC_MSG_CHECKING(whether to use UCD SNMP library)
997 if test "x$want_ucdsnmp" = "xno" ; then
1000 if test "x$want_ucdsnmp" = "xifavailable" ; then
1001 AC_MSG_RESULT([yes, if available])
1005 AC_WIRESHARK_UCDSNMP_CHECK
1009 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
1010 AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to 1 if some SNMP support is to be used])
1017 AC_MSG_CHECKING(whether to use kerberos)
1020 [ --with-krb5[[=DIR]] use kerberos (located in directory DIR, if supplied) to use in kerberos dissection [[default=yes]]],
1022 if test $withval = no
1025 elif test $withval = yes
1034 # Use kerberos if specified, otherwise don't.
1036 want_krb5=ifavailable
1039 if test "x$want_krb5" = "xno" ; then
1043 AC_WIRESHARK_KRB5_CHECK
1049 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
1052 [ --with-adns[[=DIR]] use GNU ADNS (located in directory DIR, if supplied). [[default=yes, if present]]],
1054 if test "x$withval" = "xno"; then
1056 elif test "x$withval" = "xyes"; then
1058 elif test -d "$withval"; then
1060 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1063 if test "x$with_adns" = "xno" ; then
1067 AC_WIRESHARK_ADNS_CHECK
1072 # Define WS_VAR_IMPORT appropriately for declarations of external
1073 # variables exported from dynamically-linked libraries.
1075 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
1077 dnl Checks for typedefs, structures, and compiler characteristics.
1080 # We need to know whether "struct sockaddr" has an "sa_len" member
1081 # for get_interface_list().
1083 AC_WIRESHARK_STRUCT_SA_LEN
1085 # We must know our byte order
1088 # Checks whether "-traditional" is needed when using "ioctl".
1089 # XXX - do we need this?
1090 AC_PROG_GCC_TRADITIONAL
1094 AC_CHECK_FUNC(getopt, GETOPT_O="",
1095 [GETOPT_O="getopt.o"
1096 AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h needs to be included])
1098 if test "$ac_cv_func_getopt" = no ; then
1105 AC_CHECK_FUNC(strerror, STRERROR_O="",
1106 [STRERROR_O="strerror.o"
1107 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
1109 if test "$ac_cv_func_strerror" = no ; then
1110 STRERROR_C="strerror.c"
1111 STRERROR_O="strerror.o"
1113 AC_SUBST(STRERROR_C)
1114 AC_SUBST(STRERROR_O)
1116 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
1117 STRCASECMP_O="strcasecmp.o")
1118 if test "$ac_cv_func_strcasecmp" = no ; then
1119 STRCASECMP_C="strcasecmp.c"
1120 STRCASECMP_O="strcasecmp.o"
1122 AC_SUBST(STRCASECMP_C)
1123 AC_SUBST(STRCASECMP_O)
1125 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
1126 STRNCASECMP_O="strncasecmp.o")
1127 if test "$ac_cv_func_strncasecmp" = no ; then
1128 STRNCASECMP_C="strncasecmp.c"
1129 STRNCASECMP_O="strncasecmp.o"
1131 AC_SUBST(STRNCASECMP_C)
1132 AC_SUBST(STRNCASECMP_O)
1134 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1135 MKSTEMP_O="mkstemp.o")
1136 if test "$ac_cv_func_mkstemp" = no ; then
1137 MKSTEMP_C="mkstemp.c"
1138 MKSTEMP_O="mkstemp.o"
1143 ac_save_LIBS="$LIBS"
1144 LIBS="$GLIB_LIBS $LIBS"
1145 G_ASCII_STRTOULL_C=""
1146 G_ASCII_STRTOULL_O=""
1147 G_ASCII_STRTOULL_LO=""
1148 AC_CHECK_FUNC(g_ascii_strtoull,
1149 [G_ASCII_STRTOULL_O=""
1150 G_ASCII_STRTOULL_LO=""],
1151 [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1152 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1153 AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1155 LIBS="$ac_save_LIBS"
1156 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1157 G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1158 G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1159 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1161 AC_SUBST(G_ASCII_STRTOULL_C)
1162 AC_SUBST(G_ASCII_STRTOULL_O)
1163 AC_SUBST(G_ASCII_STRTOULL_LO)
1165 AC_CHECK_FUNC(inet_aton,
1168 [INET_ATON_O="inet_aton.o"
1169 INET_ATON_LO="inet_aton.lo"
1171 if test "$ac_cv_func_inet_aton" = no ; then
1172 INET_ATON_C="inet_aton.c"
1173 INET_ATON_O="inet_aton.o"
1174 INET_ATON_LO="inet_aton.lo"
1175 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1177 AC_SUBST(INET_ATON_C)
1178 AC_SUBST(INET_ATON_O)
1179 AC_SUBST(INET_ATON_LO)
1181 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1182 dnl check for pre-BIND82 inet_pton() bug.
1183 AC_MSG_CHECKING(for broken inet_pton)
1184 AC_TRY_RUN([#include <sys/types.h>
1185 #include <sys/socket.h>
1186 #include <netinet/in.h>
1187 #include <arpa/inet.h>
1192 /* this should return 0 (error) */
1193 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1197 }], [AC_MSG_RESULT(ok);
1198 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1199 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1200 have_inet_pton=no])],
1202 if test "$have_inet_pton" = no; then
1203 INET_PTON_C="inet_pton.c"
1204 INET_PTON_O="inet_pton.o"
1205 INET_PTON_LO="inet_pton.lo"
1211 AC_SUBST(INET_PTON_C)
1212 AC_SUBST(INET_PTON_O)
1213 AC_SUBST(INET_PTON_LO)
1215 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1216 AC_MSG_CHECKING([for inet_ntop prototype])
1217 AC_TRY_COMPILE([#include <stdio.h>
1218 #include <sys/types.h>
1219 #include <sys/socket.h>
1220 #include <netinet/in.h>
1221 #include <arpa/inet.h>
1223 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1225 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1226 [Define if inet_ntop() prototype exists])], [
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 *, socklen_t);],, [
1235 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1236 [Define if inet_ntop() prototype exists])], [
1237 AC_MSG_RESULT(no)])])
1240 INET_NTOP_C="inet_ntop.c"
1241 INET_NTOP_O="inet_ntop.o"
1242 INET_NTOP_LO="inet_ntop.lo"
1243 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1244 [Define if inet/v6defs.h needs to be included])])
1245 AC_SUBST(INET_NTOP_C)
1246 AC_SUBST(INET_NTOP_O)
1247 AC_SUBST(INET_NTOP_LO)
1249 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1250 [STRPTIME_O="strptime.o"
1251 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1253 if test "$ac_cv_func_strptime" = no ; then
1254 STRPTIME_C="strptime.c"
1255 STRPTIME_O="strptime.o"
1257 AC_SUBST(STRPTIME_C)
1258 AC_SUBST(STRPTIME_O)
1260 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1261 AC_CHECK_FUNCS(issetugid)
1262 AC_CHECK_FUNCS(mmap mprotect sysconf)
1264 dnl blank for now, but will be used in future
1265 AC_SUBST(wireshark_SUBDIRS)
1268 dnl check whether plugins should be enabled and, if they should be,
1269 dnl check for plugins directory - stolen from Amanda's configure.in
1271 plugindir="$libdir/wireshark/plugins/$VERSION"
1272 AC_ARG_WITH(plugins,
1273 [ --with-plugins[[=DIR]] support plugins (installed in DIR, if supplied).],
1277 if test x$have_plugins = xno
1279 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1286 if test x$have_plugins = xno
1288 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1290 plugindir="$withval"
1295 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1296 if test x$have_plugins = xyes
1298 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1300 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1301 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1302 eval echo "$plugindir"
1304 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1306 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1311 # The plugin dissectors reside in ./plugins/PROTO/
1313 PLUGIN_LIBS="-L../../epan -lwireshark $GLIB_LIBS"
1314 AC_SUBST(PLUGIN_LIBS)
1318 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1319 # (autoconf? automake? libtool?) - with the newer version(s), it's
1320 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1322 # With older version(s) of those tool(s), however, it's not just an
1323 # alias, and the configure scripts don't work without it.
1326 AC_SUBST(LIBTOOL_DEPS)
1328 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1329 if test x$enable_static = xyes -a x$have_plugins = xyes
1331 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
1333 AC_SUBST(ENABLE_STATIC)
1335 dnl Save the cacheable configure results to config.cache before recursing
1338 AM_CONFIG_HEADER(config.h)
1339 AC_CONFIG_SUBDIRS(wiretap)
1347 epan/dfilter/Makefile
1348 epan/dissectors/Makefile
1349 epan/ftypes/Makefile
1356 packaging/nsis/Makefile
1357 packaging/rpm/Makefile
1358 packaging/rpm/SPECS/Makefile
1359 packaging/rpm/SPECS/wireshark.spec
1360 packaging/svr4/Makefile
1361 packaging/svr4/checkinstall
1362 packaging/svr4/pkginfo
1364 plugins/acn/Makefile
1365 plugins/agentx/Makefile
1366 plugins/artnet/Makefile
1367 plugins/asn1/Makefile
1368 plugins/ciscosm/Makefile
1369 plugins/docsis/Makefile
1370 plugins/enttec/Makefile
1371 plugins/giop/Makefile
1372 plugins/gryphon/Makefile
1373 plugins/h223/Makefile
1374 plugins/irda/Makefile
1375 plugins/lwres/Makefile
1376 plugins/mate/Makefile
1377 plugins/megaco/Makefile
1378 plugins/mgcp/Makefile
1379 plugins/opsi/Makefile
1380 plugins/pcli/Makefile
1381 plugins/profinet/Makefile
1382 plugins/rlm/Makefile
1383 plugins/rtnet/Makefile
1384 plugins/rudp/Makefile
1385 plugins/sbus/Makefile
1386 plugins/stats_tree/Makefile
1387 plugins/v5ua/Makefile
1389 tools/lemon/Makefile
1395 if test "x$enable_setuid_install" = "xyes" ; then
1396 setuid_message="yes (DANGEROUS!!!)"
1401 if test "x$want_zlib" = "xno" ; then
1407 if test "x$want_pcre" = "xno" ; then
1413 if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
1419 if test "x$want_portaudio" = "xyes" ; then
1420 portaudio_message="yes"
1422 portaudio_message="no"
1425 if test "x$want_ssl" = "xno" ; then
1431 if test "x$want_krb5" = "xno" ; then
1434 krb5_message="yes ($ac_krb5_version)"
1437 if test "x$have_good_adns" = "xyes" ; then
1443 if test "x$have_net_snmp" = "xyes" ; then
1444 snmp_libs_message="yes (net-snmp)"
1445 elif test "x$have_ucdsnmp" = "xyes" ; then
1446 snmp_libs_message="yes (ucd-snmp)"
1448 snmp_libs_message="no"
1452 echo "The Wireshark package has been configured with the following options."
1453 echo " Build wireshark : $enable_wireshark"
1454 echo " Build tshark : $enable_tshark"
1455 echo " Build capinfos : $enable_capinfos"
1456 echo " Build editcap : $enable_editcap"
1457 echo " Build dumpcap : $enable_dumpcap"
1458 echo " Build mergecap : $enable_mergecap"
1459 echo " Build text2pcap : $enable_text2pcap"
1460 echo " Build idl2wrs : $enable_idl2wrs"
1461 echo " Build randpkt : $enable_randpkt"
1462 echo " Build dftest : $enable_dftest"
1464 echo " Install setuid : $setuid_message"
1465 echo " Use plugins : $have_plugins"
1466 echo " Build lua plugin : $lua_message"
1467 echo " Build rtp_player : $portaudio_message"
1468 echo " Use GTK+ v2 library : $enable_gtk2"
1469 if test "x$enable_gtk2" = "xyes" ; then
1470 echo " Use threads : $enable_threads"
1471 echo " Build profile binaries : $enable_profile_build"
1473 echo " Use pcap library : $want_pcap"
1474 echo " Use zlib library : $zlib_message"
1475 echo " Use pcre library : $pcre_message"
1476 echo " Use kerberos library : $krb5_message"
1477 echo " Use GNU ADNS library : $adns_message"
1478 echo " Use GNU crypto library : $gcrypt_message"
1479 echo " Use SSL crypto library : $ssl_message"
1480 echo " Use IPv6 name resolution : $enable_ipv6"
1481 echo " Use UCD SNMP/Net-SNMP library : $snmp_libs_message"
1482 echo " Use gnutls library : $tls_message"