~ubuntu-branches/ubuntu/maverick/ntop/maverick

« back to all changes in this revision

Viewing changes to ntop/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Dennis Schoen
  • Date: 2002-04-12 11:38:47 UTC
  • Revision ID: james.westby@ubuntu.com-20020412113847-4k4yydw0pzybc6g8
Tags: upstream-2.0.0
ImportĀ upstreamĀ versionĀ 2.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl>
 
2
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
3
dnl> this file is processed via 'autoconf' to produce the 'configure' script
 
4
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
5
dnl>
 
6
dnl> Copyright (c) 1998 - 2000 Luca Deri <deri@ntop.org>
 
7
dnl> Updated 1Q 2000 Rocco Carbone <rocco@ntop.org>
 
8
dnl>
 
9
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
10
dnl> This program is free software; you can redistribute it and/or modify
 
11
dnl> it under the terms of the GNU General Public License as published by
 
12
dnl> the Free Software Foundation; either version 2 of the License, or
 
13
dnl> (at your option) any later version.
 
14
dnl>
 
15
dnl> This program is distributed in the hope that it will be useful,
 
16
dnl> but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
dnl> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
dnl> GNU General Public License for more details.
 
19
dnl>
 
20
dnl> You should have received a copy of the GNU General Public License
 
21
dnl> along with this program; if not, write to the Free Software
 
22
dnl> Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
23
dnl>
 
24
 
 
25
 
 
26
dnl>
 
27
dnl> standard Autoconf prolog
 
28
dnl>
 
29
AC_PREREQ(2.13)
 
30
AC_REVISION([1.0])
 
31
 
 
32
 
 
33
dnl>
 
34
dnl> version and name of the game
 
35
dnl>
 
36
NTOP_MAJOR_VERSION=2
 
37
NTOP_MINOR_VERSION=0
 
38
NTOP_MICRO_VERSION=0
 
39
NTOP_INTERFACE_AGE=0
 
40
NTOP_BINARY_AGE=0
 
41
NTOP_VERSION=$NTOP_MAJOR_VERSION.$NTOP_MINOR_VERSION.$NTOP_MICRO_VERSION
 
42
 
 
43
dnl>
 
44
dnl> standard libtool versioning
 
45
dnl>
 
46
LT_RELEASE=$NTOP_MAJOR_VERSION.$NTOP_MINOR_VERSION
 
47
LT_CURRENT=`expr $NTOP_MICRO_VERSION - $NTOP_INTERFACE_AGE`
 
48
LT_REVISION=$NTOP_INTERFACE_AGE
 
49
LT_AGE=`expr $NTOP_BINARY_AGE - $NTOP_INTERFACE_AGE`
 
50
 
 
51
NTOP_VERSION_INFO=$LT_CURRENT:$LT_REVISION:$LT_AGE
 
52
NTOP_RELEASE=$LT_RELEASE
 
53
 
 
54
AC_SUBST(NTOP_VERSION_INFO)
 
55
AC_SUBST(SO_VERSION_PATCH)
 
56
AC_SUBST(NTOP_RELEASE)
 
57
 
 
58
 
 
59
PACKAGE=ntop
 
60
VERSION=$NTOP_VERSION
 
61
 
 
62
 
 
63
echo
 
64
echo "Welcome to $PACKAGE, Version $VERSION"
 
65
echo "[Copyright (c) 1998-2001 Luca Deri <deri@ntop.org>]"
 
66
echo
 
67
 
 
68
dnl>
 
69
dnl> variables for autoconf
 
70
dnl>
 
71
 
 
72
dnl>
 
73
dnl> By default ntop is compiled with MySQL support (if any)
 
74
ac_disable_mysql=no
 
75
 
 
76
dnl>
 
77
dnl> By default ntop is compiled in multithread mode using
 
78
dnl> async address resolution unless reset by command line options.
 
79
ac_disable_multithread=no
 
80
ac_disable_async_resolution=no
 
81
multithread_mode=yes
 
82
 
 
83
dnl>
 
84
dnl> By default the configuration script will try to link against OpenSSL library, if available.
 
85
dnl> The choice to disable this feature is left to the user.
 
86
ac_disable_openssl=no
 
87
 
 
88
dnl>
 
89
dnl> By default the configuration script will try to link against GNU readline (and curses) library, if available.
 
90
dnl> The choice to disable this feature is left to the user.
 
91
ac_disable_readline=no
 
92
ac_disable_curses=no
 
93
 
 
94
dnl>
 
95
dnl> By default the configuration script will try to link against GDChart library, if available.
 
96
dnl> The choice to disable this feature is left to the user.
 
97
ac_disable_gdchart=no
 
98
 
 
99
dnl>
 
100
dnl> By default the configuration script will not try to link against the TCP wrapper library, if available.
 
101
dnl> The choice to enable this feature is left to the user.
 
102
ac_enable_tcpwrap=no
 
103
 
 
104
 
 
105
dnl>
 
106
dnl> By default the configuration script will try to compile all the plugins in its own directory.
 
107
dnl> The choice to disable this feature is left to the user.
 
108
PLUGINS=plugins
 
109
ac_disable_plugins=no
 
110
 
 
111
dnl>
 
112
dnl> By default the configuration script will try to compile the interactive 'intop' program in its own directory.
 
113
dnl> The choice to disable this feature is left to the user.
 
114
INTOP=intop
 
115
ac_disable_intop=no
 
116
 
 
117
dnl>
 
118
dnl> *** ToBeRocked ***
 
119
dnl> user customizable section
 
120
dnl>
 
121
 
 
122
 
 
123
dnl>
 
124
dnl> look for an unique ntop's source file in the distribution
 
125
dnl> and perform initialization steps, such as loading the cache
 
126
dnl>
 
127
AC_INIT(ntop.c)
 
128
echo
 
129
 
 
130
dnl>
 
131
dnl> canonicalize the host, target, and build system types
 
132
dnl>
 
133
AC_CANONICAL_SYSTEM
 
134
echo
 
135
 
 
136
dnl>
 
137
dnl> perform program name transformation
 
138
dnl>
 
139
AC_ARG_PROGRAM
 
140
 
 
141
dnl>
 
142
dnl> initialize the macro package
 
143
dnl> and check for working GNU auto``stuff''
 
144
dnl>
 
145
AM_INIT_AUTOMAKE(ntop, $VERSION, lderi)
 
146
echo
 
147
 
 
148
dnl>
 
149
dnl> initialize the libtool macro package to
 
150
dnl> automatically include dependencies of:
 
151
dnl> ranlib, ar, gcc, cc, ld, nm, ln
 
152
dnl>
 
153
 
 
154
dnl>
 
155
dnl> checks for UNIX variants
 
156
dnl>
 
157
dnl> quoted from a public mailing list
 
158
dnl>
 
159
dnl> "Believe me, I'm all too aware of the nightmare of shared libraries
 
160
dnl>  on the various systems.  My comment about AIX stems from two things.
 
161
dnl>  One, guess what the extension for shared libs is on AIX.  ".a"  Guess
 
162
dnl>  what the static lib extension is.  ".a"  What dipshit was buttsnorkeling
 
163
dnl>  himself coming up with *that* brilliant idea?  And two, even if you
 
164
dnl>  do build a shared library, they fail to work 99% of the time.
 
165
dnl>  *cough* Perl *cough*  So as a development platform, I hate AIX with
 
166
dnl>  a passion.  Give me Solaris and HP-UX any day."
 
167
dnl>
 
168
dnl>  Michael Jennings  <mej@eterm.org>  http://www.eterm.org
 
169
dnl>  Software Engineer, VA Linux Systems Author, Eterm (www.eterm.org)
 
170
dnl>
 
171
 
 
172
case "$host" in
 
173
dnl>    AIX is ___really___ incompatible with libtooland shared libraries, so....
 
174
dnl>    disable the shared flag to no
 
175
dnl>
 
176
    *-ibm-aix* )
 
177
        enable_shared=no
 
178
        enable_static=yes
 
179
        ;;
 
180
 
 
181
    * )
 
182
        enable_shared=yes
 
183
        enable_static=yes
 
184
        ;;
 
185
esac
 
186
 
 
187
dnl>
 
188
dnl> checks for required development tools
 
189
dnl>
 
190
 
 
191
echo
 
192
echo "Step 1. Looking for required development tools...."
 
193
echo
 
194
 
 
195
AM_PROG_LIBTOOL
 
196
echo
 
197
 
 
198
dnl> set default loader
 
199
CCLD=$CC
 
200
 
 
201
AM_PROG_CC_STDC
 
202
AC_PROG_CPP
 
203
AC_SET_MAKE
 
204
AC_PROG_INSTALL
 
205
 
 
206
dnl>
 
207
dnl> you can also check for debugging and optimization
 
208
dnl>
 
209
AC_CHECK_DEBUGGING
 
210
AC_CHECK_OPTIMIZE
 
211
 
 
212
dnl>
 
213
dnl> set reasonable defaults here
 
214
dnl>
 
215
DEFS="-DHAVE_CONFIG_H"
 
216
CFLAGS="-g $CFLAGS"
 
217
 
 
218
echo
 
219
 
 
220
dnl>
 
221
dnl> force configure to use current directory
 
222
dnl>
 
223
AC_CONFIG_AUX_DIR(.)
 
224
 
 
225
dnl>
 
226
dnl> make NTOPDIR the default for the installation
 
227
dnl>
 
228
AC_PREFIX_DEFAULT(${NTOPDIR:-/usr/local})
 
229
 
 
230
 
 
231
dnl>
 
232
dnl> generate the config header
 
233
dnl>
 
234
umask 002
 
235
AM_CONFIG_HEADER(config.h)
 
236
 
 
237
 
 
238
dnl>
 
239
dnl> Yup!  Avoid to initialize maintainer mode.
 
240
dnl> This is a pain if you have SUBDIRS.
 
241
dnl>
 
242
dnl> AM_MAINTAINER_MODE
 
243
 
 
244
 
 
245
echo
 
246
echo "Step 2. Processing user options...."
 
247
echo
 
248
 
 
249
AC_ARG_WITH(void, [  +----------------------------------------------------------------------------+])
 
250
 
 
251
AC_ARG_WITH(pcap-root, [  --with-pcap-root=DIR    LBNL pcap source tree located in DIR], PCAP_ROOT="$withval", PCAP_ROOT=)
 
252
 
 
253
AC_ARG_WITH(gdbm-root, [  --with-gdbm-root=DIR    GNU gdbm source tree located in DIR], GDBM_ROOT="$withval", GDBM_ROOT=)
 
254
 
 
255
AC_ARG_WITH(ossl-root, [  --with-ossl-root=DIR    OpenSSL source tree located in DIR], OSSL_ROOT="$withval", OSSL_ROOT=)
 
256
 
 
257
AC_ARG_WITH(gdchart-root, [  --with-gdchart-root=DIR GDChart source tree located in DIR], GDCHART_ROOT="$withval", GDCHART_ROOT="../gdchart0.94c")
 
258
 
 
259
AC_ARG_WITH(void, [  +----------------------------------------------------------------------------+])
 
260
 
 
261
dnl>
 
262
dnl> Give the user an option to compile a micro version of ntop
 
263
dnl> for embedded systems
 
264
dnl>
 
265
AC_ARG_ENABLE(micro-ntop, [  --enable-micro-ntop            compile a slim version of ntop [default=no]], ac_micro_ntop="yes", ac_micro_ntop="no")
 
266
 
 
267
dnl>
 
268
dnl> Give the user an option to compile without multithread support,
 
269
dnl> for example to start a debugging session.
 
270
dnl>
 
271
AC_ARG_ENABLE(mt, [  --disable-mt            disable multithread support also if available [default=no]], ac_disable_multithread="yes", ac_disable_multithread="no")
 
272
 
 
273
 
 
274
dnl>
 
275
dnl> Give the user an option to compile without MySQL support
 
276
dnl>
 
277
AC_ARG_ENABLE(mysql, [  --disable-mysql            disable MySQL support also if available [default=no]], ac_disable_mysql="yes", ac_disable_mysql="no")
 
278
 
 
279
dnl>
 
280
dnl> Give the user an option to compile without the HTTPS support provided by OpenSSL.
 
281
dnl>
 
282
AC_ARG_ENABLE(ssl, [  --disable-ssl           disable HTPPS support also if OpenSSL is available [default=no]], ac_disable_openssl="yes", ac_disable_openssl="no")
 
283
 
 
284
dnl>
 
285
dnl> Give the user an option to compile without the GNU readline support.
 
286
dnl>
 
287
AC_ARG_ENABLE(readline, [  --disable-readline      disable GNU readline support also if available [default=no]], ac_disable_readline="yes", ac_disable_readline="no")
 
288
 
 
289
dnl>
 
290
dnl> Give the user an option to compile without the curses support.
 
291
dnl>
 
292
AC_ARG_ENABLE(curses, [  --disable-curses        disable curses support also if available [default=no]], ac_disable_curses="yes", ac_disable_curses="no")
 
293
 
 
294
dnl>
 
295
dnl> Give the user an option to compile without the GDChart support.
 
296
dnl>
 
297
AC_ARG_ENABLE(gdchart, [  --disable-gdchart       disable GDChart support also if available [default=no]], ac_disable_gdchart="yes", ac_disable_gdchart="no")
 
298
 
 
299
dnl>
 
300
dnl> Give the user an option to compile with the TCP Wrapper support.
 
301
dnl>
 
302
AC_ARG_ENABLE(tcpwrap, [  --enable-tcpwrap        enable TCP Wrap support if available [default=no]], ac_enable_tcpwrap="yes")
 
303
 
 
304
AC_ARG_WITH(void, [  +----------------------------------------------------------------------------+])
 
305
 
 
306
dnl>
 
307
dnl> Give the user an option to avoid to compile all the plugins.
 
308
dnl>
 
309
AC_ARG_ENABLE(plugins, [  --disable-plugins       disable compilation of plugins, also if they are available [default=no]], ac_disable_plugins="yes")
 
310
 
 
311
dnl>
 
312
dnl> Give the user an option to avoid to compile the interactive version.
 
313
dnl>
 
314
AC_ARG_ENABLE(intop, [  --disable-intop         disable compilation of intop [default=no]], ac_disable_intop="yes")
 
315
 
 
316
 
 
317
dnl>
 
318
dnl>
 
319
dnl> checks for special support for platform/compiler
 
320
dnl> $CC, $CFLAGS, $LDFLAGS and $LIBS are my friends
 
321
dnl>
 
322
 
 
323
echo
 
324
echo "Step 3. Checking for special support for platform/compiler...."
 
325
echo
 
326
DYN_FLAGS=
 
327
SO_VERSION_PATCH=
 
328
MORESOURCES=
 
329
MOREOBJECTS=
 
330
 
 
331
case "$host:$CC" in
 
332
    *-ibm-aix4.1.*:gcc )
 
333
 
 
334
dnl>    on my RS/6000 system I was really unable to link using gcc, so I switched
 
335
dnl>    to native AIX XL C Compiler. I don't know how to link with gcc.
 
336
dnl>
 
337
dnl>    Moreover I needed a local copy of the libgcc.a because the
 
338
dnl>    linker refused to create a binary from the installed archive.
 
339
dnl>    Again, I don't know why.
 
340
dnl>
 
341
        GCCLIB=`gcc -print-libgcc-file-name`
 
342
        cp $GCCLIB .
 
343
        LIBS="-L. -lgcc ${LIBS}"
 
344
 
 
345
dnl>    To link against the getmsg system call you must import the /lib/pse.exp
 
346
        CCLD="cc -bI:/lib/pse.exp"
 
347
        ;;
 
348
 
 
349
    *-ibm-aix4.*:cc* )
 
350
 
 
351
        echo "Oh no!  *cough* AIX *cough* without GCC!  Me poor!"
 
352
 
 
353
        # To link against the getmsg system call you must import the /lib/pse.exp
 
354
dnl>        CFLAGS=
 
355
dnl>        LDFLAGS="-bI:/lib/pse.exp $LDFLAGS"
 
356
        ;;
 
357
 
 
358
    *-sun-solaris2.5.1:* )
 
359
        AC_DEFINE(NEED_INET_ATON)
 
360
        ;;
 
361
 
 
362
    *openbsd* )
 
363
        SO_VERSION_PATCH=.0.0
 
364
        ;;
 
365
 
 
366
    *darwin* )
 
367
        CFLAGS="-no-cpp-precomp -DDARWIN $CFLAGS"
 
368
        DYN_FLAGS="-bundle -flat_namespace -undefined suppress $DYN_FLAGS"
 
369
        ;;
 
370
 
 
371
dnl>    *-sun-solaris2*:cc )
 
372
dnl>        # shut-up harmless warnings caused by do-while macros on Solaris
 
373
dnl>        test ".$ac_cv_prog_gcc" = ".no" && CFLAGS="$CFLAGS -w"
 
374
dnl>        ;;
 
375
esac
 
376
 
 
377
 
 
378
dnl>
 
379
dnl> checks for system header files
 
380
dnl>
 
381
 
 
382
echo
 
383
echo "Step 4. Looking for both required and optional system headers...."
 
384
echo
 
385
 
 
386
AC_HEADER_STDC
 
387
dnl> AC_HEADER_TIME
 
388
 
 
389
dnl> MANDATORY general purpose headers
 
390
AC_HAVE_HEADERS(pwd.h stdio.h errno.h stdlib.h unistd.h string.h signal.h fcntl.h dnl
 
391
                sys/types.h sys/time.h sys/wait.h sys/stat.h sys/ioctl sys/un.h)
 
392
 
 
393
dnl> OPTIONAL general purpose headers
 
394
AC_CHECK_HEADERS(sys/select.h sys/ldr.h sys/sockio.h dl.h dirent.h dlfcn.h)
 
395
 
 
396
dnl> OPTIONAL security headers
 
397
AC_CHECK_HEADERS(security/pam_appl.h shadow.h crypt.h)
 
398
 
 
399
dnl> OPTIONAL MySQL
 
400
if test ".$ac_disable_mysql" = ".no"; then
 
401
AC_CHECK_HEADERS(mysql/mysql.h, MORELIBS="$MORELIBS -L/usr/lib/mysql -lmysqlclient" && AC_DEFINE(HAVE_MYSQL))
 
402
fi
 
403
 
 
404
dnl> OPTIONAL curses headers
 
405
if test ".$ac_disable_curses" = ".no"; then
 
406
 
 
407
  if test -f "/usr/include/ncurses.h"; then
 
408
    echo "checking for ncurses.h... yes"
 
409
    AC_DEFINE(HAVE_NCURSES_H)
 
410
  else
 
411
    if test -f "/usr/include/curses.h"; then
 
412
      echo "checking for curses.h... yes"
 
413
      AC_DEFINE(HAVE_CURSES_H)
 
414
    else
 
415
      AC_MSG_WARN([It looks that you don't have (n)curses.h installed hence intop will *not* be built.])
 
416
     ac_disable_intop=yes
 
417
    fi
 
418
  fi
 
419
fi
 
420
 
 
421
dnl> OPTIONAL memory related headers
 
422
AC_CHECK_HEADERS(alloca.h)
 
423
 
 
424
dnl> OPTIONAL micro ntop
 
425
if test ".$ac_micro_ntop" = ".yes"; then
 
426
        AC_DEFINE(MICRO_NTOP)
 
427
fi
 
428
 
 
429
dnl> OPTIONAL thread headers
 
430
if test ".$ac_disable_multithread" = ".no"; then
 
431
  AC_CHECK_HEADERS(sched.h sys/sched.h semaphore.h pthread.h)
 
432
fi
 
433
 
 
434
dnl> MANDATORY universal headers for network programming code
 
435
AC_HAVE_HEADERS(sys/socket.h netdb.h netinet/in.h arpa/inet.h net/if.h)
 
436
AC_HAVE_HEADERS(netinet/in_systm.h netinet/ip.h netinet/ip_icmp.h netinet/udp.h netinet/tcp.h)
 
437
 
 
438
dnl> OPTIONAL headers for network programming headers
 
439
AC_CHECK_HEADERS(netinet/if_ether.h arpa/nameser.h net/ethernet.h ethertype.h if.h net/bpf.h)
 
440
 
 
441
AC_MSG_CHECKING(if ether_header uses ether_addr structs)
 
442
AC_CACHE_VAL(ac_cv_ether_header_has_ea,
 
443
    LBL_SAVE_CFLAGS="$CFLAGS"
 
444
    CFLAGS="$CFLAGS $V_INCLS"
 
445
    AC_TRY_COMPILE([
 
446
#       include <sys/types.h>
 
447
#       if __STDC__
 
448
        /* osf3 has REALLY good prototyes */
 
449
        struct mbuf;
 
450
        struct rtentry;
 
451
#       endif
 
452
#       include <sys/socket.h>
 
453
#       include <net/if.h>
 
454
#       include <netinet/in.h>
 
455
#       include <netinet/if_ether.h>],
 
456
        [u_int i =
 
457
             sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)],
 
458
        ac_cv_ether_header_has_ea=yes,
 
459
        ac_cv_ether_header_has_ea=no)
 
460
    CFLAGS="$LBL_SAVE_CFLAGS")
 
461
AC_MSG_RESULT($ac_cv_ether_header_has_ea)
 
462
if test $ac_cv_ether_header_has_ea = yes ; then
 
463
        AC_DEFINE(ETHER_HEADER_HAS_EA)
 
464
fi
 
465
 
 
466
dnl> OPTIONAL tcp wrapper headers
 
467
if test ".$ac_enable_tcpwrap" = ".yes"; then
 
468
 AC_CHECK_HEADERS(tcpd.h syslog.h)
 
469
fi
 
470
 
 
471
dnl> OPTIONAL UCD-SNMP
 
472
dnl> AC_HAVE_HEADERS(ucd-snmp/ucd-snmp-agent-includes.h)
 
473
 
 
474
 
 
475
dnl>
 
476
dnl> check whether we've to define essential typedefs
 
477
dnl> u_int32_t u_int16_t u_int8_t
 
478
dnl> int32_t   int16_t   int8_t
 
479
 
 
480
AC_CHECK_TYPEDEF(u_int32_t, sys/types.h)
 
481
AC_CHECK_TYPEDEF(u_int16_t, sys/types.h)
 
482
AC_CHECK_TYPEDEF(u_int8_t, sys/types.h)
 
483
AC_CHECK_TYPEDEF(int32_t, sys/types.h)
 
484
AC_CHECK_TYPEDEF(int16_t, sys/types.h)
 
485
AC_CHECK_TYPEDEF(int8_t, sys/types.h)
 
486
 
 
487
dnl>
 
488
dnl> check for reentrant library routines
 
489
dnl>
 
490
AC_CHECK_FUNCS(strtok_r)
 
491
AC_CHECK_FUNCS(localtime_r)
 
492
AC_CHECK_FUNCS(ctime_r)
 
493
AC_CHECK_FUNCS(snprintf)
 
494
AC_CHECK_FUNCS(getipnodebyaddr)
 
495
 
 
496
dnl> Check for additional functions
 
497
AC_CHECK_FUNCS(strsep)
 
498
 
 
499
echo
 
500
echo "Step 5. Looking for required system libraries...."
 
501
echo
 
502
 
 
503
 
 
504
dnl>
 
505
dnl> check for `dlopen' in -ldl (MANDATORY)
 
506
dnl>
 
507
AC_CHECK_LIB(dl, dlopen)
 
508
 
 
509
dnl>
 
510
dnl> check for `crypt' in -lcrypt (MANDATORY)
 
511
dnl>
 
512
AC_CHECK_FUNC(crypt, , AC_CHECK_LIB(c, crypt, ,
 
513
  [AC_CHECK_LIB(crypt, crypt, MORELIBS="$MORELIBS -lcrypt",
 
514
    AC_MSG_ERROR(you need the crypt library to build ntop), $MORELIBS)]))
 
515
 
 
516
AC_CHECK_LIB(kstat, kstat_lookup)
 
517
 
 
518
dnl>
 
519
dnl> GDChart uses functions from math library,
 
520
dnl> so make sure we link against the math library if needed
 
521
dnl>
 
522
dnl> check for `sin' in -lm (MANDATORY)
 
523
dnl>
 
524
if test ".$ac_disable_gdchart" = ".no"; then
 
525
AC_CHECK_LIB(c, sin,  AC_MSG_CHECKING([The standard C library includes the math lib]),
 
526
  AC_CHECK_LIB(m, sin, MORELIBS="$MORELIBS -lm", [
 
527
echo "ERROR: You need libm to build ntop with GDChart support. Verify that you have libm.a or libm.so installed.";
 
528
             AC_MSG_ERROR([Fatal: libm not found.])], $MORELIBS))
 
529
fi
 
530
 
 
531
 
 
532
dnl>
 
533
dnl> Networking libraries
 
534
dnl>
 
535
dnl> check for `gethostname' or `gethostbyname' in -lnsl
 
536
dnl> and then check for `accept' in -lsocket
 
537
dnl> and then check for `inet_aton' in -lresolv
 
538
dnl>
 
539
AC_CHECK_LIB(nsl, gethostname)
 
540
if test ".`echo $LIBS | grep nsl`" = .; then
 
541
    AC_CHECK_LIB(nsl, gethostbyname)
 
542
fi
 
543
AC_CHECK_LIB(socket, accept)
 
544
AC_CHECK_LIB(resolv, inet_aton)
 
545
 
 
546
dnl> both Solaris and AIX lack definition of `getdomainname'
 
547
case "$host" in
 
548
    *-sun-solaris2* )
 
549
        AC_DEFINE(NEED_GETDOMAINNAME)
 
550
        ;;
 
551
    *-ibm-aix4.[12].* )
 
552
        AC_DEFINE(NEED_GETDOMAINNAME)
 
553
        ;;
 
554
esac
 
555
 
 
556
dnl>
 
557
dnl> TCP Wrappers library
 
558
dnl> check for `request_init' in -lwrap
 
559
dnl>
 
560
if test ".$ac_enable_tcpwrap" = ".yes"; then
 
561
  AC_MSG_WARN([TCP Wrap support enabled, if available, via command line option!])
 
562
  AC_CHECK_LIB(wrap, request_init, MORELIBS="$MORELIBS -lwrap" && AC_DEFINE(HAVE_LIBWRAP))
 
563
fi
 
564
 
 
565
 
 
566
dnl>
 
567
dnl> (n)curses Library (optional)
 
568
dnl> check for `initscr' in -lncurses or in -lcurses
 
569
dnl>
 
570
dnl> Do not perform any check for the curses library,
 
571
dnl> if the user decided to compile without curses support.
 
572
dnl>
 
573
LIBCURSES=
 
574
if test ".$ac_disable_curses" = ".no"; then
 
575
  AC_CHECK_LIB(ncurses, initscr, LIBCURSES="-lncurses")
 
576
  if test ".`echo $LIBCURSES | grep curses`" = .; then
 
577
      AC_CHECK_LIB(curses, initscr, LIBCURSES="-lcurses", ac_disable_intop=yes)
 
578
  fi
 
579
else
 
580
  AC_MSG_WARN([Curses support disabled via command line option!])
 
581
 ac_disable_intop=yes
 
582
fi
 
583
 
 
584
 
 
585
dnl>
 
586
dnl> Thread Library (optional)
 
587
dnl> check for `pthread_create' in -lpthread
 
588
dnl>
 
589
dnl> Do not perform any check for the thread library,
 
590
dnl> if the user decided to compile without multithread support.
 
591
dnl>
 
592
if test ".$ac_disable_multithread" = ".no"; then
 
593
  AC_CHECK_LIB(pthread, pthread_create)
 
594
  if test ".`echo $LIBS | grep pthread`" != .; then
 
595
dnl>
 
596
dnl> check for `sem_init' in -lposix4
 
597
dnl>
 
598
     AC_CHECK_LIB(posix4, sem_init)
 
599
     AC_DEFINE(MULTITHREADED)
 
600
     AC_DEFINE(ASYNC_ADDRESS_RESOLUTION)
 
601
  else
 
602
 AC_CHECK_LIB(pthreads, pthread_create)
 
603
  if test ".`echo $LIBS | grep pthread`" != .; then
 
604
dnl>
 
605
dnl> check for `sem_init' in -lposix4
 
606
dnl>
 
607
     AC_CHECK_LIB(posix4, sem_init)
 
608
     AC_DEFINE(MULTITHREADED)
 
609
     AC_DEFINE(ASYNC_ADDRESS_RESOLUTION)
 
610
  else
 
611
     AC_CHECK_LIB(c_r, pthread_create)
 
612
     if test ".`echo $LIBS | grep c_r`" != .; then
 
613
     AC_DEFINE(MULTITHREADED)
 
614
     AC_DEFINE(ASYNC_ADDRESS_RESOLUTION)
 
615
    else
 
616
     multithread_mode=no
 
617
    fi
 
618
  fi
 
619
fi
 
620
else
 
621
  AC_MSG_WARN([Multithread support disabled via command line option!])
 
622
  multithread_mode=no
 
623
fi
 
624
 
 
625
dnl>
 
626
dnl> GNU ReadLine Library (optional)
 
627
dnl> check for `readline' in -lreadline
 
628
dnl>  AC_MSG_CHECKING([for GNU readline Library (optional package)])
 
629
dnl>
 
630
LIBREADLINE=
 
631
LIBTERMCAP=
 
632
if test ".$ac_disable_readline" = ".no"; then
 
633
 
 
634
dnl>
 
635
dnl> Make sure we link termcap with readline if we aren't already
 
636
dnl> linking curses or termcap
 
637
dnl>
 
638
  READLIBS=$LIBCURSES
 
639
  case "$LIBCURSES" in
 
640
    *termcap*|*curses*)
 
641
    ;;
 
642
    *)
 
643
    AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP="-ltermcap")
 
644
    READLIBS="$READLIBS $LIBTERMCAP"
 
645
    ;;
 
646
  esac
 
647
 
 
648
  AC_CHECK_HEADERS(readline/readline.h)
 
649
  AC_CHECK_LIB(readline, readline, LIBREADLINE="-lreadline", ,$READLIBS)
 
650
  if test "$LIBREADLINE" != "" ; then
 
651
    AC_DEFINE(HAVE_READLINE)
 
652
    LIBREADLINE="$LIBREADLINE $LIBTERMCAP"
 
653
  fi
 
654
fi
 
655
 
 
656
 
 
657
echo
 
658
echo "Step 6. Looking for required GPLed libraries...."
 
659
echo
 
660
 
 
661
dnl>
 
662
dnl> Packet Capture Library by Lawrence Berkeley National Laboratory - Network Research Group
 
663
dnl>
 
664
 
 
665
dnl> order as follow
 
666
dnl> 1. user defined libpcap development tree
 
667
dnl> 2. standard installation in /usr/lib and /usr/include respectively
 
668
dnl> 3. default package installation in /usr/local/lib and /usr/local/include respectively
 
669
dnl> 4. libpcap-0.4 development tree under the same ntop's root directory or in a subdir
 
670
 
 
671
AC_MSG_CHECKING([for LBL Packet Capture Library (required package)])
 
672
 
 
673
dnl>
 
674
dnl> user defined directory passed as option at configuration time
 
675
dnl>
 
676
if test ".${PCAP_ROOT}" != .; then
 
677
  if test -d $PCAP_ROOT &&
 
678
     test -r $PCAP_ROOT/libpcap.a &&
 
679
     test -r $PCAP_ROOT/pcap.h; then
 
680
       PCAP_ROOT=`cd ${PCAP_ROOT} && pwd`
 
681
       CORELIBS="${CORELIBS} -L$PCAP_ROOT -lpcap"
 
682
       INCS="${INCS} -I$PCAP_ROOT"
 
683
       AC_MSG_RESULT([found in $PCAP_ROOT])
 
684
  else
 
685
    AC_MSG_RESULT([not found in ${PCAP_ROOT}])
 
686
    AC_MSG_RESULT([             *** FATAL ERROR ***             ])
 
687
    AC_MSG_RESULT([ It looks that you don't have some files needed to use the pcap library.])
 
688
    AC_MSG_RESULT([ Please check the source tree, compile and, optionally, install the software.])
 
689
    AC_MSG_RESULT([ When finished please re-run this program.])
 
690
    AC_MSG_RESULT([ You can download the latest source tarball at http://www.tcpdump.org])
 
691
    AC_MSG_ERROR([ The LBL Packet Capture Library development tree seems corrupted or incomplete!])
 
692
  fi
 
693
dnl>
 
694
dnl> default installation as defined in latest available libpcap-0.4a6
 
695
dnl>
 
696
elif test -d /usr/local &&
 
697
     test -r /usr/local/lib/libpcap.a &&
 
698
     test -r /usr/local/include/pcap.h; then
 
699
       PCAP_ROOT="/usr/local"
 
700
       CORELIBS="${CORELIBS} -L$PCAP_ROOT/lib -lpcap"
 
701
       INCS="${INCS} -I$PCAP_ROOT/include"
 
702
       AC_MSG_RESULT([found in $PCAP_ROOT])
 
703
dnl>
 
704
dnl> installation used by most packagers
 
705
dnl>
 
706
elif test -r /usr/lib/libpcap.a &&
 
707
     test -r /usr/include/pcap.h; then
 
708
       PCAP_ROOT="standard installation"
 
709
       CORELIBS="${CORELIBS} -lpcap"
 
710
       AC_MSG_RESULT([found in $PCAP_ROOT])
 
711
dnl>
 
712
dnl> unusual and more complex installation used by some packagers
 
713
dnl> (e.g. Red Hat Linux)
 
714
dnl>
 
715
elif test -r /usr/lib/libpcap.a &&
 
716
     test -r /usr/include/pcap/pcap.h; then
 
717
       PCAP_ROOT="semi-standard installation"
 
718
       CORELIBS="${CORELIBS} -lpcap"
 
719
       INCS="${INCS} -I/usr/include/pcap"
 
720
       AC_MSG_RESULT([found in $PCAP_ROOT])
 
721
dnl>
 
722
dnl> on place source tree under the same ntop's root
 
723
dnl>
 
724
elif test -d ../libpcap-0.4 &&
 
725
     test -r ../libpcap-0.4/libpcap.a &&
 
726
     test -r ../libpcap-0.4/pcap.h; then
 
727
       PCAP_ROOT=`cd ../libpcap-0.4 && pwd`
 
728
       CORELIBS="${CORELIBS} -L$PCAP_ROOT -lpcap"
 
729
       INCS="${INCS} -I$PCAP_ROOT"
 
730
       AC_MSG_RESULT([found in $PCAP_ROOT])
 
731
dnl>
 
732
dnl> on place source tree under the same ntop's root
 
733
dnl>
 
734
elif test -d ../libpcap-0.4a6 &&
 
735
     test -r ../libpcap-0.4a6/libpcap.a &&
 
736
     test -r ../libpcap-0.4a6/pcap.h; then
 
737
       PCAP_ROOT=`cd ../libpcap-0.4a6 && pwd`
 
738
       CORELIBS="${CORELIBS} -L$PCAP_ROOT -lpcap"
 
739
       INCS="${INCS} -I$PCAP_ROOT"
 
740
       AC_MSG_RESULT([found in $PCAP_ROOT])
 
741
dnl>
 
742
dnl> on place source tree as ntop subdir
 
743
dnl>
 
744
elif test -d libpcap-0.4 &&
 
745
     test -r libpcap-0.4/libpcap.a &&
 
746
     test -r libpcap-0.4/pcap.h; then
 
747
       PCAP_ROOT=`cd libpcap-0.4 && pwd`
 
748
       CORELIBS="${CORELIBS} -L$PCAP_ROOT -lpcap"
 
749
       INCS="${INCS} -I$PCAP_ROOT"
 
750
       AC_MSG_RESULT([found in $PCAP_ROOT])
 
751
dnl>
 
752
dnl> on place source tree as ntop subdir
 
753
dnl>
 
754
elif test -d libpcap-0.4a6 &&
 
755
     test -r libpcap-0.4a6/libpcap.a &&
 
756
     test -r libpcap-0.4a6/pcap.h; then
 
757
       PCAP_ROOT=`cd libpcap-0.4a6 && pwd`
 
758
       CORELIBS="${CORELIBS} -L$PCAP_ROOT -lpcap"
 
759
       INCS="${INCS} -I$PCAP_ROOT"
 
760
       AC_MSG_RESULT([found in $PCAP_ROOT])
 
761
else
 
762
     AC_CHECK_LIB(pcap, pcap_lookupdev)
 
763
     if test "$ac_tr_lib" != "HAVE_LIBPCAP"; then
 
764
       AC_MSG_RESULT([not found!])
 
765
       AC_MSG_RESULT([             *** FATAL ERROR ***             ])
 
766
       AC_MSG_RESULT([ It looks that you don't have the libpcap distribution installed.])
 
767
       AC_MSG_RESULT([ Download, compile and, optionally, install it.])
 
768
       AC_MSG_RESULT([ When finished please re-run this program.])
 
769
       AC_MSG_RESULT([ You can download the latest source tarball at http://www.tcpdump.org/])
 
770
       AC_MSG_ERROR([ The LBL Packet Capture Library, libpcap, was not found! ])
 
771
     else
 
772
        if test -r /usr/include/pcap/pcap.h; then
 
773
               INCS="${INCS} -I/usr/include/pcap"
 
774
               PCAP_ROOT="standard installation"
 
775
        else
 
776
       AC_MSG_RESULT([             *** FATAL ERROR ***             ])
 
777
       AC_MSG_RESULT([ It looks that you don't have the libpcap distribution installed.])
 
778
       AC_MSG_RESULT([ Download, compile and, optionally, install it.])
 
779
       AC_MSG_RESULT([ When finished please re-run this program.])
 
780
       AC_MSG_RESULT([ You can download the latest source tarball at http://www.tcpdump.org/])
 
781
       AC_MSG_ERROR([ The LBL Packet Capture Library, libpcap, was not found! ])
 
782
        fi
 
783
     fi
 
784
fi
 
785
 
 
786
dnl>
 
787
dnl> If your gdbm header file and library are installed somewhere strange
 
788
dnl>
 
789
 
 
790
dnl>
 
791
dnl> The GNU database manager gdbm (MANDATORY)
 
792
dnl> check for `gdbm_open' in -lgdbm
 
793
dnl>
 
794
dnl> order as follow
 
795
dnl> 1. user defined gdbm development tree
 
796
dnl> 2. standard installation in /usr/lib and /usr/include respectively
 
797
dnl> 3. default package installation in /usr/local/lib and /usr/local/include respectively
 
798
dnl> 4. gdbm development tree under the same ntop's root source directory or in a subdir
 
799
 
 
800
if test ".${GDBM_ROOT}" != .; then
 
801
  AC_MSG_CHECKING([for the GNU Database Manager Library gdbm (required package)])
 
802
  if test -d $GDBM_ROOT &&
 
803
     test -r $GDBM_ROOT/libgdbm.a &&
 
804
     test -r $GDBM_ROOT/gdbm.h; then
 
805
       GDBM_ROOT=`cd ${GDBM_ROOT} && pwd`
 
806
       CORELIBS="${CORELIBS} -L$GDBM_ROOT -lgdbm"
 
807
       INCS="${INCS} -I$GDBM_ROOT"
 
808
       AC_DEFINE(HAVE_GDBM_H)
 
809
       AC_MSG_RESULT([found in $GDBM_ROOT])
 
810
  else
 
811
    AC_MSG_RESULT([not found in ${GDBM_ROOT}])
 
812
    AC_MSG_RESULT([             *** FATAL ERROR ***             ])
 
813
    AC_MSG_RESULT([ It looks that you don't have some files needed to use the gdbm library.])
 
814
    AC_MSG_RESULT([ Please check the source tree, compile and, optionally, install the software.])
 
815
    AC_MSG_RESULT([ When finished please re-run this program.])
 
816
    AC_MSG_RESULT([ You can download the latest source tarball at http://www.gnu.org/software/gdbm/gdbm.html])
 
817
    AC_MSG_ERROR([ The GNU Gdbm Library development tree seems corrupted or incomplete!])
 
818
  fi
 
819
else
 
820
  AC_HAVE_HEADERS(gdbm.h)
 
821
  AC_CHECK_LIB(gdbm, gdbm_open, CORELIBS="$CORELIBS -lgdbm")
 
822
fi
 
823
 
 
824
 
 
825
if test ".`echo $CORELIBS | grep gdbm`" = .; then
 
826
  if test -d /usr/local &&
 
827
     test -r /usr/local/lib/libgdbm.a &&
 
828
     test -r /usr/local/include/gdbm.h; then
 
829
       GDBM_ROOT="/usr/local"
 
830
       CORELIBS="${CORELIBS} -L$GDBM_ROOT/lib -lgdbm"
 
831
       INCS="${INCS} -I$GDBM_ROOT/include"
 
832
       AC_DEFINE(HAVE_GDBM_H)
 
833
       AC_MSG_RESULT([found in $GDBM_ROOT])
 
834
  elif test -r /usr/lib/libgdbm.a &&
 
835
       test -r /usr/include/gdbm.h; then
 
836
         GDBM_ROOT="/usr"
 
837
         CORELIBS="${CORELIBS} -lgdbm"
 
838
         AC_DEFINE(HAVE_GDBM_H)
 
839
         AC_MSG_RESULT([found in $GDBM_ROOT])
 
840
  else
 
841
       AC_CHECK_LIB(gdbm, gdbm_close)
 
842
       if test "$ac_tr_lib" != "HAVE_LIBGDBM"; then
 
843
         AC_MSG_RESULT([             *** FATAL ERROR ***             ])
 
844
         AC_MSG_RESULT([ It looks that you don't have the libgdbm distribution installed.])
 
845
         AC_MSG_RESULT([ Download, compile and, optionally, install it.])
 
846
         AC_MSG_RESULT([ When finished please re-run this program.])
 
847
         AC_MSG_RESULT([ You can download the latest source tarball at http://www.gnu.org/software/gdbm/gdbm.html])
 
848
         AC_MSG_ERROR([ The GNU Gdbm Library development tree seems corrupted or incomplete!])
 
849
       else
 
850
         GDBM_ROOT="standard installation"
 
851
       fi
 
852
  fi
 
853
fi
 
854
 
 
855
dnl>
 
856
dnl> check for installed optional libraries
 
857
dnl>
 
858
 
 
859
echo
 
860
echo "Step 7. Looking for optional GPLed libraries...."
 
861
echo
 
862
 
 
863
AC_CHECK_LIB(c, re_search, AC_DEFINE(HAVE_REGEX))
 
864
 
 
865
dnl>
 
866
dnl> check for `gdchart' library by Bruce Verderaime [http://www.fred.net/brv/chart/]
 
867
dnl> By default the configuration script will try to link against GDChart library.
 
868
dnl> It looks if the the GDChart source code is available at the parent directory
 
869
dnl>
 
870
if test ".$ac_disable_gdchart" = ".no"; then
 
871
  AC_MSG_CHECKING([for GDchart (optional package)])
 
872
 
 
873
dnl>
 
874
dnl> user defined directory passed as option at configuration time
 
875
dnl>
 
876
  if test ".${GDCHART_ROOT}" != .; then
 
877
    if test -d $GDCHART_ROOT &&
 
878
       test -r $GDCHART_ROOT/libgdchart.a &&
 
879
       test -r $GDCHART_ROOT/gdc.h &&
 
880
       test -r $GDCHART_ROOT/gd-1.8.3/libgd.a &&
 
881
       test -r $GDCHART_ROOT/gd-1.8.3/gd.h &&
 
882
       test -r $GDCHART_ROOT/zlib-1.1.3/libz.a; then
 
883
         GDCHART_ROOT=`cd ${GDCHART_ROOT} && pwd`
 
884
         MORELIBS="${MORELIBS} -L$GDCHART_ROOT -lgdchart -L$GDCHART_ROOT/gd-1.8.3 -lgd -L$GDCHART_ROOT/gd-1.8.3/libpng-1.0.8 -lpng -L$GDCHART_ROOT/zlib-1.1.3 -lz"
 
885
         INCS="${INCS} -I$GDCHART_ROOT"
 
886
         AC_DEFINE(HAVE_GDCHART)
 
887
         AC_MSG_RESULT([found in $GDCHART_ROOT])
 
888
    else
 
889
      AC_MSG_RESULT([not found in ${GDCHART_ROOT}])
 
890
      AC_MSG_RESULT([ It looks that you don't have some files needed to use the GDChart library.])
 
891
      AC_MSG_RESULT([ Please check the source tree, compile and, optionally, install the software.])
 
892
      AC_MSG_RESULT([ When finished please re-run this program.])
 
893
      AC_MSG_RESULT([ You can download the needed code using CVS from cvs.ntop.org ])
 
894
      AC_MSG_WARN([ Some ntop's features will be disabled.])
 
895
    fi
 
896
dnl>
 
897
dnl> on place source tree under the same ntop's parent directory
 
898
dnl>
 
899
  else
 
900
    if test -d ../gdchart0.94c &&
 
901
       test -r ../gdchart0.94c/gdc.h &&
 
902
       test -r ../gdchart0.94c/libgdchart.a &&
 
903
       test -r ../gdchart0.94c/gd-1.8.3/libgd.a &&
 
904
       test -r ../gdchart0.94c/gd-1.8.3/gd.h &&
 
905
       test -r ../gdchart0.94c/gd-1.8.3/libpng-1.0.8/libpng.a &&
 
906
       test -r ../gdchart0.94c/gd-1.8.3/libpng-1.0.8/gd.h; then
 
907
         GDCHART_ROOT="../gdchart0.94c"
 
908
         GDCHART_ROOT=`cd ${GDCHART_ROOT} && pwd`
 
909
         MORELIBS="${MORELIBS} -L$GDCHART_ROOT -lgdchart -L$GDCHART_ROOT/gd-1.8.3 -lgd -L$GDCHART_ROOT/gd-1.8.3/libpng-1.0.8 -lpng"
 
910
         INCS="${INCS} -I$GDCHART_ROOT"
 
911
         AC_DEFINE(HAVE_GDCHART)
 
912
         AC_MSG_RESULT([found in $GDCHART_ROOT])
 
913
    else
 
914
         AC_MSG_RESULT([not found])
 
915
    fi
 
916
  fi
 
917
else
 
918
  AC_MSG_WARN([GDchart support disabled via command line option!])
 
919
fi
 
920
 
 
921
 
 
922
 
 
923
dnl>
 
924
dnl> OpenSSL by Open SLL Project
 
925
dnl>
 
926
dnl> order as follow
 
927
dnl> 1. user defined openssl development tree
 
928
dnl> 2. standard installation in /usr/lib and /usr/include respectively
 
929
dnl> 3. default package installation in /usr/local/lib and /usr/local/include respectively
 
930
dnl> 4. openssl development tree under the same ntop's root source directory or in a subdir
 
931
 
 
932
dnl>
 
933
dnl> Do not perform any check for the OpenSSL library,
 
934
dnl> if the user decided to compile without HTTPS support.
 
935
dnl>
 
936
if test ".$ac_disable_openssl" = ".no"; then
 
937
  AC_MSG_CHECKING([for OpenSSL Library by Open SLL Project (optional package)])
 
938
  if test ".${OSSL_ROOT}" != .; then
 
939
    if test -d $OSSL_ROOT &&
 
940
       test -r $OSSL_ROOT/libssl.a &&
 
941
       test -r $OSSL_ROOT/openssl/ssl.h; then
 
942
         OSSL_ROOT=`cd ${OSSL_ROOT} && pwd`
 
943
         MORELIBS="${MORELIBS} -L$OSSL_ROOT -lssl"
 
944
         INCS="${INCS} -I$OSSL_ROOT"
 
945
         AC_DEFINE(HAVE_OPENSSL)
 
946
         AC_MSG_RESULT([found in $OSSL_ROOT])
 
947
    elif test -d $OSSL_ROOT &&
 
948
       test -r $OSSL_ROOT/libssl.a &&
 
949
       test -r $OSSL_ROOT/include/openssl/ssl.h; then
 
950
         OSSL_ROOT=`cd ${OSSL_ROOT} && pwd`
 
951
         MORELIBS="${MORELIBS} -L$OSSL_ROOT/crypto -lssl"
 
952
         INCS="${INCS} -I$OSSL_ROOT/include"
 
953
         AC_DEFINE(HAVE_OPENSSL)
 
954
         AC_MSG_RESULT([found in $OSSL_ROOT])
 
955
    else
 
956
      AC_MSG_RESULT([not found in ${OSSL_ROOT}])
 
957
      AC_MSG_WARN([ The Open SSL Library development tree seems corrupted or incomplete!])
 
958
      AC_MSG_RESULT([ It looks that you don't have some files needed to use the Open SSL library.])
 
959
      AC_MSG_RESULT([ Please check the source tree, compile and, optionally, install the software.])
 
960
      AC_MSG_RESULT([ When finished please re-run this program.])
 
961
      AC_MSG_WARN([ You can download the latest source tarball at http://www.openssl.org/])
 
962
      AC_MSG_WARN([ HTTPS disabled!])
 
963
    fi
 
964
  elif test -d /usr/local/ssl &&
 
965
       test -r /usr/local/ssl/lib/libssl.a &&
 
966
       test -r /usr/local/ssl/lib/libcrypto.a &&
 
967
       test -r /usr/local/ssl/include/openssl/ssl.h; then
 
968
         OSSL_ROOT="/usr/local/ssl"
 
969
         MORELIBS="${MORELIBS} -L$OSSL_ROOT/lib -lssl -lcrypto"
 
970
         INCS="${INCS} -I$OSSL_ROOT/include"
 
971
         AC_DEFINE(HAVE_OPENSSL)
 
972
         AC_MSG_RESULT([found in $OSSL_ROOT])
 
973
  elif test -r /usr/lib/ssl/libssl.a &&
 
974
       test -r /usr/include/ssl/ssl.h; then
 
975
         OSSL_ROOT="/usr/lib/ssl"
 
976
         MORELIBS="${MORELIBS} -lssl -lcrypto"
 
977
         INCS="${INCS} -I/usr/include/ssl"
 
978
         AC_DEFINE(HAVE_OPENSSL)
 
979
         AC_MSG_RESULT([found in $OSSL_ROOT])
 
980
  elif test -r /usr/lib/libssl.a &&
 
981
       test -r /usr/include/openssl/ssl.h; then
 
982
         OSSL_ROOT="/usr/lib/"
 
983
         MORELIBS="${MORELIBS} -lssl -lcrypto"
 
984
         INCS="${INCS} -I/usr/include/openssl"
 
985
         AC_DEFINE(HAVE_OPENSSL)
 
986
         AC_MSG_RESULT([found in $OSSL_ROOT])
 
987
  elif test -d ../openssl-0.9.4 &&
 
988
       test -r ../openssl-0.9.4/libssl.a &&
 
989
       test -r ../openssl-0.9.4/libcrypto.a &&
 
990
       test -r ../openssl-0.9.4/openssl/ssl/ssl.h; then
 
991
         OSSL_ROOT="../openssl-0.9.4"
 
992
         OSSL_ROOT=`cd ${OSSL_ROOT} && pwd`
 
993
         MORELIBS="${MORELIBS} -L$OSSL_ROOT -lssl -lcrypto"
 
994
         INCS="${INCS} -I$OSSL_ROOT/ssl"
 
995
         AC_DEFINE(HAVE_OPENSSL)
 
996
         AC_MSG_RESULT([found in $OSSL_ROOT])
 
997
  elif test -d openssl-0.9.4 &&
 
998
       test -r openssl-0.9.4/libssl.a &&
 
999
       test -r openssl-0.9.4/openssl/ssl/ssl.h; then
 
1000
         OSSL_ROOT="openssl-0.9.4"
 
1001
         OSSL_ROOT=`cd ${OSSL_ROOT} && pwd`
 
1002
         MORELIBS="${MORELIBS} -L$OSSL_ROOT -lssl -lcrypto"
 
1003
         INCS="${INCS} -I$OSSL_ROOT/ssl"
 
1004
         AC_DEFINE(HAVE_OPENSSL)
 
1005
         AC_MSG_RESULT([found in $OSSL_ROOT])
 
1006
  else
 
1007
      AC_MSG_RESULT([not found!])
 
1008
      AC_MSG_WARN([ The Open SSL Library development tree seems corrupted or incomplete!])
 
1009
      AC_MSG_RESULT([ Download, compile and, optionally, install it.])
 
1010
      AC_MSG_RESULT([ When finished please re-run this program.])
 
1011
      AC_MSG_WARN([ You can download the latest source tarball at http://www.openssl.org/])
 
1012
      AC_MSG_WARN([ HTTPS disabled!])
 
1013
  fi
 
1014
else
 
1015
  AC_MSG_WARN([HTTPS support disabled via command line option!])
 
1016
fi
 
1017
 
 
1018
dnl>
 
1019
dnl> check for `UCD-SNMP' library by University of California [http://ucd-snmp.ucdavis.edu]
 
1020
dnl>
 
1021
dnl>AC_CHECK_LIB(ucdagent, register_mib, [AC_DEFINE(HAVE_SNMP) SNMPLIBS="-lsnmp -lucdagent -lucdmibs"], , -lsnmp -lucdagent -lucdmibs $LIBS $MORELIBS)
 
1022
 
 
1023
 
 
1024
echo
 
1025
echo "Step 8. Creating various ntop develpment tools...."
 
1026
echo
 
1027
 
 
1028
dnl>
 
1029
dnl> Do not walk in the plugins/ subdir if the user decided he/she does not need any plugin.
 
1030
dnl>
 
1031
if test "$ac_disable_plugins" = yes; then
 
1032
  PLUGINS=''
 
1033
  AC_MSG_WARN([compilation of ntop's plugins disabled via command line option!])
 
1034
fi
 
1035
 
 
1036
 
 
1037
 
 
1038
echo
 
1039
echo "Step 9. Semi-Automatic files generation...."
 
1040
echo
 
1041
 
 
1042
AC_SUBST(VERSION)
 
1043
 
 
1044
AC_SUBST(LIBCURSES)
 
1045
AC_SUBST(LIBREADLINE)
 
1046
AC_SUBST(SNMPLIBS)
 
1047
 
 
1048
AC_SUBST(INCS)
 
1049
AC_SUBST(LIBS)
 
1050
AC_SUBST(MORELIBS)
 
1051
AC_SUBST(CFLAGS)
 
1052
AC_SUBST(LDFLAGS)
 
1053
AC_SUBST(DYN_FLAGS)
 
1054
AC_SUBST(CCLD)
 
1055
 
 
1056
AC_SUBST(CORELIBS)
 
1057
AC_SUBST(MOREOBJECTS)
 
1058
AC_SUBST(SNMPLIBS)
 
1059
 
 
1060
AC_SUBST(MORESOURCES)
 
1061
AC_SUBST(MORELIBS)
 
1062
 
 
1063
if test ".$ac_disable_intop" = ".yes"; then
 
1064
INTOP=
 
1065
fi
 
1066
 
 
1067
AC_SUBST(INTOP)
 
1068
AC_SUBST(PLUGINS)
 
1069
 
 
1070
dnl>
 
1071
dnl> ntops directories
 
1072
dnl>
 
1073
DATAFILE_DIR=$datadir/ntop
 
1074
DATAFILE_DIR=`(
 
1075
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
1076
    eval echo "$DATAFILE_DIR"
 
1077
)`
 
1078
AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR", [Data file directory])
 
1079
AC_SUBST(DATAFILE_DIR)
 
1080
 
 
1081
CONFIGFILE_DIR=$sysconfdir/ntop
 
1082
CONFIGFILE_DIR=`(
 
1083
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
1084
    eval echo "$CONFIGFILE_DIR"
 
1085
)`
 
1086
AC_DEFINE_UNQUOTED(CONFIGFILE_DIR,"$CONFIGFILE_DIR", [Configuration file directory])
 
1087
AC_SUBST(CONFIGFILE_DIR)
 
1088
 
 
1089
RUN_DIR=$localstatedir/ntop
 
1090
RUN_DIR=`(
 
1091
    test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
1092
    eval echo "$RUN_DIR"
 
1093
)`
 
1094
AC_DEFINE_UNQUOTED(RUN_DIR,"$RUN_DIR", [Run files directory])
 
1095
AC_SUBST(RUN_DIR)
 
1096
 
 
1097
PLUGIN_DIR=$libdir/ntop/plugins
 
1098
PLUGIN_DIR=`(
 
1099
  test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
1100
  test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
 
1101
  eval echo "$PLUGIN_DIR"
 
1102
)`
 
1103
AC_DEFINE_UNQUOTED(PLUGIN_DIR,"$PLUGIN_DIR", [Plugin installation directory])
 
1104
AC_SUBST(PLUGIN_DIR)
 
1105
 
 
1106
DBFILE_DIR=$localstatedir/ntop
 
1107
DBFILE_DIR=`(
 
1108
  test "x$prefix" = xNONE && prefix=$ac_default_prefix
 
1109
  eval echo "$DBFILE_DIR"
 
1110
)`
 
1111
AC_DEFINE_UNQUOTED(DBFILE_DIR,"$DBFILE_DIR", [Database file directory])
 
1112
AC_SUBST(DBFILE_DIR)
 
1113
 
 
1114
dnl> temporary
 
1115
AC_DEFINE_UNQUOTED(RETSIGTYPE, void)
 
1116
 
 
1117
AC_OUTPUT([
 
1118
Makefile
 
1119
plugins/Makefile
 
1120
plugins/pep/Makefile
 
1121
intop/Makefile
 
1122
ntop-config
 
1123
], [
 
1124
case "$CONFIG_FILES" in
 
1125
 *ntop-config*)
 
1126
    chmod +x ntop-config
 
1127
    ;;
 
1128
esac])
 
1129
 
 
1130
dnl>
 
1131
dnl> versioning
 
1132
dnl>
 
1133
echo "creating version.c"
 
1134
/bin/rm -f version.c
 
1135
echo $VERSION  | sed -e 's/.*/char * version   = "&";/' > version.c
 
1136
./config.guess | sed -e 's/.*/char * osName    = "&";/' >> version.c
 
1137
echo "char * author    = \"Luca Deri <deri@ntop.org>\";" >> version.c
 
1138
date +"%D %r" | sed -e 's/.*/char * buildDate = "&";/' >> version.c
 
1139
 
 
1140
echo "
 
1141
 
 
1142
This is your $PACKAGE $VERSION configuration:
 
1143
 
 
1144
Host System Type  : ${host}
 
1145
Compiler (cflags) : ${CC} ${CFLAGS} ${DEFS}
 
1146
Include path      : ${INCS}
 
1147
System Libs       : ${LDFLAGS} ${LIBS}
 
1148
Core Libs         : ${CORELIBS}
 
1149
Additional Libs   : ${MORELIBS} ${SNMPLIBS}
 
1150
LBL pcap in       : ${PCAP_ROOT}
 
1151
GNU gdbm in       : ${GDBM_ROOT}
 
1152
MultiThread mode  : ${multithread_mode}
 
1153
Install path      : ${prefix}
 
1154
 
 
1155
Now type 'make' or 'gmake' (GNU make) on *BSD and Solaris
 
1156
systems to build $PACKAGE $VERSION.
 
1157
"
 
1158
 
 
1159
echo
 
1160
echo
 
1161
echo "================================================="
 
1162
echo
 
1163
echo "If you like ntop, please do not forget to support"
 
1164
echo "its development. See SUPPORT_NTOP.txt for more"
 
1165
echo "information. Thanks for supporting ntop!"
 
1166
echo
 
1167
echo "================================================="
 
1168
echo
 
1169
 
 
1170
 
 
1171
exit 0