2000-04-01 20:09:13 +08:00
|
|
|
dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.111 2000-04-01 12:09:57 assar Exp $ (LBL)
|
1999-10-08 07:47:09 +08:00
|
|
|
dnl
|
|
|
|
dnl Copyright (c) 1994, 1995, 1996, 1997
|
|
|
|
dnl The Regents of the University of California. All rights reserved.
|
|
|
|
dnl
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
dnl
|
|
|
|
|
2000-04-01 20:09:13 +08:00
|
|
|
AC_REVISION($Revision: 1.111 $)
|
2000-01-17 14:07:16 +08:00
|
|
|
AC_PREREQ(2.13)
|
1999-10-08 07:47:09 +08:00
|
|
|
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)
|
1999-11-21 11:42:19 +08:00
|
|
|
AC_C_INLINE
|
2000-04-01 20:09:13 +08:00
|
|
|
AC_C___ATTRIBUTE__
|
1999-10-08 07:47:09 +08:00
|
|
|
|
2000-01-10 05:34:14 +08:00
|
|
|
AC_CHECK_HEADERS(fcntl.h malloc.h memory.h rpc/rpcent.h)
|
1999-10-08 07:47:09 +08:00
|
|
|
AC_HEADER_TIME
|
|
|
|
|
|
|
|
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
|
1999-10-30 13:11:06 +08:00
|
|
|
AC_DEFINE(HAVE_NET_SLIP_H)
|
1999-10-08 07:47:09 +08:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
AC_CHECK_HEADERS(net/slip.h)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
1999-12-14 02:06:13 +08:00
|
|
|
|
1999-12-29 09:12:54 +08:00
|
|
|
AC_CHECK_HEADERS(smi.h)
|
|
|
|
AC_CHECK_LIB(smi, main)
|
|
|
|
AC_MSG_CHECKING([whether to enable libsmi])
|
|
|
|
AC_TRY_RUN([ /* libsmi available check */
|
|
|
|
#include <smi.h>
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
if (smiInit(""))
|
|
|
|
exit(1);
|
|
|
|
else
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[ AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(LIBSMI)
|
|
|
|
libsmi=yes],
|
|
|
|
[ AC_MSG_RESULT(no)
|
2000-01-10 05:41:00 +08:00
|
|
|
libsmi=no],
|
|
|
|
[ AC_MSG_RESULT(not when cross-compiling)
|
1999-12-29 09:12:54 +08:00
|
|
|
libsmi=no]
|
|
|
|
)
|
1999-12-14 02:06:13 +08:00
|
|
|
|
|
|
|
|
1999-10-30 13:11:06 +08:00
|
|
|
CFLAGS="$CFLAGS -Dss_family=__ss_family -Dss_len=__ss_len"
|
|
|
|
AC_MSG_CHECKING([whether to enable ipv6])
|
|
|
|
AC_ARG_ENABLE(ipv6,
|
1999-12-14 02:06:13 +08:00
|
|
|
[ --enable-ipv6 enable ipv6 (with ipv4) support
|
|
|
|
--disable-ipv6 disable ipv6 support],
|
1999-10-30 13:11:06 +08:00
|
|
|
[ case "$enableval" in
|
1999-10-30 13:26:21 +08:00
|
|
|
yes) AC_MSG_RESULT(yes)
|
1999-10-30 13:11:06 +08:00
|
|
|
AC_DEFINE(ENABLE_IPV6)
|
|
|
|
LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
|
|
|
|
AC_DEFINE(INET6)
|
|
|
|
ipv6=yes
|
|
|
|
;;
|
1999-10-30 13:26:21 +08:00
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
ipv6=no
|
|
|
|
;;
|
1999-10-30 13:11:06 +08:00
|
|
|
esac ],
|
|
|
|
|
1999-12-14 02:06:13 +08:00
|
|
|
AC_TRY_RUN([ /* AF_INET6 available check */
|
1999-10-30 13:11:06 +08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
|
|
|
|
exit(1);
|
|
|
|
else
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
],
|
1999-10-30 13:26:21 +08:00
|
|
|
[ AC_MSG_RESULT(yes)
|
1999-10-30 13:11:06 +08:00
|
|
|
AC_DEFINE(ENABLE_IPV6)
|
|
|
|
LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
|
|
|
|
AC_DEFINE(INET6)
|
1999-10-30 13:26:21 +08:00
|
|
|
ipv6=yes],
|
|
|
|
[ AC_MSG_RESULT(no)
|
|
|
|
ipv6=no],
|
|
|
|
[ AC_MSG_RESULT(no)
|
|
|
|
ipv6=no]
|
1999-10-30 13:11:06 +08:00
|
|
|
))
|
|
|
|
|
|
|
|
ipv6type=unknown
|
|
|
|
ipv6lib=none
|
|
|
|
ipv6trylibc=no
|
|
|
|
|
|
|
|
if test "$ipv6" = "yes"; then
|
|
|
|
AC_MSG_CHECKING([ipv6 stack type])
|
|
|
|
for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
|
|
|
|
case $i in
|
|
|
|
inria)
|
|
|
|
dnl http://www.kame.net/
|
|
|
|
AC_EGREP_CPP(yes, [dnl
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#ifdef IPV6_INRIA_VERSION
|
|
|
|
yes
|
|
|
|
#endif],
|
|
|
|
[ipv6type=$i;
|
|
|
|
CFLAGS="-DINET6 $CFLAGS"])
|
|
|
|
;;
|
|
|
|
kame)
|
|
|
|
dnl http://www.kame.net/
|
|
|
|
AC_EGREP_CPP(yes, [dnl
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#ifdef __KAME__
|
|
|
|
yes
|
|
|
|
#endif],
|
|
|
|
[ipv6type=$i;
|
|
|
|
ipv6lib=inet6;
|
|
|
|
ipv6libdir=/usr/local/v6/lib;
|
|
|
|
ipv6trylibc=yes;
|
|
|
|
CFLAGS="-DINET6 $CFLAGS"])
|
|
|
|
;;
|
|
|
|
linux-glibc)
|
|
|
|
dnl http://www.v6.linux.or.jp/
|
|
|
|
AC_EGREP_CPP(yes, [dnl
|
|
|
|
#include <features.h>
|
|
|
|
#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
|
|
|
|
yes
|
|
|
|
#endif],
|
|
|
|
[ipv6type=$i;
|
|
|
|
CFLAGS="-DINET6 $CFLAGS"])
|
|
|
|
;;
|
|
|
|
linux-libinet6)
|
|
|
|
dnl http://www.v6.linux.or.jp/
|
|
|
|
if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
|
|
|
|
ipv6type=$i
|
|
|
|
ipv6lib=inet6
|
|
|
|
ipv6libdir=/usr/inet6/lib
|
|
|
|
ipv6trylibc=yes;
|
|
|
|
CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
toshiba)
|
|
|
|
AC_EGREP_CPP(yes, [dnl
|
|
|
|
#include <sys/param.h>
|
|
|
|
#ifdef _TOSHIBA_INET6
|
|
|
|
yes
|
|
|
|
#endif],
|
|
|
|
[ipv6type=$i;
|
|
|
|
ipv6lib=inet6;
|
|
|
|
ipv6libdir=/usr/local/v6/lib;
|
|
|
|
CFLAGS="-DINET6 $CFLAGS"])
|
|
|
|
;;
|
|
|
|
v6d)
|
|
|
|
AC_EGREP_CPP(yes, [dnl
|
|
|
|
#include </usr/local/v6/include/sys/v6config.h>
|
|
|
|
#ifdef __V6D__
|
|
|
|
yes
|
|
|
|
#endif],
|
|
|
|
[ipv6type=$i;
|
|
|
|
ipv6lib=v6;
|
|
|
|
ipv6libdir=/usr/local/v6/lib;
|
|
|
|
CFLAGS="-I/usr/local/v6/include $CFLAGS"])
|
|
|
|
;;
|
|
|
|
zeta)
|
|
|
|
AC_EGREP_CPP(yes, [dnl
|
|
|
|
#include <sys/param.h>
|
|
|
|
#ifdef _ZETA_MINAMI_INET6
|
|
|
|
yes
|
|
|
|
#endif],
|
|
|
|
[ipv6type=$i;
|
|
|
|
ipv6lib=inet6;
|
|
|
|
ipv6libdir=/usr/local/v6/lib;
|
|
|
|
CFLAGS="-DINET6 $CFLAGS"])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test "$ipv6type" != "unknown"; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
AC_MSG_RESULT($ipv6type)
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
|
|
|
|
if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
|
|
|
|
LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
|
|
|
|
echo "You have $ipv6lib library, using it"
|
|
|
|
else
|
|
|
|
if test "$ipv6trylibc" = "yes"; then
|
|
|
|
echo "You do not have $ipv6lib library, using libc"
|
|
|
|
else
|
|
|
|
echo 'Fatal: no $ipv6lib library found. cannot continue.'
|
|
|
|
echo "You need to fetch lib$ipv6lib.a from appropriate"
|
|
|
|
echo 'ipv6 kit and compile beforehand.'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2000-01-25 13:05:21 +08:00
|
|
|
if test "$ipv6" = "yes"; then
|
|
|
|
AC_CHECK_FUNCS(getaddrinfo, [dnl
|
|
|
|
AC_MSG_CHECKING(getaddrinfo bug)
|
|
|
|
AC_TRY_RUN([
|
1999-10-30 13:11:06 +08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <netdb.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
int passive, gaierr, inet4 = 0, inet6 = 0;
|
|
|
|
struct addrinfo hints, *ai, *aitop;
|
|
|
|
char straddr[INET6_ADDRSTRLEN], strport[16];
|
|
|
|
|
|
|
|
for (passive = 0; passive <= 1; passive++) {
|
|
|
|
memset(&hints, 0, sizeof(hints));
|
|
|
|
hints.ai_family = AF_UNSPEC;
|
|
|
|
hints.ai_flags = passive ? AI_PASSIVE : 0;
|
|
|
|
hints.ai_socktype = SOCK_STREAM;
|
|
|
|
if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
|
|
|
|
(void)gai_strerror(gaierr);
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
for (ai = aitop; ai; ai = ai->ai_next) {
|
|
|
|
if (ai->ai_addr == NULL ||
|
|
|
|
ai->ai_addrlen == 0 ||
|
|
|
|
getnameinfo(ai->ai_addr, ai->ai_addrlen,
|
|
|
|
straddr, sizeof(straddr), strport, sizeof(strport),
|
|
|
|
NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
switch (ai->ai_family) {
|
|
|
|
case AF_INET:
|
|
|
|
if (strcmp(strport, "54321") != 0) {
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
if (passive) {
|
|
|
|
if (strcmp(straddr, "0.0.0.0") != 0) {
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (strcmp(straddr, "127.0.0.1") != 0) {
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inet4++;
|
|
|
|
break;
|
|
|
|
case AF_INET6:
|
|
|
|
if (strcmp(strport, "54321") != 0) {
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
if (passive) {
|
|
|
|
if (strcmp(straddr, "::") != 0) {
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (strcmp(straddr, "::1") != 0) {
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inet6++;
|
|
|
|
break;
|
|
|
|
case AF_UNSPEC:
|
|
|
|
goto bad;
|
|
|
|
break;
|
|
|
|
#ifdef AF_UNIX
|
|
|
|
case AF_UNIX:
|
|
|
|
#else
|
|
|
|
#ifdef AF_LOCAL
|
|
|
|
case AF_LOCAL:
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
/* another family support? */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-01-18 13:25:06 +08:00
|
|
|
/* supported family should be 2, unsupported family should be 0 */
|
2000-01-19 12:34:55 +08:00
|
|
|
if (!(inet4 == 0 || inet4 == 2))
|
|
|
|
goto bad;
|
|
|
|
if (!(inet6 == 0 || inet6 == 2))
|
|
|
|
goto bad;
|
1999-10-30 13:11:06 +08:00
|
|
|
|
|
|
|
if (aitop)
|
|
|
|
freeaddrinfo(aitop);
|
|
|
|
exit(0);
|
|
|
|
|
|
|
|
bad:
|
|
|
|
if (aitop)
|
|
|
|
freeaddrinfo(aitop);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
],
|
2000-01-25 13:05:21 +08:00
|
|
|
AC_MSG_RESULT(good)
|
|
|
|
buggygetaddrinfo=no,
|
|
|
|
AC_MSG_RESULT(buggy)
|
|
|
|
buggygetaddrinfo=yes,
|
|
|
|
AC_MSG_RESULT(buggy)
|
|
|
|
buggygetaddrinfo=yes)], [buggygetaddrinfo=yes])
|
1999-10-30 13:11:06 +08:00
|
|
|
|
2000-01-25 13:05:21 +08:00
|
|
|
if test "$buggygetaddrinfo" = "yes"; then
|
|
|
|
if test "$ipv6type" != "linux"; then
|
|
|
|
echo 'Fatal: You must get working getaddrinfo() function.'
|
|
|
|
echo ' or you can specify "--disable-ipv6"'.
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
|
|
|
|
echo ' Better upgreade your system library to newest version'
|
|
|
|
echo ' of GNU C library (aka glibc).'
|
|
|
|
fi
|
1999-10-30 13:11:06 +08:00
|
|
|
fi
|
2000-01-25 13:05:21 +08:00
|
|
|
AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
|
1999-10-30 13:11:06 +08:00
|
|
|
fi
|
2000-01-25 13:05:21 +08:00
|
|
|
AC_REPLACE_FUNCS(inet_ntop inet_pton inet_aton)
|
1999-10-30 13:11:06 +08:00
|
|
|
|
|
|
|
dnl portability macros for getaddrinfo/getnameinfo
|
|
|
|
dnl
|
|
|
|
dnl Check for sa_len
|
|
|
|
AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
|
|
|
|
if test "$ac_cv_sockaddr_has_sa_len" = no; then
|
|
|
|
missing_includes=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl check __P macro
|
|
|
|
AC_CHECK_PORTABLE_PROTO(ac_cv_portable_proto)
|
|
|
|
if test "$ac_cv_portable_proto" = no; then
|
|
|
|
missing_includes=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl
|
2000-01-10 05:41:00 +08:00
|
|
|
dnl check sizeof basic types.
|
|
|
|
dnl They're very likely to be wrong for cross-compiling.
|
|
|
|
AC_CHECK_SIZEOF(char, 1)
|
|
|
|
AC_CHECK_SIZEOF(short, 2)
|
|
|
|
AC_CHECK_SIZEOF(int, 4)
|
|
|
|
AC_CHECK_SIZEOF(long, 4)
|
1999-10-30 13:11:06 +08:00
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Checks for u_intXX_t
|
1999-10-30 15:33:45 +08:00
|
|
|
dnl AC_CHECK_BITTYPES(ac_cv_bittypes)
|
|
|
|
dnl if test "$ac_cv_bittypes" = no; then
|
|
|
|
dnl missing_includes=yes
|
|
|
|
dnl fi
|
1999-10-30 13:11:06 +08:00
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Checks for addrinfo structure
|
|
|
|
AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
|
|
|
|
if test "$ac_cv_addrinfo" = no; then
|
|
|
|
missing_includes=yes
|
|
|
|
fi
|
|
|
|
|
2000-01-21 12:06:17 +08:00
|
|
|
dnl
|
|
|
|
dnl Checks for NI_MAXSERV
|
|
|
|
AC_NI_MAXSERV(ac_cv_maxserv)
|
|
|
|
if test "$ac_cv_maxserv" = no; then
|
|
|
|
missing_includes=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Checks for NI_NAMEREQD
|
|
|
|
AC_NI_NAMEREQD(ac_cv_namereqd)
|
|
|
|
if test "$ac_cv_namereqd" = no; then
|
|
|
|
missing_includes=yes
|
|
|
|
fi
|
|
|
|
|
1999-10-30 13:11:06 +08:00
|
|
|
dnl
|
|
|
|
dnl Checks for sockaddr_storage structure
|
|
|
|
AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
|
|
|
|
if test "$ac_cv_sa_storage" = no; then
|
|
|
|
missing_includes=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Checks for IN[6]ADDRSZ
|
|
|
|
AC_CHECK_ADDRSZ(ac_cv_addrsz)
|
|
|
|
if test "$ac_cv_addrsz" = no; then
|
|
|
|
missing_includes=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Checks for RES_USE_INET6
|
|
|
|
AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
|
|
|
|
if test "$ac_cv_res_inet6" = no; then
|
|
|
|
missing_includes=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Checks for res_state_ext structure
|
|
|
|
AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
|
|
|
|
if test "$ac_cv_res_state_ext" = no; then
|
|
|
|
missing_includes=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Checks if res_state structure has nsort member.
|
|
|
|
AC_STRUCT_RES_STATE(ac_cv_res_state)
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl set additional include path if necessary
|
|
|
|
if test "$missing_includes" = "yes"; then
|
1999-10-30 15:45:37 +08:00
|
|
|
CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
|
|
|
|
V_INCLS="$V_INCLS -I\$(srcdir)/missing"
|
1999-10-30 13:11:06 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2000-01-19 13:34:17 +08:00
|
|
|
AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy)
|
1999-11-22 12:23:34 +08:00
|
|
|
AC_CHECK_FUNCS(ether_ntohost setlinebuf gethostbyname2)
|
1999-10-08 07:47:09 +08:00
|
|
|
|
2000-01-26 01:57:59 +08:00
|
|
|
usegetipnodeby=yes
|
|
|
|
AC_CHECK_FUNCS(getipnodebyname getipnodebyaddr freeaddrinfo,
|
|
|
|
[], [usegetipnodeby=no])
|
|
|
|
if test $usegetipnodeby = yes; then
|
|
|
|
AC_DEFINE(USE_GETIPNODEBY)
|
|
|
|
fi
|
|
|
|
|
2000-01-15 16:11:33 +08:00
|
|
|
needsnprintf=no
|
|
|
|
AC_CHECK_FUNCS(vsnprintf snprintf asprintf asnprintf vasprintf vasnprintf,,
|
|
|
|
[needsnprintf=yes])
|
|
|
|
if test $needsnprintf = yes; then
|
|
|
|
LIBOBJS="$LIBOBJS snprintf.o"
|
|
|
|
fi
|
2000-01-07 23:45:52 +08:00
|
|
|
|
1999-10-08 07:47:09 +08:00
|
|
|
dnl The following generates a warning from autoconf...
|
2000-01-10 05:41:00 +08:00
|
|
|
errprint(__file__:__line__: please ignore the next warning:
|
|
|
|
)dnl
|
1999-10-08 07:47:09 +08:00
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
|
|
|
AC_CHECK_LIB(dnet, main)
|
|
|
|
AC_CHECK_LIB(rpc, main)
|
2000-04-01 00:57:13 +08:00
|
|
|
AC_CHECK_LIB(nsl, getrpcbynumber)
|
2000-01-26 01:57:59 +08:00
|
|
|
dnl AC_CHECK_LIB(z, uncompress)
|
|
|
|
dnl AC_CHECK_HEADERS(zlib.h)
|
1999-10-08 07:47:09 +08:00
|
|
|
|
|
|
|
AC_LBL_TYPE_SIGNAL
|
|
|
|
|
|
|
|
AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
|
|
|
|
|
|
|
|
V_GROUP=0
|
|
|
|
if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
|
|
|
|
V_GROUP=wheel
|
|
|
|
fi
|
|
|
|
case "$target_os" in
|
|
|
|
|
|
|
|
aix*)
|
|
|
|
dnl Workaround to enable certain features
|
|
|
|
AC_DEFINE(_SUN)
|
|
|
|
;;
|
|
|
|
|
|
|
|
irix*)
|
|
|
|
V_GROUP=sys
|
|
|
|
;;
|
|
|
|
|
|
|
|
linux*)
|
1999-10-31 07:43:57 +08:00
|
|
|
V_INCLS="$V_INCLS -I\$(srcdir)/linux-include"
|
1999-10-08 07:47:09 +08:00
|
|
|
;;
|
|
|
|
|
|
|
|
osf*)
|
|
|
|
V_GROUP=system
|
|
|
|
dnl Workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
|
|
|
|
AC_DEFINE(__STDC__,2)
|
|
|
|
;;
|
|
|
|
|
|
|
|
solaris*)
|
|
|
|
V_GROUP=sys
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test -f /dev/bpf0 ; then
|
|
|
|
V_GROUP=bpf
|
|
|
|
fi
|
|
|
|
|
1999-10-30 15:33:45 +08:00
|
|
|
AC_LBL_CHECK_TYPE(u_int8_t, u_char)
|
1999-12-15 06:35:17 +08:00
|
|
|
AC_LBL_CHECK_TYPE(int16_t, short)
|
|
|
|
AC_LBL_CHECK_TYPE(u_int16_t, u_short)
|
1999-10-08 07:47:09 +08:00
|
|
|
AC_LBL_CHECK_TYPE(int32_t, int)
|
|
|
|
AC_LBL_CHECK_TYPE(u_int32_t, u_int)
|
|
|
|
|
|
|
|
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,
|
|
|
|
LBL_SAVE_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $V_INCLS"
|
|
|
|
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,
|
|
|
|
ac_cv_ether_header_has_ea=no)
|
|
|
|
CFLAGS="$LBL_SAVE_CFLAGS")
|
|
|
|
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,
|
|
|
|
LBL_SAVE_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $V_INCLS"
|
|
|
|
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,
|
|
|
|
ac_cv_ether_arp_has_ea=no)
|
|
|
|
CFLAGS="$LBL_SAVE_CFLAGS")
|
|
|
|
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,
|
|
|
|
LBL_SAVE_CFLAGS="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS $V_INCLS"
|
|
|
|
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,
|
|
|
|
ac_cv_struct_ether_arp_x=no)
|
|
|
|
CFLAGS="$LBL_SAVE_CFLAGS")
|
|
|
|
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
|
|
|
|
|
1999-10-31 07:45:50 +08:00
|
|
|
AC_VAR_H_ERRNO
|
|
|
|
|
1999-10-30 13:11:06 +08:00
|
|
|
AC_MSG_CHECKING(for SSLeay)
|
|
|
|
ac_cv_ssleay_path=no
|
|
|
|
incdir=no
|
2000-01-15 07:17:01 +08:00
|
|
|
for dir in /usr /usr/local /usr/local/ssl /usr/pkg; do
|
1999-10-30 13:11:06 +08:00
|
|
|
if test -d $dir/lib -a -f $dir/lib/libcrypto.a; then
|
|
|
|
ac_cv_ssleay_path=$dir
|
|
|
|
fi
|
2000-01-15 08:03:36 +08:00
|
|
|
if test -d $dir/include/ssleay -a -f $dir/include/ssleay/des.h; then
|
|
|
|
incdir="-I$dir/include/ssleay"
|
|
|
|
elif test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then
|
|
|
|
incdir="-I$dir/include -I$dir/include/openssl"
|
|
|
|
elif test -d $dir/include -a -f $dir/include/des.h; then
|
1999-10-30 13:11:06 +08:00
|
|
|
incdir="-I$dir/include"
|
|
|
|
fi
|
|
|
|
if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
ac_cv_ssleay_path=no
|
|
|
|
incdir=no
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
AC_MSG_RESULT($ac_cv_ssleay_path)
|
|
|
|
if test "$ac_cv_ssleay_path" != no; then
|
|
|
|
V_INCLS="$V_INCLS $incdir"
|
|
|
|
LIBS="$LIBS -L$dir/lib"
|
1999-12-05 03:30:04 +08:00
|
|
|
if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
|
|
|
|
LIBS="$LIBS -lRSAglue"
|
|
|
|
fi
|
|
|
|
if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
|
|
|
|
LIBS="$LIBS -lrsaref"
|
|
|
|
fi
|
1999-10-30 13:11:06 +08:00
|
|
|
AC_CHECK_LIB(crypto, des_cbc_encrypt)
|
|
|
|
|
|
|
|
bak_CPPFLAGS=$CPPFLAGS
|
|
|
|
CPPFLAGS="$CPPFLAGS $V_INCLS"
|
|
|
|
AC_CHECK_HEADERS(cast.h rc5.h)
|
|
|
|
|
|
|
|
if test "$ac_cv_header_cast_h" = "yes"; then
|
|
|
|
AC_MSG_CHECKING(for buggy CAST128)
|
|
|
|
AC_TRY_RUN(dnl
|
|
|
|
[
|
|
|
|
#include <cast.h>
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
unsigned char key[] = {0x01,0x23,0x45,0x67,0x12};
|
|
|
|
unsigned char in[] = {0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF};
|
|
|
|
unsigned char out[sizeof(in)];
|
|
|
|
unsigned char ok[] = {0x7A,0xC8,0x16,0xD1,0x6E,0x9B,0x30,0x2E};
|
|
|
|
CAST_KEY ks;
|
|
|
|
CAST_set_key(&ks, sizeof(key), key);
|
|
|
|
CAST_ecb_encrypt(in, out, &ks, CAST_ENCRYPT);
|
|
|
|
if (memcmp(out, ok, sizeof(ok)) != 0)
|
|
|
|
return 0;
|
|
|
|
else
|
|
|
|
return 1;
|
|
|
|
}],
|
|
|
|
[buggy_cast128=yes],
|
|
|
|
[buggy_cast128=no],
|
|
|
|
[buggy_cast128="cross-compiling, assume yes"])
|
|
|
|
AC_MSG_RESULT($buggy_cast128)
|
|
|
|
if test "$buggy_cast128" != no; then
|
|
|
|
echo "NOTE: SSLeay 0.9.0b has a bug in CAST128 en/decoding routine."
|
|
|
|
echo "disabling CAST128 support."
|
|
|
|
AC_DEFINE(HAVE_BUGGY_CAST128)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
CPPFLAGS=$bak_CPPFLAGS
|
|
|
|
fi
|
|
|
|
|
1999-10-30 15:33:45 +08:00
|
|
|
if test -r ${srcdir}/lbl/gnuc.h ; then
|
1999-10-30 13:11:06 +08:00
|
|
|
rm -f gnuc.h
|
1999-10-30 15:33:45 +08:00
|
|
|
ln -s ${srcdir}/lbl/gnuc.h gnuc.h
|
1999-10-30 13:11:06 +08:00
|
|
|
fi
|
1999-10-10 07:57:18 +08:00
|
|
|
|
1999-10-08 07:47:09 +08:00
|
|
|
AC_SUBST(V_CCOPT)
|
|
|
|
AC_SUBST(V_GROUP)
|
|
|
|
AC_SUBST(V_INCLS)
|
|
|
|
AC_SUBST(V_PCAPDEP)
|
1999-10-30 13:11:06 +08:00
|
|
|
AC_SUBST(LOCALSRC)
|
1999-10-08 07:47:09 +08:00
|
|
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
1999-11-21 17:36:43 +08:00
|
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
|
2000-01-18 11:46:49 +08:00
|
|
|
AC_OUTPUT_COMMANDS([if test -f .devel; then
|
|
|
|
echo timestamp > stamp-h
|
|
|
|
cat Makefile-devel-adds >> Makefile
|
2000-01-17 14:07:16 +08:00
|
|
|
make depend
|
2000-01-18 11:46:49 +08:00
|
|
|
fi])
|
|
|
|
AC_OUTPUT(Makefile)
|
|
|
|
exit 0
|