freebsd-dev/contrib/traceroute/configure.in
2002-07-28 02:24:33 +00:00

141 lines
2.7 KiB
Plaintext

dnl @(#) $Id: configure.in,v 1.33 2000/12/18 09:38:26 leres Exp $ (LBL)
dnl
dnl Copyright (c) 1995, 1996, 1997, 1999, 2000
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(traceroute.c)
AC_CANONICAL_SYSTEM
umask 002
if test -z "$PWD" ; then
PWD=`pwd`
fi
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_CHECK_HEADERS(malloc.h sys/select.h sys/sockio.h net/route.h \
net/if_dl.h inet/mib2.h)
AC_REPLACE_FUNCS(strerror usleep)
AC_CHECK_FUNCS(setlinebuf)
if test $ac_cv_func_usleep = "no" ; then
AC_CHECK_FUNCS(nanosleep)
fi
AC_LBL_LIBRARY_NET
case "$target_os" in
bsd4*)
AC_DEFINE(HAVE_RAW_OPTIONS)
;;
bsdi*)
AC_DEFINE(HAVE_RAW_OPTIONS)
;;
freebsd*)
AC_DEFINE(HAVE_RAW_OPTIONS)
;;
linux*)
V_INCLS="$V_INCLS -Ilinux-include"
AC_DEFINE(BYTESWAP_IP_HDR)
;;
osf3*)
dnl Workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
AC_DEFINE(__STDC__,2)
;;
solaris2.[[012345]]*)
AC_DEFINE(BYTESWAP_IP_HDR)
AC_DEFINE(CANT_HACK_IPCKSUM)
;;
solaris*)
AC_DEFINE(BYTESWAP_IP_HDR)
;;
esac
dnl
dnl What kind of routing table lookup do we have?
dnl
AC_MSG_CHECKING(routing table type)
t="generic"
if test $ac_cv_header_inet_mib2_h = yes ; then
t="mib"
elif test $ac_cv_header_net_route_h = yes -a \
$ac_cv_header_net_if_dl_h = yes ; then
t="socket"
elif test -f /proc/net/route ; then
t="linux"
fi
AC_MSG_RESULT(${t})
V_FINDSADDR="findsaddr-${t}.c"
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 struct icmp has icmp_nextmtu)
AC_CACHE_VAL(ac_cv_struct_icmp_has_icmp_nextmtu,
LBL_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $V_INCLS"
AC_TRY_COMPILE([
# include <sys/param.h>
# include <sys/socket.h>
# include <netinet/in_systm.h>
# if __STDC__
/* osf3 has REALLY good prototyes */
struct mbuf;
struct rtentry;
# endif
# include <netinet/in.h>
# include <netinet/ip.h>
# include <netinet/ip_icmp.h>
# include <netinet/if_ether.h>],
[u_int i = sizeof(((struct icmp *)0)->icmp_nextmtu)],
ac_cv_struct_icmp_has_icmp_nextmtu=yes,
ac_cv_struct_icmp_has_icmp_nextmtu=no)
CFLAGS="$LBL_SAVE_CFLAGS")
AC_MSG_RESULT($ac_cv_struct_icmp_has_icmp_nextmtu)
if test $ac_cv_struct_icmp_has_icmp_nextmtu = yes ; then
AC_DEFINE(HAVE_ICMP_NEXTMTU)
fi
if test "${srcdir}" = "." ; then
srcdirprefix=""
else
srcdirprefix="./"
fi
if test -r ${srcdirprefix}lbl/gnuc.h ; then
rm -f gnuc.h
ln -s ${srcdirprefix}lbl/gnuc.h gnuc.h
fi
AC_SUBST(V_CCOPT)
AC_SUBST(V_INCLS)
AC_SUBST(V_FINDSADDR)
AC_PROG_INSTALL
AC_OUTPUT(Makefile)
if test -f .devel ; then
make depend
fi
exit 0