7 dnl Check for CPU / vendor / OS
11 AM_INIT_AUTOMAKE(ethereal, 0.10.7)
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)
52 AC_PATH_PROG(DOXYGEN, doxygen)
53 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
54 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
56 # Check for packaging utilities
57 # For now, we check to see if the various packaging utilites are in our
58 # path. I'm too lazy to write code to go hunt for them. - Gerald
59 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
60 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
61 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
63 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
64 -a x$HAVE_PKGTRANS = xyes ; then
65 HAVE_SVR4_PACKAGING=yes
67 HAVE_SVR4_PACKAGING=no
69 AC_SUBST(HAVE_SVR4_PACKAGING)
75 # If we're running gcc, add '-Wall -W' to CFLAGS, and add
76 # '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
77 # flag unused function arguments and not get warnings about them.
78 # If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
79 # -Wcast-align" as well. (Add more checks here in the future?)
81 # Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
82 # argument will compile with non-GCC compilers.
84 AC_ARG_WITH(extra-gcc-checks,
85 [ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
87 if test $withval != no
89 ethereal_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wstrict-prototypes"
92 AC_MSG_CHECKING(to see if we can add '-Wall -W$ethereal_extra_gcc_flags' to CFLAGS)
93 if test x$GCC != x ; then
94 CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W$ethereal_extra_gcc_flags $CFLAGS"
97 CFLAGS="-D_U_=\"\" $CFLAGS"
102 # Add any platform-specific compiler flags needed.
104 AC_MSG_CHECKING(for platform-specific compiler flags)
108 # Not GCC - assume it's the vendor's compiler.
113 # HP's ANSI C compiler; flags suggested by Jost Martin.
114 # "-Ae" for ANSI C plus extensions such as "long long".
115 # "+O2", for optimization. XXX - works with "-g"?
117 CFLAGS="-Ae +O2 $CFLAGS"
118 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
122 # It may be called "cc", but it's really a GCC derivative
123 # with a problematic special precompiler and precompiled
124 # headers; turn off the special precompiler, as some
125 # apparently-legal code won't compile with its precompiled
128 CFLAGS="-no-cpp-precomp $CFLAGS"
129 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
132 AC_MSG_RESULT(none needed)
138 # the X11 headers don't automatically include prototype info
139 # and a lot don't include the return type
140 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
141 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
145 # See comments above about Apple's lovely C compiler.
147 CFLAGS="-no-cpp-precomp $CFLAGS"
148 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
152 # Shared libraries in cygwin/Win32 must never contain
155 LDFLAGS="$LDFLAGS -no-undefined"
156 AC_MSG_RESULT(CygWin GCC - added -no-undefined to LDFLAGS)
159 AC_MSG_RESULT(none needed)
165 # On OS X, if we find the headers for Core Foundation and Launch Services,
166 # add -framework options to link with Application Services (of which
167 # Launch Services is a subframework) and Core Foundation (required by
168 # the Launch Services APIs), so we can use that to launch a Web browser
169 # from the Help menu.
171 # (Do those headers exist on pure Darwin? If so, does the CoreFoundation
172 # *and* Launch Services code exist there, or are those headers just stubs?
173 # If the frameworks aren't present on Darwin, how *should* we check for
179 AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
181 ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
182 LIBS="$LIBS $ac_frameworks"
185 # include <CoreFoundation/CFBase.h>
186 # include <CoreFoundation/CFString.h>
187 # include <CoreFoundation/CFURL.h>
188 # include <ApplicationServices/ApplicationServices.h>
191 CFStringRef url_CFString;
195 url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
196 url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
197 status = LSOpenCFURLRef(url_CFURL, NULL);
199 ac_cv_can_use_cf_and_ls=yes,
200 ac_cv_can_use_cf_and_ls=no,
201 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
202 if test "$ac_cv_can_use_cf_and_ls" = yes ; then
203 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
204 FRAMEWORKS="$ac_frameworks"
214 dnl Look in /usr/local for header files and libraries ?
215 dnl XXX FIXME don't include /usr/local if it is already in the system
216 dnl search path as this causes gcc 3.2 on Linux to complain about a change
217 dnl of the system search order for includes
218 AC_ARG_ENABLE(usr-local,
219 [ --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)
221 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
222 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
225 # Arrange that we search for header files in the source directory
226 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
227 # as various packages we use ("libpcap", "zlib", an SNMP library)
228 # may have been installed under "/usr/local/include".
230 CFLAGS="$CFLAGS -I/usr/local/include"
231 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
234 # Arrange that we search for libraries in "/usr/local/lib".
236 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
242 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
247 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
248 if test x$LD_LIBRARY_PATH != x ; then
249 LIBS="$LIBS -R$LD_LIBRARY_PATH"
250 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
252 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
258 # Check for versions of "sed" inadequate to handle, in libtool, a list
259 # of object files as large as the list in Ethereal.
261 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
262 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
263 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
264 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
265 # is the only "sed" that comes with Solaris that can handle Ethereal.
267 # Add any checks here that are necessary for other OSes.
269 AC_ETHEREAL_GNU_SED_CHECK
270 if test "$HAVE_GNU_SED" = no ; then
273 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
275 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
277 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
292 # Enable/disable tethereal
294 AC_ARG_ENABLE(ethereal,
295 [ --enable-ethereal build GTK+-based ethereal. [default=yes]],enable_ethereal=$enableval,enable_ethereal=yes)
298 [ --disable-gtk2 build Glib1/Gtk1+-based (t)ethereal. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
299 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
301 AC_ARG_ENABLE(threads,
302 [ --enable-threads use threads in ethereal. [default=no]],enable_threads=$enableval,enable_threads=no)
303 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
305 AC_ARG_ENABLE(profile-build,
306 [ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
307 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
308 AC_MSG_CHECKING(if profile builds must be generated)
309 if test "x$enable_profile_build" = "xyes" ; then
310 if test -n "$GCC" ; then
312 CFLAGS=" -pg $CFLAGS"
315 echo "Building profile binaries currently only supported for GCC."
321 # Create DATAFILE_DIR #define for config.h
322 datafiledir=$datadir/ethereal
324 test "x$prefix" = xNONE && prefix=$ac_default_prefix
325 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
326 eval echo "$datafiledir"
328 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
331 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
332 # programs to be built with GTK+.
334 if test "x$enable_gtk2" = "xyes" -a "x$enable_ethereal" = "xyes" ; then
336 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
337 elif test "x$enable_gtk2" != "xyes" -a "x$enable_ethereal" = "xyes" ; then
339 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
345 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
346 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
347 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
348 # set when generating the Makefile, so we can make programs that require
349 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
350 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
351 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
352 # programs to be built with GLib.
354 if test "$GTK_OK" = "no" ; then
359 if test "x$enable_gtk2" = "xyes" ; then
360 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
362 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
365 ethereal_bin="ethereal\$(EXEEXT)"
366 ethereal_man="ethereal.1"
367 ethereal_SUBDIRS="gtk"
369 if test "$GTK_OK" = "two" ; then
370 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
372 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
377 # Check whether GLib modules are supported, to determine whether we
378 # can support plugins.
380 AC_MSG_CHECKING(whether GLib supports loadable modules)
381 ac_save_CFLAGS="$CFLAGS"
383 CFLAGS="$CFLAGS $GLIB_CFLAGS"
384 LIBS="$GLIB_LIBS $LIBS"
394 if (g_module_supported())
395 return 0; /* success */
397 return 1; /* failure */
399 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
400 [echo $ac_n "cross compiling; assumed OK... $ac_c"
401 ac_cv_glib_supports_modules=yes])
402 CFLAGS="$ac_save_CFLAGS"
404 if test "$ac_cv_glib_supports_modules" = yes ; then
413 # We can't just check for <inttypes.h> - some systems have one that
414 # doesn't define all the PRI[doxu]64 macros.
416 AC_CHECK_HEADERS(inttypes.h,
419 # OK, we have inttypes.h, but does it define those macros?
421 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
426 #include <inttypes.h>
429 #include <sys/types.h>
433 printf("%" PRId64 "\n", (gint64)1);
434 printf("%" PRIo64 "\n", (guint64)1);
435 printf("%" PRIx64 "\n", (guint64)1);
436 printf("%" PRIu64 "\n", (guint64)1);
442 ac_ethereal_inttypes_h_defines_formats=yes
446 ac_ethereal_inttypes_h_defines_formats=no
451 # We don't have inttypes.h, so it obviously can't define those
454 ac_ethereal_inttypes_h_defines_formats=no
456 if test "$ac_ethereal_inttypes_h_defines_formats" = yes; then
457 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
459 AC_ETHEREAL_CHECK_64BIT_FORMAT(ll,
461 AC_ETHEREAL_CHECK_64BIT_FORMAT(L,
463 AC_ETHEREAL_CHECK_64BIT_FORMAT(q,
465 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
471 AC_SUBST(ethereal_bin)
472 AC_SUBST(ethereal_man)
474 rdps_bin="rdps\$(EXEEXT)"
478 # Enable/disable tethereal
480 AC_ARG_ENABLE(tethereal,
481 [ --enable-tethereal build tethereal. [default=yes]],tethereal=$enableval,enable_tethereal=yes)
483 if test "x$enable_tethereal" = "xyes" ; then
484 tethereal_bin="tethereal\$(EXEEXT)"
485 tethereal_man="tethereal.1"
486 etherealfilter_man="ethereal-filter.4"
491 AC_SUBST(tethereal_bin)
492 AC_SUBST(tethereal_man)
493 AC_SUBST(etherealfilter_man)
497 # Enable/disable editcap
499 AC_ARG_ENABLE(editcap,
500 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
502 if test "x$enable_editcap" = "xyes" ; then
503 editcap_bin="editcap\$(EXEEXT)"
504 editcap_man="editcap.1"
509 AC_SUBST(editcap_bin)
510 AC_SUBST(editcap_man)
513 # Enable/disable capinfos
515 AC_ARG_ENABLE(capinfos,
516 [ --enable-capinfos build capinfos. [default=yes]],enable_capinfos=$enableval,enable_capinfos=yes)
518 if test "x$enable_capinfos" = "xyes" ; then
519 capinfos_bin="capinfos\$(EXEEXT)"
520 capinfos_man="capinfos.1"
525 AC_SUBST(capinfos_bin)
526 AC_SUBST(capinfos_man)
529 # Enable/disable mergecap
531 AC_ARG_ENABLE(mergecap,
532 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
534 if test "x$enable_mergecap" = "xyes" ; then
535 mergecap_bin="mergecap\$(EXEEXT)"
536 mergecap_man="mergecap.1"
541 AC_SUBST(mergecap_bin)
542 AC_SUBST(mergecap_man)
545 # Enable/disable text2pcap
547 AC_ARG_ENABLE(text2pcap,
548 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
550 if test "x$enable_text2pcap" = "xyes" ; then
551 text2pcap_bin="text2pcap\$(EXEEXT)"
552 text2pcap_man="text2pcap.1"
557 AC_SUBST(text2pcap_bin)
558 AC_SUBST(text2pcap_man)
560 # Enable/disable idl2eth
562 AC_ARG_ENABLE(idl2eth,
563 [ --enable-idl2eth build idl2eth. [default=yes]],enable_idl2eth=$enableval,enable_idl2eth=yes)
565 if test "x$enable_idl2eth" = "xyes" ; then
566 idl2eth_bin="idl2eth"
567 idl2eth_man="idl2eth.1"
572 AC_SUBST(idl2eth_bin)
573 AC_SUBST(idl2eth_man)
576 # Enable/disable dftest
578 AC_ARG_ENABLE(dftest,
579 [ --enable-dftest build dftest. [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
581 if test "x$enable_dftest" = "xyes" ; then
582 dftest_bin="dftest\$(EXEEXT)"
589 # Enable/disable randpkt
591 AC_ARG_ENABLE(randpkt,
592 [ --enable-randpkt build randpkt. [default=no]],enable_randpkt=$enableval,enable_randpkt=no)
594 if test "x$enable_randpkt" = "xyes" ; then
595 randpkt_bin="randpkt\$(EXEEXT)"
599 AC_SUBST(randpkt_bin)
602 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
603 dnl "gethostbyname()".
604 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
606 dnl Checks for "connect()", used as a proxy for "socket()" - and
607 dnl "-lsocket", if we need it to get "connect()".
608 AC_ETHEREAL_SOCKET_LIB_CHECK
611 AC_MSG_CHECKING(whether to use libpcap for packet capture)
614 changequote(<<, >>)dnl
615 << --with-pcap[=DIR] use libpcap for packet capturing. [default=yes]>>,
618 if test $withval = no
621 elif test $withval = yes
632 if test "x$want_pcap" = "xno" ; then
636 AC_ETHEREAL_PCAP_CHECK
640 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
643 changequote(<<, >>)dnl
644 << --with-zlib[=DIR] use zlib (located in directory DIR, if supplied) to read compressed data. [default=yes, if present]>>,
647 if test $withval = no
650 elif test $withval = yes
659 # Use zlib if it's present, otherwise don't.
664 if test "x$want_zlib" = "xno" ; then
668 AC_ETHEREAL_ZLIB_CHECK
669 if test "x$want_zlib" = "xno" ; then
670 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
676 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
679 changequote(<<, >>)dnl
680 << --with-pcre[=DIR] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [default=yes, if present]>>,
683 if test $withval = no
686 elif test $withval = yes
695 # Use libpcre if it's present, otherwise don't.
700 if test "x$want_pcre" = "xno" ; then
704 AC_ETHEREAL_LIBPCRE_CHECK
705 if test "x$want_pcre" = "xno" ; then
706 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
713 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
715 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
716 if test "x$enable_ipv6" = "xno" ; then
720 AC_ETHEREAL_IPV6_STACK
724 dnl Check if ethereal should be installed setuid
725 AC_ARG_ENABLE(setuid-install,
726 [ --enable-setuid-install install ethereal as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
728 AC_MSG_CHECKING(whether to install ethereal setuid)
729 if test "x$enable_setuid_install" = "xno" ; then
735 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
737 dnl Checks for header files.
739 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
740 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)
741 AC_CHECK_HEADERS(netinet/in.h)
742 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
743 AC_CHECK_HEADERS(iconv.h)
747 AC_MSG_CHECKING(whether to use SSL library)
750 changequote(<<, >>)dnl
751 << --with-ssl[=DIR] use SSL crypto library (located in directory DIR, if supplied). [default=no]>>,
754 if test "x$withval" = "xno"; then
756 elif test "x$withval" = "xyes"; then
758 elif test -d "$withval"; then
760 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
765 if test "x$want_ssl" = "xyes"; then
767 AC_CHECK_LIB(crypto,EVP_md5,
772 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
779 dnl UCD SNMP/NET-SNMP Check
782 AC_ARG_WITH(net-snmp,
783 changequote(<<, >>)dnl
784 << --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.>>,
786 [netsnmpconfig=$withval]
789 AC_ARG_WITH(ucd-snmp,
790 changequote(<<, >>)dnl
791 << --with-ucd-snmp[=DIR] use UCD SNMP client library (located in directory DIR, if supplied). [default=yes, if present]>>,
794 if test $withval = no
797 elif test $withval = yes
806 # Set "want_ucdsnmp" to "ifpresent" to make the default "use it
807 # if you find it, otherwise don't".
809 want_ucdsnmp=ifpresent
813 dnl try net-snmp first
814 AC_MSG_CHECKING(whether to use NET-SNMP library if available)
815 if test "x$netsnmpconfig" != "xno" ; then
817 dnl get the net-snmp-config binary
818 if test "x$netsnmpconfig" = "xyes" -o "x$netsnmpconfig" = "x" ; then
820 AC_PATH_PROG(NETSNMPCONFIG,net-snmp-config)
822 NETSNMPCONFIG=$netsnmpconfig
823 if test ! -x $NETSNMPCONFIG -o ! -f $NETSNMPCONFIG ; then
824 NETSNMPCONFIG=$netsnmpconfig/bin/net-snmp-config
825 if test ! -x $NETSNMPCONFIG -o ! -f $NETSNMPCONFIG ; then
826 AC_MSG_ERROR(Invalid net-snmp-config: $netsnmpconfig)
834 if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
835 dnl other choices for flags to use here: could also use
836 dnl --prefix or --exec-prefix if you don't want the full list.
839 # Save the current settings of CFLAGS and CPPFLAGS, and add
840 # the output of "$NETSNMPCONFIG --cflags" to it, so that when
841 # searching for the Net-SNMP headers, we look in whatever
842 # directory that output specifies.
844 ethereal_save_CFLAGS="$CFLAGS"
845 ethereal_save_CPPFLAGS="$CPPFLAGS"
846 CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags`"
847 CPPFLAGS="$CPPFLAGS `$NETSNMPCONFIG --cflags`"
849 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h net-snmp/library/default_store.h)
850 if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = "xyes" -a "x$ac_cv_header_net_snmp_library_default_store_h" = "xyes" ; then
851 SNMP_LIBS=`$NETSNMPCONFIG --libs`
852 if echo "$SNMP_LIBS" | grep crypto >/dev/null && test "x$SSL_LIBS" = "x"; then
853 AC_MSG_RESULT(Net-SNMP requires openssl but ssl not enabled - disabling Net-SNMP)
854 CFLAGS="$ethereal_save_CFLAGS"
855 CPPFLAGS="$ethereal_save_CPPFLAGS"
859 AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for NET-SNMP])
863 # technically, we should retry ucd-snmp but it's
864 # unlikely they have installed net-snmp-config and not
865 # the net-snmp headers but do have the ucd-snmp
866 # headers. This would likely be a broken system to
867 # try and use anyway.
871 # Restore the versions of CFLAGS and CPPFLAGS before
872 # we added the output of '$NETSNMPCONFIG --cflags",
873 # as we didn't actually find Net-SNMP there.
875 CFLAGS="$ethereal_save_CFLAGS"
876 CPPFLAGS="$ethereal_save_CPPFLAGS"
879 AC_MSG_CHECKING(whether to use UCD SNMP library if available)
880 if test "x$want_ucdsnmp" = "xno" ; then
884 AC_ETHEREAL_UCDSNMP_CHECK
888 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
889 AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to 1 if some SNMP support is to be used])
896 AC_MSG_CHECKING(whether to use kerberos)
899 changequote(<<, >>)dnl
900 << --with-krb5[=DIR] use kerberos (located in directory DIR, if supplied) to use in kerberos dissection [default=yes]>>,
903 if test $withval = no
906 elif test $withval = yes
915 # Use kerberos if specified, otherwise don't.
920 if test "x$want_krb5" = "xno" ; then
924 AC_ETHEREAL_KRB5_CHECK
930 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
931 if test "x$with_adns" = "xno" ; then
935 AC_ETHEREAL_ADNS_CHECK
940 # Define ETH_VAR_IMPORT appropriately for declarations of external
941 # variables exported from dynamically-linked libraries.
943 AC_DEFINE(ETH_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
945 dnl Checks for typedefs, structures, and compiler characteristics.
948 # We need to know whether "struct sockaddr" has an "sa_len" member
949 # for get_interface_list().
951 AC_ETHEREAL_STRUCT_SA_LEN
953 # We must know our byte order
956 # Checks whether "-traditional" is needed when using "ioctl".
957 # XXX - do we need this?
958 AC_PROG_GCC_TRADITIONAL
960 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
961 # then this won't work.
964 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
965 [SNPRINTF_O="snprintf.o"
966 AC_DEFINE(NEED_SNPRINTF_H, 1, [Define if sprintf.h needs to be included])
968 if test "$ac_cv_func_snprintf" = no ; then
969 SNPRINTF_C="snprintf.c"
970 SNPRINTF_O="snprintf.o"
975 AC_CHECK_FUNC(strerror, STRERROR_O="",
976 [STRERROR_O="strerror.o"
977 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
979 if test "$ac_cv_func_strerror" = no ; then
980 STRERROR_C="strerror.c"
981 STRERROR_O="strerror.o"
986 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
987 STRCASECMP_O="strcasecmp.o")
988 if test "$ac_cv_func_strcasecmp" = no ; then
989 STRCASECMP_C="strcasecmp.c"
990 STRCASECMP_O="strcasecmp.o"
992 AC_SUBST(STRCASECMP_C)
993 AC_SUBST(STRCASECMP_O)
995 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
996 STRNCASECMP_O="strncasecmp.o")
997 if test "$ac_cv_func_strncasecmp" = no ; then
998 STRNCASECMP_C="strncasecmp.c"
999 STRNCASECMP_O="strncasecmp.o"
1001 AC_SUBST(STRNCASECMP_C)
1002 AC_SUBST(STRNCASECMP_O)
1004 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1005 MKSTEMP_O="mkstemp.o")
1006 if test "$ac_cv_func_mkstemp" = no ; then
1007 MKSTEMP_C="mkstemp.c"
1008 MKSTEMP_O="mkstemp.o"
1013 ac_save_LIBS="$LIBS"
1014 LIBS="$GLIB_LIBS $LIBS"
1015 G_ASCII_STRTOULL_C=""
1016 G_ASCII_STRTOULL_O=""
1017 G_ASCII_STRTOULL_LO=""
1018 AC_CHECK_FUNC(g_ascii_strtoull,
1019 [G_ASCII_STRTOULL_O=""
1020 G_ASCII_STRTOULL_LO=""],
1021 [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1022 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1023 AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1025 LIBS="$ac_save_LIBS"
1026 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1027 G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1028 G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1029 G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1031 AC_SUBST(G_ASCII_STRTOULL_C)
1032 AC_SUBST(G_ASCII_STRTOULL_O)
1033 AC_SUBST(G_ASCII_STRTOULL_LO)
1035 AC_CHECK_FUNC(inet_aton,
1038 [INET_ATON_O="inet_aton.o"
1039 INET_ATON_LO="inet_aton.lo"
1041 if test "$ac_cv_func_inet_aton" = no ; then
1042 INET_ATON_C="inet_aton.c"
1043 INET_ATON_O="inet_aton.o"
1044 INET_ATON_LO="inet_aton.lo"
1045 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1047 AC_SUBST(INET_ATON_C)
1048 AC_SUBST(INET_ATON_O)
1049 AC_SUBST(INET_ATON_LO)
1051 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1052 dnl check for pre-BIND82 inet_pton() bug.
1053 AC_MSG_CHECKING(for broken inet_pton)
1054 AC_TRY_RUN([#include <sys/types.h>
1055 #include <sys/socket.h>
1056 #include <netinet/in.h>
1057 #include <arpa/inet.h>
1062 /* this should return 0 (error) */
1063 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1067 }], [AC_MSG_RESULT(ok);
1068 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1069 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1070 have_inet_pton=no])],
1072 if test "$have_inet_pton" = no; then
1073 INET_PTON_C="inet_pton.c"
1074 INET_PTON_O="inet_pton.o"
1075 INET_PTON_LO="inet_pton.lo"
1081 AC_SUBST(INET_PTON_C)
1082 AC_SUBST(INET_PTON_O)
1083 AC_SUBST(INET_PTON_LO)
1085 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1086 AC_MSG_CHECKING([for inet_ntop prototype])
1087 AC_TRY_COMPILE([#include <stdio.h>
1088 #include <sys/types.h>
1089 #include <sys/socket.h>
1090 #include <netinet/in.h>
1091 #include <arpa/inet.h>
1093 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1095 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1096 [Define if inet_ntop() prototype exists])], [
1097 AC_TRY_COMPILE([#include <stdio.h>
1098 #include <sys/types.h>
1099 #include <sys/socket.h>
1100 #include <netinet/in.h>
1101 #include <arpa/inet.h>
1103 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1105 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1106 [Define if inet_ntop() prototype exists])], [
1107 AC_MSG_RESULT(no)])])
1110 INET_NTOP_C="inet_ntop.c"
1111 INET_NTOP_O="inet_ntop.o"
1112 INET_NTOP_LO="inet_ntop.lo"
1113 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1114 [Define if inet/v6defs.h needs to be included])])
1115 AC_SUBST(INET_NTOP_C)
1116 AC_SUBST(INET_NTOP_O)
1117 AC_SUBST(INET_NTOP_LO)
1119 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1120 [STRPTIME_O="strptime.o"
1121 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1123 if test "$ac_cv_func_strptime" = no ; then
1124 STRPTIME_C="strptime.c"
1125 STRPTIME_O="strptime.o"
1127 AC_SUBST(STRPTIME_C)
1128 AC_SUBST(STRPTIME_O)
1130 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1132 dnl blank for now, but will be used in future
1133 AC_SUBST(ethereal_SUBDIRS)
1136 dnl check whether plugins should be enabled and, if they should be,
1137 dnl check for plugins directory - stolen from Amanda's configure.in
1139 plugindir="$libdir/ethereal/plugins/$VERSION"
1140 AC_ARG_WITH(plugins,
1141 changequote(<<, >>)dnl
1142 << --with-plugins[=DIR] support plugins (installed in DIR, if supplied).>>,
1143 changequote([, ])dnl
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/artnet/Makefile
1233 plugins/asn1/Makefile
1234 plugins/ciscosm/Makefile
1235 plugins/docsis/Makefile
1236 plugins/enttec/Makefile
1237 plugins/giop/Makefile
1238 plugins/gryphon/Makefile
1239 plugins/irda/Makefile
1240 plugins/lwres/Makefile
1241 plugins/megaco/Makefile
1242 plugins/mgcp/Makefile
1243 plugins/opsi/Makefile
1244 plugins/pcli/Makefile
1245 plugins/rdm/Makefile
1246 plugins/rlm/Makefile
1247 plugins/rtnet/Makefile
1248 plugins/rudp/Makefile
1249 plugins/v5ua/Makefile
1251 tools/lemon/Makefile
1257 if test "x$enable_setuid_install" = "xyes" ; then
1258 setuid_message="yes (DANGEROUS!!!)"
1263 if test "x$want_zlib" = "xno" ; then
1269 if test "x$want_pcre" = "xno" ; then
1275 if test "x$want_ssl" = "xno" ; then
1281 if test "x$want_krb5" = "xno" ; then
1284 krb5_message="yes ($ac_krb5_version)"
1287 if test "x$have_good_adns" = "xyes" ; then
1293 if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
1294 snmp_libs_message="yes (net-snmp)"
1295 elif test "x$SNMP_LIBS" = "x" ; then
1296 snmp_libs_message="no"
1298 snmp_libs_message="yes (ucd-snmp)"
1302 echo "The Ethereal package has been configured with the following options."
1303 echo " Build ethereal : $enable_ethereal"
1304 echo " Build tethereal : $enable_tethereal"
1305 echo " Build capinfos : $enable_capinfos"
1306 echo " Build editcap : $enable_editcap"
1307 echo " Build mergecap : $enable_mergecap"
1308 echo " Build text2pcap : $enable_text2pcap"
1309 echo " Build idl2eth : $enable_idl2eth"
1310 echo " Build randpkt : $enable_randpkt"
1311 echo " Build dftest : $enable_dftest"
1313 echo " Install setuid : $setuid_message"
1314 echo " Use plugins : $have_plugins"
1315 echo " Use GTK+ v2 library : $enable_gtk2"
1316 if test "x$enable_gtk2" = "xyes" ; then
1317 echo " Use threads : $enable_threads"
1318 echo " Build profile binaries : $enable_profile_build"
1320 echo " Use pcap library : $want_pcap"
1321 echo " Use zlib library : $zlib_message"
1322 echo " Use pcre library : $pcre_message"
1323 echo " Use kerberos library : $krb5_message"
1324 echo " Use GNU ADNS library : $adns_message"
1325 echo " Use SSL crypto library : $ssl_message"
1326 echo " Use IPv6 name resolution : $enable_ipv6"
1327 echo " Use UCD SNMP/NET-SNMP library : $snmp_libs_message"