File: configure.in

package info (click to toggle)
arpwatch 2.1a15-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,984 kB
  • sloc: sh: 3,047; ansic: 2,811; makefile: 90; awk: 90; perl: 15
file content (171 lines) | stat: -rwxr-xr-x 4,006 bytes parent folder | download | duplicates (3)
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
dnl @(#) $Header: /usr/src/local/sbin/arpwatch/RCS/configure.in,v 1.35 2006/06/21 20:34:27 leres Exp $ (LBL)
dnl
dnl Copyright (c) 1994, 1995, 1996, 1997, 1998, 2000, 2006
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(arpwatch.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(fcntl.h memory.h)
AC_HEADER_TIME

AC_REPLACE_FUNCS(bcopy strerror)

dnl The following generates a warning from autoconf...
AC_C_BIGENDIAN

AC_LBL_TYPE_SIGNAL
AC_LBL_UNION_WAIT

AC_CHECK_LIB(resolv, res_query)
AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)

AC_PATH_PROG(V_SENDMAIL, sendmail, /usr/lib/sendmail,
    $PATH:/usr/sbin:/usr/lib:/usr/bin:/usr/ucblib:/usr/local/etc)

case "$target_os" in

osf3*)
	# workaround around ip_hl vs. ip_vhl problem in netinet/ip.h
	AC_DEFINE(__STDC__,2)
	;;
esac

AC_LBL_DEVEL(V_CCOPT)

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

dnl
dnl bind 8 does some routine name renaming so we must test specially
dnl
AC_MSG_CHECKING(for dn_skipname)
AC_CACHE_VAL(ac_cv_have_dn_skipname,
    AC_TRY_LINK([
#	include <sys/types.h>
#	include <netinet/in.h>
#	include <arpa/nameser.h>
#	include <resolv.h>],
	[(void)dn_skipname(0, 0);],
	ac_cv_have_dn_skipname=yes,
	ac_cv_have_dn_skipname=no))
AC_MSG_RESULT($ac_cv_have_dn_skipname)
if test $ac_cv_have_dn_skipname = yes ; then
	AC_DEFINE(HAVE_DN_SKIPNAME)
fi

if test -f $srcdir/.devel ; then
	AC_DEFINE(LBL)
fi

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

if test ! -r $srcdir/addresses.h ; then
	cp $srcdir/addresses.h.in $srcdir/addresses.h
fi

AC_SUBST(V_CCOPT)
AC_SUBST(V_INCLS)
AC_SUBST(V_PCAPDEP)
AC_SUBST(V_SENDMAIL)
AC_SUBST(LBL_LIBS)

AC_PROG_INSTALL

AC_OUTPUT(Makefile)

if test ! -f $srcdir/arp.dat ; then
	echo 'creating empty arp.dat file'
	touch $srcdir/arp.dat
fi

if test -f $srcdir/.devel ; then
	make depend
fi
exit 0