dnl> dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- dnl> this file is processed via 'autoconf' to produce the 'configure' script dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- dnl> dnl> Copyright (c) 1998 - 2000 Luca Deri dnl> Updated 1Q 2000 Rocco Carbone dnl> dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- dnl> This program is free software; you can redistribute it and/or modify dnl> it under the terms of the GNU General Public License as published by dnl> the Free Software Foundation; either version 2 of the License, or dnl> (at your option) any later version. dnl> dnl> This program is distributed in the hope that it will be useful, dnl> but WITHOUT ANY WARRANTY; without even the implied warranty of dnl> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl> GNU General Public License for more details. dnl> dnl> You should have received a copy of the GNU General Public License dnl> along with this program; if not, write to the Free Software dnl> Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl> dnl> dnl> standard Autoconf prolog dnl> AC_PREREQ(2.13) AC_REVISION([1.0]) dnl> dnl> version and name of the game dnl> NTOP_MAJOR_VERSION=1 NTOP_MINOR_VERSION=3 NTOP_MICRO_VERSION=2 NTOP_INTERFACE_AGE=0 NTOP_BINARY_AGE=0 NTOP_VERSION=$NTOP_MAJOR_VERSION.$NTOP_MINOR_VERSION.$NTOP_MICRO_VERSION dnl> dnl> standard libtool versioning dnl> LT_RELEASE=$NTOP_MAJOR_VERSION.$NTOP_MINOR_VERSION LT_CURRENT=`expr $NTOP_MICRO_VERSION - $NTOP_INTERFACE_AGE` LT_REVISION=$NTOP_INTERFACE_AGE LT_AGE=`expr $NTOP_BINARY_AGE - $NTOP_INTERFACE_AGE` NTOP_VERSION_INFO=$LT_CURRENT:$LT_REVISION:$LT_AGE NTOP_RELEASE=$LT_RELEASE AC_SUBST(NTOP_VERSION_INFO) AC_SUBST(NTOP_RELEASE) PACKAGE=ntop VERSION=$NTOP_VERSION echo echo "Welcome to $PACKAGE, Version $VERSION" echo "[Copyright (c) 1998-2000 Luca Deri ]" echo dnl> dnl> variables for autoconf dnl> dnl> dnl> By default ntop is compiled in multithread mode using dnl> async address resolution unless reset by command line options. ac_disable_multithread=no ac_disable_async_resolution=no multithread_mode=yes dnl> dnl> by default ntop will try to link against OpenSSL Library, if available. dnl> The choice to disable this feature is left to the user. ac_disable_openssl=no dnl> dnl> by default ntop will try to link against curses library, if available. dnl> The choice to disable this feature is left to the user. ac_disable_curses=no dnl> dnl> by default ntop will not try to link against the TCP wrapper library, if available. dnl> The choice to enable this feature is left to the user. ac_enable_tcpwrap=no dnl> dnl> by default ntop will try to compile the remoteInterface module, which dnl> needs a C++ compiler. dnl> The choice to disable this feature is left to the user. REMOTEINTERFACE=remoteInterface ac_disable_ri=no dnl> dnl> *** ToBeRocked *** dnl> user customizable section dnl> dnl> dnl> look for an unique ntop's source file in the distribution dnl> and perform initialization steps, such as loading the cache dnl> AC_INIT(ntop.c) echo dnl> dnl> canonicalize the host, target, and build system types dnl> AC_CANONICAL_SYSTEM echo dnl> dnl> perform program name transformation dnl> AC_ARG_PROGRAM dnl> dnl> initialize the macro package dnl> and check for working GNU auto``stuff'' dnl> AM_INIT_AUTOMAKE(ntop, $VERSION, lderi) echo dnl> dnl> initialize the libtool macro package to dnl> automatically include dependencies of: dnl> ranlib, ar, gcc, cc, ld, nm, ln dnl> dnl> dnl> checks for UNIX variants dnl> dnl> quoted from a public mailing list dnl> dnl> "Believe me, I'm all too aware of the nightmare of shared libraries dnl> on the various systems. My comment about AIX stems from two things. dnl> One, guess what the extension for shared libs is on AIX. ".a" Guess dnl> what the static lib extension is. ".a" What dipshit was buttsnorkeling dnl> himself coming up with *that* brilliant idea? And two, even if you dnl> do build a shared library, they fail to work 99% of the time. dnl> *cough* Perl *cough* So as a development platform, I hate AIX with dnl> a passion. Give me Solaris and HP-UX any day." dnl> dnl> Michael Jennings http://www.eterm.org dnl> Software Engineer, VA Linux Systems Author, Eterm (www.eterm.org) dnl> case "$host" in dnl> AIX is ___really___ incompatible with libtooland shared libraries, so.... dnl> disable the shared flag to no dnl> *-ibm-aix4.* ) echo "Oh no! *cough* AIX *cough*" enable_shared=no enable_static=yes echo "AIX is a so different flavor of Unix!" echo "leave AIX alone! use linux. it is free, it it fun, it is linux." echo " rocco " ;; * ) enable_shared=yes enable_static=yes ;; esac dnl> dnl> checks for required development tools dnl> echo echo "Step 1. Looking for required development tools...." echo AM_PROG_LIBTOOL echo dnl> set default loader CCLD=$CC AM_PROG_CC_STDC AC_PROG_CPP AC_SET_MAKE AC_PROG_INSTALL dnl> dnl> you can also check for debugging and optimization dnl> AC_CHECK_DEBUGGING AC_CHECK_OPTIMIZE dnl> dnl> set reasonable defaults here dnl> DEFS="-DHAVE_CONFIG_H" CFLAGS="-g $CFLAGS" echo dnl> dnl> force configure to use current directory dnl> AC_CONFIG_AUX_DIR(.) dnl> dnl> make NTOPDIR the default for the installation dnl> AC_PREFIX_DEFAULT(${NTOPDIR:-/usr/local}) dnl> dnl> generate the config header dnl> umask 002 AM_CONFIG_HEADER(config.h) dnl> dnl> Yup! Avoid to initialize maintainer mode. dnl> This is a pain if you have SUBDIRS. dnl> dnl> AM_MAINTAINER_MODE echo echo "Step 2. Processing user options...." echo AC_ARG_WITH(void, [ +----------------------------------------------------------------------------+]) AC_ARG_WITH(pcap-root, [ --with-pcap-root=DIR LBNL pcap source tree located in DIR], PCAP_ROOT="$withval", PCAP_ROOT=) AC_ARG_WITH(gdbm-root, [ --with-gdbm-root=DIR GNU gdbm source tree located in DIR], GDBM_ROOT="$withval", GDBM_ROOT=) AC_ARG_WITH(ossl-root, [ --with-ossl-root=DIR OpenSSL source tree located in DIR], OSSL_ROOT="$withval", OSSL_ROOT=) AC_ARG_WITH(void, [ +----------------------------------------------------------------------------+]) dnl> dnl> Give the user an option to compile without multithread support, dnl> for example to start a debugging session. dnl> AC_ARG_ENABLE(mt, [ --disable-mt disable multithread support also if available [default=no]], ac_disable_multithread="yes", ac_disable_multithread="no") dnl> dnl> Give the user an option to compile without the HTTPS support provided by OpenSSL. dnl> AC_ARG_ENABLE(ssl, [ --disable-ssl disable HTPPS support also if OpenSSL is available [default=no]], ac_disable_openssl="yes", ac_disable_openssl="no") dnl> dnl> Give the user an option to compile without the curses support. dnl> AC_ARG_ENABLE(curses, [ --disable-curses disable curses support also if available [default=no]], ac_disable_curses="yes", ac_disable_curses="no") dnl> dnl> Give the user an option to compile with the TCP Wrapper support. dnl> AC_ARG_ENABLE(tcpwrap, [ --enable-tcpwrap enable TCP Wrap support if available [default=no]], ac_enable_tcpwrap="yes") dnl> dnl> Give the user an option to compile without the C++ support dnl> AC_ARG_ENABLE(ri, [ --disable-ri disable support for Remote Interface also if a C++ compiler is available [default=no]], ac_disable_ri="yes") dnl> dnl> OPTIONAL Look a C++ Compiler. dnl> if test ".$ac_disable_ri" = ".no"; then AC_PROG_CXX REMOTEINTERFACE=remoteInterfaceAPI fi dnl> dnl> dnl> checks for special support for platform/compiler dnl> $CC, $CFLAGS, $LDFLAGS and $LIBS are my friends dnl> echo echo "Step 3. Checking for special support for platform/compiler...." echo case "$host:$CC" in *-ibm-aix4.1.*:gcc ) dnl> on my RS/6000 system I was really unable to link using gcc, so I switched dnl> to native AIX XL C Compiler. I don't know how to link with gcc. dnl> dnl> Moreover I needed a local copy of the libgcc.a because the dnl> linker refused to create a binary from the installed archive. dnl> Again, I don't know why. dnl> GCCLIB=`gcc -print-libgcc-file-name` cp $GCCLIB . LIBS="-L. -lgcc ${LIBS}" dnl> To link against the getmsg system call you must import the /lib/pse.exp CCLD="cc -bI:/lib/pse.exp" ;; *-ibm-aix4.*:cc* ) echo "Oh no! *cough* AIX *cough* without GCC! Me poor!" # To link against the getmsg system call you must import the /lib/pse.exp dnl> CFLAGS= dnl> LDFLAGS="-bI:/lib/pse.exp $LDFLAGS" ;; *-sun-solaris2.5.1:* ) AC_DEFINE(NEED_INET_ATON) ;; dnl> *-sun-solaris2*:cc ) dnl> # shut-up harmless warnings caused by do-while macros on Solaris dnl> test ".$ac_cv_prog_gcc" = ".no" && CFLAGS="$CFLAGS -w" dnl> ;; esac dnl> dnl> checks for system header files dnl> echo echo "Step 4. Looking for both required and optional system headers...." echo AC_HEADER_STDC dnl> AC_HEADER_TIME dnl> MANDATORY general purpose headers AC_HAVE_HEADERS(pwd.h stdio.h errno.h stdlib.h unistd.h string.h signal.h fcntl.h dnl sys/types.h sys/time.h sys/wait.h sys/stat.h sys/ioctl sys/un.h) dnl> MANDATORY the GNU database manager gdbm AC_HAVE_HEADERS(gdbm.h) dnl> OPTIONAL general purpose headers AC_CHECK_HEADERS(sys/select.h sys/ldr.h sys/sockio.h dl.h dirent.h dlfcn.h crypt.h) dnl> OPTIONAL curses headers LIBCURSES= if test ".$ac_disable_curses" = ".no"; then if test -f "/usr/include/ncurses.h"; then echo "checking for ncurses.h... yes" AC_DEFINE(HAVE_NCURSES_H) else if test -f "/usr/include/curses.h"; then echo "checking for curses.h... yes" AC_DEFINE(HAVE_CURSES_H) else AC_MSG_WARN([It looks that you don't have ncurses.h/curses.h installed. Some ntop features will be disabled.]) fi fi fi dnl> OPTIONAL memory related headers AC_CHECK_HEADERS(alloca.h) dnl> OPTIONAL thread headers if test ".$ac_disable_multithread" = ".no"; then AC_CHECK_HEADERS(sched.h sys/sched.h semaphore.h pthread.h) fi dnl> MANDATORY universal headers for network programming code AC_HAVE_HEADERS(sys/socket.h netdb.h netinet/in.h arpa/inet.h net/if.h) AC_HAVE_HEADERS(netinet/in_systm.h netinet/ip.h netinet/ip_icmp.h netinet/udp.h netinet/tcp.h) dnl> OPTIONAL headers for network programming headers AC_CHECK_HEADERS(netinet/if_ether.h arpa/nameser.h net/ethernet.h ethertype.h if.h net/bpf.h) AC_MSG_CHECKING(if ether_header uses ether_addr structs) AC_CACHE_VAL(ac_cv_ether_header_has_ea, LBL_SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $V_INCLS" AC_TRY_COMPILE([ # include # if __STDC__ /* osf3 has REALLY good prototyes */ struct mbuf; struct rtentry; # endif # include # include # include # include ], [u_int i = sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)], ac_cv_ether_header_has_ea=yes, ac_cv_ether_header_has_ea=no) CFLAGS="$LBL_SAVE_CFLAGS") AC_MSG_RESULT($ac_cv_ether_header_has_ea) if test $ac_cv_ether_header_has_ea = yes ; then AC_DEFINE(ETHER_HEADER_HAS_EA) fi dnl> OPTIONAL tcp wrapper headers if test ".$ac_enable_tcpwrap" = ".yes"; then AC_CHECK_HEADERS(tcpd.h syslog.h) fi dnl> dnl> check whether we've to define essential typedefs dnl> u_int32_t u_int16_t u_int8_t dnl> int32_t int16_t int8_t AC_CHECK_TYPEDEF(u_int32_t, sys/types.h) AC_CHECK_TYPEDEF(u_int16_t, sys/types.h) AC_CHECK_TYPEDEF(u_int8_t, sys/types.h) AC_CHECK_TYPEDEF(int32_t, sys/types.h) AC_CHECK_TYPEDEF(int16_t, sys/types.h) AC_CHECK_TYPEDEF(int8_t, sys/types.h) echo echo "Step 5. Looking for required system libraries...." echo dnl> dnl> check for `dlopen' in -ldl (MANDATORY) dnl> AC_CHECK_LIB(dl, dlopen) dnl> dnl> check for `crypt' in -lcrypt (MANDATORY) dnl> AC_CHECK_LIB(crypt, crypt) dnl> dnl> gdchart uses functions from math library dnl> so make sure we link against the math library if needed dnl> dnl> check for `sin' in -lm (MANDATORY) dnl> AC_CHECK_LIB(m, sin) dnl> dnl> Networking libraries dnl> dnl> check for `gethostname' or `gethostbyname' in -lnsl dnl> and then check for `accept' in -lsocket dnl> and then check for `inet_aton' in -lresolv dnl> AC_CHECK_LIB(nsl, gethostname) if test ".`echo $LIBS | grep nsl`" = .; then AC_CHECK_LIB(nsl, gethostbyname) fi AC_CHECK_LIB(socket, accept) AC_CHECK_LIB(resolv, inet_aton) # both solaris and aix lack definition of `getdomainname' case "$host" in *-sun-solaris2* ) AC_DEFINE(NEED_GETDOMAINNAME) ;; *-ibm-aix4.[12].* ) AC_DEFINE(NEED_GETDOMAINNAME) ;; esac dnl> dnl> TCP Wrappers library dnl> check for `request_init' in -lwrap dnl> if test ".$ac_enable_tcpwrap" = ".yes"; then AC_MSG_WARN([TCP Wrap support enabled, if available, via command line option!]) AC_CHECK_LIB(wrap, request_init) fi dnl> dnl> (n)curses Library (optional) dnl> check for `initscr' in -lncurses or in -lcurses dnl> dnl> Do not perform any check for the curses library, dnl> if the user decided to compile without curses support. dnl> LIBCURSES= if test ".$ac_disable_curses" = ".no"; then AC_CHECK_LIB(ncurses, initscr, LIBCURSES="-lncurses") if test ".`echo $LIBS | grep curses`" = .; then AC_CHECK_LIB(curses, initscr, LIBCURSES="-lcurses") fi else AC_MSG_WARN([Curses support disabled via command line option!]) fi dnl> dnl> Thread Library (optional) dnl> check for `pthread_create' in -lpthread dnl> dnl> Do not perform any check for the thread library, dnl> if the user decided to compile without multithread support. dnl> if test ".$ac_disable_multithread" = ".no"; then AC_CHECK_LIB(pthread, pthread_create) if test ".`echo $LIBS | grep pthread`" != .; then dnl> dnl> check for `sem_init' in -lposix4 dnl> AC_CHECK_LIB(posix4, sem_init) AC_DEFINE(MULTITHREADED) AC_DEFINE(ASYNC_ADDRESS_RESOLUTION) else multithread_mode=no fi else AC_MSG_WARN([Multithread support disabled via command line option!]) multithread_mode=no fi dnl> dnl> GNU ReadLine Library (optional) dnl> LIBREADLINE='-lreadline' LIBTERMCAP='' INTOPAPP='intop' if test "$ac_disable_readline" = yes; then LIBREADLINE='' INTOPAPP='' fi dnl> dnl> check for `readline' in -lreadline dnl> if test "$LIBREADLINE" != "" ; then AC_CHECK_HEADERS(readline/readline.h) AC_CHECK_LIB(readline, readline) if test ".`echo $LIBS | grep readline`" != .; then AC_DEFINE(HAVE_READLINE) else INTOPAPP='' fi fi dnl> Make sure we link termcap with readline if we aren't already dnl> linking curses or termcap if test "$LIBREADLINE" != "" ; then AC_CHECK_LIB(termcap, tgetent, [LIBTERMCAP="-ltermcap"]) case "$LIBS" in *termcap*|*curses*) ;; *) LIBREADLINE="$LIBREADLINE $LIBTERMCAP" ;; esac fi dnl> OPTIONAL UCD-SNMP AC_HAVE_HEADERS(ucd-snmp/ucd-snmp-agent-includes.h, HAVE_SNMP="yes") if test ".$HAVE_SNMP" = ".yes"; then AC_CHECK_LIB(snmp, snmp_pdu_create, LIBS="$LIBS -lsnmp -lucdagent -lucdmibs") fi dnl> dnl> checks for required libraries dnl> AC_MSG_CHECKING([for GDchart]) if test -d ../gdchart0.94b/ && test -r ../gdchart0.94b/gd1.3/gd.h && test -r ../gdchart0.94b/gdc.h; then GDCHART_ROOT="../gdchart0.94b" GDCHART_ROOT=`cd ${GDCHART_ROOT} && pwd` LIBS="-L$GDCHART_ROOT -L$GDCHART_ROOT/gd1.3 -lgdchart -lgd ${LIBS}" INCS="${INCS} -I$GDCHART_ROOT" AC_DEFINE(HAVE_GDCHART) AC_MSG_RESULT([found in $GDCHART_ROOT]) else AC_MSG_RESULT([not found]) fi echo echo "Step 6. Looking for required GPLed libraries...." echo dnl> dnl> Packet Capture Library by Lawrence Berkeley National Laboratory - Network Research Group dnl> dnl> order as follow dnl> 1. user defined libpcap development tree dnl> 2. standard installation in /usr/lib and /usr/include respectively dnl> 3. default package installation in /usr/local/lib and /usr/local/include respectively dnl> 4. libpcap-0.4 development tree under the same ntop's root directory or in a subdir AC_MSG_CHECKING([for LBL Packet Capture Library (required package)]) dnl> dnl> user defined directory passed as option at configuration time dnl> if test ".${PCAP_ROOT}" != .; then if test -d $PCAP_ROOT && test -r $PCAP_ROOT/libpcap.a && test -r $PCAP_ROOT/pcap.h; then PCAP_ROOT=`cd ${PCAP_ROOT} && pwd` LIBS="-L$PCAP_ROOT -lpcap ${LIBS}" INCS="${INCS} -I$PCAP_ROOT" AC_MSG_RESULT([found in $PCAP_ROOT]) else AC_MSG_RESULT([not found in ${PCAP_ROOT}]) AC_MSG_RESULT([ *** FATAL ERROR *** ]) AC_MSG_RESULT([ It looks that you don't have some files needed to use the pcap library.]) AC_MSG_RESULT([ Please check the source tree, compile and, optionally, install the software.]) AC_MSG_RESULT([ When finished please re-run this program.]) AC_MSG_RESULT([ You can download the latest source tarball at ftp://ftp.ee.lbl.gov/libpcap.tar.Z]) AC_MSG_ERROR([ The LBL Packet Capture Library development tree seems corrupted or incomplete!]) fi dnl> dnl> default installation as defined in latest available libpcap-0.4a7 dnl> elif test -d /usr/local && test -r /usr/local/lib/libpcap.a && test -r /usr/local/include/pcap.h; then PCAP_ROOT="/usr/local" LIBS="-L$PCAP_ROOT/lib -lpcap ${LIBS}" INCS="${INCS} -I$PCAP_ROOT/include" AC_MSG_RESULT([found in $PCAP_ROOT]) dnl> dnl> installation used by most packagers dnl> elif test -r /usr/lib/libpcap.a && test -r /usr/include/pcap.h; then PCAP_ROOT="standard installation" LIBS="-lpcap ${LIBS}" AC_MSG_RESULT([found in $PCAP_ROOT]) dnl> dnl> unusual and more complex installation used by some packagers dnl> (e.g. Red Hat Linux) dnl> elif test -r /usr/lib/libpcap.a && test -r /usr/include/pcap/pcap.h; then PCAP_ROOT="semi-standard installation" LIBS="-lpcap ${LIBS}" INCS="${INCS} -I/usr/include/pcap" AC_MSG_RESULT([found in $PCAP_ROOT]) dnl> dnl> on place source tree under the same ntop's root dnl> elif test -d ../libpcap-0.4a7 && test -r ../libpcap-0.4a7/libpcap.a && test -r ../libpcap-0.4a7/pcap.h; then PCAP_ROOT="../libpcap-0.4a7" PCAP_ROOT=`cd ${PCAP_ROOT} && pwd` LIBS="-L$PCAP_ROOT -lpcap ${LIBS}" INCS="${INCS} -I$PCAP_ROOT" AC_MSG_RESULT([found in $PCAP_ROOT]) dnl> dnl> on place source tree as ntop subdir dnl> elif test -d libpcap-0.4a7 && test -r libpcap-0.4a7/libpcap.a && test -r libpcap-0.4a7/pcap.h; then PCAP_ROOT="libpcap-0.4a7" PCAP_ROOT=`cd ${PCAP_ROOT} && pwd` LIBS="-L$PCAP_ROOT -lpcap ${LIBS}" INCS="${INCS} -I$PCAP_ROOT" AC_MSG_RESULT([found in $PCAP_ROOT]) else AC_MSG_RESULT([not found! fallback for standard installation.]) AC_CHECK_LIB(pcap, pcap_lookupdev) if test "$ac_tr_lib" != "HAVE_LIBPCAP"; then AC_MSG_RESULT([not found!]) AC_MSG_RESULT([ *** FATAL ERROR *** ]) AC_MSG_RESULT([ It looks that you don't have the libpcap distribution installed.]) AC_MSG_RESULT([ Download, compile and, optionally, install it.]) AC_MSG_RESULT([ When finished please re-run this program.]) AC_MSG_RESULT([ You can download the latest source tarball at ftp://ftp.ee.lbl.gov/libpcap.tar.Z]) AC_MSG_ERROR([ The LBL Packet Capture Library, libpcap, was not found! ]) else INCS="${INCS} -I/usr/include/pcap" PCAP_ROOT="standard installation" fi fi dnl> dnl> If your gdbm header file and library are installed somewhere strange dnl> dnl> dnl> The GNU database manager gdbm (MANDATORY) dnl> check for `gdbm_open' in -lgdbm dnl> dnl> AC_CHECK_LIB(gdbm, gdbm_open) dnl> if test "$ac_tr_lib" != "HAVE_LIBGDBM"; then dnl> AC_MSG_RESULT([not found!]) dnl> AC_MSG_RESULT([ *** FATAL ERROR *** ]) dnl> AC_MSG_RESULT([ It looks that you don't have the libgdbm distribution installed.]) dnl> AC_MSG_RESULT([ Download, compile and, optionally, install it.]) dnl> AC_MSG_RESULT([ When finished please re-run this program.]) dnl> AC_MSG_RESULT([ You can download the latest source tarball at http://www.gnu.org/software/gdbm/gdbm.html]) dnl> AC_MSG_ERROR([ The GDBM Library, libgdbm, was not found! ]) dnl> fi dnl> order as follow dnl> 1. user defined gdbm development tree dnl> 2. standard installation in /usr/lib and /usr/include respectively dnl> 3. default package installation in /usr/local/lib and /usr/local/include respectively dnl> 4. gdbm development tree under the same ntop's root source directory or in a subdir AC_MSG_CHECKING([for the GNU Database Manager Library gdbm (required package)]) if test ".${GDBM_ROOT}" != .; then if test -d $GDBM_ROOT && test -r $GDBM_ROOT/libgdbm.a && test -r $GDBM_ROOT/gdbm.h; then GDBM_ROOT=`cd ${GDBM_ROOT} && pwd` LIBS="-L$GDBM_ROOT -lgdbm ${LIBS}" INCS="${INCS} -I$GDBM_ROOT" AC_DEFINE(HAVE_GDBM_H) AC_MSG_RESULT([found in $GDBM_ROOT]) else AC_MSG_RESULT([not found in ${GDBM_ROOT}]) AC_MSG_RESULT([ *** FATAL ERROR *** ]) AC_MSG_RESULT([ It looks that you don't have some files needed to use the gdbm library.]) AC_MSG_RESULT([ Please check the source tree, compile and, optionally, install the software.]) AC_MSG_RESULT([ When finished please re-run this program.]) AC_MSG_RESULT([ You can download the latest source tarball at http://www.gnu.org/software/gdbm/gdbm.html]) AC_MSG_ERROR([ The GNU Gdbm Library development tree seems corrupted or incomplete!]) fi elif test -d /usr/local && test -r /usr/local/lib/libgdbm.a && test -r /usr/local/include/gdbm.h; then GDBM_ROOT="/usr/local" LIBS="-L$GDBM_ROOT/lib -lgdbm ${LIBS}" INCS="${INCS} -I$GDBM_ROOT/include" AC_DEFINE(HAVE_GDBM_H) AC_MSG_RESULT([found in $GDBM_ROOT]) elif test -r /usr/lib/libgdbm.a && test -r /usr/include/gdbm.h; then GDBM_ROOT="/usr" LIBS="-lgdbm ${LIBS}" AC_DEFINE(HAVE_GDBM_H) AC_MSG_RESULT([found in $GDBM_ROOT]) elif test -d ../gdbm-1.7.3 && test -r ../gdbm-1.7.3/libgdbm.a && test -r ../gdbm-1.7.3/gdbm.h; then GDBM_ROOT="../gdbm-1.7.3" GDBM_ROOT=`cd ${GDBM_ROOT} && pwd` LIBS="-L$GDBM_ROOT -lgdbm ${LIBS}" INCS="${INCS} -I$GDBM_ROOT" AC_DEFINE(HAVE_GDBM_H) AC_MSG_RESULT([found in $GDBM_ROOT]) elif test -d gdbm-1.7.3 && test -r gdbm-1.7.3/libgdbm.a && test -r gdbm-1.7.3/gdbm.h; then GDBM_ROOT="gdbm-1.7.3" GDBM_ROOT=`cd ${GDBM_ROOT} && pwd` LIBS="-L$GDBM_ROOT -lgdbm ${LIBS}" INCS="${INCS} -I$GDBM_ROOT" AC_DEFINE(HAVE_GDBM_H) AC_MSG_RESULT([found in $GDBM_ROOT]) else AC_MSG_RESULT([not found! fallback for standard installation.]) AC_CHECK_LIB(gdbm, gdbm_close) if test "$ac_tr_lib" != "HAVE_LIBGDBM"; then AC_MSG_RESULT([ *** FATAL ERROR *** ]) AC_MSG_RESULT([ It looks that you don't have the libgdbm distribution installed.]) AC_MSG_RESULT([ Download, compile and, optionally, install it.]) AC_MSG_RESULT([ When finished please re-run this program.]) AC_MSG_RESULT([ You can download the latest source tarball at http://www.gnu.org/software/gdbm/gdbm.html]) AC_MSG_ERROR([ The GNU Gdbm Library development tree seems corrupted or incomplete!]) else GDBM_ROOT="standard installation" fi fi dnl> dnl> check for installed optional libraries dnl> echo echo "Step 7. Looking for optional GPLed libraries...." echo dnl> dnl> OpenSSL by Open SLL Project dnl> dnl> order as follow dnl> 1. user defined openssl development tree dnl> 2. standard installation in /usr/lib and /usr/include respectively dnl> 3. default package installation in /usr/local/lib and /usr/local/include respectively dnl> 4. openssl development tree under the same ntop's root source directory or in a subdir dnl> dnl> Do not perform any check for the OpenSSL library, dnl> if the user decided to compile without HTTPS support. dnl> if test ".$ac_disable_openssl" = ".no"; then AC_MSG_CHECKING([for OpenSSL Library by Open SLL Project (optional package)]) if test ".${OSSL_ROOT}" != .; then if test -d $OSSL_ROOT && test -r $OSSL_ROOT/libssl.a && test -r $OSSL_ROOT/openssl/ssl.h; then OSSL_ROOT=`cd ${OSSL_ROOT} && pwd` LIBS="-L$OSSL_ROOT -lssl ${LIBS}" INCS="${INCS} -I$OSSL_ROOT" AC_DEFINE(HAVE_OPENSSL) AC_MSG_RESULT([found in $OSSL_ROOT]) else AC_MSG_RESULT([not found in ${OSSL_ROOT}]) AC_MSG_WARN([ The Open SSL Library development tree seems corrupted or incomplete!]) AC_MSG_RESULT([ It looks that you don't have some files needed to use the Open SSL library.]) AC_MSG_RESULT([ Please check the source tree, compile and, optionally, install the software.]) AC_MSG_RESULT([ When finished please re-run this program.]) AC_MSG_WARN([ You can download the latest source tarball at http://www.openssl.org/]) AC_MSG_WARN([ HTTPS disabled!]) fi elif test -d /usr/local/ssl && test -r /usr/local/ssl/lib/libssl.a && test -r /usr/local/ssl/lib/libcrypto.a && test -r /usr/local/ssl/include/openssl/ssl.h; then OSSL_ROOT="/usr/local/ssl" LIBS="-L$OSSL_ROOT/lib -lssl -lcrypto ${LIBS}" INCS="${INCS} -I$OSSL_ROOT/include" AC_DEFINE(HAVE_OPENSSL) AC_MSG_RESULT([found in $OSSL_ROOT]) elif test -r /usr/lib/ssl/libssl.a && test -r /usr/include/ssl/ssl.h; then OSSL_ROOT="/usr/lib/ssl" LIBS="-lssl -lcrypto ${LIBS}" INCS="${INCS} -I/usr/include/ssl" AC_DEFINE(HAVE_OPENSSL) AC_MSG_RESULT([found in $OSSL_ROOT]) elif test -r /usr/lib/libssl.a && test -r /usr/include/openssl/ssl.h; then OSSL_ROOT="/usr/lib/" LIBS="-lssl -lcrypto ${LIBS}" INCS="${INCS} -I/usr/include/openssl" AC_DEFINE(HAVE_OPENSSL) AC_MSG_RESULT([found in $OSSL_ROOT]) elif test -d ../openssl-0.9.4 && test -r ../openssl-0.9.4/libssl.a && test -r ../openssl-0.9.4/libcrypto.a && test -r ../openssl-0.9.4/openssl/ssl/ssl.h; then OSSL_ROOT="../openssl-0.9.4" OSSL_ROOT=`cd ${OSSL_ROOT} && pwd` LIBS="-L$OSSL_ROOT -lssl -lcrypto ${LIBS}" INCS="${INCS} -I$OSSL_ROOT/ssl" AC_DEFINE(HAVE_OPENSSL) AC_MSG_RESULT([found in $OSSL_ROOT]) elif test -d openssl-0.9.4 && test -r openssl-0.9.4/libssl.a && test -r openssl-0.9.4/openssl/ssl/ssl.h; then OSSL_ROOT="openssl-0.9.4" OSSL_ROOT=`cd ${OSSL_ROOT} && pwd` LIBS="-L$OSSL_ROOT -lssl -lcrypto ${LIBS}" INCS="${INCS} -I$OSSL_ROOT/ssl" AC_DEFINE(HAVE_OPENSSL) AC_MSG_RESULT([found in $OSSL_ROOT]) else AC_MSG_RESULT([not found!]) AC_MSG_WARN([ The Open SSL Library development tree seems corrupted or incomplete!]) AC_MSG_RESULT([ Download, compile and, optionally, install it.]) AC_MSG_RESULT([ When finished please re-run this program.]) AC_MSG_WARN([ You can download the latest source tarball at http://www.openssl.org/]) AC_MSG_WARN([ HTTPS disabled!]) fi else AC_MSG_WARN([HTTPS support disabled via command line option!]) fi dnl> dnl> *** ToBeRocked *** dnl> building tools needed to successful compile the NtoPerl Module dnl> echo echo "Step 8. Creating various ntop develpment tools...." echo dnl> dnl> *** ToBeRocked *** dnl> echo echo "Step 9. Semi-Automatic files generation...." echo AC_SUBST(VERSION) AC_SUBST(LIBCURSES) AC_SUBST(LIBREADLINE) AC_SUBST(INCS) AC_SUBST(LIBS) AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(CCLD) AC_SUBST(REMOTEINTERFACE) AC_SUBST(INTOPAPP) dnl> temporary AC_DEFINE_UNQUOTED(RETSIGTYPE, void) AC_OUTPUT([ Makefile intop/Makefile plugins/Makefile remoteInterfaceAPI/Makefile remoteInterfaceAPI/CPP/Makefile remoteInterfaceAPI/utils/Makefile ntop-config ], [ case "$CONFIG_FILES" in *ntop-config*) chmod +x ntop-config ;; esac]) dnl> dnl> versioning dnl> echo "creating version.c" /bin/rm -f version.c echo $VERSION | sed -e 's/.*/char * version = "&";/' > version.c ./config.guess | sed -e 's/.*/char * osName = "&";/' >> version.c echo "char * author = \"Luca Deri \";" >> version.c echo " This is your $PACKAGE $VERSION configuration: Host System Type : ${host} Compiler : ${CC} ${CFLAGS} ${DEFS} Include path : ${INCS} Libraries : ${LDFLAGS} ${LIBS} LBL pcap in : ${PCAP_ROOT} GNU gdbm in : ${GDBM_ROOT} MultiThread mode : ${multithread_mode} Install path : ${prefix} Now type 'make' or 'gmake' (on *BSD systems) to build $PACKAGE $VERSION " echo echo echo "-------------------------------------------------" echo "If you like ntop, please do not forget to support" echo "its development. See SUPPORT_NTOP.txt for more" echo "information. Thanks for supporting ntop!" echo "-------------------------------------------------" echo exit 0