7 dnl Check for CPU / vendor / OS
11 AM_INIT_AUTOMAKE(wireshark, 0.99.2)
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.0,
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 eval echo "$datafiledir"
392 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
395 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
396 # programs to be built with GTK+.
398 if test "x$enable_gtk2" = "xyes" -a "x$enable_wireshark" = "xyes" ; then
400 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
401 elif test "x$enable_gtk2" != "xyes" -a "x$enable_wireshark" = "xyes" ; then
403 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
409 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
410 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
411 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
412 # set when generating the Makefile, so we can make programs that require
413 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
414 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
415 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
416 # programs to be built with GLib.
418 if test "$GTK_OK" = "no" ; then
419 enable_wireshark="no"
423 if test "x$enable_gtk2" = "xyes" ; then
424 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
426 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
429 wireshark_bin="wireshark\$(EXEEXT)"
430 wireshark_man="wireshark.1"
431 wireshark_SUBDIRS="gtk"
433 if test "$GTK_OK" = "two" ; then
434 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
436 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
441 # Check whether GLib modules are supported, to determine whether we
442 # can support plugins.
444 AC_MSG_CHECKING(whether GLib supports loadable modules)
445 ac_save_CFLAGS="$CFLAGS"
447 CFLAGS="$CFLAGS $GLIB_CFLAGS"
448 LIBS="$GLIB_LIBS $LIBS"
458 if (g_module_supported())
459 return 0; /* success */
461 return 1; /* failure */
463 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
464 [echo $ac_n "cross compiling; assumed OK... $ac_c"
465 ac_cv_glib_supports_modules=yes])
466 CFLAGS="$ac_save_CFLAGS"
468 if test "$ac_cv_glib_supports_modules" = yes ; then
477 # We can't just check for <inttypes.h> - some systems have one that
478 # doesn't define all the PRI[doxu]64 macros.
480 AC_CHECK_HEADERS(inttypes.h,
483 # OK, we have inttypes.h, but does it define those macros?
485 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
490 #include <inttypes.h>
493 #include <sys/types.h>
497 printf("%" PRId64 "\n", (gint64)1);
498 printf("%" PRIo64 "\n", (guint64)1);
499 printf("%" PRIx64 "\n", (guint64)1);
500 printf("%" PRIX64 "\n", (guint64)1);
501 printf("%" PRIu64 "\n", (guint64)1);
507 ac_wireshark_inttypes_h_defines_formats=yes
511 ac_wireshark_inttypes_h_defines_formats=no
516 # We don't have inttypes.h, so it obviously can't define those
519 ac_wireshark_inttypes_h_defines_formats=no
521 if test "$ac_wireshark_inttypes_h_defines_formats" = yes; then
522 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
524 AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
526 AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
528 AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
530 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
536 AC_SUBST(wireshark_bin)
537 AC_SUBST(wireshark_man)
539 rdps_bin="rdps\$(EXEEXT)"
543 # Enable/disable tshark
545 AC_ARG_ENABLE(tshark,
546 [ --enable-tshark build tshark. [default=yes]],tshark=$enableval,enable_tshark=yes)
548 if test "x$enable_tshark" = "xyes" ; then
549 tshark_bin="tshark\$(EXEEXT)"
550 tshark_man="tshark.1"
551 wiresharkfilter_man="wireshark-filter.4"
558 AC_SUBST(wiresharkfilter_man)
562 # Enable/disable editcap
564 AC_ARG_ENABLE(editcap,
565 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
567 if test "x$enable_editcap" = "xyes" ; then
568 editcap_bin="editcap\$(EXEEXT)"
569 editcap_man="editcap.1"
574 AC_SUBST(editcap_bin)
575 AC_SUBST(editcap_man)
578 # Enable/disable dumpcap
580 AC_ARG_ENABLE(dumpcap,
581 [ --enable-dumpcap build dumpcap. [default=yes]],enable_dumpcap=$enableval,enable_dumpcap=yes)
583 if test "x$enable_dumpcap" = "xyes" ; then
584 dumpcap_bin="dumpcap\$(EXEEXT)"
585 dumpcap_man="dumpcap.1"
590 AC_SUBST(dumpcap_bin)
591 AC_SUBST(dumpcap_man)
594 # Enable/disable capinfos
596 AC_ARG_ENABLE(capinfos,
597 [ --enable-capinfos build capinfos. [default=yes]],enable_capinfos=$enableval,enable_capinfos=yes)
599 if test "x$enable_capinfos" = "xyes" ; then
600 capinfos_bin="capinfos\$(EXEEXT)"
601 capinfos_man="capinfos.1"
606 AC_SUBST(capinfos_bin)
607 AC_SUBST(capinfos_man)
610 # Enable/disable mergecap
612 AC_ARG_ENABLE(mergecap,
613 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
615 if test "x$enable_mergecap" = "xyes" ; then
616 mergecap_bin="mergecap\$(EXEEXT)"
617 mergecap_man="mergecap.1"
622 AC_SUBST(mergecap_bin)
623 AC_SUBST(mergecap_man)
626 # Enable/disable text2pcap
628 AC_ARG_ENABLE(text2pcap,
629 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
631 if test "x$enable_text2pcap" = "xyes" ; then
632 text2pcap_bin="text2pcap\$(EXEEXT)"
633 text2pcap_man="text2pcap.1"
638 AC_SUBST(text2pcap_bin)
639 AC_SUBST(text2pcap_man)
641 # Enable/disable idl2wrs
643 AC_ARG_ENABLE(idl2wrs,
644 [ --enable-idl2wrs build idl2wrs. [default=yes]],enable_idl2wrs=$enableval,enable_idl2wrs=yes)
646 if test "x$enable_idl2wrs" = "xyes" ; then
647 idl2wrs_bin="idl2wrs"
648 idl2wrs_man="idl2wrs.1"
653 AC_SUBST(idl2wrs_bin)
654 AC_SUBST(idl2wrs_man)
657 # Enable/disable dftest
659 AC_ARG_ENABLE(dftest,
660 [ --enable-dftest build dftest. [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
662 if test "x$enable_dftest" = "xyes" ; then
663 dftest_bin="dftest\$(EXEEXT)"
670 # Enable/disable randpkt
672 AC_ARG_ENABLE(randpkt,
673 [ --enable-randpkt build randpkt. [default=yes]],enable_randpkt=$enableval,enable_randpkt=yes)
675 if test "x$enable_randpkt" = "xyes" ; then
676 randpkt_bin="randpkt\$(EXEEXT)"
680 AC_SUBST(randpkt_bin)
683 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
684 dnl "gethostbyname()".
685 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
687 dnl Checks for "connect()", used as a proxy for "socket()" - and
688 dnl "-lsocket", if we need it to get "connect()".
689 AC_WIRESHARK_SOCKET_LIB_CHECK
692 AC_MSG_CHECKING(whether to use libpcap for packet capture)
695 [ --with-pcap[[=DIR]] use libpcap for packet capturing. [[default=yes]]],
697 if test $withval = no
700 elif test $withval = yes
711 if test "x$want_pcap" = "xno" ; then
715 AC_WIRESHARK_PCAP_CHECK
719 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
722 [ --with-zlib[[=DIR]] use zlib (located in directory DIR, if supplied) to read compressed data. [[default=yes, if available]]],
724 if test $withval = no
727 elif test $withval = yes
736 # Use zlib if it's present, otherwise don't.
738 want_zlib=ifavailable
741 if test "x$want_zlib" = "xno" ; then
745 AC_WIRESHARK_ZLIB_CHECK
746 if test "x$want_zlib" = "xno" ; then
747 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
753 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
756 [ --with-pcre[[=DIR]] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [[default=yes, if available]]],
758 if test $withval = no
761 elif test $withval = yes
770 # Use libpcre if it's present, otherwise don't.
772 want_pcre=ifavailable
775 if test "x$want_pcre" = "xno" ; then
779 AC_WIRESHARK_LIBPCRE_CHECK
780 if test "x$want_pcre" = "xno" ; then
781 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
787 AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
790 [ --with-lua[[=DIR]] use liblua (located in directory DIR, if supplied) for the lua scripting plugin. [[default=no]]],
792 if test $withval = no
795 elif test $withval = yes
804 # Don't use liblua by default (it isn't ready yet)
809 if test "x$want_lua" = "xno" ; then
813 AC_WIRESHARK_LIBLUA_CHECK
814 if test "x$want_lua" = "xno" ; then
815 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
818 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
823 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
825 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
826 if test "x$enable_ipv6" = "xno" ; then
830 AC_WIRESHARK_IPV6_STACK
834 dnl Check if wireshark should be installed setuid
835 AC_ARG_ENABLE(setuid-install,
836 [ --enable-setuid-install install wireshark as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
838 AC_MSG_CHECKING(whether to install wireshark setuid)
839 if test "x$enable_setuid_install" = "xno" ; then
842 if test "x$enable_dumpcap" = "xno" ; then
843 AC_MSG_ERROR(Setuid install works only with --enable-dumpcap, but dumpcap disabled)
849 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
851 dnl Checks for header files.
853 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
854 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)
855 AC_CHECK_HEADERS(netinet/in.h)
856 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
863 AC_MSG_CHECKING(whether to use SSL library)
866 [ --with-ssl[[=DIR]] use SSL crypto library (located in directory DIR, if supplied). [[default=no]]],
868 if test "x$withval" = "xno"; then
870 elif test "x$withval" = "xyes"; then
872 elif test -d "$withval"; then
874 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
879 if test "x$want_ssl" = "xyes"; then
881 AC_CHECK_LIB(crypto,EVP_md5,
886 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
893 dnl UCD SNMP/Net-SNMP Check
896 AC_ARG_WITH(net-snmp,
897 [ --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]]],
899 if test $withval = no
902 elif test $withval = yes
907 netsnmpconfig="$withval"
911 # Set "want_netsnmp" to "ifavailable" to make the default "use it
912 # if you find it, otherwise don't".
914 want_netsnmp=ifavailable
917 AC_ARG_WITH(ucd-snmp,
918 [ --with-ucd-snmp[[=DIR]] use UCD SNMP client library (located in directory DIR, if supplied). [[default=yes, if available]]],
920 if test $withval = no
923 elif test $withval = yes
932 # Set "want_ucdsnmp" to "ifavailable" to make the default "use it
933 # if you find it, otherwise don't".
935 want_ucdsnmp=ifavailable
940 # Try Net-SNMP first.
942 AC_MSG_CHECKING(whether to use Net-SNMP library)
943 if test "x$want_netsnmp" = "xno" ; then
946 if test "x$want_netsnmp" = "xifavailable" ; then
947 AC_MSG_RESULT([yes, if available])
951 AC_WIRESHARK_NETSNMP_CHECK
955 # If that didn't find Net-SNMP, try UCD SNMP.
957 if test "x$have_net_snmp" != "xyes" ; then
958 AC_MSG_CHECKING(whether to use UCD SNMP library)
959 if test "x$want_ucdsnmp" = "xno" ; then
962 if test "x$want_ucdsnmp" = "xifavailable" ; then
963 AC_MSG_RESULT([yes, if available])
967 AC_WIRESHARK_UCDSNMP_CHECK
971 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
972 AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to 1 if some SNMP support is to be used])
979 AC_MSG_CHECKING(whether to use kerberos)
982 [ --with-krb5[[=DIR]] use kerberos (located in directory DIR, if supplied) to use in kerberos dissection [[default=yes]]],
984 if test $withval = no
987 elif test $withval = yes
996 # Use kerberos if specified, otherwise don't.
998 want_krb5=ifavailable
1001 if test "x$want_krb5" = "xno" ; then
1005 AC_WIRESHARK_KRB5_CHECK
1011 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
1014 [ --with-adns[[=DIR]] use GNU ADNS (located in directory DIR, if supplied). [[default=yes, if present]]],
1016 if test "x$withval" = "xno"; then
1018 elif test "x$withval" = "xyes"; then
1020 elif test -d "$withval"; then
1022 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1025 if test "x$with_adns" = "xno" ; then
1029 AC_WIRESHARK_ADNS_CHECK
1034 # Define WS_VAR_IMPORT appropriately for declarations of external
1035 # variables exported from dynamically-linked libraries.
1037 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
1039 dnl Checks for typedefs, structures, and compiler characteristics.
1042 # We need to know whether "struct sockaddr" has an "sa_len" member
1043 # for get_interface_list().
1045 AC_WIRESHARK_STRUCT_SA_LEN
1047 # We must know our byte order
1050 # Checks whether "-traditional" is needed when using "ioctl".
1051 # XXX - do we need this?
1052 AC_PROG_GCC_TRADITIONAL
1056 AC_CHECK_FUNC(getopt, GETOPT_O="",
1057 [GETOPT_O="getopt.o"
1058 AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h needs to be included])
1060 if test "$ac_cv_func_getopt" = no ; then
1067 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
1068 # then this won't work.
1071 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
1072 [SNPRINTF_O="snprintf.o"
1073 AC_DEFINE(NEED_SNPRINTF_H, 1, [Define if sprintf.h needs to be included])
1075 if test "$ac_cv_func_snprintf" = no ; then
1076 SNPRINTF_C="snprintf.c"
1077 SNPRINTF_O="snprintf.o"
1079 AC_SUBST(SNPRINTF_C)
1080 AC_SUBST(SNPRINTF_O)
1082 AC_CHECK_FUNC(strerror, STRERROR_O="",
1083 [STRERROR_O="strerror.o"
1084 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
1086 if test "$ac_cv_func_strerror" = no ; then
1087 STRERROR_C="strerror.c"
1088 STRERROR_O="strerror.o"
1090 AC_SUBST(STRERROR_C)
1091 AC_SUBST(STRERROR_O)
1093 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
1094 STRCASECMP_O="strcasecmp.o")
1095 if test "$ac_cv_func_strcasecmp" = no ; then
1096 STRCASECMP_C="strcasecmp.c"
1097 STRCASECMP_O="strcasecmp.o"
1099 AC_SUBST(STRCASECMP_C)
1100 AC_SUBST(STRCASECMP_O)
1102 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
1103 STRNCASECMP_O="strncasecmp.o")
1104 if test "$ac_cv_func_strncasecmp" = no ; then
1105 STRNCASECMP_C="strncasecmp.c"
1106 STRNCASECMP_O="strncasecmp.o"
1108 AC_SUBST(STRNCASECMP_C)
1109 AC_SUBST(STRNCASECMP_O)
1111 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1112 MKSTEMP_O="mkstemp.o")
1113 if test "$ac_cv_func_mkstemp" = no ; then
1114 MKSTEMP_C="mkstemp.c"
1115 MKSTEMP_O="mkstemp.o"
1120 ac_save_LIBS="$LIBS"
1121 LIBS="$GLIB_LIBS $LIBS"
1122 G_ASCII_STRTOULL_C=""
1123 G_ASCII_STRTOULL_O=""
1124 G_ASCII_STRTOULL_LO=""
1125 AC_CHECK_FUNC(g_ascii_strtoull,
1126 [G_ASCII_STRTOULL_O=""
1127 G_ASCII_STRTOULL_LO=""],
1128 [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1129 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1130 AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1132 LIBS="$ac_save_LIBS"
1133 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1134 G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1135 G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1136 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1138 AC_SUBST(G_ASCII_STRTOULL_C)
1139 AC_SUBST(G_ASCII_STRTOULL_O)
1140 AC_SUBST(G_ASCII_STRTOULL_LO)
1142 AC_CHECK_FUNC(inet_aton,
1145 [INET_ATON_O="inet_aton.o"
1146 INET_ATON_LO="inet_aton.lo"
1148 if test "$ac_cv_func_inet_aton" = no ; then
1149 INET_ATON_C="inet_aton.c"
1150 INET_ATON_O="inet_aton.o"
1151 INET_ATON_LO="inet_aton.lo"
1152 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1154 AC_SUBST(INET_ATON_C)
1155 AC_SUBST(INET_ATON_O)
1156 AC_SUBST(INET_ATON_LO)
1158 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1159 dnl check for pre-BIND82 inet_pton() bug.
1160 AC_MSG_CHECKING(for broken inet_pton)
1161 AC_TRY_RUN([#include <sys/types.h>
1162 #include <sys/socket.h>
1163 #include <netinet/in.h>
1164 #include <arpa/inet.h>
1169 /* this should return 0 (error) */
1170 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1174 }], [AC_MSG_RESULT(ok);
1175 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1176 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1177 have_inet_pton=no])],
1179 if test "$have_inet_pton" = no; then
1180 INET_PTON_C="inet_pton.c"
1181 INET_PTON_O="inet_pton.o"
1182 INET_PTON_LO="inet_pton.lo"
1188 AC_SUBST(INET_PTON_C)
1189 AC_SUBST(INET_PTON_O)
1190 AC_SUBST(INET_PTON_LO)
1192 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1193 AC_MSG_CHECKING([for inet_ntop prototype])
1194 AC_TRY_COMPILE([#include <stdio.h>
1195 #include <sys/types.h>
1196 #include <sys/socket.h>
1197 #include <netinet/in.h>
1198 #include <arpa/inet.h>
1200 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1202 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1203 [Define if inet_ntop() prototype exists])], [
1204 AC_TRY_COMPILE([#include <stdio.h>
1205 #include <sys/types.h>
1206 #include <sys/socket.h>
1207 #include <netinet/in.h>
1208 #include <arpa/inet.h>
1210 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1212 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1213 [Define if inet_ntop() prototype exists])], [
1214 AC_MSG_RESULT(no)])])
1217 INET_NTOP_C="inet_ntop.c"
1218 INET_NTOP_O="inet_ntop.o"
1219 INET_NTOP_LO="inet_ntop.lo"
1220 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1221 [Define if inet/v6defs.h needs to be included])])
1222 AC_SUBST(INET_NTOP_C)
1223 AC_SUBST(INET_NTOP_O)
1224 AC_SUBST(INET_NTOP_LO)
1226 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1227 [STRPTIME_O="strptime.o"
1228 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1230 if test "$ac_cv_func_strptime" = no ; then
1231 STRPTIME_C="strptime.c"
1232 STRPTIME_O="strptime.o"
1234 AC_SUBST(STRPTIME_C)
1235 AC_SUBST(STRPTIME_O)
1237 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1238 AC_CHECK_FUNCS(issetugid)
1239 AC_CHECK_FUNCS(mmap mprotect sysconf)
1241 dnl blank for now, but will be used in future
1242 AC_SUBST(wireshark_SUBDIRS)
1245 dnl check whether plugins should be enabled and, if they should be,
1246 dnl check for plugins directory - stolen from Amanda's configure.in
1248 plugindir="$libdir/wireshark/plugins/$VERSION"
1249 AC_ARG_WITH(plugins,
1250 [ --with-plugins[[=DIR]] support plugins (installed in DIR, if supplied).],
1254 if test x$have_plugins = xno
1256 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1263 if test x$have_plugins = xno
1265 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1267 plugindir="$withval"
1272 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1273 if test x$have_plugins = xyes
1275 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1277 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1278 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1279 eval echo "$plugindir"
1281 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1283 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1288 # The plugin dissectors reside in ./plugins/PROTO/
1290 PLUGIN_LIBS="-L../../epan -lwireshark $GLIB_LIBS"
1291 AC_SUBST(PLUGIN_LIBS)
1295 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1296 # (autoconf? automake? libtool?) - with the newer version(s), it's
1297 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1299 # With older version(s) of those tool(s), however, it's not just an
1300 # alias, and the configure scripts don't work without it.
1303 AC_SUBST(LIBTOOL_DEPS)
1305 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1306 if test x$enable_static = xyes -a x$have_plugins = xyes
1308 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
1310 AC_SUBST(ENABLE_STATIC)
1312 dnl Save the cacheable configure results to config.cache before recursing
1315 AM_CONFIG_HEADER(config.h)
1316 AC_CONFIG_SUBDIRS(wiretap)
1324 epan/dfilter/Makefile
1325 epan/dissectors/Makefile
1326 epan/ftypes/Makefile
1331 packaging/nsis/Makefile
1332 packaging/rpm/Makefile
1333 packaging/rpm/SPECS/Makefile
1334 packaging/rpm/SPECS/wireshark.spec
1335 packaging/svr4/Makefile
1336 packaging/svr4/checkinstall
1337 packaging/svr4/pkginfo
1339 plugins/acn/Makefile
1340 plugins/agentx/Makefile
1341 plugins/artnet/Makefile
1342 plugins/asn1/Makefile
1343 plugins/ciscosm/Makefile
1344 plugins/docsis/Makefile
1345 plugins/enttec/Makefile
1346 plugins/giop/Makefile
1347 plugins/gryphon/Makefile
1348 plugins/h223/Makefile
1349 plugins/irda/Makefile
1350 plugins/lua/Makefile
1351 plugins/lwres/Makefile
1352 plugins/mate/Makefile
1353 plugins/megaco/Makefile
1354 plugins/mgcp/Makefile
1355 plugins/opsi/Makefile
1356 plugins/pcli/Makefile
1357 plugins/profinet/Makefile
1358 plugins/rdm/Makefile
1359 plugins/rlm/Makefile
1360 plugins/rtnet/Makefile
1361 plugins/rudp/Makefile
1362 plugins/sbus/Makefile
1363 plugins/stats_tree/Makefile
1364 plugins/v5ua/Makefile
1366 tools/lemon/Makefile
1372 if test "x$enable_setuid_install" = "xyes" ; then
1373 setuid_message="yes (DANGEROUS!!!)"
1378 if test "x$want_zlib" = "xno" ; then
1384 if test "x$want_pcre" = "xno" ; then
1390 if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
1396 if test "x$want_ssl" = "xno" ; then
1402 if test "x$want_krb5" = "xno" ; then
1405 krb5_message="yes ($ac_krb5_version)"
1408 if test "x$have_good_adns" = "xyes" ; then
1414 if test "x$have_net_snmp" = "xyes" ; then
1415 snmp_libs_message="yes (net-snmp)"
1416 elif test "x$have_ucdsnmp" = "xyes" ; then
1417 snmp_libs_message="yes (ucd-snmp)"
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 " Use GTK+ v2 library : $enable_gtk2"
1439 if test "x$enable_gtk2" = "xyes" ; then
1440 echo " Use threads : $enable_threads"
1441 echo " Build profile binaries : $enable_profile_build"
1443 echo " Use pcap library : $want_pcap"
1444 echo " Use zlib library : $zlib_message"
1445 echo " Use pcre library : $pcre_message"
1446 echo " Use kerberos library : $krb5_message"
1447 echo " Use GNU ADNS library : $adns_message"
1448 echo " Use GNU crypto library : $gcrypt_message"
1449 echo " Use SSL crypto library : $ssl_message"
1450 echo " Use IPv6 name resolution : $enable_ipv6"
1451 echo " Use UCD SNMP/Net-SNMP library : $snmp_libs_message"
1452 echo " Use gnutls library : $tls_message"