1998-09-15 19:36:32 +00:00
|
|
|
dnl @(#) $Header: configure.in,v 1.71 97/07/27 22:17:59 leres Exp $ (LBL)
|
1996-08-19 20:34:12 +00:00
|
|
|
dnl
|
1998-09-15 19:36:32 +00:00
|
|
|
dnl Copyright (c) 1994, 1995, 1996, 1997
|
1996-08-19 20:34:12 +00:00
|
|
|
dnl The Regents of the University of California. All rights reserved.
|
|
|
|
dnl
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_INIT(tcpdump.c)
|
|
|
|
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
|
|
|
|
umask 002
|
|
|
|
|
|
|
|
if test -z "$PWD" ; then
|
|
|
|
PWD=`pwd`
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
|
|
|
|
|
1998-09-15 19:36:32 +00:00
|
|
|
AC_CHECK_HEADERS(fcntl.h malloc.h memory.h rpc/rpcent.h)
|
1996-08-19 20:34:12 +00:00
|
|
|
AC_HEADER_TIME
|
|
|
|
|
1998-09-15 19:36:32 +00:00
|
|
|
case "$target_os" in
|
|
|
|
|
|
|
|
linux*)
|
|
|
|
AC_MSG_CHECKING(Linux kernel version)
|
|
|
|
AC_CACHE_VAL(ac_cv_linux_vers,
|
|
|
|
ac_cv_linux_vers=`uname -r 2>&1 | \
|
|
|
|
sed -n -e '$s/.* //' -e '$s/\..*//p'`)
|
|
|
|
AC_MSG_RESULT($ac_cv_linux_vers)
|
|
|
|
if test $ac_cv_linux_vers -lt 2 ; then
|
|
|
|
AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
|
|
|
|
fi
|
|
|
|
AC_DEFINE(HAVE_NET_SLIP_H)
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
AC_CHECK_HEADERS(net/slip.h)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
1996-08-19 20:34:12 +00:00
|
|
|
AC_REPLACE_FUNCS(vfprintf strcasecmp)
|
|
|
|
AC_CHECK_FUNCS(ether_ntoa setlinebuf)
|
|
|
|
|
1998-09-15 19:36:32 +00:00
|
|
|
dnl The following generates a warning from autoconf...
|
1997-05-27 02:11:31 +00:00
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
1996-08-19 20:34:12 +00:00
|
|
|
AC_CHECK_LIB(dnet, main)
|
|
|
|
AC_CHECK_LIB(rpc, main)
|
|
|
|
|
1998-09-15 19:36:32 +00:00
|
|
|
AC_LBL_TYPE_SIGNAL
|
1996-08-19 20:34:12 +00:00
|
|
|
|
|
|
|
AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
|
|
|
|
|
|
|
|
V_GROUP=0
|
1998-09-15 19:36:32 +00:00
|
|
|
if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
|
|
|
|
V_GROUP=wheel
|
|
|
|
fi
|
1996-08-19 20:34:12 +00:00
|
|
|
case "$target_os" in
|
|
|
|
|
|
|
|
aix*)
|
|
|
|
dnl Workaround to enable certain features
|
|
|
|
AC_DEFINE(_SUN)
|
|
|
|
;;
|
|
|
|
|
|
|
|
irix*)
|
|
|
|
V_GROUP=sys
|
|
|
|
;;
|
|
|
|
|
1998-09-15 19:36:32 +00:00
|
|
|
linux*)
|
|
|
|
V_INCLS="$V_INCLS -Ilinux-include"
|
|
|
|
;;
|
|
|
|
|
1996-08-19 20:34:12 +00:00
|
|
|
osf*)
|
|
|
|
V_GROUP=system
|
1998-09-15 19:36:32 +00:00
|
|
|
dnl Workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
|
|
|
|
AC_DEFINE(__STDC__,2)
|
1996-08-19 20:34:12 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
solaris*)
|
|
|
|
V_GROUP=sys
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test -f /dev/bpf0 ; then
|
|
|
|
V_GROUP=bpf
|
|
|
|
fi
|
|
|
|
|
1998-09-15 19:36:32 +00:00
|
|
|
AC_LBL_CHECK_TYPE(int32_t, int)
|
|
|
|
AC_LBL_CHECK_TYPE(u_int32_t, u_int)
|
1996-08-19 20:34:12 +00:00
|
|
|
|
|
|
|
AC_LBL_DEVEL(V_CCOPT)
|
|
|
|
|
|
|
|
AC_LBL_SOCKADDR_SA_LEN
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(if ether_header uses ether_addr structs)
|
|
|
|
AC_CACHE_VAL(ac_cv_ether_header_has_ea,
|
1997-05-27 02:11:31 +00:00
|
|
|
LBL_SAVE_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $V_INCLS"
|
1996-08-19 20:34:12 +00:00
|
|
|
AC_TRY_COMPILE([
|
|
|
|
# include <sys/types.h>
|
|
|
|
# if __STDC__
|
|
|
|
/* osf3 has REALLY good prototyes */
|
|
|
|
struct mbuf;
|
|
|
|
struct rtentry;
|
|
|
|
# endif
|
|
|
|
# include <sys/socket.h>
|
|
|
|
# include <net/if.h>
|
|
|
|
# include <netinet/in.h>
|
|
|
|
# include <netinet/if_ether.h>],
|
|
|
|
[u_int i =
|
|
|
|
sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)],
|
|
|
|
ac_cv_ether_header_has_ea=yes,
|
1997-05-27 02:11:31 +00:00
|
|
|
ac_cv_ether_header_has_ea=no)
|
|
|
|
CFLAGS="$LBL_SAVE_CFLAGS")
|
1996-08-19 20:34:12 +00:00
|
|
|
AC_MSG_RESULT($ac_cv_ether_header_has_ea)
|
|
|
|
if test $ac_cv_ether_header_has_ea = yes ; then
|
|
|
|
AC_DEFINE(ETHER_HEADER_HAS_EA)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(if ether_arp uses ether_addr structs)
|
|
|
|
AC_CACHE_VAL(ac_cv_ether_arp_has_ea,
|
1997-05-27 02:11:31 +00:00
|
|
|
LBL_SAVE_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $V_INCLS"
|
1996-08-19 20:34:12 +00:00
|
|
|
AC_TRY_COMPILE([
|
|
|
|
# include <sys/types.h>
|
|
|
|
# if __STDC__
|
|
|
|
/* osf3 has REALLY good prototyes */
|
|
|
|
struct mbuf;
|
|
|
|
struct rtentry;
|
|
|
|
# endif
|
|
|
|
# include <sys/socket.h>
|
|
|
|
# include <net/if.h>
|
|
|
|
# include <netinet/in.h>
|
|
|
|
# include <netinet/if_ether.h>],
|
|
|
|
[u_int i =
|
|
|
|
sizeof(((struct ether_arp *)0)->arp_sha.ether_addr_octet)],
|
|
|
|
ac_cv_ether_arp_has_ea=yes,
|
1997-05-27 02:11:31 +00:00
|
|
|
ac_cv_ether_arp_has_ea=no)
|
|
|
|
CFLAGS="$LBL_SAVE_CFLAGS")
|
1996-08-19 20:34:12 +00:00
|
|
|
AC_MSG_RESULT($ac_cv_ether_arp_has_ea)
|
|
|
|
if test $ac_cv_ether_arp_has_ea = yes ; then
|
|
|
|
AC_DEFINE(ETHER_ARP_HAS_EA)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(if ether_arp uses erp_xsha member)
|
|
|
|
AC_CACHE_VAL(ac_cv_struct_ether_arp_x,
|
1997-05-27 02:11:31 +00:00
|
|
|
LBL_SAVE_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $V_INCLS"
|
1996-08-19 20:34:12 +00:00
|
|
|
AC_TRY_COMPILE([
|
|
|
|
# include <sys/types.h>
|
|
|
|
# include <sys/socket.h>
|
|
|
|
# if __STDC__
|
|
|
|
/* osf3 has REALLY good prototyes */
|
|
|
|
struct mbuf;
|
|
|
|
struct rtentry;
|
|
|
|
# endif
|
|
|
|
# include <net/if.h>
|
|
|
|
# include <netinet/in.h>
|
|
|
|
# include <netinet/if_ether.h>],
|
|
|
|
[u_int i = sizeof( ((struct ether_arp *)0)->arp_xsha)],
|
|
|
|
ac_cv_struct_ether_arp_x=yes,
|
1997-05-27 02:11:31 +00:00
|
|
|
ac_cv_struct_ether_arp_x=no)
|
|
|
|
CFLAGS="$LBL_SAVE_CFLAGS")
|
1996-08-19 20:34:12 +00:00
|
|
|
AC_MSG_RESULT($ac_cv_struct_ether_arp_x)
|
|
|
|
if test $ac_cv_struct_ether_arp_x = yes ; then
|
|
|
|
AC_DEFINE(ETHER_ARP_HAS_X)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_LBL_UNALIGNED_ACCESS
|
|
|
|
|
1998-09-15 19:36:32 +00:00
|
|
|
if test "${srcdir}" = "." ; then
|
|
|
|
srcdirprefix=""
|
|
|
|
else
|
|
|
|
srcdirprefix="./"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -r ${srcdirprefix}lbl/gnuc.h ; then
|
1996-08-19 20:34:12 +00:00
|
|
|
rm -f gnuc.h
|
1998-09-15 19:36:32 +00:00
|
|
|
ln -s ${srcdirprefix}lbl/gnuc.h gnuc.h
|
1996-08-19 20:34:12 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(V_CCOPT)
|
|
|
|
AC_SUBST(V_GROUP)
|
|
|
|
AC_SUBST(V_INCLS)
|
|
|
|
AC_SUBST(V_PCAPDEP)
|
|
|
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
AC_OUTPUT(Makefile)
|
|
|
|
|
|
|
|
if test -f .devel ; then
|
|
|
|
make depend
|
|
|
|
fi
|
|
|
|
exit 0
|