-# $Id: configure.in,v 1.33 1999/07/31 23:06:13 gram Exp $
-dnl Process this file with autoconf to produce a configure script.
+# $Id: configure.in,v 1.80 2000/01/21 08:44:40 guy Exp $
+dnl
+dnl Process this file with autoconf 2.13 or later to produce a
+dnl configure script; 2.12 doesn't generate a "configure" script that
+dnl defines SHELL, and "Makefile.in" has
+dnl
+dnl SHELL = @SHELL@
+dnl
+dnl which requires it to be defined - and there may be other problems
+dnl with pre-2.13 "autoconf" as well.
+dnl
AC_INIT(etypes.h)
-AM_INIT_AUTOMAKE(ethereal, 0.6.3)
+AC_PREREQ(2.13)
+
+AM_INIT_AUTOMAKE(ethereal, 0.8.1)
dnl Check for CPU / vendor / OS
AC_CANONICAL_HOST
AC_PROG_RANLIB
AC_PROG_YACC
AM_PROG_LEX
+AC_PATH_PROG(PERL_PATH, perl)
+AC_PATH_PROG(LEX, flex)
+
+AC_SUBST(PERL_PATH)
+AC_SUBST(FLEX_PATH)
+
# If we're running gcc, add '-Wall' to CFLAGS.
AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS)
AC_MSG_RESULT(no)
fi
-CFLAGS="$CFLAGS -Iwiretap"
+#
+# Add any platform-specific compiler flags needed.
+#
+AC_MSG_CHECKING(for platform-specific compiler flags)
+if test "x$GCC" = x
+then
+ #
+ # Not GCC - assume it's the vendor's compiler.
+ #
+ case "$host_os" in
+ hpux*)
+ #
+ # HP's ANSI C compiler; flags suggested by Jost Martin.
+ # "-Aa" for ANSI C
+ # "-Ae" for extensions to ANSI, for "long long".
+ # "+O2", for optimization. XXX - works with "-g"?
+ #
+ CFLAGS="-Aa -Ae +O2 $CFLAGS"
+ AC_MSG_RESULT(HP ANSI C compiler - added -Aa -Ae +O2)
+ ;;
+ *)
+ AC_MSG_RESULT(none needed)
+ ;;
+ esac
+else
+ AC_MSG_RESULT(none needed)
+fi
+
+#
+# Arrange that we search for header files in the source directory
+# and in its "wiretap" subdirectory, as well as in "/usr/local/include",
+# as various packages we use ("libpcap", "zlib", an SNMP library)
+# may have been installed under "/usr/local/include".
+#
+CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I/usr/local/include"
+CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/wiretap -I/usr/local/include"
+
+#
+# Arrange that we search for libraries in "/usr/local/lib".
+#
+AC_ETHEREAL_ADD_DASH_L(LDFLAGS, /usr/local/lib)
# Create DATAFILE_DIR #define for config.h
DATAFILE_DIR=$sysconfdir
;;
esac
+# GLib checks
+# This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
+# GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
+# However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
+# set when generating the Makefile, so we can make programs that require
+# only GLib link with @GLIB_LIBS@ and make programs that require GTK+
+# link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
+# We don't add $GLIB_LIBS to LIBS, because we don't want to force all
+# programs to be built with GLib.
+#
+AM_PATH_GLIB(1.2.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
+
# GTK checks
-AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS",
+# We don't add $GLIB_LIBS to LIBS, because we don't want to force all
+# programs to be built with GTK+.
+#
+AM_PATH_GTK(1.2.0, CFLAGS="$CFLAGS $GTK_CFLAGS",
AC_MSG_ERROR(GTK+ distribution not found.))
+dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
+dnl "gethostbyname()".
+AC_ETHEREAL_GETHOSTBY_LIB_CHECK
+
+dnl Checks for "connect()", used as a proxy for "socket()" - and
+dnl "-lsocket", if we need it to get "connect()".
+AC_ETHEREAL_SOCKET_LIB_CHECK
+
dnl pcap check
AC_ARG_ENABLE(pcap,
[ --enable-pcap use libpcap for packet capturing. [default=yes]],,enable_pcap=yes)
AC_ETHEREAL_PCAP_CHECK
fi
+dnl zlib check
+AC_ARG_ENABLE(zlib,
+[ --enable-zlib use zlib to read compressed data. [default=yes]],,enable_zlib=yes)
+
+AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
+if test "x$enable_zlib" = "xno" ; then
+ AC_MSG_RESULT(no)
+else
+ AC_MSG_RESULT(yes)
+ AC_ETHEREAL_ZLIB_CHECK
+ if test "x$enable_zlib" = "xno" ; then
+ AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
+ fi
+fi
+
+
dnl ipv6 check
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 use ipv6 name resolution, if available. [default=yes]],,enable_ipv6=yes)
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h netdb.h)
-AC_CHECK_HEADERS(sys/stat.h sys/sockio.h sys/types.h netinet/in.h sys/socket.h net/if.h)
+AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h netdb.h dirent.h)
+AC_CHECK_HEADERS(sys/stat.h sys/sockio.h sys/types.h sys/socket.h)
+AC_CHECK_HEADERS(sys/wait.h sys/param.h)
+AC_CHECK_HEADERS(netinet/in.h net/if.h)
+AC_CHECK_HEADERS(stddef.h)
+AC_CHECK_HEADERS(dlfcn.h)
+AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
dnl SNMP Check
AC_ARG_ENABLE(snmp,
[ --enable-snmp use SNMP library, if available. [default=yes]],,enable_snmp=yes)
-SNMP_A=''
-SNMP_O=''
+SNMP_LIBS=''
AC_MSG_CHECKING(whether to use SNMP library if available)
if test "x$enable_snmp" = "xno" ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
- AC_CHECK_HEADERS(ucd-snmp/snmp.h snmp/snmp.h)
- AC_CHECK_LIB(snmp, asn_parse_header,
- [
- SNMP_A=-lsnmp
- SNMP_O=packet-snmp.o
- ], )
+ AC_ETHEREAL_UCDSNMP_CHECK
+ AC_CHECK_HEADERS(ucd-snmp/snmp.h ucd-snmp/version.h snmp/snmp.h snmp/version.h)
+
+ #
+ # This may require "-lkstat" on Solaris, sigh.
+ #
+ AC_CHECK_LIB(snmp, sprint_objid,
+ SNMP_LIBS=-lsnmp,
+ [
+ #
+ # Throw away the cached "we didn't find it" answer.
+ #
+ unset ac_cv_lib_snmp_sprint_objid
+ AC_CHECK_LIB(snmp, sprint_objid,
+ [
+ #
+ # Throw away the cached "we found it" answer, so that if
+ # we rerun "configure", we don't just blow off this check
+ # and blithely assume that we don't need "-lkstat".
+ #
+ # XXX - autoconf really needs a way to test for a given
+ # routine in a given library *and* to test whether additional
+ # "-L"/"-R"/whatever flags are needed *before* the "-l"
+ # flag for the library and to test whether additional libraries
+ # are needed after the library *and* to cache all that
+ # information.
+ #
+ unset ac_cv_lib_snmp_sprint_objid
+ SNMP_LIBS="-lsnmp -lkstat"
+ ],,$SOCKET_LIBS $NSL_LIBS -lkstat
+ )
+ ], $SOCKET_LIBS $NSL_LIBS
+ )
+
fi
-AC_SUBST(SNMP_A)
-AC_SUBST(SNMP_O)
+AC_SUBST(SNMP_LIBS)
dnl Checks for typedefs, structures, and compiler characteristics.
# AC_C_CONST
# We must know our byte order
AC_C_BIGENDIAN
-dnl Checks for library functions.
+# Checks whether "-traditional" is needed when using "ioctl".
+# XXX - do we need this?
AC_PROG_GCC_TRADITIONAL
-AC_CHECK_FUNC(socket,, AC_MSG_ERROR(Function 'socket' not found.))
# If there's a system out there that has snprintf and _doesn't_ have vsnprintf,
# then this won't work.
AC_SUBST(STRERROR_C)
AC_SUBST(STRERROR_O)
+AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
+ STRNCASECMP_O="strncasecmp.o")
+if test "$ac_cv_func_strncasecmp" = no ; then
+ STRNCASECMP_C="strncasecmp.c"
+ STRNCASECMP_O="strncasecmp.o"
+fi
+AC_SUBST(STRNCASECMP_C)
+AC_SUBST(STRNCASECMP_O)
+
+AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
+ MKSTEMP_O="mkstemp.o")
+if test "$ac_cv_func_mkstemp" = no ; then
+ MKSTEMP_C="mkstemp.c"
+ MKSTEMP_O="mkstemp.o"
+ AC_DEFINE(NEED_MKSTEMP)
+fi
+AC_SUBST(MKSTEMP_C)
+AC_SUBST(MKSTEMP_O)
+
+AC_CHECK_FUNC(inet_aton, INET_ATON_O="",
+ INET_ATON_O="inet_aton.o")
+if test "$ac_cv_func_inet_aton" = no ; then
+ INET_ATON_C="inet_aton.c"
+ INET_ATON_O="inet_aton.o"
+fi
+AC_SUBST(INET_ATON_C)
+AC_SUBST(INET_ATON_O)
+
+AC_CHECK_FUNC(inet_pton, [
+ dnl check for pre-BIND82 inet_pton() bug.
+ AC_MSG_CHECKING(for broken inet_pton)
+ AC_TRY_RUN([#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+int main()
+{
+#ifdef AF_INET6
+ char buf[16];
+ /* this should return 0 (error) */
+ return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
+#else
+ return 1;
+#endif
+}], [AC_MSG_RESULT(ok);
+have_inet_pton=yes], [AC_MSG_RESULT(broken);
+have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
+have_inet_pton=no])],
+have_inet_pton=no)
+if test "$have_inet_pton" = no; then
+ INET_PTON_C="inet_pton.c"
+ INET_PTON_O="inet_pton.o"
+else
+ INET_PTON_C=""
+ INET_PTON_O=""
+fi
+AC_SUBST(INET_PTON_C)
+AC_SUBST(INET_PTON_O)
+
+AC_CHECK_FUNC(inet_ntop, INET_NTOP_O="",
+ INET_NTOP_O="inet_ntop.o")
+if test "$ac_cv_func_inet_ntop" = no ; then
+ INET_NTOP_C="inet_ntop.c"
+ INET_NTOP_O="inet_ntop.o"
+ AC_DEFINE(NEED_INET_V6DEFS_H)
+fi
+AC_SUBST(INET_NTOP_C)
+AC_SUBST(INET_NTOP_O)
+
+AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
+
dnl blank for now, but will be used in future
-AC_SUBST(SUBDIRS)
+AC_SUBST(ethereal_SUBDIRS)
+
+dnl check for plugins directory - stolen from Amanda's configure.in
+AC_ARG_WITH(plugindir,
+ [ --with-plugindir=DIR install plugins in DIR],
+ [
+ case "$withval" in
+ "" | y | ye | yes | n | no)
+ AC_MSG_ERROR([*** You must supply an argument to the --with-plugindir option.])
+ ;;
+ *) PLUGIN_DIR="$withval"
+ esac
+ ],
+ : ${PLUGIN_DIR=$libdir/ethereal/plugins/0.8}
+)
+
+PLUGIN_DIR=`(
+ test "x$prefix" = xNONE && prefix=$ac_default_prefix
+ test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+ eval echo "$PLUGIN_DIR"
+)`
+AC_DEFINE_UNQUOTED(PLUGIN_DIR,"$PLUGIN_DIR", [Plugin installation directory])
+AC_SUBST(PLUGIN_DIR)
+
+dnl libtool defs
+AC_LIBTOOL_DLOPEN
+AM_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
AM_CONFIG_HEADER(config.h)
-AC_CONFIG_SUBDIRS(wiretap doc)
-AC_OUTPUT(Makefile)
+AC_CONFIG_SUBDIRS(wiretap)
+AC_OUTPUT(
+ Makefile
+ ethereal.spec
+ doc/Makefile
+ doc/dfilter2pod
+ gtk/Makefile
+ plugins/Makefile
+ plugins/gryphon/Makefile,
+ [chmod +x doc/dfilter2pod])