2
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3
dnl> this file is processed via 'autoconf' to produce the 'configure' script
4
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
6
dnl> Copyright (c) 1998 - 2000 Luca Deri <deri@ntop.org>
7
dnl> Updated 1Q 2000 Rocco Carbone <rocco@ntop.org>
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.
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.
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.
27
dnl> standard Autoconf prolog
34
dnl> version and name of the game
41
NTOP_VERSION=$NTOP_MAJOR_VERSION.$NTOP_MINOR_VERSION.$NTOP_MICRO_VERSION
44
dnl> standard libtool versioning
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`
51
NTOP_VERSION_INFO=$LT_CURRENT:$LT_REVISION:$LT_AGE
52
NTOP_RELEASE=$LT_RELEASE
54
AC_SUBST(NTOP_VERSION_INFO)
55
AC_SUBST(SO_VERSION_PATCH)
56
AC_SUBST(NTOP_RELEASE)
64
echo "Welcome to $PACKAGE, Version $VERSION"
65
echo "[Copyright (c) 1998-2001 Luca Deri <deri@ntop.org>]"
69
dnl> variables for autoconf
73
dnl> By default ntop is compiled with MySQL support (if any)
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
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.
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
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.
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.
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.
109
ac_disable_plugins=no
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.
118
dnl> *** ToBeRocked ***
119
dnl> user customizable section
124
dnl> look for an unique ntop's source file in the distribution
125
dnl> and perform initialization steps, such as loading the cache
131
dnl> canonicalize the host, target, and build system types
137
dnl> perform program name transformation
142
dnl> initialize the macro package
143
dnl> and check for working GNU auto``stuff''
145
AM_INIT_AUTOMAKE(ntop, $VERSION, lderi)
149
dnl> initialize the libtool macro package to
150
dnl> automatically include dependencies of:
151
dnl> ranlib, ar, gcc, cc, ld, nm, ln
155
dnl> checks for UNIX variants
157
dnl> quoted from a public mailing list
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."
168
dnl> Michael Jennings <mej@eterm.org> http://www.eterm.org
169
dnl> Software Engineer, VA Linux Systems Author, Eterm (www.eterm.org)
173
dnl> AIX is ___really___ incompatible with libtooland shared libraries, so....
174
dnl> disable the shared flag to no
188
dnl> checks for required development tools
192
echo "Step 1. Looking for required development tools...."
198
dnl> set default loader
207
dnl> you can also check for debugging and optimization
213
dnl> set reasonable defaults here
215
DEFS="-DHAVE_CONFIG_H"
221
dnl> force configure to use current directory
226
dnl> make NTOPDIR the default for the installation
228
AC_PREFIX_DEFAULT(${NTOPDIR:-/usr/local})
232
dnl> generate the config header
235
AM_CONFIG_HEADER(config.h)
239
dnl> Yup! Avoid to initialize maintainer mode.
240
dnl> This is a pain if you have SUBDIRS.
242
dnl> AM_MAINTAINER_MODE
246
echo "Step 2. Processing user options...."
249
AC_ARG_WITH(void, [ +----------------------------------------------------------------------------+])
251
AC_ARG_WITH(pcap-root, [ --with-pcap-root=DIR LBNL pcap source tree located in DIR], PCAP_ROOT="$withval", PCAP_ROOT=)
253
AC_ARG_WITH(gdbm-root, [ --with-gdbm-root=DIR GNU gdbm source tree located in DIR], GDBM_ROOT="$withval", GDBM_ROOT=)
255
AC_ARG_WITH(ossl-root, [ --with-ossl-root=DIR OpenSSL source tree located in DIR], OSSL_ROOT="$withval", OSSL_ROOT=)
257
AC_ARG_WITH(gdchart-root, [ --with-gdchart-root=DIR GDChart source tree located in DIR], GDCHART_ROOT="$withval", GDCHART_ROOT="../gdchart0.94c")
259
AC_ARG_WITH(void, [ +----------------------------------------------------------------------------+])
262
dnl> Give the user an option to compile a micro version of ntop
263
dnl> for embedded systems
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")
268
dnl> Give the user an option to compile without multithread support,
269
dnl> for example to start a debugging session.
271
AC_ARG_ENABLE(mt, [ --disable-mt disable multithread support also if available [default=no]], ac_disable_multithread="yes", ac_disable_multithread="no")
275
dnl> Give the user an option to compile without MySQL support
277
AC_ARG_ENABLE(mysql, [ --disable-mysql disable MySQL support also if available [default=no]], ac_disable_mysql="yes", ac_disable_mysql="no")
280
dnl> Give the user an option to compile without the HTTPS support provided by OpenSSL.
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")
285
dnl> Give the user an option to compile without the GNU readline support.
287
AC_ARG_ENABLE(readline, [ --disable-readline disable GNU readline support also if available [default=no]], ac_disable_readline="yes", ac_disable_readline="no")
290
dnl> Give the user an option to compile without the curses support.
292
AC_ARG_ENABLE(curses, [ --disable-curses disable curses support also if available [default=no]], ac_disable_curses="yes", ac_disable_curses="no")
295
dnl> Give the user an option to compile without the GDChart support.
297
AC_ARG_ENABLE(gdchart, [ --disable-gdchart disable GDChart support also if available [default=no]], ac_disable_gdchart="yes", ac_disable_gdchart="no")
300
dnl> Give the user an option to compile with the TCP Wrapper support.
302
AC_ARG_ENABLE(tcpwrap, [ --enable-tcpwrap enable TCP Wrap support if available [default=no]], ac_enable_tcpwrap="yes")
304
AC_ARG_WITH(void, [ +----------------------------------------------------------------------------+])
307
dnl> Give the user an option to avoid to compile all the plugins.
309
AC_ARG_ENABLE(plugins, [ --disable-plugins disable compilation of plugins, also if they are available [default=no]], ac_disable_plugins="yes")
312
dnl> Give the user an option to avoid to compile the interactive version.
314
AC_ARG_ENABLE(intop, [ --disable-intop disable compilation of intop [default=no]], ac_disable_intop="yes")
319
dnl> checks for special support for platform/compiler
320
dnl> $CC, $CFLAGS, $LDFLAGS and $LIBS are my friends
324
echo "Step 3. Checking for special support for platform/compiler...."
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.
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.
341
GCCLIB=`gcc -print-libgcc-file-name`
343
LIBS="-L. -lgcc ${LIBS}"
345
dnl> To link against the getmsg system call you must import the /lib/pse.exp
346
CCLD="cc -bI:/lib/pse.exp"
351
echo "Oh no! *cough* AIX *cough* without GCC! Me poor!"
353
# To link against the getmsg system call you must import the /lib/pse.exp
355
dnl> LDFLAGS="-bI:/lib/pse.exp $LDFLAGS"
358
*-sun-solaris2.5.1:* )
359
AC_DEFINE(NEED_INET_ATON)
363
SO_VERSION_PATCH=.0.0
367
CFLAGS="-no-cpp-precomp -DDARWIN $CFLAGS"
368
DYN_FLAGS="-bundle -flat_namespace -undefined suppress $DYN_FLAGS"
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"
379
dnl> checks for system header files
383
echo "Step 4. Looking for both required and optional system headers...."
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)
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)
396
dnl> OPTIONAL security headers
397
AC_CHECK_HEADERS(security/pam_appl.h shadow.h crypt.h)
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))
404
dnl> OPTIONAL curses headers
405
if test ".$ac_disable_curses" = ".no"; then
407
if test -f "/usr/include/ncurses.h"; then
408
echo "checking for ncurses.h... yes"
409
AC_DEFINE(HAVE_NCURSES_H)
411
if test -f "/usr/include/curses.h"; then
412
echo "checking for curses.h... yes"
413
AC_DEFINE(HAVE_CURSES_H)
415
AC_MSG_WARN([It looks that you don't have (n)curses.h installed hence intop will *not* be built.])
421
dnl> OPTIONAL memory related headers
422
AC_CHECK_HEADERS(alloca.h)
424
dnl> OPTIONAL micro ntop
425
if test ".$ac_micro_ntop" = ".yes"; then
426
AC_DEFINE(MICRO_NTOP)
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)
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)
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)
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"
446
# include <sys/types.h>
448
/* osf3 has REALLY good prototyes */
452
# include <sys/socket.h>
454
# include <netinet/in.h>
455
# include <netinet/if_ether.h>],
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)
466
dnl> OPTIONAL tcp wrapper headers
467
if test ".$ac_enable_tcpwrap" = ".yes"; then
468
AC_CHECK_HEADERS(tcpd.h syslog.h)
471
dnl> OPTIONAL UCD-SNMP
472
dnl> AC_HAVE_HEADERS(ucd-snmp/ucd-snmp-agent-includes.h)
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
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)
488
dnl> check for reentrant library routines
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)
496
dnl> Check for additional functions
497
AC_CHECK_FUNCS(strsep)
500
echo "Step 5. Looking for required system libraries...."
505
dnl> check for `dlopen' in -ldl (MANDATORY)
507
AC_CHECK_LIB(dl, dlopen)
510
dnl> check for `crypt' in -lcrypt (MANDATORY)
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)]))
516
AC_CHECK_LIB(kstat, kstat_lookup)
519
dnl> GDChart uses functions from math library,
520
dnl> so make sure we link against the math library if needed
522
dnl> check for `sin' in -lm (MANDATORY)
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))
533
dnl> Networking libraries
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
539
AC_CHECK_LIB(nsl, gethostname)
540
if test ".`echo $LIBS | grep nsl`" = .; then
541
AC_CHECK_LIB(nsl, gethostbyname)
543
AC_CHECK_LIB(socket, accept)
544
AC_CHECK_LIB(resolv, inet_aton)
546
dnl> both Solaris and AIX lack definition of `getdomainname'
549
AC_DEFINE(NEED_GETDOMAINNAME)
552
AC_DEFINE(NEED_GETDOMAINNAME)
557
dnl> TCP Wrappers library
558
dnl> check for `request_init' in -lwrap
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))
567
dnl> (n)curses Library (optional)
568
dnl> check for `initscr' in -lncurses or in -lcurses
570
dnl> Do not perform any check for the curses library,
571
dnl> if the user decided to compile without curses support.
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)
580
AC_MSG_WARN([Curses support disabled via command line option!])
586
dnl> Thread Library (optional)
587
dnl> check for `pthread_create' in -lpthread
589
dnl> Do not perform any check for the thread library,
590
dnl> if the user decided to compile without multithread support.
592
if test ".$ac_disable_multithread" = ".no"; then
593
AC_CHECK_LIB(pthread, pthread_create)
594
if test ".`echo $LIBS | grep pthread`" != .; then
596
dnl> check for `sem_init' in -lposix4
598
AC_CHECK_LIB(posix4, sem_init)
599
AC_DEFINE(MULTITHREADED)
600
AC_DEFINE(ASYNC_ADDRESS_RESOLUTION)
602
AC_CHECK_LIB(pthreads, pthread_create)
603
if test ".`echo $LIBS | grep pthread`" != .; then
605
dnl> check for `sem_init' in -lposix4
607
AC_CHECK_LIB(posix4, sem_init)
608
AC_DEFINE(MULTITHREADED)
609
AC_DEFINE(ASYNC_ADDRESS_RESOLUTION)
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)
621
AC_MSG_WARN([Multithread support disabled via command line option!])
626
dnl> GNU ReadLine Library (optional)
627
dnl> check for `readline' in -lreadline
628
dnl> AC_MSG_CHECKING([for GNU readline Library (optional package)])
632
if test ".$ac_disable_readline" = ".no"; then
635
dnl> Make sure we link termcap with readline if we aren't already
636
dnl> linking curses or termcap
643
AC_CHECK_LIB(termcap, tgetent, LIBTERMCAP="-ltermcap")
644
READLIBS="$READLIBS $LIBTERMCAP"
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"
658
echo "Step 6. Looking for required GPLed libraries...."
662
dnl> Packet Capture Library by Lawrence Berkeley National Laboratory - Network Research Group
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
671
AC_MSG_CHECKING([for LBL Packet Capture Library (required package)])
674
dnl> user defined directory passed as option at configuration time
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])
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!])
694
dnl> default installation as defined in latest available libpcap-0.4a6
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])
704
dnl> installation used by most packagers
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])
712
dnl> unusual and more complex installation used by some packagers
713
dnl> (e.g. Red Hat Linux)
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])
722
dnl> on place source tree under the same ntop's root
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])
732
dnl> on place source tree under the same ntop's root
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])
742
dnl> on place source tree as ntop subdir
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])
752
dnl> on place source tree as ntop subdir
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])
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! ])
772
if test -r /usr/include/pcap/pcap.h; then
773
INCS="${INCS} -I/usr/include/pcap"
774
PCAP_ROOT="standard installation"
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! ])
787
dnl> If your gdbm header file and library are installed somewhere strange
791
dnl> The GNU database manager gdbm (MANDATORY)
792
dnl> check for `gdbm_open' in -lgdbm
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
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])
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!])
820
AC_HAVE_HEADERS(gdbm.h)
821
AC_CHECK_LIB(gdbm, gdbm_open, CORELIBS="$CORELIBS -lgdbm")
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
837
CORELIBS="${CORELIBS} -lgdbm"
838
AC_DEFINE(HAVE_GDBM_H)
839
AC_MSG_RESULT([found in $GDBM_ROOT])
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!])
850
GDBM_ROOT="standard installation"
856
dnl> check for installed optional libraries
860
echo "Step 7. Looking for optional GPLed libraries...."
863
AC_CHECK_LIB(c, re_search, AC_DEFINE(HAVE_REGEX))
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
870
if test ".$ac_disable_gdchart" = ".no"; then
871
AC_MSG_CHECKING([for GDchart (optional package)])
874
dnl> user defined directory passed as option at configuration time
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])
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.])
897
dnl> on place source tree under the same ntop's parent directory
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])
914
AC_MSG_RESULT([not found])
918
AC_MSG_WARN([GDchart support disabled via command line option!])
924
dnl> OpenSSL by Open SLL Project
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
933
dnl> Do not perform any check for the OpenSSL library,
934
dnl> if the user decided to compile without HTTPS support.
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])
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!])
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])
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!])
1015
AC_MSG_WARN([HTTPS support disabled via command line option!])
1019
dnl> check for `UCD-SNMP' library by University of California [http://ucd-snmp.ucdavis.edu]
1021
dnl>AC_CHECK_LIB(ucdagent, register_mib, [AC_DEFINE(HAVE_SNMP) SNMPLIBS="-lsnmp -lucdagent -lucdmibs"], , -lsnmp -lucdagent -lucdmibs $LIBS $MORELIBS)
1025
echo "Step 8. Creating various ntop develpment tools...."
1029
dnl> Do not walk in the plugins/ subdir if the user decided he/she does not need any plugin.
1031
if test "$ac_disable_plugins" = yes; then
1033
AC_MSG_WARN([compilation of ntop's plugins disabled via command line option!])
1039
echo "Step 9. Semi-Automatic files generation...."
1045
AC_SUBST(LIBREADLINE)
1057
AC_SUBST(MOREOBJECTS)
1060
AC_SUBST(MORESOURCES)
1063
if test ".$ac_disable_intop" = ".yes"; then
1071
dnl> ntops directories
1073
DATAFILE_DIR=$datadir/ntop
1075
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1076
eval echo "$DATAFILE_DIR"
1078
AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR", [Data file directory])
1079
AC_SUBST(DATAFILE_DIR)
1081
CONFIGFILE_DIR=$sysconfdir/ntop
1083
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1084
eval echo "$CONFIGFILE_DIR"
1086
AC_DEFINE_UNQUOTED(CONFIGFILE_DIR,"$CONFIGFILE_DIR", [Configuration file directory])
1087
AC_SUBST(CONFIGFILE_DIR)
1089
RUN_DIR=$localstatedir/ntop
1091
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1092
eval echo "$RUN_DIR"
1094
AC_DEFINE_UNQUOTED(RUN_DIR,"$RUN_DIR", [Run files directory])
1097
PLUGIN_DIR=$libdir/ntop/plugins
1099
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1100
test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1101
eval echo "$PLUGIN_DIR"
1103
AC_DEFINE_UNQUOTED(PLUGIN_DIR,"$PLUGIN_DIR", [Plugin installation directory])
1104
AC_SUBST(PLUGIN_DIR)
1106
DBFILE_DIR=$localstatedir/ntop
1108
test "x$prefix" = xNONE && prefix=$ac_default_prefix
1109
eval echo "$DBFILE_DIR"
1111
AC_DEFINE_UNQUOTED(DBFILE_DIR,"$DBFILE_DIR", [Database file directory])
1112
AC_SUBST(DBFILE_DIR)
1115
AC_DEFINE_UNQUOTED(RETSIGTYPE, void)
1120
plugins/pep/Makefile
1124
case "$CONFIG_FILES" in
1126
chmod +x ntop-config
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
1142
This is your $PACKAGE $VERSION configuration:
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}
1155
Now type 'make' or 'gmake' (GNU make) on *BSD and Solaris
1156
systems to build $PACKAGE $VERSION.
1161
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!"
1167
echo "================================================="