7 dnl Check for CPU / vendor / OS
11 AM_INIT_AUTOMAKE(ethereal, 0.10.10)
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(LEX, flex)
42 AC_PATH_PROG(PYTHON, python)
54 AC_PATH_PROG(DOXYGEN, doxygen)
55 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
56 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
59 AC_PATH_PROG(XSLTPROC, xsltproc)
60 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
61 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
64 AC_PATH_PROG(XMLLINT, xmllint)
65 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
66 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
68 # Check for fop (translate .fo to e.g. pdf)
69 AC_PATH_PROG(FOP, fop)
70 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
71 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
73 # Check for hhc (html help compiler)
74 AC_PATH_PROG(HHC, hhc.exe)
75 AC_CHECK_PROG(HAVE_HHC, hhc.exe, "yes", "no")
76 AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
78 # Check for packaging utilities
79 # For now, we check to see if the various packaging utilites are in our
80 # path. I'm too lazy to write code to go hunt for them. - Gerald
81 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
82 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
83 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
85 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
86 -a x$HAVE_PKGTRANS = xyes ; then
87 HAVE_SVR4_PACKAGING=yes
89 HAVE_SVR4_PACKAGING=no
91 AC_SUBST(HAVE_SVR4_PACKAGING)
97 # If we're running gcc, add '-Wall -W' to CFLAGS, and add
98 # '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
99 # flag unused function arguments and not get warnings about them.
100 # If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
101 # -Wcast-align" as well. (Add more checks here in the future?)
103 # Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
104 # argument will compile with non-GCC compilers.
106 AC_ARG_WITH(extra-gcc-checks,
107 [ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
109 if test $withval != no
111 ethereal_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wstrict-prototypes"
114 AC_MSG_CHECKING(to see if we can add '-Wall -W $ethereal_extra_gcc_flags' to CFLAGS)
115 if test x$GCC != x ; then
116 CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W $ethereal_extra_gcc_flags $CFLAGS"
119 CFLAGS="-D_U_=\"\" $CFLAGS"
124 # Add any platform-specific compiler flags needed.
126 AC_MSG_CHECKING(for platform-specific compiler flags)
130 # Not GCC - assume it's the vendor's compiler.
135 # HP's ANSI C compiler; flags suggested by Jost Martin.
136 # "-Ae" for ANSI C plus extensions such as "long long".
137 # "+O2", for optimization. XXX - works with "-g"?
139 CFLAGS="-Ae +O2 $CFLAGS"
140 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
144 # It may be called "cc", but it's really a GCC derivative
145 # with a problematic special precompiler and precompiled
146 # headers; turn off the special precompiler, as some
147 # apparently-legal code won't compile with its precompiled
150 CFLAGS="-no-cpp-precomp $CFLAGS"
151 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
154 AC_MSG_RESULT(none needed)
160 # the X11 headers don't automatically include prototype info
161 # and a lot don't include the return type
162 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
163 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
167 # See comments above about Apple's lovely C compiler.
169 CFLAGS="-no-cpp-precomp $CFLAGS"
170 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
174 # Shared libraries in cygwin/Win32 must never contain
177 LDFLAGS="$LDFLAGS -no-undefined"
178 AC_MSG_RESULT(CygWin GCC - added -no-undefined to LDFLAGS)
181 AC_MSG_RESULT(none needed)
187 # On OS X, if we find the headers for Core Foundation and Launch Services,
188 # add -framework options to link with Application Services (of which
189 # Launch Services is a subframework) and Core Foundation (required by
190 # the Launch Services APIs), so we can use that to launch a Web browser
191 # from the Help menu.
193 # (Do those headers exist on pure Darwin? If so, does the CoreFoundation
194 # *and* Launch Services code exist there, or are those headers just stubs?
195 # If the frameworks aren't present on Darwin, how *should* we check for
201 AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
203 ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
204 LIBS="$LIBS $ac_frameworks"
207 # include <CoreFoundation/CFBase.h>
208 # include <CoreFoundation/CFString.h>
209 # include <CoreFoundation/CFURL.h>
210 # include <ApplicationServices/ApplicationServices.h>
213 CFStringRef url_CFString;
217 url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
218 url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
219 status = LSOpenCFURLRef(url_CFURL, NULL);
221 ac_cv_can_use_cf_and_ls=yes,
222 ac_cv_can_use_cf_and_ls=no,
223 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
224 if test "$ac_cv_can_use_cf_and_ls" = yes ; then
225 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
226 FRAMEWORKS="$ac_frameworks"
236 dnl Look in /usr/local for header files and libraries ?
237 dnl XXX FIXME don't include /usr/local if it is already in the system
238 dnl search path as this causes gcc 3.2 on Linux to complain about a change
239 dnl of the system search order for includes
240 AC_ARG_ENABLE(usr-local,
241 [ --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)
243 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
244 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
247 # Arrange that we search for header files in the source directory
248 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
249 # as various packages we use ("libpcap", "zlib", an SNMP library)
250 # may have been installed under "/usr/local/include".
252 CFLAGS="$CFLAGS -I/usr/local/include"
253 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
256 # Arrange that we search for libraries in "/usr/local/lib".
258 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
264 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
269 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
270 if test x$LD_LIBRARY_PATH != x ; then
271 LIBS="$LIBS -R$LD_LIBRARY_PATH"
272 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
274 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
280 # Check for versions of "sed" inadequate to handle, in libtool, a list
281 # of object files as large as the list in Ethereal.
283 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
284 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
285 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
286 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
287 # is the only "sed" that comes with Solaris that can handle Ethereal.
289 # Add any checks here that are necessary for other OSes.
291 AC_ETHEREAL_GNU_SED_CHECK
292 if test "$HAVE_GNU_SED" = no ; then
295 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
297 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
299 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
314 # Enable/disable tethereal
316 AC_ARG_ENABLE(ethereal,
317 [ --enable-ethereal build GTK+-based ethereal. [default=yes]],enable_ethereal=$enableval,enable_ethereal=yes)
320 [ --disable-gtk2 build Glib1/Gtk1+-based (t)ethereal. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
321 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
323 AC_ARG_ENABLE(threads,
324 [ --enable-threads use threads in ethereal. [default=no]],enable_threads=$enableval,enable_threads=no)
325 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
327 AC_ARG_ENABLE(profile-build,
328 [ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
329 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
330 AC_MSG_CHECKING(if profile builds must be generated)
331 if test "x$enable_profile_build" = "xyes" ; then
332 if test -n "$GCC" ; then
334 CFLAGS=" -pg $CFLAGS"
337 echo "Building profile binaries currently only supported for GCC."
343 # Create DATAFILE_DIR #define for config.h
344 datafiledir=$datadir/ethereal
346 test "x$prefix" = xNONE && prefix=$ac_default_prefix
347 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
348 eval echo "$datafiledir"
350 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
353 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
354 # programs to be built with GTK+.
356 if test "x$enable_gtk2" = "xyes" -a "x$enable_ethereal" = "xyes" ; then
358 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
359 elif test "x$enable_gtk2" != "xyes" -a "x$enable_ethereal" = "xyes" ; then
361 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
367 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
368 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
369 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
370 # set when generating the Makefile, so we can make programs that require
371 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
372 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
373 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
374 # programs to be built with GLib.
376 if test "$GTK_OK" = "no" ; then
381 if test "x$enable_gtk2" = "xyes" ; then
382 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
384 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
387 ethereal_bin="ethereal\$(EXEEXT)"
388 ethereal_man="ethereal.1"
389 ethereal_SUBDIRS="gtk"
391 if test "$GTK_OK" = "two" ; then
392 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
394 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
399 # Check whether GLib modules are supported, to determine whether we
400 # can support plugins.
402 AC_MSG_CHECKING(whether GLib supports loadable modules)
403 ac_save_CFLAGS="$CFLAGS"
405 CFLAGS="$CFLAGS $GLIB_CFLAGS"
406 LIBS="$GLIB_LIBS $LIBS"
416 if (g_module_supported())
417 return 0; /* success */
419 return 1; /* failure */
421 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
422 [echo $ac_n "cross compiling; assumed OK... $ac_c"
423 ac_cv_glib_supports_modules=yes])
424 CFLAGS="$ac_save_CFLAGS"
426 if test "$ac_cv_glib_supports_modules" = yes ; then
435 # We can't just check for <inttypes.h> - some systems have one that
436 # doesn't define all the PRI[doxu]64 macros.
438 AC_CHECK_HEADERS(inttypes.h,
441 # OK, we have inttypes.h, but does it define those macros?
443 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
448 #include <inttypes.h>
451 #include <sys/types.h>
455 printf("%" PRId64 "\n", (gint64)1);
456 printf("%" PRIo64 "\n", (guint64)1);
457 printf("%" PRIx64 "\n", (guint64)1);
458 printf("%" PRIu64 "\n", (guint64)1);
464 ac_ethereal_inttypes_h_defines_formats=yes
468 ac_ethereal_inttypes_h_defines_formats=no
473 # We don't have inttypes.h, so it obviously can't define those
476 ac_ethereal_inttypes_h_defines_formats=no
478 if test "$ac_ethereal_inttypes_h_defines_formats" = yes; then
479 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
481 AC_ETHEREAL_CHECK_64BIT_FORMAT(ll,
483 AC_ETHEREAL_CHECK_64BIT_FORMAT(L,
485 AC_ETHEREAL_CHECK_64BIT_FORMAT(q,
487 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
493 AC_SUBST(ethereal_bin)
494 AC_SUBST(ethereal_man)
496 rdps_bin="rdps\$(EXEEXT)"
500 # Enable/disable tethereal
502 AC_ARG_ENABLE(tethereal,
503 [ --enable-tethereal build tethereal. [default=yes]],tethereal=$enableval,enable_tethereal=yes)
505 if test "x$enable_tethereal" = "xyes" ; then
506 tethereal_bin="tethereal\$(EXEEXT)"
507 tethereal_man="tethereal.1"
508 etherealfilter_man="ethereal-filter.4"
513 AC_SUBST(tethereal_bin)
514 AC_SUBST(tethereal_man)
515 AC_SUBST(etherealfilter_man)
519 # Enable/disable editcap
521 AC_ARG_ENABLE(editcap,
522 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
524 if test "x$enable_editcap" = "xyes" ; then
525 editcap_bin="editcap\$(EXEEXT)"
526 editcap_man="editcap.1"
531 AC_SUBST(editcap_bin)
532 AC_SUBST(editcap_man)
535 # Enable/disable capinfos
537 AC_ARG_ENABLE(capinfos,
538 [ --enable-capinfos build capinfos. [default=yes]],enable_capinfos=$enableval,enable_capinfos=yes)
540 if test "x$enable_capinfos" = "xyes" ; then
541 capinfos_bin="capinfos\$(EXEEXT)"
542 capinfos_man="capinfos.1"
547 AC_SUBST(capinfos_bin)
548 AC_SUBST(capinfos_man)
551 # Enable/disable mergecap
553 AC_ARG_ENABLE(mergecap,
554 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
556 if test "x$enable_mergecap" = "xyes" ; then
557 mergecap_bin="mergecap\$(EXEEXT)"
558 mergecap_man="mergecap.1"
563 AC_SUBST(mergecap_bin)
564 AC_SUBST(mergecap_man)
567 # Enable/disable text2pcap
569 AC_ARG_ENABLE(text2pcap,
570 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
572 if test "x$enable_text2pcap" = "xyes" ; then
573 text2pcap_bin="text2pcap\$(EXEEXT)"
574 text2pcap_man="text2pcap.1"
579 AC_SUBST(text2pcap_bin)
580 AC_SUBST(text2pcap_man)
582 # Enable/disable idl2eth
584 AC_ARG_ENABLE(idl2eth,
585 [ --enable-idl2eth build idl2eth. [default=yes]],enable_idl2eth=$enableval,enable_idl2eth=yes)
587 if test "x$enable_idl2eth" = "xyes" ; then
588 idl2eth_bin="idl2eth"
589 idl2eth_man="idl2eth.1"
594 AC_SUBST(idl2eth_bin)
595 AC_SUBST(idl2eth_man)
598 # Enable/disable dftest
600 AC_ARG_ENABLE(dftest,
601 [ --enable-dftest build dftest. [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
603 if test "x$enable_dftest" = "xyes" ; then
604 dftest_bin="dftest\$(EXEEXT)"
611 # Enable/disable randpkt
613 AC_ARG_ENABLE(randpkt,
614 [ --enable-randpkt build randpkt. [default=no]],enable_randpkt=$enableval,enable_randpkt=no)
616 if test "x$enable_randpkt" = "xyes" ; then
617 randpkt_bin="randpkt\$(EXEEXT)"
621 AC_SUBST(randpkt_bin)
624 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
625 dnl "gethostbyname()".
626 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
628 dnl Checks for "connect()", used as a proxy for "socket()" - and
629 dnl "-lsocket", if we need it to get "connect()".
630 AC_ETHEREAL_SOCKET_LIB_CHECK
633 AC_MSG_CHECKING(whether to use libpcap for packet capture)
636 [ --with-pcap[[=DIR]] use libpcap for packet capturing. [[default=yes]]],
638 if test $withval = no
641 elif test $withval = yes
652 if test "x$want_pcap" = "xno" ; then
656 AC_ETHEREAL_PCAP_CHECK
660 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
663 [ --with-zlib[[=DIR]] use zlib (located in directory DIR, if supplied) to read compressed data. [[default=yes, if available]]],
665 if test $withval = no
668 elif test $withval = yes
677 # Use zlib if it's present, otherwise don't.
679 want_zlib=ifavailable
682 if test "x$want_zlib" = "xno" ; then
686 AC_ETHEREAL_ZLIB_CHECK
687 if test "x$want_zlib" = "xno" ; then
688 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
694 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
697 [ --with-pcre[[=DIR]] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [[default=yes, if available]]],
699 if test $withval = no
702 elif test $withval = yes
711 # Use libpcre if it's present, otherwise don't.
713 want_pcre=ifavailable
716 if test "x$want_pcre" = "xno" ; then
720 AC_ETHEREAL_LIBPCRE_CHECK
721 if test "x$want_pcre" = "xno" ; then
722 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
729 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
731 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
732 if test "x$enable_ipv6" = "xno" ; then
736 AC_ETHEREAL_IPV6_STACK
740 dnl Check if ethereal should be installed setuid
741 AC_ARG_ENABLE(setuid-install,
742 [ --enable-setuid-install install ethereal as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
744 AC_MSG_CHECKING(whether to install ethereal setuid)
745 if test "x$enable_setuid_install" = "xno" ; then
751 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
753 dnl Checks for header files.
755 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
756 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)
757 AC_CHECK_HEADERS(netinet/in.h)
758 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
759 AC_CHECK_HEADERS(iconv.h)
763 AC_MSG_CHECKING(whether to use SSL library)
766 [ --with-ssl[[=DIR]] use SSL crypto library (located in directory DIR, if supplied). [[default=no]]],
768 if test "x$withval" = "xno"; then
770 elif test "x$withval" = "xyes"; then
772 elif test -d "$withval"; then
774 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
779 if test "x$want_ssl" = "xyes"; then
781 AC_CHECK_LIB(crypto,EVP_md5,
786 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
793 dnl UCD SNMP/Net-SNMP Check
796 AC_ARG_WITH(net-snmp,
797 [ --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]]],
799 if test $withval = no
802 elif test $withval = yes
807 netsnmpconfig="$withval"
811 # Set "want_netsnmp" to "ifavailable" to make the default "use it
812 # if you find it, otherwise don't".
814 want_netsnmp=ifavailable
817 AC_ARG_WITH(ucd-snmp,
818 [ --with-ucd-snmp[[=DIR]] use UCD SNMP client library (located in directory DIR, if supplied). [[default=yes, if available]]],
820 if test $withval = no
823 elif test $withval = yes
832 # Set "want_ucdsnmp" to "ifavailable" to make the default "use it
833 # if you find it, otherwise don't".
835 want_ucdsnmp=ifavailable
840 # Try Net-SNMP first.
842 AC_MSG_CHECKING(whether to use Net-SNMP library)
843 if test "x$want_netsnmp" = "xno" ; then
846 if test "x$want_netsnmp" = "xifavailable" ; then
847 AC_MSG_RESULT([yes, if available])
851 AC_ETHEREAL_NETSNMP_CHECK
855 # If that didn't find Net-SNMP, try UCD SNMP.
857 if test "x$have_net_snmp" != "xyes" ; then
858 AC_MSG_CHECKING(whether to use UCD SNMP library)
859 if test "x$want_ucdsnmp" = "xno" ; then
862 if test "x$want_ucdsnmp" = "xifavailable" ; then
863 AC_MSG_RESULT([yes, if available])
867 AC_ETHEREAL_UCDSNMP_CHECK
871 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
872 AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to 1 if some SNMP support is to be used])
879 AC_MSG_CHECKING(whether to use kerberos)
882 [ --with-krb5[[=DIR]] use kerberos (located in directory DIR, if supplied) to use in kerberos dissection [[default=yes]]],
884 if test $withval = no
887 elif test $withval = yes
896 # Use kerberos if specified, otherwise don't.
898 want_krb5=ifavailable
901 if test "x$want_krb5" = "xno" ; then
905 AC_ETHEREAL_KRB5_CHECK
911 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
914 [ --with-adns[[=DIR]] use GNU ADNS (located in directory DIR, if supplied). [[default=yes, if present]]],
916 if test "x$withval" = "xno"; then
918 elif test "x$withval" = "xyes"; then
920 elif test -d "$withval"; then
922 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
925 if test "x$with_adns" = "xno" ; then
929 AC_ETHEREAL_ADNS_CHECK
934 # Define ETH_VAR_IMPORT appropriately for declarations of external
935 # variables exported from dynamically-linked libraries.
937 AC_DEFINE(ETH_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
939 dnl Checks for typedefs, structures, and compiler characteristics.
942 # We need to know whether "struct sockaddr" has an "sa_len" member
943 # for get_interface_list().
945 AC_ETHEREAL_STRUCT_SA_LEN
947 # We must know our byte order
950 # Checks whether "-traditional" is needed when using "ioctl".
951 # XXX - do we need this?
952 AC_PROG_GCC_TRADITIONAL
954 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
955 # then this won't work.
958 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
959 [SNPRINTF_O="snprintf.o"
960 AC_DEFINE(NEED_SNPRINTF_H, 1, [Define if sprintf.h needs to be included])
962 if test "$ac_cv_func_snprintf" = no ; then
963 SNPRINTF_C="snprintf.c"
964 SNPRINTF_O="snprintf.o"
969 AC_CHECK_FUNC(strerror, STRERROR_O="",
970 [STRERROR_O="strerror.o"
971 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
973 if test "$ac_cv_func_strerror" = no ; then
974 STRERROR_C="strerror.c"
975 STRERROR_O="strerror.o"
980 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
981 STRCASECMP_O="strcasecmp.o")
982 if test "$ac_cv_func_strcasecmp" = no ; then
983 STRCASECMP_C="strcasecmp.c"
984 STRCASECMP_O="strcasecmp.o"
986 AC_SUBST(STRCASECMP_C)
987 AC_SUBST(STRCASECMP_O)
989 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
990 STRNCASECMP_O="strncasecmp.o")
991 if test "$ac_cv_func_strncasecmp" = no ; then
992 STRNCASECMP_C="strncasecmp.c"
993 STRNCASECMP_O="strncasecmp.o"
995 AC_SUBST(STRNCASECMP_C)
996 AC_SUBST(STRNCASECMP_O)
998 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
999 MKSTEMP_O="mkstemp.o")
1000 if test "$ac_cv_func_mkstemp" = no ; then
1001 MKSTEMP_C="mkstemp.c"
1002 MKSTEMP_O="mkstemp.o"
1007 ac_save_LIBS="$LIBS"
1008 LIBS="$GLIB_LIBS $LIBS"
1009 G_ASCII_STRTOULL_C=""
1010 G_ASCII_STRTOULL_O=""
1011 G_ASCII_STRTOULL_LO=""
1012 AC_CHECK_FUNC(g_ascii_strtoull,
1013 [G_ASCII_STRTOULL_O=""
1014 G_ASCII_STRTOULL_LO=""],
1015 [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1016 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1017 AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1019 LIBS="$ac_save_LIBS"
1020 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1021 G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1022 G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1023 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1025 AC_SUBST(G_ASCII_STRTOULL_C)
1026 AC_SUBST(G_ASCII_STRTOULL_O)
1027 AC_SUBST(G_ASCII_STRTOULL_LO)
1029 AC_CHECK_FUNC(inet_aton,
1032 [INET_ATON_O="inet_aton.o"
1033 INET_ATON_LO="inet_aton.lo"
1035 if test "$ac_cv_func_inet_aton" = no ; then
1036 INET_ATON_C="inet_aton.c"
1037 INET_ATON_O="inet_aton.o"
1038 INET_ATON_LO="inet_aton.lo"
1039 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1041 AC_SUBST(INET_ATON_C)
1042 AC_SUBST(INET_ATON_O)
1043 AC_SUBST(INET_ATON_LO)
1045 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1046 dnl check for pre-BIND82 inet_pton() bug.
1047 AC_MSG_CHECKING(for broken inet_pton)
1048 AC_TRY_RUN([#include <sys/types.h>
1049 #include <sys/socket.h>
1050 #include <netinet/in.h>
1051 #include <arpa/inet.h>
1056 /* this should return 0 (error) */
1057 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1061 }], [AC_MSG_RESULT(ok);
1062 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1063 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1064 have_inet_pton=no])],
1066 if test "$have_inet_pton" = no; then
1067 INET_PTON_C="inet_pton.c"
1068 INET_PTON_O="inet_pton.o"
1069 INET_PTON_LO="inet_pton.lo"
1075 AC_SUBST(INET_PTON_C)
1076 AC_SUBST(INET_PTON_O)
1077 AC_SUBST(INET_PTON_LO)
1079 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1080 AC_MSG_CHECKING([for inet_ntop prototype])
1081 AC_TRY_COMPILE([#include <stdio.h>
1082 #include <sys/types.h>
1083 #include <sys/socket.h>
1084 #include <netinet/in.h>
1085 #include <arpa/inet.h>
1087 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1089 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1090 [Define if inet_ntop() prototype exists])], [
1091 AC_TRY_COMPILE([#include <stdio.h>
1092 #include <sys/types.h>
1093 #include <sys/socket.h>
1094 #include <netinet/in.h>
1095 #include <arpa/inet.h>
1097 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1099 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1100 [Define if inet_ntop() prototype exists])], [
1101 AC_MSG_RESULT(no)])])
1104 INET_NTOP_C="inet_ntop.c"
1105 INET_NTOP_O="inet_ntop.o"
1106 INET_NTOP_LO="inet_ntop.lo"
1107 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1108 [Define if inet/v6defs.h needs to be included])])
1109 AC_SUBST(INET_NTOP_C)
1110 AC_SUBST(INET_NTOP_O)
1111 AC_SUBST(INET_NTOP_LO)
1113 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1114 [STRPTIME_O="strptime.o"
1115 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1117 if test "$ac_cv_func_strptime" = no ; then
1118 STRPTIME_C="strptime.c"
1119 STRPTIME_O="strptime.o"
1121 AC_SUBST(STRPTIME_C)
1122 AC_SUBST(STRPTIME_O)
1124 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1126 dnl blank for now, but will be used in future
1127 AC_SUBST(ethereal_SUBDIRS)
1130 dnl check whether plugins should be enabled and, if they should be,
1131 dnl check for plugins directory - stolen from Amanda's configure.in
1133 plugindir="$libdir/ethereal/plugins/$VERSION"
1134 AC_ARG_WITH(plugins,
1135 [ --with-plugins[[=DIR]] support plugins (installed in DIR, if supplied).],
1139 if test x$have_plugins = xno
1141 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1148 if test x$have_plugins = xno
1150 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1152 plugindir="$withval"
1157 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1158 if test x$have_plugins = xyes
1160 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1162 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1163 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1164 eval echo "$plugindir"
1166 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1168 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1173 # The plugin dissectors reside in ./plugins/PROTO/
1175 PLUGIN_LIBS="-L../../epan -lethereal $GLIB_LIBS"
1176 AC_SUBST(PLUGIN_LIBS)
1180 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1181 # (autoconf? automake? libtool?) - with the newer version(s), it's
1182 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1184 # With older version(s) of those tool(s), however, it's not just an
1185 # alias, and the configure scripts don't work without it.
1188 AC_SUBST(LIBTOOL_DEPS)
1190 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1191 if test x$enable_static = xyes -a x$have_plugins = xyes
1193 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Ethereal])
1195 AC_SUBST(ENABLE_STATIC)
1197 dnl Save the cacheable configure results to config.cache before recursing
1200 AM_CONFIG_HEADER(config.h)
1201 AC_CONFIG_SUBDIRS(wiretap)
1208 epan/dfilter/Makefile
1209 epan/dissectors/Makefile
1210 epan/ftypes/Makefile
1215 packaging/nsis/Makefile
1216 packaging/rpm/Makefile
1217 packaging/rpm/SPECS/Makefile
1218 packaging/rpm/SPECS/ethereal.spec
1219 packaging/svr4/Makefile
1220 packaging/svr4/checkinstall
1221 packaging/svr4/pkginfo
1223 plugins/acn/Makefile
1224 plugins/agentx/Makefile
1225 plugins/artnet/Makefile
1226 plugins/asn1/Makefile
1227 plugins/ciscosm/Makefile
1228 plugins/docsis/Makefile
1229 plugins/enttec/Makefile
1230 plugins/giop/Makefile
1231 plugins/gryphon/Makefile
1232 plugins/irda/Makefile
1233 plugins/lwres/Makefile
1234 plugins/mate/Makefile
1235 plugins/megaco/Makefile
1236 plugins/mgcp/Makefile
1237 plugins/opsi/Makefile
1238 plugins/pcli/Makefile
1239 plugins/rdm/Makefile
1240 plugins/rlm/Makefile
1241 plugins/rtnet/Makefile
1242 plugins/rudp/Makefile
1243 plugins/stats_tree/Makefile
1244 plugins/v5ua/Makefile
1245 plugins/xml/Makefile
1247 tools/lemon/Makefile
1253 if test "x$enable_setuid_install" = "xyes" ; then
1254 setuid_message="yes (DANGEROUS!!!)"
1259 if test "x$want_zlib" = "xno" ; then
1265 if test "x$want_pcre" = "xno" ; then
1271 if test "x$want_ssl" = "xno" ; then
1277 if test "x$want_krb5" = "xno" ; then
1280 krb5_message="yes ($ac_krb5_version)"
1283 if test "x$have_good_adns" = "xyes" ; then
1289 if test "x$have_net_snmp" = "xyes" ; then
1290 snmp_libs_message="yes (net-snmp)"
1291 elif test "x$have_ucdsnmp" = "xyes" ; then
1292 snmp_libs_message="yes (ucd-snmp)"
1294 snmp_libs_message="no"
1298 echo "The Ethereal package has been configured with the following options."
1299 echo " Build ethereal : $enable_ethereal"
1300 echo " Build tethereal : $enable_tethereal"
1301 echo " Build capinfos : $enable_capinfos"
1302 echo " Build editcap : $enable_editcap"
1303 echo " Build mergecap : $enable_mergecap"
1304 echo " Build text2pcap : $enable_text2pcap"
1305 echo " Build idl2eth : $enable_idl2eth"
1306 echo " Build randpkt : $enable_randpkt"
1307 echo " Build dftest : $enable_dftest"
1309 echo " Install setuid : $setuid_message"
1310 echo " Use plugins : $have_plugins"
1311 echo " Use GTK+ v2 library : $enable_gtk2"
1312 if test "x$enable_gtk2" = "xyes" ; then
1313 echo " Use threads : $enable_threads"
1314 echo " Build profile binaries : $enable_profile_build"
1316 echo " Use pcap library : $want_pcap"
1317 echo " Use zlib library : $zlib_message"
1318 echo " Use pcre library : $pcre_message"
1319 echo " Use kerberos library : $krb5_message"
1320 echo " Use GNU ADNS library : $adns_message"
1321 echo " Use SSL crypto library : $ssl_message"
1322 echo " Use IPv6 name resolution : $enable_ipv6"
1323 echo " Use UCD SNMP/Net-SNMP library : $snmp_libs_message"