7 dnl Check for CPU / vendor / OS
11 AM_INIT_AUTOMAKE(ethereal, 0.10.12)
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 AC_PATH_PROG(XSLTPROC, xsltproc)
68 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
69 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
72 AC_PATH_PROG(XMLLINT, xmllint)
73 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
74 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
76 # Check for fop (translate .fo to e.g. pdf)
77 AC_PATH_PROG(FOP, fop)
78 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
79 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
81 # Check for hhc (html help compiler)
82 AC_PATH_PROG(HHC, hhc.exe)
83 AC_CHECK_PROG(HAVE_HHC, hhc.exe, "yes", "no")
84 AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
86 # Check for packaging utilities
87 # For now, we check to see if the various packaging utilites are in our
88 # path. I'm too lazy to write code to go hunt for them. - Gerald
89 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
90 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
91 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
93 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
94 -a x$HAVE_PKGTRANS = xyes ; then
95 HAVE_SVR4_PACKAGING=yes
97 HAVE_SVR4_PACKAGING=no
99 AC_SUBST(HAVE_SVR4_PACKAGING)
101 AC_ETHEREAL_RPM_CHECK
105 # If we're running gcc, add '-Wall -W' to CFLAGS, and add
106 # '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
107 # flag unused function arguments and not get warnings about them.
108 # If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
109 # -Wcast-align" as well. (Add more checks here in the future?)
111 # Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
112 # argument will compile with non-GCC compilers.
114 AC_ARG_WITH(extra-gcc-checks,
115 [ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
117 if test $withval != no
119 ethereal_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wstrict-prototypes"
122 AC_MSG_CHECKING(to see if we can add '-Wall -W $ethereal_extra_gcc_flags' to CFLAGS)
123 if test x$GCC != x ; then
124 CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W $ethereal_extra_gcc_flags $CFLAGS"
127 CFLAGS="-D_U_=\"\" $CFLAGS"
132 # Add any platform-specific compiler flags needed.
134 AC_MSG_CHECKING(for platform-specific compiler flags)
138 # Not GCC - assume it's the vendor's compiler.
143 # HP's ANSI C compiler; flags suggested by Jost Martin.
144 # "-Ae" for ANSI C plus extensions such as "long long".
145 # "+O2", for optimization. XXX - works with "-g"?
147 CFLAGS="-Ae +O2 $CFLAGS"
148 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
152 # It may be called "cc", but it's really a GCC derivative
153 # with a problematic special precompiler and precompiled
154 # headers; turn off the special precompiler, as some
155 # apparently-legal code won't compile with its precompiled
158 CFLAGS="-no-cpp-precomp $CFLAGS"
159 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
162 AC_MSG_RESULT(none needed)
168 # the X11 headers don't automatically include prototype info
169 # and a lot don't include the return type
170 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
171 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
175 # See comments above about Apple's lovely C compiler.
177 CFLAGS="-no-cpp-precomp $CFLAGS"
178 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
182 # Shared libraries in cygwin/Win32 must never contain
185 LDFLAGS="$LDFLAGS -no-undefined"
186 AC_MSG_RESULT(CygWin GCC - added -no-undefined to LDFLAGS)
189 AC_MSG_RESULT(none needed)
195 # On OS X, if we find the headers for Core Foundation and Launch Services,
196 # add -framework options to link with Application Services (of which
197 # Launch Services is a subframework) and Core Foundation (required by
198 # the Launch Services APIs), so we can use that to launch a Web browser
199 # from the Help menu.
201 # (Do those headers exist on pure Darwin? If so, does the CoreFoundation
202 # *and* Launch Services code exist there, or are those headers just stubs?
203 # If the frameworks aren't present on Darwin, how *should* we check for
209 AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
211 ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
212 LIBS="$LIBS $ac_frameworks"
215 # include <CoreFoundation/CFBase.h>
216 # include <CoreFoundation/CFString.h>
217 # include <CoreFoundation/CFURL.h>
218 # include <ApplicationServices/ApplicationServices.h>
221 CFStringRef url_CFString;
225 url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
226 url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
227 status = LSOpenCFURLRef(url_CFURL, NULL);
229 ac_cv_can_use_cf_and_ls=yes,
230 ac_cv_can_use_cf_and_ls=no,
231 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
232 if test "$ac_cv_can_use_cf_and_ls" = yes ; then
233 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
234 FRAMEWORKS="$ac_frameworks"
244 dnl Look in /usr/local for header files and libraries ?
245 dnl XXX FIXME don't include /usr/local if it is already in the system
246 dnl search path as this causes gcc 3.2 on Linux to complain about a change
247 dnl of the system search order for includes
248 AC_ARG_ENABLE(usr-local,
249 [ --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)
251 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
252 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
255 # Arrange that we search for header files in the source directory
256 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
257 # as various packages we use ("libpcap", "zlib", an SNMP library)
258 # may have been installed under "/usr/local/include".
260 CFLAGS="$CFLAGS -I/usr/local/include"
261 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
264 # Arrange that we search for libraries in "/usr/local/lib".
266 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
272 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
277 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
278 if test x$LD_LIBRARY_PATH != x ; then
279 LIBS="$LIBS -R$LD_LIBRARY_PATH"
280 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
282 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
288 # Check for versions of "sed" inadequate to handle, in libtool, a list
289 # of object files as large as the list in Ethereal.
291 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
292 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
293 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
294 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
295 # is the only "sed" that comes with Solaris that can handle Ethereal.
297 # Add any checks here that are necessary for other OSes.
299 AC_ETHEREAL_GNU_SED_CHECK
300 if test "$HAVE_GNU_SED" = no ; then
303 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
305 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
307 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
322 # Enable/disable tethereal
324 AC_ARG_ENABLE(ethereal,
325 [ --enable-ethereal build GTK+-based ethereal. [default=yes]],enable_ethereal=$enableval,enable_ethereal=yes)
328 [ --disable-gtk2 build Glib1/Gtk1+-based (t)ethereal. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
329 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
331 AC_ARG_ENABLE(threads,
332 [ --enable-threads use threads in ethereal. [default=no]],enable_threads=$enableval,enable_threads=no)
333 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
335 AC_ARG_ENABLE(profile-build,
336 [ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
337 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
338 AC_MSG_CHECKING(if profile builds must be generated)
339 if test "x$enable_profile_build" = "xyes" ; then
340 if test -n "$GCC" ; then
342 CFLAGS=" -pg $CFLAGS"
345 echo "Building profile binaries currently only supported for GCC."
351 # Create DATAFILE_DIR #define for config.h
352 datafiledir=$datadir/ethereal
354 test "x$prefix" = xNONE && prefix=$ac_default_prefix
355 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
356 eval echo "$datafiledir"
358 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
361 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
362 # programs to be built with GTK+.
364 if test "x$enable_gtk2" = "xyes" -a "x$enable_ethereal" = "xyes" ; then
366 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
367 elif test "x$enable_gtk2" != "xyes" -a "x$enable_ethereal" = "xyes" ; then
369 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
375 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
376 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
377 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
378 # set when generating the Makefile, so we can make programs that require
379 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
380 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
381 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
382 # programs to be built with GLib.
384 if test "$GTK_OK" = "no" ; then
389 if test "x$enable_gtk2" = "xyes" ; then
390 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
392 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
395 ethereal_bin="ethereal\$(EXEEXT)"
396 ethereal_man="ethereal.1"
397 ethereal_SUBDIRS="gtk"
399 if test "$GTK_OK" = "two" ; then
400 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
402 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
407 # Check whether GLib modules are supported, to determine whether we
408 # can support plugins.
410 AC_MSG_CHECKING(whether GLib supports loadable modules)
411 ac_save_CFLAGS="$CFLAGS"
413 CFLAGS="$CFLAGS $GLIB_CFLAGS"
414 LIBS="$GLIB_LIBS $LIBS"
424 if (g_module_supported())
425 return 0; /* success */
427 return 1; /* failure */
429 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
430 [echo $ac_n "cross compiling; assumed OK... $ac_c"
431 ac_cv_glib_supports_modules=yes])
432 CFLAGS="$ac_save_CFLAGS"
434 if test "$ac_cv_glib_supports_modules" = yes ; then
443 # We can't just check for <inttypes.h> - some systems have one that
444 # doesn't define all the PRI[doxu]64 macros.
446 AC_CHECK_HEADERS(inttypes.h,
449 # OK, we have inttypes.h, but does it define those macros?
451 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
456 #include <inttypes.h>
459 #include <sys/types.h>
463 printf("%" PRId64 "\n", (gint64)1);
464 printf("%" PRIo64 "\n", (guint64)1);
465 printf("%" PRIx64 "\n", (guint64)1);
466 printf("%" PRIu64 "\n", (guint64)1);
472 ac_ethereal_inttypes_h_defines_formats=yes
476 ac_ethereal_inttypes_h_defines_formats=no
481 # We don't have inttypes.h, so it obviously can't define those
484 ac_ethereal_inttypes_h_defines_formats=no
486 if test "$ac_ethereal_inttypes_h_defines_formats" = yes; then
487 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
489 AC_ETHEREAL_CHECK_64BIT_FORMAT(ll,
491 AC_ETHEREAL_CHECK_64BIT_FORMAT(L,
493 AC_ETHEREAL_CHECK_64BIT_FORMAT(q,
495 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
501 AC_SUBST(ethereal_bin)
502 AC_SUBST(ethereal_man)
504 rdps_bin="rdps\$(EXEEXT)"
508 # Enable/disable tethereal
510 AC_ARG_ENABLE(tethereal,
511 [ --enable-tethereal build tethereal. [default=yes]],tethereal=$enableval,enable_tethereal=yes)
513 if test "x$enable_tethereal" = "xyes" ; then
514 tethereal_bin="tethereal\$(EXEEXT)"
515 tethereal_man="tethereal.1"
516 etherealfilter_man="ethereal-filter.4"
521 AC_SUBST(tethereal_bin)
522 AC_SUBST(tethereal_man)
523 AC_SUBST(etherealfilter_man)
527 # Enable/disable editcap
529 AC_ARG_ENABLE(editcap,
530 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
532 if test "x$enable_editcap" = "xyes" ; then
533 editcap_bin="editcap\$(EXEEXT)"
534 editcap_man="editcap.1"
539 AC_SUBST(editcap_bin)
540 AC_SUBST(editcap_man)
543 # Enable/disable capinfos
545 AC_ARG_ENABLE(capinfos,
546 [ --enable-capinfos build capinfos. [default=yes]],enable_capinfos=$enableval,enable_capinfos=yes)
548 if test "x$enable_capinfos" = "xyes" ; then
549 capinfos_bin="capinfos\$(EXEEXT)"
550 capinfos_man="capinfos.1"
555 AC_SUBST(capinfos_bin)
556 AC_SUBST(capinfos_man)
559 # Enable/disable mergecap
561 AC_ARG_ENABLE(mergecap,
562 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
564 if test "x$enable_mergecap" = "xyes" ; then
565 mergecap_bin="mergecap\$(EXEEXT)"
566 mergecap_man="mergecap.1"
571 AC_SUBST(mergecap_bin)
572 AC_SUBST(mergecap_man)
575 # Enable/disable text2pcap
577 AC_ARG_ENABLE(text2pcap,
578 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
580 if test "x$enable_text2pcap" = "xyes" ; then
581 text2pcap_bin="text2pcap\$(EXEEXT)"
582 text2pcap_man="text2pcap.1"
587 AC_SUBST(text2pcap_bin)
588 AC_SUBST(text2pcap_man)
590 # Enable/disable idl2eth
592 AC_ARG_ENABLE(idl2eth,
593 [ --enable-idl2eth build idl2eth. [default=yes]],enable_idl2eth=$enableval,enable_idl2eth=yes)
595 if test "x$enable_idl2eth" = "xyes" ; then
596 idl2eth_bin="idl2eth"
597 idl2eth_man="idl2eth.1"
602 AC_SUBST(idl2eth_bin)
603 AC_SUBST(idl2eth_man)
606 # Enable/disable dftest
608 AC_ARG_ENABLE(dftest,
609 [ --enable-dftest build dftest. [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
611 if test "x$enable_dftest" = "xyes" ; then
612 dftest_bin="dftest\$(EXEEXT)"
619 # Enable/disable randpkt
621 AC_ARG_ENABLE(randpkt,
622 [ --enable-randpkt build randpkt. [default=yes]],enable_randpkt=$enableval,enable_randpkt=yes)
624 if test "x$enable_randpkt" = "xyes" ; then
625 randpkt_bin="randpkt\$(EXEEXT)"
629 AC_SUBST(randpkt_bin)
632 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
633 dnl "gethostbyname()".
634 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
636 dnl Checks for "connect()", used as a proxy for "socket()" - and
637 dnl "-lsocket", if we need it to get "connect()".
638 AC_ETHEREAL_SOCKET_LIB_CHECK
641 AC_MSG_CHECKING(whether to use libpcap for packet capture)
644 [ --with-pcap[[=DIR]] use libpcap for packet capturing. [[default=yes]]],
646 if test $withval = no
649 elif test $withval = yes
660 if test "x$want_pcap" = "xno" ; then
664 AC_ETHEREAL_PCAP_CHECK
668 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
671 [ --with-zlib[[=DIR]] use zlib (located in directory DIR, if supplied) to read compressed data. [[default=yes, if available]]],
673 if test $withval = no
676 elif test $withval = yes
685 # Use zlib if it's present, otherwise don't.
687 want_zlib=ifavailable
690 if test "x$want_zlib" = "xno" ; then
694 AC_ETHEREAL_ZLIB_CHECK
695 if test "x$want_zlib" = "xno" ; then
696 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
702 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
705 [ --with-pcre[[=DIR]] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [[default=yes, if available]]],
707 if test $withval = no
710 elif test $withval = yes
719 # Use libpcre if it's present, otherwise don't.
721 want_pcre=ifavailable
724 if test "x$want_pcre" = "xno" ; then
728 AC_ETHEREAL_LIBPCRE_CHECK
729 if test "x$want_pcre" = "xno" ; then
730 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
737 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
739 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
740 if test "x$enable_ipv6" = "xno" ; then
744 AC_ETHEREAL_IPV6_STACK
748 dnl Check if ethereal should be installed setuid
749 AC_ARG_ENABLE(setuid-install,
750 [ --enable-setuid-install install ethereal as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
752 AC_MSG_CHECKING(whether to install ethereal setuid)
753 if test "x$enable_setuid_install" = "xno" ; then
759 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
761 dnl Checks for header files.
763 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
764 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)
765 AC_CHECK_HEADERS(netinet/in.h)
766 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
767 AC_CHECK_HEADERS(iconv.h)
771 AC_MSG_CHECKING(whether to use SSL library)
774 [ --with-ssl[[=DIR]] use SSL crypto library (located in directory DIR, if supplied). [[default=no]]],
776 if test "x$withval" = "xno"; then
778 elif test "x$withval" = "xyes"; then
780 elif test -d "$withval"; then
782 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
787 if test "x$want_ssl" = "xyes"; then
789 AC_CHECK_LIB(crypto,EVP_md5,
794 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
801 dnl UCD SNMP/Net-SNMP Check
804 AC_ARG_WITH(net-snmp,
805 [ --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]]],
807 if test $withval = no
810 elif test $withval = yes
815 netsnmpconfig="$withval"
819 # Set "want_netsnmp" to "ifavailable" to make the default "use it
820 # if you find it, otherwise don't".
822 want_netsnmp=ifavailable
825 AC_ARG_WITH(ucd-snmp,
826 [ --with-ucd-snmp[[=DIR]] use UCD SNMP client library (located in directory DIR, if supplied). [[default=yes, if available]]],
828 if test $withval = no
831 elif test $withval = yes
840 # Set "want_ucdsnmp" to "ifavailable" to make the default "use it
841 # if you find it, otherwise don't".
843 want_ucdsnmp=ifavailable
848 # Try Net-SNMP first.
850 AC_MSG_CHECKING(whether to use Net-SNMP library)
851 if test "x$want_netsnmp" = "xno" ; then
854 if test "x$want_netsnmp" = "xifavailable" ; then
855 AC_MSG_RESULT([yes, if available])
859 AC_ETHEREAL_NETSNMP_CHECK
863 # If that didn't find Net-SNMP, try UCD SNMP.
865 if test "x$have_net_snmp" != "xyes" ; then
866 AC_MSG_CHECKING(whether to use UCD SNMP library)
867 if test "x$want_ucdsnmp" = "xno" ; then
870 if test "x$want_ucdsnmp" = "xifavailable" ; then
871 AC_MSG_RESULT([yes, if available])
875 AC_ETHEREAL_UCDSNMP_CHECK
879 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
880 AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to 1 if some SNMP support is to be used])
887 AC_MSG_CHECKING(whether to use kerberos)
890 [ --with-krb5[[=DIR]] use kerberos (located in directory DIR, if supplied) to use in kerberos dissection [[default=yes]]],
892 if test $withval = no
895 elif test $withval = yes
904 # Use kerberos if specified, otherwise don't.
906 want_krb5=ifavailable
909 if test "x$want_krb5" = "xno" ; then
913 AC_ETHEREAL_KRB5_CHECK
919 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
922 [ --with-adns[[=DIR]] use GNU ADNS (located in directory DIR, if supplied). [[default=yes, if present]]],
924 if test "x$withval" = "xno"; then
926 elif test "x$withval" = "xyes"; then
928 elif test -d "$withval"; then
930 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
933 if test "x$with_adns" = "xno" ; then
937 AC_ETHEREAL_ADNS_CHECK
942 # Define ETH_VAR_IMPORT appropriately for declarations of external
943 # variables exported from dynamically-linked libraries.
945 AC_DEFINE(ETH_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
947 dnl Checks for typedefs, structures, and compiler characteristics.
950 # We need to know whether "struct sockaddr" has an "sa_len" member
951 # for get_interface_list().
953 AC_ETHEREAL_STRUCT_SA_LEN
955 # We must know our byte order
958 # Checks whether "-traditional" is needed when using "ioctl".
959 # XXX - do we need this?
960 AC_PROG_GCC_TRADITIONAL
962 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
963 # then this won't work.
966 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
967 [SNPRINTF_O="snprintf.o"
968 AC_DEFINE(NEED_SNPRINTF_H, 1, [Define if sprintf.h needs to be included])
970 if test "$ac_cv_func_snprintf" = no ; then
971 SNPRINTF_C="snprintf.c"
972 SNPRINTF_O="snprintf.o"
977 AC_CHECK_FUNC(strerror, STRERROR_O="",
978 [STRERROR_O="strerror.o"
979 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
981 if test "$ac_cv_func_strerror" = no ; then
982 STRERROR_C="strerror.c"
983 STRERROR_O="strerror.o"
988 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
989 STRCASECMP_O="strcasecmp.o")
990 if test "$ac_cv_func_strcasecmp" = no ; then
991 STRCASECMP_C="strcasecmp.c"
992 STRCASECMP_O="strcasecmp.o"
994 AC_SUBST(STRCASECMP_C)
995 AC_SUBST(STRCASECMP_O)
997 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
998 STRNCASECMP_O="strncasecmp.o")
999 if test "$ac_cv_func_strncasecmp" = no ; then
1000 STRNCASECMP_C="strncasecmp.c"
1001 STRNCASECMP_O="strncasecmp.o"
1003 AC_SUBST(STRNCASECMP_C)
1004 AC_SUBST(STRNCASECMP_O)
1006 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1007 MKSTEMP_O="mkstemp.o")
1008 if test "$ac_cv_func_mkstemp" = no ; then
1009 MKSTEMP_C="mkstemp.c"
1010 MKSTEMP_O="mkstemp.o"
1015 ac_save_LIBS="$LIBS"
1016 LIBS="$GLIB_LIBS $LIBS"
1017 G_ASCII_STRTOULL_C=""
1018 G_ASCII_STRTOULL_O=""
1019 G_ASCII_STRTOULL_LO=""
1020 AC_CHECK_FUNC(g_ascii_strtoull,
1021 [G_ASCII_STRTOULL_O=""
1022 G_ASCII_STRTOULL_LO=""],
1023 [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1024 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1025 AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1027 LIBS="$ac_save_LIBS"
1028 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1029 G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1030 G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1031 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1033 AC_SUBST(G_ASCII_STRTOULL_C)
1034 AC_SUBST(G_ASCII_STRTOULL_O)
1035 AC_SUBST(G_ASCII_STRTOULL_LO)
1037 AC_CHECK_FUNC(inet_aton,
1040 [INET_ATON_O="inet_aton.o"
1041 INET_ATON_LO="inet_aton.lo"
1043 if test "$ac_cv_func_inet_aton" = no ; then
1044 INET_ATON_C="inet_aton.c"
1045 INET_ATON_O="inet_aton.o"
1046 INET_ATON_LO="inet_aton.lo"
1047 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1049 AC_SUBST(INET_ATON_C)
1050 AC_SUBST(INET_ATON_O)
1051 AC_SUBST(INET_ATON_LO)
1053 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1054 dnl check for pre-BIND82 inet_pton() bug.
1055 AC_MSG_CHECKING(for broken inet_pton)
1056 AC_TRY_RUN([#include <sys/types.h>
1057 #include <sys/socket.h>
1058 #include <netinet/in.h>
1059 #include <arpa/inet.h>
1064 /* this should return 0 (error) */
1065 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1069 }], [AC_MSG_RESULT(ok);
1070 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1071 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1072 have_inet_pton=no])],
1074 if test "$have_inet_pton" = no; then
1075 INET_PTON_C="inet_pton.c"
1076 INET_PTON_O="inet_pton.o"
1077 INET_PTON_LO="inet_pton.lo"
1083 AC_SUBST(INET_PTON_C)
1084 AC_SUBST(INET_PTON_O)
1085 AC_SUBST(INET_PTON_LO)
1087 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1088 AC_MSG_CHECKING([for inet_ntop prototype])
1089 AC_TRY_COMPILE([#include <stdio.h>
1090 #include <sys/types.h>
1091 #include <sys/socket.h>
1092 #include <netinet/in.h>
1093 #include <arpa/inet.h>
1095 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1097 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1098 [Define if inet_ntop() prototype exists])], [
1099 AC_TRY_COMPILE([#include <stdio.h>
1100 #include <sys/types.h>
1101 #include <sys/socket.h>
1102 #include <netinet/in.h>
1103 #include <arpa/inet.h>
1105 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1107 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1108 [Define if inet_ntop() prototype exists])], [
1109 AC_MSG_RESULT(no)])])
1112 INET_NTOP_C="inet_ntop.c"
1113 INET_NTOP_O="inet_ntop.o"
1114 INET_NTOP_LO="inet_ntop.lo"
1115 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1116 [Define if inet/v6defs.h needs to be included])])
1117 AC_SUBST(INET_NTOP_C)
1118 AC_SUBST(INET_NTOP_O)
1119 AC_SUBST(INET_NTOP_LO)
1121 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1122 [STRPTIME_O="strptime.o"
1123 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1125 if test "$ac_cv_func_strptime" = no ; then
1126 STRPTIME_C="strptime.c"
1127 STRPTIME_O="strptime.o"
1129 AC_SUBST(STRPTIME_C)
1130 AC_SUBST(STRPTIME_O)
1132 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1134 dnl blank for now, but will be used in future
1135 AC_SUBST(ethereal_SUBDIRS)
1138 dnl check whether plugins should be enabled and, if they should be,
1139 dnl check for plugins directory - stolen from Amanda's configure.in
1141 plugindir="$libdir/ethereal/plugins/$VERSION"
1142 AC_ARG_WITH(plugins,
1143 [ --with-plugins[[=DIR]] support plugins (installed in DIR, if supplied).],
1147 if test x$have_plugins = xno
1149 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1156 if test x$have_plugins = xno
1158 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1160 plugindir="$withval"
1165 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1166 if test x$have_plugins = xyes
1168 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1170 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1171 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1172 eval echo "$plugindir"
1174 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1176 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1181 # The plugin dissectors reside in ./plugins/PROTO/
1183 PLUGIN_LIBS="-L../../epan -lethereal $GLIB_LIBS"
1184 AC_SUBST(PLUGIN_LIBS)
1188 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1189 # (autoconf? automake? libtool?) - with the newer version(s), it's
1190 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1192 # With older version(s) of those tool(s), however, it's not just an
1193 # alias, and the configure scripts don't work without it.
1196 AC_SUBST(LIBTOOL_DEPS)
1198 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1199 if test x$enable_static = xyes -a x$have_plugins = xyes
1201 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Ethereal])
1203 AC_SUBST(ENABLE_STATIC)
1205 dnl Save the cacheable configure results to config.cache before recursing
1208 AM_CONFIG_HEADER(config.h)
1209 AC_CONFIG_SUBDIRS(wiretap)
1216 epan/dfilter/Makefile
1217 epan/dissectors/Makefile
1218 epan/ftypes/Makefile
1223 packaging/nsis/Makefile
1224 packaging/rpm/Makefile
1225 packaging/rpm/SPECS/Makefile
1226 packaging/rpm/SPECS/ethereal.spec
1227 packaging/svr4/Makefile
1228 packaging/svr4/checkinstall
1229 packaging/svr4/pkginfo
1231 plugins/acn/Makefile
1232 plugins/agentx/Makefile
1233 plugins/artnet/Makefile
1234 plugins/asn1/Makefile
1235 plugins/ciscosm/Makefile
1236 plugins/docsis/Makefile
1237 plugins/enttec/Makefile
1238 plugins/giop/Makefile
1239 plugins/gryphon/Makefile
1240 plugins/irda/Makefile
1241 plugins/lwres/Makefile
1242 plugins/mate/Makefile
1243 plugins/megaco/Makefile
1244 plugins/mgcp/Makefile
1245 plugins/opsi/Makefile
1246 plugins/pcli/Makefile
1247 plugins/profinet/Makefile
1248 plugins/rdm/Makefile
1249 plugins/rlm/Makefile
1250 plugins/rtnet/Makefile
1251 plugins/rudp/Makefile
1252 plugins/stats_tree/Makefile
1253 plugins/v5ua/Makefile
1254 plugins/xml/Makefile
1256 tools/lemon/Makefile
1262 if test "x$enable_setuid_install" = "xyes" ; then
1263 setuid_message="yes (DANGEROUS!!!)"
1268 if test "x$want_zlib" = "xno" ; then
1274 if test "x$want_pcre" = "xno" ; then
1280 if test "x$want_ssl" = "xno" ; then
1286 if test "x$want_krb5" = "xno" ; then
1289 krb5_message="yes ($ac_krb5_version)"
1292 if test "x$have_good_adns" = "xyes" ; then
1298 if test "x$have_net_snmp" = "xyes" ; then
1299 snmp_libs_message="yes (net-snmp)"
1300 elif test "x$have_ucdsnmp" = "xyes" ; then
1301 snmp_libs_message="yes (ucd-snmp)"
1303 snmp_libs_message="no"
1307 echo "The Ethereal package has been configured with the following options."
1308 echo " Build ethereal : $enable_ethereal"
1309 echo " Build tethereal : $enable_tethereal"
1310 echo " Build capinfos : $enable_capinfos"
1311 echo " Build editcap : $enable_editcap"
1312 echo " Build mergecap : $enable_mergecap"
1313 echo " Build text2pcap : $enable_text2pcap"
1314 echo " Build idl2eth : $enable_idl2eth"
1315 echo " Build randpkt : $enable_randpkt"
1316 echo " Build dftest : $enable_dftest"
1318 echo " Install setuid : $setuid_message"
1319 echo " Use plugins : $have_plugins"
1320 echo " Use GTK+ v2 library : $enable_gtk2"
1321 if test "x$enable_gtk2" = "xyes" ; then
1322 echo " Use threads : $enable_threads"
1323 echo " Build profile binaries : $enable_profile_build"
1325 echo " Use pcap library : $want_pcap"
1326 echo " Use zlib library : $zlib_message"
1327 echo " Use pcre library : $pcre_message"
1328 echo " Use kerberos library : $krb5_message"
1329 echo " Use GNU ADNS library : $adns_message"
1330 echo " Use SSL crypto library : $ssl_message"
1331 echo " Use IPv6 name resolution : $enable_ipv6"
1332 echo " Use UCD SNMP/Net-SNMP library : $snmp_libs_message"