7 dnl Check for CPU / vendor / OS
11 AM_INIT_AUTOMAKE(ethereal, 0.10.14)
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"
85 AC_PATH_PROG(XSLTPROC, xsltproc)
86 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
87 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
90 AC_PATH_PROG(XMLLINT, xmllint)
91 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
92 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
94 # Check for fop (translate .fo to e.g. pdf)
95 AC_PATH_PROG(FOP, fop)
96 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
97 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
99 # Check for hhc (html help compiler)
100 AC_PATH_PROG(HHC, hhc.exe)
101 AC_CHECK_PROG(HAVE_HHC, hhc.exe, "yes", "no")
102 AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
104 # Check for packaging utilities
105 # For now, we check to see if the various packaging utilites are in our
106 # path. I'm too lazy to write code to go hunt for them. - Gerald
107 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
108 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
109 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
111 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
112 -a x$HAVE_PKGTRANS = xyes ; then
113 HAVE_SVR4_PACKAGING=yes
115 HAVE_SVR4_PACKAGING=no
117 AC_SUBST(HAVE_SVR4_PACKAGING)
119 AC_ETHEREAL_RPM_CHECK
123 # If we're running gcc, add '-Wall -W' to CFLAGS, and add
124 # '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
125 # flag unused function arguments and not get warnings about them.
126 # If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
127 # -Wcast-align" as well. (Add more checks here in the future?)
129 # Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
130 # argument will compile with non-GCC compilers.
132 AC_ARG_WITH(extra-gcc-checks,
133 [ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
135 if test $withval != no
137 ethereal_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wstrict-prototypes -Wmissing-declarations -Wwrite-strings"
140 AC_MSG_CHECKING(to see if we can add '-Wall -W $ethereal_extra_gcc_flags' to CFLAGS)
141 if test x$GCC != x ; then
142 CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -Wpointer-arith -W $ethereal_extra_gcc_flags $CFLAGS"
145 CFLAGS="-D_U_=\"\" $CFLAGS"
150 # Add any platform-specific compiler flags needed.
152 AC_MSG_CHECKING(for platform-specific compiler flags)
156 # Not GCC - assume it's the vendor's compiler.
161 # HP's ANSI C compiler; flags suggested by Jost Martin.
162 # "-Ae" for ANSI C plus extensions such as "long long".
163 # "+O2", for optimization. XXX - works with "-g"?
165 CFLAGS="-Ae +O2 $CFLAGS"
166 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
170 # It may be called "cc", but it's really a GCC derivative
171 # with a problematic special precompiler and precompiled
172 # headers; turn off the special precompiler, as some
173 # apparently-legal code won't compile with its precompiled
176 CFLAGS="-no-cpp-precomp $CFLAGS"
177 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
180 AC_MSG_RESULT(none needed)
186 # the X11 headers don't automatically include prototype info
187 # and a lot don't include the return type
188 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
189 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
193 # See comments above about Apple's lovely C compiler.
195 CFLAGS="-no-cpp-precomp $CFLAGS"
196 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
200 # Shared libraries in cygwin/Win32 must never contain
203 LDFLAGS="$LDFLAGS -no-undefined"
204 AC_MSG_RESULT(CygWin GCC - added -no-undefined to LDFLAGS)
207 AC_MSG_RESULT(none needed)
213 # On OS X, if we find the headers for Core Foundation and Launch Services,
214 # add -framework options to link with Application Services (of which
215 # Launch Services is a subframework) and Core Foundation (required by
216 # the Launch Services APIs), so we can use that to launch a Web browser
217 # from the Help menu.
219 # (Do those headers exist on pure Darwin? If so, does the CoreFoundation
220 # *and* Launch Services code exist there, or are those headers just stubs?
221 # If the frameworks aren't present on Darwin, how *should* we check for
227 AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
229 ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
230 LIBS="$LIBS $ac_frameworks"
233 # include <CoreFoundation/CFBase.h>
234 # include <CoreFoundation/CFString.h>
235 # include <CoreFoundation/CFURL.h>
236 # include <ApplicationServices/ApplicationServices.h>
239 CFStringRef url_CFString;
243 url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
244 url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
245 status = LSOpenCFURLRef(url_CFURL, NULL);
247 ac_cv_can_use_cf_and_ls=yes,
248 ac_cv_can_use_cf_and_ls=no,
249 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
250 if test "$ac_cv_can_use_cf_and_ls" = yes ; then
251 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
252 FRAMEWORKS="$ac_frameworks"
262 dnl Look in /usr/local for header files and libraries ?
263 dnl XXX FIXME don't include /usr/local if it is already in the system
264 dnl search path as this causes gcc 3.2 on Linux to complain about a change
265 dnl of the system search order for includes
266 AC_ARG_ENABLE(usr-local,
267 [ --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)
269 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
270 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
273 # Arrange that we search for header files in the source directory
274 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
275 # as various packages we use ("libpcap", "zlib", an SNMP library)
276 # may have been installed under "/usr/local/include".
278 CFLAGS="$CFLAGS -I/usr/local/include"
279 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
282 # Arrange that we search for libraries in "/usr/local/lib".
284 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
290 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
295 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
296 if test x$LD_LIBRARY_PATH != x ; then
297 LIBS="$LIBS -R$LD_LIBRARY_PATH"
298 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
300 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
306 # Check for versions of "sed" inadequate to handle, in libtool, a list
307 # of object files as large as the list in Ethereal.
309 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
310 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
311 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
312 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
313 # is the only "sed" that comes with Solaris that can handle Ethereal.
315 # Add any checks here that are necessary for other OSes.
317 AC_ETHEREAL_GNU_SED_CHECK
318 if test "$HAVE_GNU_SED" = no ; then
321 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
323 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
325 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
340 # Enable/disable tethereal
342 AC_ARG_ENABLE(ethereal,
343 [ --enable-ethereal build GTK+-based ethereal. [default=yes]],enable_ethereal=$enableval,enable_ethereal=yes)
346 [ --disable-gtk2 build Glib1/Gtk1+-based (t)ethereal. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
347 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
349 AC_ARG_ENABLE(threads,
350 [ --enable-threads use threads in ethereal. [default=no]],enable_threads=$enableval,enable_threads=no)
351 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
353 AC_ARG_ENABLE(profile-build,
354 [ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
355 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
356 AC_MSG_CHECKING(if profile builds must be generated)
357 if test "x$enable_profile_build" = "xyes" ; then
358 if test -n "$GCC" ; then
360 CFLAGS=" -pg $CFLAGS"
363 echo "Building profile binaries currently only supported for GCC."
369 # Create DATAFILE_DIR #define for config.h
370 datafiledir=$datadir/ethereal
372 test "x$prefix" = xNONE && prefix=$ac_default_prefix
373 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
374 eval echo "$datafiledir"
376 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
379 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
380 # programs to be built with GTK+.
382 if test "x$enable_gtk2" = "xyes" -a "x$enable_ethereal" = "xyes" ; then
384 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
385 elif test "x$enable_gtk2" != "xyes" -a "x$enable_ethereal" = "xyes" ; then
387 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
393 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
394 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
395 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
396 # set when generating the Makefile, so we can make programs that require
397 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
398 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
399 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
400 # programs to be built with GLib.
402 if test "$GTK_OK" = "no" ; then
407 if test "x$enable_gtk2" = "xyes" ; then
408 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
410 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
413 ethereal_bin="ethereal\$(EXEEXT)"
414 ethereal_man="ethereal.1"
415 ethereal_SUBDIRS="gtk"
417 if test "$GTK_OK" = "two" ; then
418 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
420 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
425 # Check whether GLib modules are supported, to determine whether we
426 # can support plugins.
428 AC_MSG_CHECKING(whether GLib supports loadable modules)
429 ac_save_CFLAGS="$CFLAGS"
431 CFLAGS="$CFLAGS $GLIB_CFLAGS"
432 LIBS="$GLIB_LIBS $LIBS"
442 if (g_module_supported())
443 return 0; /* success */
445 return 1; /* failure */
447 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
448 [echo $ac_n "cross compiling; assumed OK... $ac_c"
449 ac_cv_glib_supports_modules=yes])
450 CFLAGS="$ac_save_CFLAGS"
452 if test "$ac_cv_glib_supports_modules" = yes ; then
461 # We can't just check for <inttypes.h> - some systems have one that
462 # doesn't define all the PRI[doxu]64 macros.
464 AC_CHECK_HEADERS(inttypes.h,
467 # OK, we have inttypes.h, but does it define those macros?
469 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
474 #include <inttypes.h>
477 #include <sys/types.h>
481 printf("%" PRId64 "\n", (gint64)1);
482 printf("%" PRIo64 "\n", (guint64)1);
483 printf("%" PRIx64 "\n", (guint64)1);
484 printf("%" PRIX64 "\n", (guint64)1);
485 printf("%" PRIu64 "\n", (guint64)1);
491 ac_ethereal_inttypes_h_defines_formats=yes
495 ac_ethereal_inttypes_h_defines_formats=no
500 # We don't have inttypes.h, so it obviously can't define those
503 ac_ethereal_inttypes_h_defines_formats=no
505 if test "$ac_ethereal_inttypes_h_defines_formats" = yes; then
506 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
508 AC_ETHEREAL_CHECK_64BIT_FORMAT(ll,
510 AC_ETHEREAL_CHECK_64BIT_FORMAT(L,
512 AC_ETHEREAL_CHECK_64BIT_FORMAT(q,
514 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
520 AC_SUBST(ethereal_bin)
521 AC_SUBST(ethereal_man)
523 rdps_bin="rdps\$(EXEEXT)"
527 # Enable/disable tethereal
529 AC_ARG_ENABLE(tethereal,
530 [ --enable-tethereal build tethereal. [default=yes]],tethereal=$enableval,enable_tethereal=yes)
532 if test "x$enable_tethereal" = "xyes" ; then
533 tethereal_bin="tethereal\$(EXEEXT)"
534 tethereal_man="tethereal.1"
535 etherealfilter_man="ethereal-filter.4"
540 AC_SUBST(tethereal_bin)
541 AC_SUBST(tethereal_man)
542 AC_SUBST(etherealfilter_man)
546 # Enable/disable editcap
548 AC_ARG_ENABLE(editcap,
549 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
551 if test "x$enable_editcap" = "xyes" ; then
552 editcap_bin="editcap\$(EXEEXT)"
553 editcap_man="editcap.1"
558 AC_SUBST(editcap_bin)
559 AC_SUBST(editcap_man)
562 # Enable/disable dumpcap
564 AC_ARG_ENABLE(dumpcap,
565 [ --enable-dumpcap build dumpcap. [default=yes]],enable_dumpcap=$enableval,enable_dumpcap=yes)
567 if test "x$enable_dumpcap" = "xyes" ; then
568 dumpcap_bin="dumpcap\$(EXEEXT)"
569 dumpcap_man="dumpcap.1"
574 AC_SUBST(dumpcap_bin)
575 AC_SUBST(dumpcap_man)
578 # Enable/disable capinfos
580 AC_ARG_ENABLE(capinfos,
581 [ --enable-capinfos build capinfos. [default=yes]],enable_capinfos=$enableval,enable_capinfos=yes)
583 if test "x$enable_capinfos" = "xyes" ; then
584 capinfos_bin="capinfos\$(EXEEXT)"
585 capinfos_man="capinfos.1"
590 AC_SUBST(capinfos_bin)
591 AC_SUBST(capinfos_man)
594 # Enable/disable mergecap
596 AC_ARG_ENABLE(mergecap,
597 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
599 if test "x$enable_mergecap" = "xyes" ; then
600 mergecap_bin="mergecap\$(EXEEXT)"
601 mergecap_man="mergecap.1"
606 AC_SUBST(mergecap_bin)
607 AC_SUBST(mergecap_man)
610 # Enable/disable text2pcap
612 AC_ARG_ENABLE(text2pcap,
613 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
615 if test "x$enable_text2pcap" = "xyes" ; then
616 text2pcap_bin="text2pcap\$(EXEEXT)"
617 text2pcap_man="text2pcap.1"
622 AC_SUBST(text2pcap_bin)
623 AC_SUBST(text2pcap_man)
625 # Enable/disable idl2eth
627 AC_ARG_ENABLE(idl2eth,
628 [ --enable-idl2eth build idl2eth. [default=yes]],enable_idl2eth=$enableval,enable_idl2eth=yes)
630 if test "x$enable_idl2eth" = "xyes" ; then
631 idl2eth_bin="idl2eth"
632 idl2eth_man="idl2eth.1"
637 AC_SUBST(idl2eth_bin)
638 AC_SUBST(idl2eth_man)
641 # Enable/disable dftest
643 AC_ARG_ENABLE(dftest,
644 [ --enable-dftest build dftest. [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
646 if test "x$enable_dftest" = "xyes" ; then
647 dftest_bin="dftest\$(EXEEXT)"
654 # Enable/disable randpkt
656 AC_ARG_ENABLE(randpkt,
657 [ --enable-randpkt build randpkt. [default=yes]],enable_randpkt=$enableval,enable_randpkt=yes)
659 if test "x$enable_randpkt" = "xyes" ; then
660 randpkt_bin="randpkt\$(EXEEXT)"
664 AC_SUBST(randpkt_bin)
667 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
668 dnl "gethostbyname()".
669 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
671 dnl Checks for "connect()", used as a proxy for "socket()" - and
672 dnl "-lsocket", if we need it to get "connect()".
673 AC_ETHEREAL_SOCKET_LIB_CHECK
676 AC_MSG_CHECKING(whether to use libpcap for packet capture)
679 [ --with-pcap[[=DIR]] use libpcap for packet capturing. [[default=yes]]],
681 if test $withval = no
684 elif test $withval = yes
695 if test "x$want_pcap" = "xno" ; then
699 AC_ETHEREAL_PCAP_CHECK
703 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
706 [ --with-zlib[[=DIR]] use zlib (located in directory DIR, if supplied) to read compressed data. [[default=yes, if available]]],
708 if test $withval = no
711 elif test $withval = yes
720 # Use zlib if it's present, otherwise don't.
722 want_zlib=ifavailable
725 if test "x$want_zlib" = "xno" ; then
729 AC_ETHEREAL_ZLIB_CHECK
730 if test "x$want_zlib" = "xno" ; then
731 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
737 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
740 [ --with-pcre[[=DIR]] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [[default=yes, if available]]],
742 if test $withval = no
745 elif test $withval = yes
754 # Use libpcre if it's present, otherwise don't.
756 want_pcre=ifavailable
759 if test "x$want_pcre" = "xno" ; then
763 AC_ETHEREAL_LIBPCRE_CHECK
764 if test "x$want_pcre" = "xno" ; then
765 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
771 AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
774 [ --with-lua[[=DIR]] use liblua (located in directory DIR, if supplied) for the lua scripting plugin. [[default=no]]],
776 if test $withval = no
779 elif test $withval = yes
788 # Don't use liblua by default (it isn't ready yet)
793 if test "x$want_lua" = "xno" ; then
797 AC_ETHEREAL_LIBLUA_CHECK
798 if test "x$want_lua" = "xno" ; then
799 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
802 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
807 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
809 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
810 if test "x$enable_ipv6" = "xno" ; then
814 AC_ETHEREAL_IPV6_STACK
818 dnl Check if ethereal should be installed setuid
819 AC_ARG_ENABLE(setuid-install,
820 [ --enable-setuid-install install ethereal as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
822 AC_MSG_CHECKING(whether to install ethereal setuid)
823 if test "x$enable_setuid_install" = "xno" ; then
826 if test "x$enable_dumpcap" = "xno" ; then
827 AC_MSG_ERROR(Setuid install works only with --enable-dumpcap, but dumpcap disabled)
833 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
835 dnl Checks for header files.
837 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
838 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)
839 AC_CHECK_HEADERS(netinet/in.h)
840 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
841 AC_CHECK_HEADERS(iconv.h)
845 AC_MSG_CHECKING(whether to use SSL library)
848 [ --with-ssl[[=DIR]] use SSL crypto library (located in directory DIR, if supplied). [[default=no]]],
850 if test "x$withval" = "xno"; then
852 elif test "x$withval" = "xyes"; then
854 elif test -d "$withval"; then
856 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
861 if test "x$want_ssl" = "xyes"; then
863 AC_CHECK_LIB(crypto,EVP_md5,
868 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
875 dnl UCD SNMP/Net-SNMP Check
878 AC_ARG_WITH(net-snmp,
879 [ --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]]],
881 if test $withval = no
884 elif test $withval = yes
889 netsnmpconfig="$withval"
893 # Set "want_netsnmp" to "ifavailable" to make the default "use it
894 # if you find it, otherwise don't".
896 want_netsnmp=ifavailable
899 AC_ARG_WITH(ucd-snmp,
900 [ --with-ucd-snmp[[=DIR]] use UCD SNMP client library (located in directory DIR, if supplied). [[default=yes, if available]]],
902 if test $withval = no
905 elif test $withval = yes
914 # Set "want_ucdsnmp" to "ifavailable" to make the default "use it
915 # if you find it, otherwise don't".
917 want_ucdsnmp=ifavailable
922 # Try Net-SNMP first.
924 AC_MSG_CHECKING(whether to use Net-SNMP library)
925 if test "x$want_netsnmp" = "xno" ; then
928 if test "x$want_netsnmp" = "xifavailable" ; then
929 AC_MSG_RESULT([yes, if available])
933 AC_ETHEREAL_NETSNMP_CHECK
937 # If that didn't find Net-SNMP, try UCD SNMP.
939 if test "x$have_net_snmp" != "xyes" ; then
940 AC_MSG_CHECKING(whether to use UCD SNMP library)
941 if test "x$want_ucdsnmp" = "xno" ; then
944 if test "x$want_ucdsnmp" = "xifavailable" ; then
945 AC_MSG_RESULT([yes, if available])
949 AC_ETHEREAL_UCDSNMP_CHECK
953 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
954 AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to 1 if some SNMP support is to be used])
961 AC_MSG_CHECKING(whether to use kerberos)
964 [ --with-krb5[[=DIR]] use kerberos (located in directory DIR, if supplied) to use in kerberos dissection [[default=yes]]],
966 if test $withval = no
969 elif test $withval = yes
978 # Use kerberos if specified, otherwise don't.
980 want_krb5=ifavailable
983 if test "x$want_krb5" = "xno" ; then
987 AC_ETHEREAL_KRB5_CHECK
993 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
996 [ --with-adns[[=DIR]] use GNU ADNS (located in directory DIR, if supplied). [[default=yes, if present]]],
998 if test "x$withval" = "xno"; then
1000 elif test "x$withval" = "xyes"; then
1002 elif test -d "$withval"; then
1004 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1007 if test "x$with_adns" = "xno" ; then
1011 AC_ETHEREAL_ADNS_CHECK
1016 # Define ETH_VAR_IMPORT appropriately for declarations of external
1017 # variables exported from dynamically-linked libraries.
1019 AC_DEFINE(ETH_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
1021 dnl Checks for typedefs, structures, and compiler characteristics.
1024 # We need to know whether "struct sockaddr" has an "sa_len" member
1025 # for get_interface_list().
1027 AC_ETHEREAL_STRUCT_SA_LEN
1029 # We must know our byte order
1032 # Checks whether "-traditional" is needed when using "ioctl".
1033 # XXX - do we need this?
1034 AC_PROG_GCC_TRADITIONAL
1038 AC_CHECK_FUNC(getopt, GETOPT_O="",
1039 [GETOPT_O="getopt.o"
1040 AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h needs to be included])
1042 if test "$ac_cv_func_getopt" = no ; then
1049 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
1050 # then this won't work.
1053 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
1054 [SNPRINTF_O="snprintf.o"
1055 AC_DEFINE(NEED_SNPRINTF_H, 1, [Define if sprintf.h needs to be included])
1057 if test "$ac_cv_func_snprintf" = no ; then
1058 SNPRINTF_C="snprintf.c"
1059 SNPRINTF_O="snprintf.o"
1061 AC_SUBST(SNPRINTF_C)
1062 AC_SUBST(SNPRINTF_O)
1064 AC_CHECK_FUNC(strerror, STRERROR_O="",
1065 [STRERROR_O="strerror.o"
1066 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
1068 if test "$ac_cv_func_strerror" = no ; then
1069 STRERROR_C="strerror.c"
1070 STRERROR_O="strerror.o"
1072 AC_SUBST(STRERROR_C)
1073 AC_SUBST(STRERROR_O)
1075 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
1076 STRCASECMP_O="strcasecmp.o")
1077 if test "$ac_cv_func_strcasecmp" = no ; then
1078 STRCASECMP_C="strcasecmp.c"
1079 STRCASECMP_O="strcasecmp.o"
1081 AC_SUBST(STRCASECMP_C)
1082 AC_SUBST(STRCASECMP_O)
1084 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
1085 STRNCASECMP_O="strncasecmp.o")
1086 if test "$ac_cv_func_strncasecmp" = no ; then
1087 STRNCASECMP_C="strncasecmp.c"
1088 STRNCASECMP_O="strncasecmp.o"
1090 AC_SUBST(STRNCASECMP_C)
1091 AC_SUBST(STRNCASECMP_O)
1093 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1094 MKSTEMP_O="mkstemp.o")
1095 if test "$ac_cv_func_mkstemp" = no ; then
1096 MKSTEMP_C="mkstemp.c"
1097 MKSTEMP_O="mkstemp.o"
1102 ac_save_LIBS="$LIBS"
1103 LIBS="$GLIB_LIBS $LIBS"
1104 G_ASCII_STRTOULL_C=""
1105 G_ASCII_STRTOULL_O=""
1106 G_ASCII_STRTOULL_LO=""
1107 AC_CHECK_FUNC(g_ascii_strtoull,
1108 [G_ASCII_STRTOULL_O=""
1109 G_ASCII_STRTOULL_LO=""],
1110 [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1111 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1112 AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1114 LIBS="$ac_save_LIBS"
1115 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1116 G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1117 G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1118 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1120 AC_SUBST(G_ASCII_STRTOULL_C)
1121 AC_SUBST(G_ASCII_STRTOULL_O)
1122 AC_SUBST(G_ASCII_STRTOULL_LO)
1124 AC_CHECK_FUNC(inet_aton,
1127 [INET_ATON_O="inet_aton.o"
1128 INET_ATON_LO="inet_aton.lo"
1130 if test "$ac_cv_func_inet_aton" = no ; then
1131 INET_ATON_C="inet_aton.c"
1132 INET_ATON_O="inet_aton.o"
1133 INET_ATON_LO="inet_aton.lo"
1134 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1136 AC_SUBST(INET_ATON_C)
1137 AC_SUBST(INET_ATON_O)
1138 AC_SUBST(INET_ATON_LO)
1140 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1141 dnl check for pre-BIND82 inet_pton() bug.
1142 AC_MSG_CHECKING(for broken inet_pton)
1143 AC_TRY_RUN([#include <sys/types.h>
1144 #include <sys/socket.h>
1145 #include <netinet/in.h>
1146 #include <arpa/inet.h>
1151 /* this should return 0 (error) */
1152 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1156 }], [AC_MSG_RESULT(ok);
1157 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1158 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1159 have_inet_pton=no])],
1161 if test "$have_inet_pton" = no; then
1162 INET_PTON_C="inet_pton.c"
1163 INET_PTON_O="inet_pton.o"
1164 INET_PTON_LO="inet_pton.lo"
1170 AC_SUBST(INET_PTON_C)
1171 AC_SUBST(INET_PTON_O)
1172 AC_SUBST(INET_PTON_LO)
1174 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1175 AC_MSG_CHECKING([for inet_ntop prototype])
1176 AC_TRY_COMPILE([#include <stdio.h>
1177 #include <sys/types.h>
1178 #include <sys/socket.h>
1179 #include <netinet/in.h>
1180 #include <arpa/inet.h>
1182 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1184 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1185 [Define if inet_ntop() prototype exists])], [
1186 AC_TRY_COMPILE([#include <stdio.h>
1187 #include <sys/types.h>
1188 #include <sys/socket.h>
1189 #include <netinet/in.h>
1190 #include <arpa/inet.h>
1192 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1194 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1195 [Define if inet_ntop() prototype exists])], [
1196 AC_MSG_RESULT(no)])])
1199 INET_NTOP_C="inet_ntop.c"
1200 INET_NTOP_O="inet_ntop.o"
1201 INET_NTOP_LO="inet_ntop.lo"
1202 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1203 [Define if inet/v6defs.h needs to be included])])
1204 AC_SUBST(INET_NTOP_C)
1205 AC_SUBST(INET_NTOP_O)
1206 AC_SUBST(INET_NTOP_LO)
1208 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1209 [STRPTIME_O="strptime.o"
1210 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1212 if test "$ac_cv_func_strptime" = no ; then
1213 STRPTIME_C="strptime.c"
1214 STRPTIME_O="strptime.o"
1216 AC_SUBST(STRPTIME_C)
1217 AC_SUBST(STRPTIME_O)
1219 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1220 AC_CHECK_FUNCS(issetugid)
1221 AC_CHECK_FUNCS(mmap mprotect sysconf)
1223 dnl blank for now, but will be used in future
1224 AC_SUBST(ethereal_SUBDIRS)
1227 dnl check whether plugins should be enabled and, if they should be,
1228 dnl check for plugins directory - stolen from Amanda's configure.in
1230 plugindir="$libdir/ethereal/plugins/$VERSION"
1231 AC_ARG_WITH(plugins,
1232 [ --with-plugins[[=DIR]] support plugins (installed in DIR, if supplied).],
1236 if test x$have_plugins = xno
1238 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1245 if test x$have_plugins = xno
1247 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1249 plugindir="$withval"
1254 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1255 if test x$have_plugins = xyes
1257 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1259 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1260 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1261 eval echo "$plugindir"
1263 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1265 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1270 # The plugin dissectors reside in ./plugins/PROTO/
1272 PLUGIN_LIBS="-L../../epan -lethereal $GLIB_LIBS"
1273 AC_SUBST(PLUGIN_LIBS)
1277 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1278 # (autoconf? automake? libtool?) - with the newer version(s), it's
1279 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1281 # With older version(s) of those tool(s), however, it's not just an
1282 # alias, and the configure scripts don't work without it.
1285 AC_SUBST(LIBTOOL_DEPS)
1287 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1288 if test x$enable_static = xyes -a x$have_plugins = xyes
1290 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Ethereal])
1292 AC_SUBST(ENABLE_STATIC)
1294 dnl Save the cacheable configure results to config.cache before recursing
1297 AM_CONFIG_HEADER(config.h)
1298 AC_CONFIG_SUBDIRS(wiretap)
1305 epan/dfilter/Makefile
1306 epan/dissectors/Makefile
1307 epan/ftypes/Makefile
1312 packaging/nsis/Makefile
1313 packaging/rpm/Makefile
1314 packaging/rpm/SPECS/Makefile
1315 packaging/rpm/SPECS/ethereal.spec
1316 packaging/svr4/Makefile
1317 packaging/svr4/checkinstall
1318 packaging/svr4/pkginfo
1320 plugins/acn/Makefile
1321 plugins/agentx/Makefile
1322 plugins/artnet/Makefile
1323 plugins/asn1/Makefile
1324 plugins/ciscosm/Makefile
1325 plugins/docsis/Makefile
1326 plugins/enttec/Makefile
1327 plugins/giop/Makefile
1328 plugins/gryphon/Makefile
1329 plugins/h223/Makefile
1330 plugins/irda/Makefile
1331 plugins/lua/Makefile
1332 plugins/lwres/Makefile
1333 plugins/mate/Makefile
1334 plugins/megaco/Makefile
1335 plugins/mgcp/Makefile
1336 plugins/opsi/Makefile
1337 plugins/pcli/Makefile
1338 plugins/profinet/Makefile
1339 plugins/rdm/Makefile
1340 plugins/rlm/Makefile
1341 plugins/rtnet/Makefile
1342 plugins/rudp/Makefile
1343 plugins/stats_tree/Makefile
1344 plugins/v5ua/Makefile
1346 tools/lemon/Makefile
1352 if test "x$enable_setuid_install" = "xyes" ; then
1353 setuid_message="yes (DANGEROUS!!!)"
1358 if test "x$want_zlib" = "xno" ; then
1364 if test "x$want_pcre" = "xno" ; then
1370 if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
1376 if test "x$want_ssl" = "xno" ; then
1382 if test "x$want_krb5" = "xno" ; then
1385 krb5_message="yes ($ac_krb5_version)"
1388 if test "x$have_good_adns" = "xyes" ; then
1394 if test "x$have_net_snmp" = "xyes" ; then
1395 snmp_libs_message="yes (net-snmp)"
1396 elif test "x$have_ucdsnmp" = "xyes" ; then
1397 snmp_libs_message="yes (ucd-snmp)"
1399 snmp_libs_message="no"
1403 echo "The Ethereal package has been configured with the following options."
1404 echo " Build ethereal : $enable_ethereal"
1405 echo " Build tethereal : $enable_tethereal"
1406 echo " Build capinfos : $enable_capinfos"
1407 echo " Build editcap : $enable_editcap"
1408 echo " Build dumpcap : $enable_dumpcap"
1409 echo " Build mergecap : $enable_mergecap"
1410 echo " Build text2pcap : $enable_text2pcap"
1411 echo " Build idl2eth : $enable_idl2eth"
1412 echo " Build randpkt : $enable_randpkt"
1413 echo " Build dftest : $enable_dftest"
1415 echo " Install setuid : $setuid_message"
1416 echo " Use plugins : $have_plugins"
1417 echo " Build lua plugin : $lua_message"
1418 echo " Use GTK+ v2 library : $enable_gtk2"
1419 if test "x$enable_gtk2" = "xyes" ; then
1420 echo " Use threads : $enable_threads"
1421 echo " Build profile binaries : $enable_profile_build"
1423 echo " Use pcap library : $want_pcap"
1424 echo " Use zlib library : $zlib_message"
1425 echo " Use pcre library : $pcre_message"
1426 echo " Use kerberos library : $krb5_message"
1427 echo " Use GNU ADNS library : $adns_message"
1428 echo " Use SSL crypto library : $ssl_message"
1429 echo " Use IPv6 name resolution : $enable_ipv6"
1430 echo " Use UCD SNMP/Net-SNMP library : $snmp_libs_message"
1431 echo " Use gnutls library : $tls_message"