7 dnl Check for CPU / vendor / OS
11 AM_INIT_AUTOMAKE(ethereal, 0.10.5)
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)])
293 # We can't just check for <inttypes.h> - some systems have one that
294 # doesn't define all the PRI[doxu]64 macros.
298 ac_ethereal_uint64_t_type=uint64_t,
299 ac_ethereal_uint64_t_type=u_int_64_t
302 AC_CHECK_HEADERS(inttypes.h,
305 # OK, we have inttypes.h, but does it define those macros?
307 AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
312 #include <inttypes.h>
314 #include <sys/types.h>
318 printf("%" PRId64 "\n", ($ac_ethereal_uint64_t_type)1);
319 printf("%" PRIo64 "\n", ($ac_ethereal_uint64_t_type)1);
320 printf("%" PRIx64 "\n", ($ac_ethereal_uint64_t_type)1);
321 printf("%" PRIu64 "\n", ($ac_ethereal_uint64_t_type)1);
327 ac_ethereal_inttypes_h_defines_formats=yes
331 ac_ethereal_inttypes_h_defines_formats=no
336 # We don't have inttypes.h, so it obviously can't define those
339 ac_ethereal_inttypes_h_defines_formats=no
341 if test "$ac_ethereal_inttypes_h_defines_formats" = yes; then
342 AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
344 AC_ETHEREAL_CHECK_64BIT_FORMAT(ll,
346 AC_ETHEREAL_CHECK_64BIT_FORMAT(L,
348 AC_ETHEREAL_CHECK_64BIT_FORMAT(q,
350 AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
356 # Enable/disable tethereal
358 AC_ARG_ENABLE(ethereal,
359 [ --enable-ethereal build GTK+-based ethereal. [default=yes]],enable_ethereal=$enableval,enable_ethereal=yes)
362 [ --disable-gtk2 build Glib1/Gtk1+-based (t)ethereal. [default=no]],enable_gtk2=$enableval,enable_gtk2=yes)
363 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
365 AC_ARG_ENABLE(threads,
366 [ --enable-threads use threads in ethereal. [default=no]],enable_threads=$enableval,enable_threads=no)
367 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
369 AC_ARG_ENABLE(profile-build,
370 [ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
371 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
372 AC_MSG_CHECKING(if profile builds must be generated)
373 if test "x$enable_profile_build" = "xyes" ; then
374 if test -n "$GCC" ; then
376 CFLAGS=" -pg $CFLAGS"
379 echo "Building profile binaries currently only supported for GCC."
385 # Create DATAFILE_DIR #define for config.h
386 datafiledir=$datadir/ethereal
388 test "x$prefix" = xNONE && prefix=$ac_default_prefix
389 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
390 eval echo "$datafiledir"
392 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
395 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
396 # programs to be built with GTK+.
398 if test "x$enable_gtk2" = "xyes" -a "x$enable_ethereal" = "xyes" ; then
400 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
401 elif test "x$enable_gtk2" != "xyes" -a "x$enable_ethereal" = "xyes" ; then
403 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
409 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
410 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
411 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
412 # set when generating the Makefile, so we can make programs that require
413 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
414 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
415 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
416 # programs to be built with GLib.
418 if test "$GTK_OK" = "no" ; then
423 if test "x$enable_gtk2" = "xyes" ; then
424 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
426 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
429 ethereal_bin="ethereal\$(EXEEXT)"
430 ethereal_man="ethereal.1"
431 ethereal_SUBDIRS="gtk"
433 if test "$GTK_OK" = "two" ; then
434 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
436 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
441 # Check whether GLib modules are supported, to determine whether we
442 # can support plugins.
444 AC_MSG_CHECKING(whether GLib supports loadable modules)
445 ac_save_CFLAGS="$CFLAGS"
447 CFLAGS="$CFLAGS $GLIB_CFLAGS"
448 LIBS="$GLIB_LIBS $LIBS"
458 if (g_module_supported())
459 return 0; /* success */
461 return 1; /* failure */
463 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
464 [echo $ac_n "cross compiling; assumed OK... $ac_c"
465 ac_cv_glib_supports_modules=yes])
466 CFLAGS="$ac_save_CFLAGS"
468 if test "$ac_cv_glib_supports_modules" = yes ; then
477 AC_SUBST(ethereal_bin)
478 AC_SUBST(ethereal_man)
480 rdps_bin="rdps\$(EXEEXT)"
484 # Enable/disable tethereal
486 AC_ARG_ENABLE(tethereal,
487 [ --enable-tethereal build tethereal. [default=yes]],tethereal=$enableval,enable_tethereal=yes)
489 if test "x$enable_tethereal" = "xyes" ; then
490 tethereal_bin="tethereal\$(EXEEXT)"
491 tethereal_man="tethereal.1"
492 etherealfilter_man="ethereal-filter.4"
497 AC_SUBST(tethereal_bin)
498 AC_SUBST(tethereal_man)
499 AC_SUBST(etherealfilter_man)
503 # Enable/disable editcap
505 AC_ARG_ENABLE(editcap,
506 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
508 if test "x$enable_editcap" = "xyes" ; then
509 editcap_bin="editcap\$(EXEEXT)"
510 editcap_man="editcap.1"
515 AC_SUBST(editcap_bin)
516 AC_SUBST(editcap_man)
519 # Enable/disable mergecap
521 AC_ARG_ENABLE(mergecap,
522 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
524 if test "x$enable_mergecap" = "xyes" ; then
525 mergecap_bin="mergecap\$(EXEEXT)"
526 mergecap_man="mergecap.1"
531 AC_SUBST(mergecap_bin)
532 AC_SUBST(mergecap_man)
535 # Enable/disable text2pcap
537 AC_ARG_ENABLE(text2pcap,
538 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
540 if test "x$enable_text2pcap" = "xyes" ; then
541 text2pcap_bin="text2pcap\$(EXEEXT)"
542 text2pcap_man="text2pcap.1"
547 AC_SUBST(text2pcap_bin)
548 AC_SUBST(text2pcap_man)
550 # Enable/disable idl2eth
552 AC_ARG_ENABLE(idl2eth,
553 [ --enable-idl2eth build idl2eth. [default=yes]],enable_idl2eth=$enableval,enable_idl2eth=yes)
555 if test "x$enable_idl2eth" = "xyes" ; then
556 idl2eth_bin="idl2eth"
557 idl2eth_man="idl2eth.1"
562 AC_SUBST(idl2eth_bin)
563 AC_SUBST(idl2eth_man)
566 # Enable/disable dftest
568 AC_ARG_ENABLE(dftest,
569 [ --enable-dftest build dftest. [default=yes]],enable_dftest=$enableval,enable_dftest=yes)
571 if test "x$enable_dftest" = "xyes" ; then
572 dftest_bin="dftest\$(EXEEXT)"
579 # Enable/disable randpkt
581 AC_ARG_ENABLE(randpkt,
582 [ --enable-randpkt build randpkt. [default=no]],enable_randpkt=$enableval,enable_randpkt=no)
584 if test "x$enable_randpkt" = "xyes" ; then
585 randpkt_bin="randpkt\$(EXEEXT)"
589 AC_SUBST(randpkt_bin)
592 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
593 dnl "gethostbyname()".
594 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
596 dnl Checks for "connect()", used as a proxy for "socket()" - and
597 dnl "-lsocket", if we need it to get "connect()".
598 AC_ETHEREAL_SOCKET_LIB_CHECK
601 AC_MSG_CHECKING(whether to use libpcap for packet capture)
604 changequote(<<, >>)dnl
605 << --with-pcap[=DIR] use libpcap for packet capturing. [default=yes]>>,
608 if test $withval = no
611 elif test $withval = yes
622 if test "x$want_pcap" = "xno" ; then
626 AC_ETHEREAL_PCAP_CHECK
630 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
633 changequote(<<, >>)dnl
634 << --with-zlib[=DIR] use zlib (located in directory DIR, if supplied) to read compressed data. [default=yes, if present]>>,
637 if test $withval = no
640 elif test $withval = yes
649 # Use zlib if it's present, otherwise don't.
654 if test "x$want_zlib" = "xno" ; then
658 AC_ETHEREAL_ZLIB_CHECK
659 if test "x$want_zlib" = "xno" ; then
660 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
666 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
669 changequote(<<, >>)dnl
670 << --with-pcre[=DIR] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [default=yes, if present]>>,
673 if test $withval = no
676 elif test $withval = yes
685 # Use libpcre if it's present, otherwise don't.
690 if test "x$want_pcre" = "xno" ; then
694 AC_ETHEREAL_LIBPCRE_CHECK
695 if test "x$want_pcre" = "xno" ; then
696 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
703 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
705 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
706 if test "x$enable_ipv6" = "xno" ; then
710 AC_ETHEREAL_IPV6_STACK
714 dnl Check if ethereal should be installed setuid
715 AC_ARG_ENABLE(setuid-install,
716 [ --enable-setuid-install install ethereal as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
718 AC_MSG_CHECKING(whether to install ethereal setuid)
719 if test "x$enable_setuid_install" = "xno" ; then
725 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
727 dnl Checks for header files.
729 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
730 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)
731 AC_CHECK_HEADERS(netinet/in.h)
732 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
733 AC_CHECK_HEADERS(iconv.h)
737 AC_MSG_CHECKING(whether to use SSL library if available)
738 if test "x$enable_ssl" = "xno" ; then
742 AC_ETHEREAL_SSL_CHECK
746 dnl UCD SNMP/NET-SNMP Check
749 AC_ARG_WITH(net-snmp,
750 changequote(<<, >>)dnl
751 << --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.>>,
753 [netsnmpconfig=$withval]
756 AC_ARG_WITH(ucd-snmp,
757 changequote(<<, >>)dnl
758 << --with-ucd-snmp[=DIR] use UCD SNMP client library (located in directory DIR, if supplied). [default=yes, if present]>>,
761 if test $withval = no
764 elif test $withval = yes
773 # Set "want_ucdsnmp" to "ifpresent" to make the default "use it
774 # if you find it, otherwise don't".
776 want_ucdsnmp=ifpresent
780 dnl try net-snmp first
781 AC_MSG_CHECKING(whether to use NET-SNMP library if available)
782 if test "x$netsnmpconfig" != "xno" ; then
784 dnl get the net-snmp-config binary
785 if test "x$netsnmpconfig" = "xyes" -o "x$netsnmpconfig" = "x" ; then
787 AC_PATH_PROG(NETSNMPCONFIG,net-snmp-config)
789 NETSNMPCONFIG=$netsnmpconfig
790 if test ! -x $NETSNMPCONFIG -o ! -f $NETSNMPCONFIG ; then
791 NETSNMPCONFIG=$netsnmpconfig/bin/net-snmp-config
792 if test ! -x $NETSNMPCONFIG -o ! -f $NETSNMPCONFIG ; then
793 AC_MSG_ERROR(Invalid net-snmp-config: $netsnmpconfig)
801 if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
802 dnl other choices for flags to use here: could also use
803 dnl --prefix or --exec-prefix if you don't want the full list.
806 # Save the current settings of CFLAGS and CPPFLAGS, and add
807 # the output of "$NETSNMPCONFIG --cflags" to it, so that when
808 # searching for the Net-SNMP headers, we look in whatever
809 # directory that output specifies.
811 ethereal_save_CFLAGS="$CFLAGS"
812 ethereal_save_CPPFLAGS="$CPPFLAGS"
813 CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags`"
814 CPPFLAGS="$CPPFLAGS `$NETSNMPCONFIG --cflags`"
816 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h net-snmp/library/default_store.h)
817 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
818 SNMP_LIBS=`$NETSNMPCONFIG --libs`
819 AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for NET-SNMP])
822 # technically, we should retry ucd-snmp but it's
823 # unlikely they have installed net-snmp-config and not
824 # the net-snmp headers but do have the ucd-snmp
825 # headers. This would likely be a broken system to
826 # try and use anyway.
830 # Restore the versions of CFLAGS and CPPFLAGS before
831 # we added the output of '$NETSNMPCONFIG --cflags",
832 # as we didn't actually find Net-SNMP there.
834 CFLAGS="$ethereal_save_CFLAGS"
835 CPPFLAGS="$ethereal_save_CPPFLAGS"
838 AC_MSG_CHECKING(whether to use UCD SNMP library if available)
839 if test "x$want_ucdsnmp" = "xno" ; then
843 AC_ETHEREAL_UCDSNMP_CHECK
847 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
848 AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to if some SNMP support is to be used])
854 dnl kerberos/heimdal check
855 AC_MSG_CHECKING(whether to use kerberos/heimdal)
858 changequote(<<, >>)dnl
859 << --with-krb5[=DIR] use kerberos/heimdal (located in directory DIR, if supplied) to use in kerberos dissection [default=yes]>>,
862 if test $withval = no
865 elif test $withval = yes
874 # Use kerberos/heimdal if specified, otherwise don't.
879 if test "x$want_krb5" = "xno" ; then
883 AC_ETHEREAL_KRB5_CHECK
884 if test "x$want_krb5" = "xno" ; then
885 AC_MSG_RESULT(heimdal not found - disabling dissection for some kerberos data in packet decoding)
892 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
893 if test "x$with_adns" = "xno" ; then
897 AC_ETHEREAL_ADNS_CHECK
902 # Define ETH_VAR_IMPORT appropriately for declarations of external
903 # variables exported from dynamically-linked libraries.
905 AC_DEFINE(ETH_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
907 dnl Checks for typedefs, structures, and compiler characteristics.
910 # We need to know whether "struct sockaddr" has an "sa_len" member
911 # for get_interface_list().
913 AC_ETHEREAL_STRUCT_SA_LEN
915 # We must know our byte order
918 # Checks whether "-traditional" is needed when using "ioctl".
919 # XXX - do we need this?
920 AC_PROG_GCC_TRADITIONAL
922 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
923 # then this won't work.
926 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
927 [SNPRINTF_O="snprintf.o"
928 AC_DEFINE(NEED_SNPRINTF_H, 1, [Define if sprintf.h needs to be included])
930 if test "$ac_cv_func_snprintf" = no ; then
931 SNPRINTF_C="snprintf.c"
932 SNPRINTF_O="snprintf.o"
937 AC_CHECK_FUNC(strerror, STRERROR_O="",
938 [STRERROR_O="strerror.o"
939 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
941 if test "$ac_cv_func_strerror" = no ; then
942 STRERROR_C="strerror.c"
943 STRERROR_O="strerror.o"
948 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
949 STRCASECMP_O="strcasecmp.o")
950 if test "$ac_cv_func_strcasecmp" = no ; then
951 STRCASECMP_C="strcasecmp.c"
952 STRCASECMP_O="strcasecmp.o"
954 AC_SUBST(STRCASECMP_C)
955 AC_SUBST(STRCASECMP_O)
957 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
958 STRNCASECMP_O="strncasecmp.o")
959 if test "$ac_cv_func_strncasecmp" = no ; then
960 STRNCASECMP_C="strncasecmp.c"
961 STRNCASECMP_O="strncasecmp.o"
963 AC_SUBST(STRNCASECMP_C)
964 AC_SUBST(STRNCASECMP_O)
966 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
967 MKSTEMP_O="mkstemp.o")
968 if test "$ac_cv_func_mkstemp" = no ; then
969 MKSTEMP_C="mkstemp.c"
970 MKSTEMP_O="mkstemp.o"
975 AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
976 INET_ATON_O="inet_aton.lo")
977 if test "$ac_cv_func_inet_aton" = no ; then
978 INET_ATON_C="inet_aton.c"
979 INET_ATON_O="inet_aton.lo"
980 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
982 AC_SUBST(INET_ATON_C)
983 AC_SUBST(INET_ATON_O)
985 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
986 dnl check for pre-BIND82 inet_pton() bug.
987 AC_MSG_CHECKING(for broken inet_pton)
988 AC_TRY_RUN([#include <sys/types.h>
989 #include <sys/socket.h>
990 #include <netinet/in.h>
991 #include <arpa/inet.h>
996 /* this should return 0 (error) */
997 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1001 }], [AC_MSG_RESULT(ok);
1002 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1003 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1004 have_inet_pton=no])],
1006 if test "$have_inet_pton" = no; then
1007 INET_PTON_C="inet_pton.c"
1008 INET_PTON_O="inet_pton.lo"
1013 AC_SUBST(INET_PTON_C)
1014 AC_SUBST(INET_PTON_O)
1016 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1017 AC_MSG_CHECKING([for inet_ntop prototype])
1018 AC_TRY_COMPILE([#include <stdio.h>
1019 #include <sys/types.h>
1020 #include <sys/socket.h>
1021 #include <netinet/in.h>
1022 #include <arpa/inet.h>
1024 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1026 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1027 [Define if inet_ntop() prototype exists])], [
1028 AC_TRY_COMPILE([#include <stdio.h>
1029 #include <sys/types.h>
1030 #include <sys/socket.h>
1031 #include <netinet/in.h>
1032 #include <arpa/inet.h>
1034 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1036 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1037 [Define if inet_ntop() prototype exists])], [
1038 AC_MSG_RESULT(no)])])
1040 INET_NTOP_C="inet_ntop.c"
1041 INET_NTOP_O="inet_ntop.lo"
1042 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1043 [Define if inet/v6defs.h needs to be included])])
1044 AC_SUBST(INET_NTOP_C)
1045 AC_SUBST(INET_NTOP_O)
1047 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1048 [STRPTIME_O="strptime.o"
1049 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1051 if test "$ac_cv_func_strptime" = no ; then
1052 STRPTIME_C="strptime.c"
1053 STRPTIME_O="strptime.o"
1055 AC_SUBST(STRPTIME_C)
1056 AC_SUBST(STRPTIME_O)
1058 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1060 dnl blank for now, but will be used in future
1061 AC_SUBST(ethereal_SUBDIRS)
1064 dnl check whether plugins should be enabled and, if they should be,
1065 dnl check for plugins directory - stolen from Amanda's configure.in
1067 plugindir="$libdir/ethereal/plugins/$VERSION"
1068 AC_ARG_WITH(plugins,
1069 changequote(<<, >>)dnl
1070 << --with-plugins[=DIR] support plugins (installed in DIR, if supplied).>>,
1071 changequote([, ])dnl
1075 if test x$have_plugins = xno
1077 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1084 if test x$have_plugins = xno
1086 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1088 plugindir="$withval"
1093 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
1094 if test x$have_plugins = xyes
1096 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1098 test "x$prefix" = xNONE && prefix=$ac_default_prefix
1099 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1100 eval echo "$plugindir"
1102 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
1104 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
1109 # The plugin dissectors reside in ./plugins/PROTO/
1111 PLUGIN_LIBS="-L../../epan -lethereal $GLIB_LIBS"
1112 AC_SUBST(PLUGIN_LIBS)
1116 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1117 # (autoconf? automake? libtool?) - with the newer version(s), it's
1118 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1120 # With older version(s) of those tool(s), however, it's not just an
1121 # alias, and the configure scripts don't work without it.
1124 AC_SUBST(LIBTOOL_DEPS)
1126 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1127 if test x$enable_static = xyes -a x$have_plugins = xyes
1129 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Ethereal])
1131 AC_SUBST(ENABLE_STATIC)
1133 dnl Save the cacheable configure results to config.cache before recursing
1136 AM_CONFIG_HEADER(config.h)
1137 AC_CONFIG_SUBDIRS(wiretap)
1144 epan/dfilter/Makefile
1145 epan/ftypes/Makefile
1150 packaging/nsis/Makefile
1151 packaging/rpm/Makefile
1152 packaging/rpm/SPECS/Makefile
1153 packaging/rpm/SPECS/ethereal.spec
1154 packaging/svr4/Makefile
1155 packaging/svr4/checkinstall
1156 packaging/svr4/pkginfo
1158 plugins/acn/Makefile
1159 plugins/artnet/Makefile
1160 plugins/asn1/Makefile
1161 plugins/ciscosm/Makefile
1162 plugins/docsis/Makefile
1163 plugins/enttec/Makefile
1164 plugins/giop/Makefile
1165 plugins/gryphon/Makefile
1166 plugins/irda/Makefile
1167 plugins/lwres/Makefile
1168 plugins/megaco/Makefile
1169 plugins/mgcp/Makefile
1170 plugins/pcli/Makefile
1171 plugins/rdm/Makefile
1172 plugins/rlm/Makefile
1173 plugins/rtnet/Makefile
1174 plugins/rudp/Makefile
1175 plugins/v5ua/Makefile
1177 tools/lemon/Makefile
1183 if test "x$enable_setuid_install" = "xyes" ; then
1184 setuid_message="yes (DANGEROUS!!!)"
1189 if test "x$want_zlib" = "xno" ; then
1195 if test "x$want_pcre" = "xno" ; then
1201 if test "x$want_krb5" = "xno" ; then
1204 krb5_message="yes (heimdal)"
1207 if test "x$have_good_adns" = "xyes" ; then
1213 if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
1214 snmp_libs_message="yes (net-snmp)"
1215 elif test "x$SNMP_LIBS" = "x" ; then
1216 snmp_libs_message="no"
1218 snmp_libs_message="yes (ucd-snmp)"
1222 echo "The Ethereal package has been configured with the following options."
1223 echo " Build ethereal : $enable_ethereal"
1224 echo " Build tethereal : $enable_tethereal"
1225 echo " Build editcap : $enable_editcap"
1226 echo " Build mergecap : $enable_mergecap"
1227 echo " Build text2pcap : $enable_text2pcap"
1228 echo " Build idl2eth : $enable_idl2eth"
1229 echo " Build randpkt : $enable_randpkt"
1230 echo " Build dftest : $enable_dftest"
1232 echo " Install setuid : $setuid_message"
1233 echo " Use plugins : $have_plugins"
1234 echo " Use GTK+ v2 library : $enable_gtk2"
1235 if test "x$enable_gtk2" = "xyes" ; then
1236 echo " Use threads : $enable_threads"
1237 echo " Build profile binaries : $enable_profile_build"
1239 echo " Use pcap library : $want_pcap"
1240 echo " Use zlib library : $zlib_message"
1241 echo " Use pcre library : $pcre_message"
1242 echo " Use kerberos library : $krb5_message"
1243 echo " Use GNU ADNS library : $adns_message"
1244 echo " Use IPv6 name resolution : $enable_ipv6"
1245 echo " Use UCD SNMP/NET-SNMP library : $snmp_libs_message"