~wibblymat/ubuntu/oneiric/sagan/ftbfs-jam

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2011-03-17 15:18:58 UTC
  • Revision ID: james.westby@ubuntu.com-20110317151858-iqvfx0hsxlamxp6b
Tags: upstream-0.1.9~svn129
ImportĀ upstreamĀ versionĀ 0.1.9~svn129

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                               -*- Autoconf -*-
 
2
# Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_INIT
 
5
AC_CONFIG_SRCDIR([src])
 
6
AC_CANONICAL_SYSTEM
 
7
 
 
8
 
 
9
#VERSION=`cat $srcdir/version.h | grep "#define VERSION " | sed -e 's/^.*\"\(.*\)\"/\1/'`
 
10
 
 
11
VERSION=`cat src/version.h | grep "#define VERSION " | sed -e 's/^.*\"\(.*\)\"/\1/'`
 
12
 
 
13
AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little]))
 
14
 
 
15
 
 
16
AC_ARG_ENABLE(mysql,
 
17
  [  --disable-mysql         Disable MySQL support.],
 
18
  [ MYSQL="$enableval"],
 
19
  [ MYSQL="yes" ]
 
20
)
 
21
 
 
22
AC_ARG_WITH(mysql_includes,
 
23
        [  --with-mysql-includes=DIR    MySQL include directory],
 
24
        [with_mysql_includes="$withval"],[with_mysql_includes="no"])
 
25
 
 
26
AC_ARG_WITH(mysql_libraries,
 
27
        [  --with-mysql-libraries=DIR   MySQL library directory],
 
28
        [with_mysql_libraries="$withval"],[with_mysql_libraries="no"])
 
29
 
 
30
if test "x$with_mysql_includes" != "xno"; then
 
31
   CPPFLAGS="${CPPFLAGS} -I${with_mysql_includes}"
 
32
   fi
 
33
 
 
34
if test "x$with_mysql_libraries" != "xno"; then
 
35
   LDFLAGS="${LDFLAGS}  -L${with_mysql_libraries}"
 
36
fi
 
37
 
 
38
 
 
39
AC_ARG_ENABLE(postgresql,
 
40
  [  --disable-postgresql    Disable PostgreSQL support.],
 
41
  [ POSTGRES="$enableval"],
 
42
  [ POSTGRES="yes" ]
 
43
)
 
44
 
 
45
AC_ARG_WITH(postgresql_includes,
 
46
        [  --with-postgresql-includes=DIR    PostgreSQL include directory],
 
47
        [with_postgresql_includes="$withval"],[with_postgresql_includes="no"])
 
48
 
 
49
AC_ARG_WITH(postgresql_libraries,
 
50
        [  --with-postgresql-libraries=DIR   PostgreSQL library directory],
 
51
        [with_postgresql_libraries="$withval"],[with_postgresql_libraries="no"])
 
52
 
 
53
if test "x$with_postgresql_includes" != "xno"; then
 
54
   CPPFLAGS="${CPPFLAGS} -I${with_postgresql_includes}"
 
55
   fi
 
56
 
 
57
if test "x$with_postgresql_libraries" != "xno"; then
 
58
   LDFLAGS="${LDFLAGS}  -L${with_postgresql_libraries}"
 
59
fi
 
60
 
 
61
 
 
62
AC_ARG_ENABLE(esmtp,
 
63
  [  --disable-esmtp      Disable libesmtp support.],
 
64
  [ ESMTP="$enableval"],
 
65
  [ ESMTP="yes" ]
 
66
)
 
67
 
 
68
AC_ARG_WITH(esmtp_includes,
 
69
        [  --with-esmtp-includes=DIR    libesmtp include directory],
 
70
        [with_esmtp_includes="$withval"],[with_esmtp_includes="no"])
 
71
 
 
72
AC_ARG_WITH(esmtp_libraries,
 
73
        [  --with-esmtp-libraries=DIR   libesmtp library directory],
 
74
        [with_esmtp_libraries="$withval"],[with_esmtp_libraries="no"])
 
75
 
 
76
if test "x$with_esmtp_includes" != "xno"; then
 
77
   CPPFLAGS="${CPPFLAGS} -I${with_esmtp_includes}"
 
78
   fi
 
79
 
 
80
if test "x$with_esmtp_libraries" != "xno"; then
 
81
   LDFLAGS="${LDFLAGS}  -L${with_esmtp_libraries}"
 
82
fi
 
83
 
 
84
 
 
85
AC_ARG_ENABLE(prelude,
 
86
  [  --disable-prelude      Disable Prelude support.],
 
87
  [ PRELUDE="$enableval"],
 
88
  [ PRELUDE="yes" ]
 
89
)
 
90
 
 
91
AC_ARG_WITH(prelude_includes,
 
92
        [  --with-prelude-includes=DIR    libprelude include directory],
 
93
        [with_prelude_includes="$withval"],[with_prelude_includes="no"])
 
94
 
 
95
AC_ARG_WITH(prelude_libraries,
 
96
        [  --with-prelude-libraries=DIR   libprelude library directory],
 
97
        [with_prelude_libraries="$withval"],[with_prelude_libraries="no"])
 
98
 
 
99
if test "x$with_prelude_includes" != "xno"; then
 
100
   CPPFLAGS="${CPPFLAGS} -I${with_prelude_includes}"
 
101
   fi
 
102
 
 
103
if test "x$with_prelude_libraries" != "xno"; then
 
104
   LDFLAGS="${LDFLAGS}  -L${with_prelude_libraries}"
 
105
fi
 
106
 
 
107
AC_ARG_ENABLE(lognorm,
 
108
  [  --disable-lognorm      Disable Lognorm (liblognorm) support.],
 
109
  [ LOGNORM="$enableval"],
 
110
  [ LOGNORM="yes" ]
 
111
)
 
112
 
 
113
AC_ARG_WITH(lognorm_includes,
 
114
        [  --with-lognorm-includes=DIR    liblognorm include directory],
 
115
        [with_lognorm_includes="$withval"],[with_lognorm_includes="no"])
 
116
 
 
117
AC_ARG_WITH(lognorm_libraries,
 
118
        [  --with-lognorm-libraries=DIR   liblognorm library directory],
 
119
        [with_lognorm_libraries="$withval"],[with_lognorm_libraries="no"])
 
120
 
 
121
if test "x$with_lognorm_includes" != "xno"; then
 
122
   CPPFLAGS="${CPPFLAGS} -I${with_lognorm_includes}"
 
123
   fi
 
124
 
 
125
if test "x$with_lognorm_libraries" != "xno"; then
 
126
   LDFLAGS="${LDFLAGS}  -L${with_lognorm_libraries}"
 
127
fi
 
128
 
 
129
 
 
130
AC_ARG_ENABLE(libpcap,
 
131
  [  --disable-libpcap      Disable libpcap (plog) support.],
 
132
  [ LIBPCAP="$enableval"],
 
133
  [ LIBPCAP="yes" ]
 
134
)
 
135
 
 
136
AC_ARG_WITH(libpcap_includes,
 
137
        [  --with-libpcap-includes=DIR    libpcap include directory],
 
138
        [with_libpcap_includes="$withval"],[with_libpcap_includes="no"])
 
139
 
 
140
AC_ARG_WITH(libpcap_libraries,
 
141
        [  --with-libpcap-libraries=DIR   libpcap library directory],
 
142
        [with_libpcap_libraries="$withval"],[with_libpcap_libraries="no"])
 
143
 
 
144
if test "x$with_libpcap_includes" != "xno"; then
 
145
   CPPFLAGS="${CPPFLAGS} -I${with_libpcap_includes}"
 
146
   fi
 
147
 
 
148
if test "x$with_libpcap_libraries" != "xno"; then
 
149
   LDFLAGS="${LDFLAGS}  -L${with_libpcap_libraries}"
 
150
fi
 
151
 
 
152
AC_ARG_ENABLE(libdnet,
 
153
  [  --disable-libdnet      Disable libdnet (unified2) support.],
 
154
  [ LIBDNET="$enableval"],
 
155
  [ LIBDNET="yes" ]
 
156
)
 
157
 
 
158
AC_ARG_WITH(libdnet_includes,
 
159
        [  --with-libdnet-includes=DIR    libdnet include directory],
 
160
        [with_libdnet_includes="$withval"],[with_libdnet_includes="no"])
 
161
 
 
162
AC_ARG_WITH(libdnet_libraries,
 
163
        [  --with-libdnet-libraries=DIR   libdnet library directory],
 
164
        [with_libdnet_libraries="$withval"],[with_libdnet_libraries="no"])
 
165
 
 
166
if test "x$with_libdnet_includes" != "xno"; then
 
167
   CPPFLAGS="${CPPFLAGS} -I${with_libdnet_includes}"
 
168
   fi
 
169
 
 
170
if test "x$with_libdnet_libraries" != "xno"; then
 
171
   LDFLAGS="${LDFLAGS}  -L${with_libdnet_libraries}"
 
172
fi
 
173
 
 
174
 
 
175
AC_SUBST(VERSION)
 
176
AM_INIT_AUTOMAKE(sagan, ${VERSION})
 
177
AC_CONFIG_HEADER(config.h)
 
178
 
 
179
# Checks for programs.
 
180
AC_PROG_CC
 
181
AC_PROG_INSTALL
 
182
AC_LANG_C
 
183
AC_PROG_MAKE_SET
 
184
 
 
185
# Checks for header files.
 
186
AC_HEADER_STDC
 
187
AC_HEADER_SYS_WAIT
 
188
 
 
189
AC_CHECK_HEADERS([stdio.h stdlib.h sys/types.h unistd.h stdint.h inttypes.h pthread.h ctype.h errno.h fcntl.h sys/stat.h string.h getopt.h time.h pcre.h stdarg.h limits.h arpa/inet.h netinet/in.h sys/time.h sys/socket.h])
 
190
 
 
191
# Checks for typedefs, structures, and compiler characteristics.
 
192
AC_C_CONST
 
193
AC_HEADER_TIME
 
194
 
 
195
# Checks for library functions.
 
196
AC_PROG_GCC_TRADITIONAL
 
197
AC_FUNC_MALLOC
 
198
AC_FUNC_SELECT_ARGTYPES
 
199
AC_FUNC_STAT
 
200
AC_TYPE_SIGNAL
 
201
AC_FUNC_STRFTIME
 
202
AC_FUNC_FORK
 
203
AC_FUNC_REALLOC
 
204
AC_TYPE_PID_T
 
205
AC_TYPE_SIZE_T
 
206
AC_STRUCT_TM
 
207
 
 
208
AC_CHECK_FUNCS([select strstr strchr strcmp strlen sizeof write snprintf strncat strlcat strlcpy getopt_long gethostbyname socket htons connect send recv dup2 strspn strdup])
 
209
 
 
210
AC_CHECK_LIB(pcre, main,,AC_MSG_ERROR(Sagan needs PCRE installed.  Please see http://www.pcre.org.))
 
211
AC_CHECK_LIB(pthread, main,,AC_MSG_ERROR(Sagan needs pthreads!))
 
212
AC_CHECK_LIB(m, main,,AC_MSG_ERROR(Sagan needs libm!))
 
213
 
 
214
if test "$MYSQL" = "yes"; then
 
215
        AC_MSG_RESULT([------- MySQL Support is enabled -------])
 
216
        AC_CHECK_HEADER([mysql/mysql.h])
 
217
        AC_CHECK_HEADER([mysql/errmsg.h])
 
218
        AC_CHECK_LIB(mysqlclient_r, main,,AC_MSG_ERROR(The MySQL library libmysqlclient_r is missing!
 
219
If you're not interested in MySQL support use the --disable-mysql flag.))
 
220
        fi
 
221
 
 
222
if test "$POSTGRES" = "yes"; then
 
223
       AC_MSG_RESULT([------- PostgreSQL support is enabled -------])
 
224
       AC_CHECK_HEADER([libpq-fe.h])
 
225
       AC_CHECK_LIB(pq, main,,AC_MSG_ERROR(The PostgreSQL library cannot be found.
 
226
If you're not interested in PostgreSQL support use the --disable-postgresql flag.))
 
227
       fi
 
228
 
 
229
if test "$ESMTP" = "yes"; then
 
230
       AC_MSG_RESULT([------- libesmtp support is enabled -------])
 
231
       AC_CHECK_HEADER([libesmtp.h])
 
232
       AC_CHECK_LIB(esmtp, main,,AC_MSG_ERROR(The libesmtp library cannot be found.
 
233
If you're not interested in libesmtp support use the --disable-esmtp flag.))
 
234
       fi
 
235
 
 
236
if test "$PRELUDE" = "yes"; then
 
237
       AC_MSG_RESULT([------- libprelude support is enabled -------])
 
238
       AC_CHECK_HEADER([libprelude/prelude.h])
 
239
       AC_CHECK_LIB(prelude, main,,AC_MSG_ERROR(The libprelude library cannot be found.
 
240
If you're not interested in Prelude support use the --disable-prelude flag.))
 
241
       fi
 
242
 
 
243
if test "$LOGNORM" = "yes"; then
 
244
       AC_MSG_RESULT([------- liblognorm support is enabled -------])
 
245
       #AC_CHECK_HEADER([libestr.h])
 
246
       #AC_CHECK_HEADER([libee/libee.h])
 
247
       #AC_CHECK_HEADER([lognorm.h])
 
248
       AC_CHECK_HEADER([liblognorm.h])
 
249
       #AC_CHECK_HEADER([ptree.h])
 
250
       #AC_CHECK_HEADER([lognorm.h])
 
251
       AC_CHECK_LIB(lognorm, main,,AC_MSG_ERROR(The liblognorm library cannot be found.
 
252
This library is important for the correlation aspects of Sagan! Please see
 
253
https://wiki.softwink.com/bin/view/Main/LibLogNorm. To disable this feature
 
254
use the --disable-lognorm flag. ))
 
255
       fi
 
256
 
 
257
if test "$LIBPCAP" = "yes"; then
 
258
       AC_MSG_RESULT([------- libpcap support is enabled -------])
 
259
       AC_CHECK_HEADER([pcap.h])
 
260
       AC_CHECK_HEADER([net/if.h])
 
261
       AC_CHECK_HEADER([net/if_arp.h])
 
262
       AC_CHECK_HEADER([netinet/in_systm.h])
 
263
       AC_CHECK_HEADER([netinet/if_ether.h])
 
264
       AC_CHECK_HEADER([netinet/ip.h])
 
265
       AC_CHECK_HEADER([netinet/udp.h])
 
266
       AC_CHECK_LIB(pcap, main,,AC_MSG_ERROR(The libpcap library cannot be found.
 
267
This library is used to run Sagan in a syslog 'sniffer' mode.  Please see
 
268
https://wiki.softwink.com/bin/view/Main/PLog.  To disable this feature use
 
269
the --disable-libpcap flag. ))
 
270
       fi
 
271
 
 
272
if test "$LIBDNET" = "yes"; then
 
273
       AC_MSG_RESULT([------- libdnet support is enabled -------])
 
274
       AC_CHECK_HEADER([dnet.h])
 
275
       AC_CHECK_LIB(dnet, main,,AC_MSG_ERROR(The libdnet library cannot be found.
 
276
This library is used for Sagan's Unified2 output support.  Please see
 
277
https://wiki.softwink.com/bin/view/Main/Unified2Output for more information. 
 
278
To disable this feature use the --disable-libdnet flag. ))
 
279
       fi
 
280
 
 
281
 
 
282
test "x$prefix" = x. || test "x$prefix" = xNONE && prefix=/usr/local
 
283
AC_DEFINE_UNQUOTED(CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/sagan.conf"`", [Sagan configuration file]) 
 
284
 
 
285
AC_DEFINE_UNQUOTED(PACKAGE_NAME, "sagan" )
 
286
AC_DEFINE_UNQUOTED(PACKAGE_STRING, "Sagan $VERSION")
 
287
AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "sagan@mailman.softwink.com" )
 
288
AC_DEFINE_UNQUOTED(PACKAGE_TARNAME, "sagan" )
 
289
AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$VERSION" )
 
290
 
 
291
AC_CONFIG_FILES([ \
 
292
Makefile \
 
293
src/Makefile])
 
294
 
 
295
 
 
296
# AC_OUTPUT(Makefile)
 
297
AC_OUTPUT
 
298
 
 
299
AC_MSG_RESULT([])
 
300
AC_MSG_RESULT([  ,-._,-.    Sagan has been configured!])
 
301
AC_MSG_RESULT([  \/)"(\/ ])
 
302
AC_MSG_RESULT([   (_o_)     Champ Clark III & The Softwink Team: http://www.softwink.com])
 
303
AC_MSG_RESULT([   /   \/)   Copyright (C) 2009-2011 Softwink, Inc., et al.])
 
304
AC_MSG_RESULT([  (|| ||) ])
 
305
AC_MSG_RESULT([   oo-oo  ]) 
 
306
AC_MSG_RESULT([])
 
307
 
 
308