File: configure.in

package info (click to toggle)
labrea 2.5-stable-3
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, lenny, sid, squeeze, stretch, wheezy
  • size: 984 kB
  • ctags: 590
  • sloc: ansic: 5,604; sh: 3,247; makefile: 77
file content (217 lines) | stat: -rw-r--r-- 5,217 bytes parent folder | download | duplicates (2)
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
dnl 
dnl configure.in
dnl
dnl Copyright (c) 2001 Dug Song <dugsong@monkey.org>
dnl
dnl $Id: configure.in,v 1.3 2003/09/12 21:23:39 lorgor Exp $

dnl Process this file with autoconf to produce a configure script.

AC_INIT(LaBrea,2.5-stable-1,lorgor@users.sourceforge.net,labrea)
AC_CONFIG_SRCDIR(src/labrea.c)

AC_CANONICAL_HOST

AM_INIT_AUTOMAKE(check-news dist-zip no-define 1.6.1)

AM_CONFIG_HEADER(config.h)

dnl Initialize prefix.
if test "$prefix" = "NONE"; then
   prefix="/usr/local"
fi

dnl Check for system type
AC_MSG_CHECKING(for target os)
case $host in
	*-*-cygwin*)	LB_CYGWIN="yes"
					;;
	*-*-solaris*)	AC_DEFINE(LB_SYSTEM_IS_SUN,1,
					[Define if system is Solaris])
					LB_CYGWIN="no"
					;;
	*)				LB_CYGWIN="no"
					;;
esac
AC_MSG_RESULT($host_os)


dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB


dnl Checks for libraries.


dnl XXX - we need MingW32 under Cygwin for win32
if test "$LB_CYGWIN" = yes ; then
   if test -d /usr/include/mingw; then
      CPPFLAGS="$CPPFLAGS -mno-cygwin"
      CFLAGS="$CFLAGS -mno-cygwin"
      AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, 
          [Define for faster code generation.])
      AC_LIBOBJ(syslog)
   else
      AC_MSG_ERROR([need MingW32 package to build under Cygwin])
   fi
fi


dnl Checks for libpcap
AC_MSG_CHECKING(for libpcap)
AC_ARG_WITH(libpcap,
[  --with-libpcap=DIR      use libpcap in DIR],
[ case "$withval" in
  yes|no)
     AC_MSG_RESULT(no)
     ;;
  *)
     AC_MSG_RESULT($withval)
     if test -f $withval/pcap.h -a -f $withval/libpcap.a; then
        owd=`pwd`
        if cd $withval; then withval=`pwd`; cd $owd; fi
	PCAPINC="-I$withval -I$withval/bpf"
	PCAPLIB="-L$withval -lpcap"
     elif test -f $withval/include/pcap.h -a \
	       -f $withval/include/net/bpf.h; then
	owd=`pwd`
	if cd $withval; then withval=`pwd`; cd $owd; fi
	PCAPINC="-I$withval/include"
	if test -f $withval/lib/libwpcap.a; then
	   PCAPLIB="-L$withval/lib -lwpcap"
	else
	   PCAPLIB="-L$withval/lib -lpcap"
        fi
     else
        AC_ERROR(pcap.h, net/bpf.h, or libpcap.a not found in $withval)
     fi
     ;;
  esac ],
[ if test -f ${prefix}/include/pcap.h; then
     PCAPINC="-I${prefix}/include"
     if test -f ${prefix}/lib/libwpcap.a; then
	PCAPLIB="-L${prefix}/lib -lwpcap"
     else
        PCAPLIB="-L${prefix}/lib -lpcap"
     fi
  elif test -f /usr/include/pcap/pcap.h; then
     PCAPINC="-I/usr/include/pcap"
     PCAPLIB="-lpcap"
  elif test -f /usr/include/pcap.h; then
     PCAPLIB="-lpcap"
  else
     AC_MSG_RESULT(no)
     AC_ERROR(libpcap not found)
  fi
  AC_MSG_RESULT(yes) ]
)
AC_SUBST(PCAPINC)
AC_SUBST(PCAPLIB)

dnl Checks for (installed) libdnet
AC_MSG_CHECKING(for libdnet)
AC_ARG_WITH(libdnet,
[  --with-libdnet=DIR      use libdnet in DIR],
[ case "$withval" in
  yes|no)
     AC_MSG_RESULT(no)
     ;;
  *)
     AC_MSG_RESULT($withval)
     if test -f $withval/src/libdnet.a; then
	DNETINC="-I$withval/include"
	DNETLIB="-L$withval/src -ldnet `$withval/dnet-config --libs`"
     elif test -x $withval/bin/dnet-config; then
	DNETINC="`$withval/bin/dnet-config --cflags`"
	DNETLIB="`$withval/bin/dnet-config --libs`"
     else
        AC_ERROR(dnet-config not found in $withval/bin)
     fi
     ;;
  esac ],
[ if test -x ${prefix}/bin/dnet-config; then
     DNETINC="`${prefix}/bin/dnet-config --cflags`"
     DNETLIB="`${prefix}/bin/dnet-config --libs`"
  else
     AC_MSG_RESULT(no)
     AC_ERROR(libdnet not found)
  fi
  AC_MSG_RESULT(yes) ]
)
AC_SUBST(DNETINC)
AC_SUBST(DNETLIB)

dnl Checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h getopt.h err.h)
AC_CHECK_HEADERS(sys/ioctl.h syslog.h time.h unistd.h)
AC_CHECK_HEADERS(windows.h winsock.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
AC_PROG_GCC_TRADITIONAL
if test "$GCC" = yes; then
   CFLAGS="$CFLAGS -Wall"
fi

dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(strstr strtol)
AC_CHECK_FUNC(strlcpy,,
	[AC_LIBOBJ(strlcpy)
	AC_DEFINE(DONT_HAVE_STRLCPY,1,
	[Define if strlcpy is missing])])

dnl If not GNU, then replace getopt
AC_MSG_CHECKING(for gnu getopt support)
case $host in
	*-*-*gnu*) 	AC_MSG_RESULT(yes)
				;;
	*) 		AC_LIBOBJ(getopt)
			AC_LIBOBJ(getopt1)
	   		AC_MSG_RESULT([no - supplying missing getopt]);;
esac

dnl Set system-wide configuration file.
if test "$LB_CYGWIN" = yes ; then
	  LABREA_CONF="LaBrea.cfg"
   else
	  LABREA_CONF=`eval echo ${sysconfdir}/labrea.conf`      
fi
AC_SUBST(LABREA_CONF)
AC_DEFINE_UNQUOTED(LABREA_CONF, "$LABREA_CONF",
	[Location of configuration file.])

dnl Set debug output
AC_MSG_CHECKING(if debug should be enabled)
AC_ARG_ENABLE(debug,
[  --enable-debug          enable debugging options (bugreports and developers only)],
                [ AC_DEFINE(DEBUG_LB,1,[Turn on debugging])
				  AC_MSG_RESULT(yes)   ],
				[ AC_MSG_RESULT(no)    ])


dnl From old accconfig.h file
AH_BOTTOM([

/* Extra includes.  */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

#ifdef DONT_HAVE_STRLCPY
size_t  strlcpy(char *, const char *, size_t);
#endif
])

AC_OUTPUT(Makefile src/Makefile inc/Makefile misc/Makefile)