summaryrefslogtreecommitdiffstats
path: root/contrib/libpcap/configure.in
blob: 049f0aba8056ef38e7a0679c5c99c60778e647f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
dnl @(#) $Header: configure.in,v 1.56 96/07/17 15:27:07 leres Exp $ (LBL)
dnl
dnl Copyright (c) 1994, 1995, 1996
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(pcap.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/ioccom.h sys/sockio.h)

AC_LBL_FIXINCLUDES

AC_CHECK_FUNCS(ether_hostton strerror)

dnl
dnl Not all versions of test support -c (character special) but it's a
dnl better way of testing since the device might be protected. So we
dnl check in our normal order using -r and then check the for the /dev
dnl guys again using -c.
dnl
AC_MSG_CHECKING(packet capture type)
if test -r /dev/bpf0 ; then
	V_PCAP=bpf
elif test -r /usr/include/net/pfilt.h ; then
	V_PCAP=pf
elif test -r /dev/enet ; then
	V_PCAP=enet
elif test -r /dev/nit ; then
	V_PCAP=snit
elif test -r /usr/include/sys/net/nit.h ; then
	V_PCAP=nit
elif test -r /usr/include/net/raw.h ; then
	V_PCAP=snoop
elif test -r /usr/include/sys/dlpi.h ; then
	V_PCAP=dlpi
elif test -c /dev/bpf0 ; then		# check again in case not readable
	V_PCAP=bpf
elif test -c /dev/enet ; then		# check again in case not readable
	V_PCAP=enet
elif test -c /dev/nit ; then		# check again in case not readable
	V_PCAP=snit
else
	V_PCAP=null
fi
AC_MSG_RESULT($V_PCAP)

case "$V_PCAP" in

null)
	AC_MSG_WARN(cannot determine packet capture interface)
	AC_MSG_WARN((see INSTALL for more info))
	;;

dlpi)
	AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi_ext.h)
	AC_MSG_CHECKING(for /dev/dlpi device)
	if test -c /dev/dlpi ; then
		AC_MSG_RESULT(yes)
		AC_DEFINE(HAVE_DEV_DLPI)

		case "$target_os" in

		hpux9*)
			AC_DEFINE(HAVE_HPUX9)
			;;

		esac
	else
		AC_MSG_RESULT(no)
		dir="/dev/dlpi"
		AC_MSG_CHECKING(for $dir directory)
		if test -d $dir ; then
			AC_MSG_RESULT(yes)
			AC_DEFINE_UNQUOTED(PCAP_DEV_PREFIX, "$dir")
		else
			AC_MSG_RESULT(no)
		fi
	fi
	;;
esac

AC_LBL_LEX_AND_YACC(V_LEX, V_YACC, pcap_)

case "$target_os" in

aix*)
	dnl Workaround to enable certain features
	AC_DEFINE(_SUN)
	;;

solaris*)
	AC_DEFINE(HAVE_SOLARIS)
	;;
esac

AC_CHECK_PROGS(V_RANLIB, ranlib, @true)

AC_LBL_DEVEL(V_CCOPT)

AC_LBL_SOCKADDR_SA_LEN

AC_LBL_UNALIGNED_ACCESS

if test -r lbl/gnuc.h ; then
	rm -f gnuc.h
	ln -s lbl/gnuc.h gnuc.h
fi

rm -f bpf_filter.c
ln -s bpf/net/bpf_filter.c bpf_filter.c
rm -f net
ln -s bpf/net net

AC_SUBST(V_CCOPT)
AC_SUBST(V_INCLS)
AC_SUBST(V_LEX)
AC_SUBST(V_PCAP)
AC_SUBST(V_RANLIB)
AC_SUBST(V_YACC)

AC_PROG_INSTALL

AC_OUTPUT(Makefile)

if test -f .devel ; then
	make depend
fi
exit 0
OpenPOWER on IntegriCloud