1 # $Id: configure.in,v 1.258 2004/05/09 10:03:36 guy Exp $
7 dnl Check for CPU / vendor / OS
11 AM_INIT_AUTOMAKE(ethereal, 0.10.3)
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(LEX, flex)
34 AC_PATH_PROG(PYTHON, python)
42 # Check for packaging utilities
43 # For now, we check to see if the various packaging utilites are in our
44 # path. I'm too lazy to write code to go hunt for them. - Gerald
45 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
46 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
47 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
49 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
50 -a x$HAVE_PKGTRANS = xyes ; then
51 HAVE_SVR4_PACKAGING=yes
53 HAVE_SVR4_PACKAGING=no
55 AC_SUBST(HAVE_SVR4_PACKAGING)
61 # If we're running gcc, add '-Wall -W' to CFLAGS, and add
62 # '-D_U_="__attribute__((unused))"' as well, so we can use _U_ to
63 # flag unused function arguments and not get warnings about them.
64 # If "--with-extra-gcc-checks" was specified, add "-Wcast-qual
65 # -Wcast-align" as well. (Add more checks here in the future?)
67 # Otherwise, add '-D_U_=""', so that _U_ used to flag an unused function
68 # argument will compile with non-GCC compilers.
70 AC_ARG_WITH(extra-gcc-checks,
71 [ --with-extra-gcc-checks Do additional -W checks in GCC. [default=no]],
73 if test $withval != no
75 ethereal_extra_gcc_flags=" -Wcast-qual -Wcast-align -Wbad-function-cast -pedantic -Wstrict-prototypes"
78 AC_MSG_CHECKING(to see if we can add '-Wall -W$ethereal_extra_gcc_flags' to CFLAGS)
79 if test x$GCC != x ; then
80 CFLAGS="-D_U_=\"__attribute__((unused))\" -Wall -W$ethereal_extra_gcc_flags $CFLAGS"
83 CFLAGS="-D_U_=\"\" $CFLAGS"
88 # Add any platform-specific compiler flags needed.
90 AC_MSG_CHECKING(for platform-specific compiler flags)
94 # Not GCC - assume it's the vendor's compiler.
99 # HP's ANSI C compiler; flags suggested by Jost Martin.
100 # "-Ae" for ANSI C plus extensions such as "long long".
101 # "+O2", for optimization. XXX - works with "-g"?
103 CFLAGS="-Ae +O2 $CFLAGS"
104 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
108 # It may be called "cc", but it's really a GCC derivative
109 # with a problematic special precompiler and precompiled
110 # headers; turn off the special precompiler, as some
111 # apparently-legal code won't compile with its precompiled
114 CFLAGS="-no-cpp-precomp $CFLAGS"
115 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
118 AC_MSG_RESULT(none needed)
124 # the X11 headers don't automatically include prototype info
125 # and a lot don't include the return type
126 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
127 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
131 # See comments above about Apple's lovely C compiler.
133 CFLAGS="-no-cpp-precomp $CFLAGS"
134 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
138 # Shared libraries in cygwin/Win32 must never contain
141 LDFLAGS="$LDFLAGS -no-undefined"
142 AC_MSG_RESULT(CygWin GCC - added -no-undefined to LDFLAGS)
145 AC_MSG_RESULT(none needed)
150 dnl Look in /usr/local for header files and libraries ?
151 dnl XXX FIXME don't include /usr/local if it is already in the system
152 dnl search path as this causes gcc 3.2 on Linux to complain about a change
153 dnl of the system search order for includes
154 AC_ARG_ENABLE(usr-local,
155 [ --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)
157 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
158 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
161 # Arrange that we search for header files in the source directory
162 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
163 # as various packages we use ("libpcap", "zlib", an SNMP library)
164 # may have been installed under "/usr/local/include".
166 CFLAGS="$CFLAGS -I/usr/local/include"
167 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
170 # Arrange that we search for libraries in "/usr/local/lib".
172 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
178 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
183 AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
184 if test x$LD_LIBRARY_PATH != x ; then
185 LIBS="$LIBS -R$LD_LIBRARY_PATH"
186 AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
188 AC_MSG_RESULT(no -- this may be a problem in a few seconds)
194 # Check for versions of "sed" inadequate to handle, in libtool, a list
195 # of object files as large as the list in Ethereal.
197 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
198 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
199 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
200 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
201 # is the only "sed" that comes with Solaris that can handle Ethereal.
203 # Add any checks here that are necessary for other OSes.
205 AC_ETHEREAL_GNU_SED_CHECK
206 if test "$HAVE_GNU_SED" = no ; then
209 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
211 /bin/sed|/usr/bin/sed|/usr/ucb/sed)
213 AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
228 # Enable/disable tethereal
230 AC_ARG_ENABLE(ethereal,
231 [ --enable-ethereal build GTK+-based ethereal. [default=yes]],enable_ethereal=$enableval,enable_ethereal=yes)
234 [ --enable-gtk2 build Glib2/Gtk2+-based (t)ethereal. [default=no]],enable_gtk2=$enableval,enable_gtk2=no)
235 AM_CONDITIONAL(USE_GTK2, test x$enable_gtk2 = xyes)
237 AC_ARG_ENABLE(threads,
238 [ --enable-threads use threads in ethereal. [default=no]],enable_threads=$enableval,enable_threads=no)
239 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
241 AC_ARG_ENABLE(profile-build,
242 [ --enable-profile-build build profile-ready binaries. [default=no]],enable_profile_build=$enableval,enable_profile_build=no)
243 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
244 AC_MSG_CHECKING(if profile builds must be generated)
245 if test "x$enable_profile_build" = "xyes" ; then
246 if test -n "$GCC" ; then
248 CFLAGS=" -pg $CFLAGS"
251 echo "Building profile binaries currently only supported for GCC."
257 # Create DATAFILE_DIR #define for config.h
258 datafiledir=$datadir/ethereal
260 test "x$prefix" = xNONE && prefix=$ac_default_prefix
261 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
262 eval echo "$datafiledir"
264 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
267 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
268 # programs to be built with GTK+.
270 if test "x$enable_gtk2" = "xyes" -a "x$enable_ethereal" = "xyes" ; then
272 AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
273 elif test "x$enable_gtk2" != "xyes" -a "x$enable_ethereal" = "xyes" ; then
275 AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no )
281 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
282 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
283 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
284 # set when generating the Makefile, so we can make programs that require
285 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
286 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
287 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
288 # programs to be built with GLib.
290 if test "$GTK_OK" = "no" ; then
295 if test "x$enable_gtk2" = "xyes" ; then
296 AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
298 AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found.), gmodule)
301 ethereal_bin="ethereal\$(EXEEXT)"
302 ethereal_man="ethereal.1"
303 ethereal_SUBDIRS="gtk"
305 if test "$GTK_OK" = "two" ; then
306 AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
308 AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
313 # Check whether GLib modules are supported, to determine whether we
314 # can support plugins.
316 AC_MSG_CHECKING(whether GLib supports loadable modules)
317 ac_save_CFLAGS="$CFLAGS"
319 CFLAGS="$CFLAGS $GLIB_CFLAGS"
320 LIBS="$GLIB_LIBS $LIBS"
330 if (g_module_supported())
331 return 0; /* success */
333 return 1; /* failure */
335 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
336 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
337 CFLAGS="$ac_save_CFLAGS"
339 if test "$ac_cv_glib_supports_modules" = yes ; then
348 AC_SUBST(ethereal_bin)
349 AC_SUBST(ethereal_man)
351 rdps_bin="rdps\$(EXEEXT)"
355 # Enable/disable tethereal
357 AC_ARG_ENABLE(tethereal,
358 [ --enable-tethereal build tethereal. [default=yes]],tethereal=$enableval,enable_tethereal=yes)
360 if test "x$enable_tethereal" = "xyes" ; then
361 tethereal_bin="tethereal\$(EXEEXT)"
362 tethereal_man="tethereal.1"
363 etherealfilter_man="ethereal-filter.4"
368 AC_SUBST(tethereal_bin)
369 AC_SUBST(tethereal_man)
370 AC_SUBST(etherealfilter_man)
374 # Enable/disable editcap
376 AC_ARG_ENABLE(editcap,
377 [ --enable-editcap build editcap. [default=yes]],enable_editcap=$enableval,enable_editcap=yes)
379 if test "x$enable_editcap" = "xyes" ; then
380 editcap_bin="editcap\$(EXEEXT)"
381 editcap_man="editcap.1"
386 AC_SUBST(editcap_bin)
387 AC_SUBST(editcap_man)
390 # Enable/disable mergecap
392 AC_ARG_ENABLE(mergecap,
393 [ --enable-mergecap build mergecap. [default=yes]],enable_mergecap=$enableval,enable_mergecap=yes)
395 if test "x$enable_mergecap" = "xyes" ; then
396 mergecap_bin="mergecap\$(EXEEXT)"
397 mergecap_man="mergecap.1"
402 AC_SUBST(mergecap_bin)
403 AC_SUBST(mergecap_man)
406 # Enable/disable text2pcap
408 AC_ARG_ENABLE(text2pcap,
409 [ --enable-text2pcap build text2pcap. [default=yes]],text2pcap=$enableval,enable_text2pcap=yes)
411 if test "x$enable_text2pcap" = "xyes" ; then
412 text2pcap_bin="text2pcap\$(EXEEXT)"
413 text2pcap_man="text2pcap.1"
418 AC_SUBST(text2pcap_bin)
419 AC_SUBST(text2pcap_man)
421 # Enable/disable idl2eth
423 AC_ARG_ENABLE(idl2eth,
424 [ --enable-idl2eth build idl2eth. [default=yes]],enable_idl2eth=$enableval,enable_idl2eth=yes)
426 if test "x$enable_idl2eth" = "xyes" ; then
427 idl2eth_bin="idl2eth"
428 idl2eth_man="idl2eth.1"
433 AC_SUBST(idl2eth_bin)
434 AC_SUBST(idl2eth_man)
437 # Enable/disable dftest
439 AC_ARG_ENABLE(dftest,
440 [ --enable-dftest build dftest. [default=no]],enable_dftest=$enableval,enable_dftest=no)
442 if test "x$enable_dftest" = "xyes" ; then
443 dftest_bin="dftest\$(EXEEXT)"
450 # Enable/disable randpkt
452 AC_ARG_ENABLE(randpkt,
453 [ --enable-randpkt build randpkt. [default=no]],enable_randpkt=$enableval,enable_randpkt=no)
455 if test "x$enable_randpkt" = "xyes" ; then
456 randpkt_bin="randpkt\$(EXEEXT)"
460 AC_SUBST(randpkt_bin)
463 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
464 dnl "gethostbyname()".
465 AC_ETHEREAL_GETHOSTBY_LIB_CHECK
467 dnl Checks for "connect()", used as a proxy for "socket()" - and
468 dnl "-lsocket", if we need it to get "connect()".
469 AC_ETHEREAL_SOCKET_LIB_CHECK
472 AC_MSG_CHECKING(whether to use libpcap for packet capture)
475 changequote(<<, >>)dnl
476 << --with-pcap[=DIR] use libpcap for packet capturing. [default=yes]>>,
479 if test $withval = no
482 elif test $withval = yes
493 if test "x$want_pcap" = "xno" ; then
497 AC_ETHEREAL_PCAP_CHECK
501 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
504 changequote(<<, >>)dnl
505 << --with-zlib[=DIR] use zlib (located in directory DIR, if supplied) to read compressed data. [default=yes, if present]>>,
508 if test $withval = no
511 elif test $withval = yes
520 # Use zlib if it's present, otherwise don't.
525 if test "x$want_zlib" = "xno" ; then
529 AC_ETHEREAL_ZLIB_CHECK
530 if test "x$want_zlib" = "xno" ; then
531 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
537 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
540 changequote(<<, >>)dnl
541 << --with-pcre[=DIR] use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions. [default=yes, if present]>>,
544 if test $withval = no
547 elif test $withval = yes
556 # Use libpcre if it's present, otherwise don't.
561 if test "x$want_pcre" = "xno" ; then
565 AC_ETHEREAL_LIBPCRE_CHECK
566 if test "x$want_pcre" = "xno" ; then
567 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
574 [ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],enable_ipv6=$enableval,enable_ipv6=yes)
576 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
577 if test "x$enable_ipv6" = "xno" ; then
581 AC_ETHEREAL_IPV6_STACK
585 dnl Check if ethereal should be installed setuid
586 AC_ARG_ENABLE(setuid-install,
587 [ --enable-setuid-install install ethereal as setuid. DANGEROUS!!! [default=no]],enable_setuid_install=$enableval,enable_setuid_install=no)
589 AC_MSG_CHECKING(whether to install ethereal setuid)
590 if test "x$enable_setuid_install" = "xno" ; then
596 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
598 dnl Checks for header files.
600 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h netdb.h stdarg.h stddef.h unistd.h)
601 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)
602 AC_CHECK_HEADERS(netinet/in.h)
603 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
604 AC_CHECK_HEADERS(iconv.h)
608 AC_MSG_CHECKING(whether to use SSL library if available)
609 if test "x$enable_ssl" = "xno" ; then
613 AC_ETHEREAL_SSL_CHECK
617 dnl UCD SNMP/NET-SNMP Check
620 AC_ARG_WITH(net-snmp,
621 changequote(<<, >>)dnl
622 << --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.>>,
624 [netsnmpconfig=$withval]
627 AC_ARG_WITH(ucd-snmp,
628 changequote(<<, >>)dnl
629 << --with-ucd-snmp[=DIR] use UCD SNMP client library (located in directory DIR, if supplied). [default=yes, if present]>>,
632 if test $withval = no
635 elif test $withval = yes
644 # Set "want_ucdsnmp" to "ifpresent" to make the default "use it
645 # if you find it, otherwise don't".
647 want_ucdsnmp=ifpresent
651 dnl try net-snmp first
652 AC_MSG_CHECKING(whether to use NET-SNMP library if available)
653 if test "x$netsnmpconfig" != "xno" ; then
655 dnl get the net-snmp-config binary
656 if test "x$netsnmpconfig" = "xyes" -o "x$netsnmpconfig" = "x" ; then
658 AC_PATH_PROG(NETSNMPCONFIG,net-snmp-config)
660 NETSNMPCONFIG=$netsnmpconfig
661 if test ! -x $NETSNMPCONFIG ; then
662 AC_MSG_ERROR(Invalid net-snmp-config: $NETSNMPCONFIG)
669 if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
670 dnl other choices for flags to use here: could also use
671 dnl --prefix or --exec-prefix if you don't want the full list.
674 # Save the current settings of CFLAGS and CPPFLAGS, and add
675 # the output of "$NETSNMPCONFIG --cflags" to it, so that when
676 # searching for the Net-SNMP headers, we look in whatever
677 # directory that output specifies.
679 ethereal_save_CFLAGS="$CFLAGS"
680 ethereal_save_CPPFLAGS="$CPPFLAGS"
681 CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags`"
682 CPPFLAGS="$CPPFLAGS `$NETSNMPCONFIG --cflags`"
684 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h net-snmp/library/default_store.h)
685 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
686 SNMP_LIBS=`$NETSNMPCONFIG --libs`
687 AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for NET-SNMP])
690 # technically, we should retry ucd-snmp but it's
691 # unlikely they have installed net-snmp-config and not
692 # the net-snmp headers but do have the ucd-snmp
693 # headers. This would likely be a broken system to
694 # try and use anyway.
698 # Restore the versions of CFLAGS and CPPFLAGS before
699 # we added the output of '$NETSNMPCONFIG --cflags",
700 # as we didn't actually find Net-SNMP there.
702 CFLAGS="$ethereal_save_CFLAGS"
703 CPPFLAGS="$ethereal_save_CPPFLAGS"
706 AC_MSG_CHECKING(whether to use UCD SNMP library if available)
707 if test "x$want_ucdsnmp" = "xno" ; then
711 AC_ETHEREAL_UCDSNMP_CHECK
715 if test "x$have_net_snmp" = "xyes" || test "x$have_ucd_snmp" = "xyes"; then
716 AC_DEFINE(HAVE_SOME_SNMP, 1, [Define to if some SNMP support is to be used])
722 dnl kerberos/heimdal check
723 AC_MSG_CHECKING(whether to use kerberos/heimdal)
726 changequote(<<, >>)dnl
727 << --with-krb5[=DIR] use kerberos/heimdal (located in directory DIR, if supplied) to use in kerberos dissection [default=no]>>,
730 if test $withval = no
733 elif test $withval = yes
742 # Use kerberos/heimdal if it's present, otherwise don't.
747 if test "x$want_krb5" = "xno" ; then
751 AC_ETHEREAL_KRB5_CHECK
752 if test "x$want_krb5" = "xno" ; then
753 AC_MSG_RESULT(heimdal not found - disabling dissection for some kerberos data in packet decoding)
760 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
761 if test "x$with_adns" = "xno" ; then
765 AC_ETHEREAL_ADNS_CHECK
770 # Define ETH_VAR_IMPORT appropriately for declarations of external
771 # variables exported from dynamically-linked libraries.
773 AC_DEFINE(ETH_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
775 dnl Checks for typedefs, structures, and compiler characteristics.
778 # We need to know whether "struct sockaddr" has an "sa_len" member
779 # for get_interface_list().
781 AC_ETHEREAL_STRUCT_SA_LEN
783 # We must know our byte order
786 # Checks whether "-traditional" is needed when using "ioctl".
787 # XXX - do we need this?
788 AC_PROG_GCC_TRADITIONAL
790 # If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
791 # then this won't work.
794 AC_CHECK_FUNC(snprintf, SNPRINTF_O="",
795 [SNPRINTF_O="snprintf.o"
796 AC_DEFINE(NEED_SNPRINTF_H, 1, [Define if sprintf.h needs to be included])
798 if test "$ac_cv_func_snprintf" = no ; then
799 SNPRINTF_C="snprintf.c"
800 SNPRINTF_O="snprintf.o"
805 AC_CHECK_FUNC(strerror, STRERROR_O="",
806 [STRERROR_O="strerror.o"
807 AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
809 if test "$ac_cv_func_strerror" = no ; then
810 STRERROR_C="strerror.c"
811 STRERROR_O="strerror.o"
816 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
817 STRCASECMP_O="strcasecmp.o")
818 if test "$ac_cv_func_strcasecmp" = no ; then
819 STRCASECMP_C="strcasecmp.c"
820 STRCASECMP_O="strcasecmp.o"
822 AC_SUBST(STRCASECMP_C)
823 AC_SUBST(STRCASECMP_O)
825 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
826 STRNCASECMP_O="strncasecmp.o")
827 if test "$ac_cv_func_strncasecmp" = no ; then
828 STRNCASECMP_C="strncasecmp.c"
829 STRNCASECMP_O="strncasecmp.o"
831 AC_SUBST(STRNCASECMP_C)
832 AC_SUBST(STRNCASECMP_O)
834 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
835 MKSTEMP_O="mkstemp.o")
836 if test "$ac_cv_func_mkstemp" = no ; then
837 MKSTEMP_C="mkstemp.c"
838 MKSTEMP_O="mkstemp.o"
843 AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
844 INET_ATON_O="inet_aton.lo")
845 if test "$ac_cv_func_inet_aton" = no ; then
846 INET_ATON_C="inet_aton.c"
847 INET_ATON_O="inet_aton.lo"
848 AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
850 AC_SUBST(INET_ATON_C)
851 AC_SUBST(INET_ATON_O)
853 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
854 dnl check for pre-BIND82 inet_pton() bug.
855 AC_MSG_CHECKING(for broken inet_pton)
856 AC_TRY_RUN([#include <sys/types.h>
857 #include <sys/socket.h>
858 #include <netinet/in.h>
859 #include <arpa/inet.h>
864 /* this should return 0 (error) */
865 return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
869 }], [AC_MSG_RESULT(ok);
870 have_inet_pton=yes], [AC_MSG_RESULT(broken);
871 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
872 have_inet_pton=no])],
874 if test "$have_inet_pton" = no; then
875 INET_PTON_C="inet_pton.c"
876 INET_PTON_O="inet_pton.lo"
881 AC_SUBST(INET_PTON_C)
882 AC_SUBST(INET_PTON_O)
884 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
885 AC_MSG_CHECKING([for inet_ntop prototype])
886 AC_TRY_COMPILE([#include <stdio.h>
887 #include <sys/types.h>
888 #include <sys/socket.h>
889 #include <netinet/in.h>
890 #include <arpa/inet.h>
892 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
894 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
895 [Define if inet_ntop() prototype exists])], [
896 AC_TRY_COMPILE([#include <stdio.h>
897 #include <sys/types.h>
898 #include <sys/socket.h>
899 #include <netinet/in.h>
900 #include <arpa/inet.h>
902 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
904 AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
905 [Define if inet_ntop() prototype exists])], [
906 AC_MSG_RESULT(no)])])
908 INET_NTOP_C="inet_ntop.c"
909 INET_NTOP_O="inet_ntop.lo"
910 AC_DEFINE(NEED_INET_V6DEFS_H, 1,
911 [Define if inet/v6defs.h needs to be included])])
912 AC_SUBST(INET_NTOP_C)
913 AC_SUBST(INET_NTOP_O)
915 AC_CHECK_FUNC(strptime, STRPTIME_O="",
916 [STRPTIME_O="strptime.o"
917 AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
919 if test "$ac_cv_func_strptime" = no ; then
920 STRPTIME_C="strptime.c"
921 STRPTIME_O="strptime.o"
926 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
928 dnl blank for now, but will be used in future
929 AC_SUBST(ethereal_SUBDIRS)
932 dnl check whether plugins should be enabled and, if they should be,
933 dnl check for plugins directory - stolen from Amanda's configure.in
935 plugindir="$libdir/ethereal/plugins/$VERSION"
937 changequote(<<, >>)dnl
938 << --with-plugins[=DIR] support plugins (installed in DIR, if supplied).>>,
943 if test x$have_plugins = xno
945 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
952 if test x$have_plugins = xno
954 AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
961 AM_CONDITIONAL(HAVE_PLUGINS, test x$have_plugins = xyes)
962 if test x$have_plugins = xyes
964 AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
966 test "x$prefix" = xNONE && prefix=$ac_default_prefix
967 test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
968 eval echo "$plugindir"
970 AC_DEFINE_UNQUOTED(PLUGIN_DIR, "$plugindir", [Plugin installation directory])
972 AC_DEFINE(PLUGIN_DIR, NULL, [Plugin installation directory])
977 # The plugin dissectors reside in ./plugins/PROTO/
979 PLUGIN_LIBS="-L../../epan -lethereal $GLIB_LIBS"
980 AC_SUBST(PLUGIN_LIBS)
984 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
985 # (autoconf? automake? libtool?) - with the newer version(s), it's
986 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
988 # With older version(s) of those tool(s), however, it's not just an
989 # alias, and the configure scripts don't work without it.
992 AC_SUBST(LIBTOOL_DEPS)
994 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
995 if test x$enable_static = xyes -a x$have_plugins = xyes
997 AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Ethereal])
999 AC_SUBST(ENABLE_STATIC)
1001 dnl Save the cacheable configure results to config.cache before recursing
1004 AM_CONFIG_HEADER(config.h)
1005 AC_CONFIG_SUBDIRS(wiretap)
1010 epan/dfilter/Makefile
1011 epan/ftypes/Makefile
1015 packaging/nsis/Makefile
1016 packaging/rpm/Makefile
1017 packaging/rpm/SPECS/Makefile
1018 packaging/rpm/SPECS/ethereal.spec
1019 packaging/svr4/Makefile
1020 packaging/svr4/checkinstall
1021 packaging/svr4/pkginfo
1023 plugins/acn/Makefile
1024 plugins/artnet/Makefile
1025 plugins/asn1/Makefile
1026 plugins/ciscosm/Makefile
1027 plugins/docsis/Makefile
1028 plugins/enttec/Makefile
1029 plugins/giop/Makefile
1030 plugins/gryphon/Makefile
1031 plugins/irda/Makefile
1032 plugins/lwres/Makefile
1033 plugins/megaco/Makefile
1034 plugins/mgcp/Makefile
1035 plugins/pcli/Makefile
1036 plugins/rdm/Makefile
1037 plugins/rlm/Makefile
1038 plugins/rtnet/Makefile
1039 plugins/rudp/Makefile
1040 plugins/v5ua/Makefile
1042 tools/lemon/Makefile
1048 if test "x$enable_setuid_install" = "xyes" ; then
1049 setuid_message="yes (DANGEROUS!!!)"
1054 if test "x$want_zlib" = "xno" ; then
1060 if test "x$want_pcre" = "xno" ; then
1066 if test "x$want_krb5" = "xno" ; then
1069 krb5_message="yes (heimdal)"
1072 if test "x$have_good_adns" = "xyes" ; then
1078 if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
1079 snmp_libs_message="yes (net-snmp)"
1080 elif test "x$SNMP_LIBS" = "x" ; then
1081 snmp_libs_message="no"
1083 snmp_libs_message="yes (ucd-snmp)"
1087 echo "The Ethereal package has been configured with the following options."
1088 echo " Build ethereal : $enable_ethereal"
1089 echo " Build tethereal : $enable_tethereal"
1090 echo " Build editcap : $enable_editcap"
1091 echo " Build mergecap : $enable_mergecap"
1092 echo " Build text2pcap : $enable_text2pcap"
1093 echo " Build idl2eth : $enable_idl2eth"
1094 echo " Build randpkt : $enable_randpkt"
1095 echo " Build dftest : $enable_dftest"
1097 echo " Install setuid : $setuid_message"
1098 echo " Use plugins : $have_plugins"
1099 echo " Use GTK+ v2 library : $enable_gtk2"
1100 if test "x$enable_gtk2" = "xyes" ; then
1101 echo " Use threads : $enable_threads"
1102 echo " Build profile binaries : $enable_profile_build"
1104 echo " Use pcap library : $want_pcap"
1105 echo " Use zlib library : $zlib_message"
1106 echo " Use pcre library : $pcre_message"
1107 echo " Use kerberos library : $krb5_message"
1108 echo " Use GNU ADNS library : $adns_message"
1109 echo " Use IPv6 name resolution : $enable_ipv6"
1110 echo " Use UCD SNMP/NET-SNMP library : $snmp_libs_message"