]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - contrib/traceroute/configure.in
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / contrib / traceroute / configure.in
1 dnl @(#) $Id: configure.in,v 1.33 2000/12/18 09:38:26 leres Exp $ (LBL)
2 dnl
3 dnl Copyright (c) 1995, 1996, 1997, 1999, 2000
4 dnl     The Regents of the University of California.  All rights reserved.
5 dnl
6 dnl Process this file with autoconf to produce a configure script.
7 dnl
8
9 AC_INIT(traceroute.c)
10
11 AC_CANONICAL_SYSTEM
12
13 umask 002
14
15 if test -z "$PWD" ; then
16         PWD=`pwd`
17 fi
18
19 AC_LBL_C_INIT(V_CCOPT, V_INCLS)
20
21 AC_CHECK_HEADERS(malloc.h sys/select.h sys/sockio.h net/route.h \
22     net/if_dl.h inet/mib2.h)
23
24 AC_REPLACE_FUNCS(strerror usleep)
25 AC_CHECK_FUNCS(setlinebuf)
26 if test $ac_cv_func_usleep = "no" ; then
27         AC_CHECK_FUNCS(nanosleep)
28 fi
29
30 AC_LBL_LIBRARY_NET
31
32 case "$target_os" in
33
34 bsd4*)
35         AC_DEFINE(HAVE_RAW_OPTIONS)
36         ;;
37
38 bsdi*)
39         AC_DEFINE(HAVE_RAW_OPTIONS)
40         ;;
41
42 freebsd*)
43         AC_DEFINE(HAVE_RAW_OPTIONS)
44         ;;
45
46 linux*)
47         V_INCLS="$V_INCLS -Ilinux-include"
48         AC_DEFINE(BYTESWAP_IP_HDR)
49         ;;
50
51 osf3*)
52         dnl Workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
53         AC_DEFINE(__STDC__,2)
54         ;;
55
56 solaris2.[[012345]]*)
57         AC_DEFINE(BYTESWAP_IP_HDR)
58         AC_DEFINE(CANT_HACK_IPCKSUM)
59         ;;
60
61 solaris*)
62         AC_DEFINE(BYTESWAP_IP_HDR)
63         ;;
64 esac
65
66 dnl
67 dnl What kind of routing table lookup do we have?
68 dnl
69 AC_MSG_CHECKING(routing table type)
70 t="generic"
71 if test $ac_cv_header_inet_mib2_h = yes ; then
72         t="mib"
73 elif test $ac_cv_header_net_route_h = yes -a \
74     $ac_cv_header_net_if_dl_h = yes ; then
75         t="socket"
76 elif test -f /proc/net/route ; then
77         t="linux"
78 fi
79
80 AC_MSG_RESULT(${t})
81 V_FINDSADDR="findsaddr-${t}.c"
82
83
84 AC_LBL_CHECK_TYPE(int32_t, int)
85 AC_LBL_CHECK_TYPE(u_int32_t, u_int)
86
87 AC_LBL_DEVEL(V_CCOPT)
88
89 AC_LBL_SOCKADDR_SA_LEN
90
91 AC_MSG_CHECKING(if struct icmp has icmp_nextmtu)
92 AC_CACHE_VAL(ac_cv_struct_icmp_has_icmp_nextmtu,
93     LBL_SAVE_CFLAGS="$CFLAGS"
94     CFLAGS="$CFLAGS $V_INCLS"
95     AC_TRY_COMPILE([   
96 #       include <sys/param.h>
97 #       include <sys/socket.h>
98 #       include <netinet/in_systm.h>
99 #       if __STDC__
100         /* osf3 has REALLY good prototyes */
101         struct mbuf;
102         struct rtentry;
103 #       endif
104 #       include <netinet/in.h>
105 #       include <netinet/ip.h>
106 #       include <netinet/ip_icmp.h>
107 #       include <netinet/if_ether.h>],
108         [u_int i = sizeof(((struct icmp *)0)->icmp_nextmtu)],
109         ac_cv_struct_icmp_has_icmp_nextmtu=yes,
110         ac_cv_struct_icmp_has_icmp_nextmtu=no)
111     CFLAGS="$LBL_SAVE_CFLAGS")
112 AC_MSG_RESULT($ac_cv_struct_icmp_has_icmp_nextmtu)
113 if test $ac_cv_struct_icmp_has_icmp_nextmtu = yes ; then
114         AC_DEFINE(HAVE_ICMP_NEXTMTU)
115 fi
116
117 if test "${srcdir}" = "." ; then
118         srcdirprefix=""
119 else
120         srcdirprefix="./"
121 fi
122
123 if test -r ${srcdirprefix}lbl/gnuc.h ; then
124         rm -f gnuc.h
125         ln -s ${srcdirprefix}lbl/gnuc.h gnuc.h
126 fi
127
128 AC_SUBST(V_CCOPT)
129 AC_SUBST(V_INCLS)
130 AC_SUBST(V_FINDSADDR)
131
132 AC_PROG_INSTALL
133
134 AC_OUTPUT(Makefile)
135
136 if test -f .devel ; then
137         make depend
138 fi
139
140 exit 0