File: configure.in

package info (click to toggle)
argus 1%3A2.0.6.fixes.1-16.3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 2,016 kB
  • ctags: 4,025
  • sloc: ansic: 23,022; sh: 5,734; makefile: 380; yacc: 255; lex: 234
file content (240 lines) | stat: -rw-r--r-- 5,561 bytes parent folder | download | duplicates (4)
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
dnl
dnl Copyright (c) 2000-2004 QoSient, LLC
dnl All rights reserved.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl                
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details. 
dnl                
dnl You should have received a copy of the GNU General Public License 
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
dnl
dnl
dnl Process this file with autoconf to produce a configure script.
dnl

AC_INIT(server/argus.c)

dnl all our local stuff like install scripts and include files
dnl is in there
AC_CONFIG_AUX_DIR(config)

AC_CANONICAL_SYSTEM

AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_C_INLINE

dnl where we install our stuff ...
AC_PREFIX_DEFAULT( /usr/local )

dnl Minimum Autoconf version required.
AC_PREREQ(2.13)

AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_QOSIENT_LEX_AND_YACC(V_LEX, V_YACC, argus_)
AC_CHECK_PROGS(V_RANLIB, ranlib, @true)

if test -z "$with_pcap" && test "$cross_compiling" = yes; then
        AC_MSG_ERROR(pcap type not determined when cross-compiling; use --with-pcap=...)
fi
AC_ARG_WITH(pcap, [  --with-pcap=TYPE        use packet capture TYPE])
AC_MSG_CHECKING(packet capture type)
if test ! -z "$with_pcap" ; then
        V_PCAP="$withval"
elif 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 -r /usr/include/linux/socket.h ; then
        V_PCAP=linux
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)

AC_LBL_UNALIGNED_ACCESS
AC_LBL_DEVEL(V_CCOPT)
AC_QOSIENT_DEBUG(V_CCOPT)
AC_CMU_SASL
AC_SYS_LARGEFILE

AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
if test ! -z "$V_PCAPDEP"; then
if test -f $V_PCAPDEP; then
        if test -f lib/libpcap.a; then
           rm -rf lib/libpcap.a
        fi
	pcapdir=`echo $V_PCAPDEP | sed -e 's/^\.\./..\/../'`
        ln -s $pcapdir lib/libpcap.a
        V_PCAPDEP="../lib/libpcap.a"
else
        if test $V_PCAPDEP = "-lpcap" ; then
                if test -f lib/libpcap.a; then
                        rm -rf lib/libpcap.a
                fi
        fi
        if test $V_PCAPDEP = "-lwpcap" ; then
                if test -f lib/libpcap.a; then
                        rm -rf lib/libpcap.a
                fi
        fi
fi
LIBS="$LIBS $V_PCAPDEP"
fi


AC_QOSIENT_TCPWRAP(V_WRAPDEP, V_INCLS)
if test ! -z "$V_WRAPDEP"; then
	if test -f $V_WRAPDEP; then
		if test -f lib/libwrap.a; then
			rm -rf lib/libwrap.a
		fi
		wrapdir=`echo $V_WRAPDEP | sed -e 's/^\.\./..\/../'`
        	ln -s $wrapdir lib/libwrap.a
		V_WRAPDEP="../lib/libwrap.a"
		AC_DEFINE(HAVE_TCP_WRAPPER)
		LIBS="$LIBS $V_WRAPDEP"
	else
		if test $V_WRAPDEP = "-lwrap" ; then
			AC_DEFINE(HAVE_TCP_WRAPPER)
			case "$target_os" in
			linux*)
				LIBS="-lnsl $LIBS" ;;
			esac
        	fi
	fi
fi

umask 002

if test -z "$PWD"; then
	PWD=`pwd`
fi

AC_HAVE_HEADERS(sys/sockio.h string.h fcntl.h sys/file.h syslog.h)
AC_CHECK_FUNCS(ether_hostton strerror)

case "$target_cpu" in
 
*86*)
        AC_DEFINE(CONFIG_X86_BSWAP,1)
        ;;
 
powerpc*)
        V_CCOPT="-mpowerpc $V_CCOPT"
        ;;
esac


case "$target_os" in

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

hpux9*)
	AC_DEFINE(HAVE_HPUX9)
	;;

hpux10.0*)
	;;

hpux10.1*)
	;;

hpux*)
	dnl HPUX 10.20 and above is similar to HPUX 9...
	AC_DEFINE(HAVE_HPUX10_20)
	;;

sinix*)
	AC_MSG_CHECKING(if SINIX compiler defines sinix)
	AC_CACHE_VAL(ac_cv_cc_sinix_defined,
		AC_TRY_COMPILE(
		    [],
		    [int i = sinix;],
		    ac_cv_cc_sinix_defined=yes,
		    ac_cv_cc_sinix_defined=no))
	    AC_MSG_RESULT($ac_cv_cc_sinix_defined)
	    if test $ac_cv_cc_sinix_defined = no ; then
		    AC_DEFINE(sinix)
	    fi
	;;

solaris*)
	AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
	AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
	if test x$LD_LIBRARY_PATH != x ; then
		LIBS="$LIBS -R$LD_LIBRARY_PATH"
		AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
	else
		AC_MSG_RESULT(no -- this may be a problem in a few seconds)
	fi
	COMPATLIB="-lsocket -lnsl"
	;;

cygwin*)
	AC_DEFINE(CYGWIN,1)
	V_INCLS="$V_INCLS -I../include/cygwin-include"
	;;

linux*)
	;;
esac

INSTALL_LIB="../lib"
INSTALL_BIN="../bin"

AC_SUBST(V_PCAP)
AC_SUBST(V_CCOPT)
AC_SUBST(V_INCLS)
AC_SUBST(V_RANLIB)
AC_SUBST(V_PCAPDEP)
AC_SUBST(V_WRAPDEP)
AC_SUBST(V_YACC)
AC_SUBST(V_LEX)
AC_SUBST(LIBS)
AC_SUBST(COMPATLIB)
AC_SUBST(INSTALL_LIB)
AC_SUBST(INSTALL_BIN)

AC_PROG_INSTALL
AC_STDC_HEADERS

AC_OUTPUT(
   Makefile
   ./common/Makefile
   ./server/Makefile
)

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