3
dnl> should use STDC_HEADERS instead of __STDC__
4
dnl> Cleanup Autoconf2 (obsolete Autoconf1 macros still in use)
5
dnl> Solaris 8 -- libgcc_s -- need test
7
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
9
dnl> Copyright (c) 1998 - 2010 Luca Deri <deri@ntop.org>
10
dnl> Rocco Carbone <rocco@ntop.org>
11
dnl> and Burton M. Strauss III <burton@ntopsupport.com>
13
dnl> Written Oct2002 by Burton M. Strauss III <burton@ntopsupport.com>
14
dnl> (Loosely based on the earlier ntop version)
16
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
18
dnl> This program is free software; you can redistribute it and/or modify
19
dnl> it under the terms of the GNU General Public License as published by
20
dnl> the Free Software Foundation; either version 2 of the License, or
21
dnl> (at your option) any later version.
23
dnl> This program is distributed in the hope that it will be useful,
24
dnl> but WITHOUT ANY WARRANTY; without even the implied warranty of
25
dnl> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
dnl> GNU General Public License for more details.
28
dnl> You should have received a copy of the GNU General Public License
29
dnl> along with this program; if not, write to the Free Software
30
dnl> Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
35
dnl> this file is processed via 'autoconf' to produce the 'configure' script
36
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
40
dnl> Initialization lines.
41
dnl> Note that the AC_INIT must, simply MUST be the first line.
42
dnl> Anything before it is ignored in autoconf 2.5x (and beyond?)
44
dnl> Edit the version # in the AC_INIT line to roll the version.
45
dnl> Edit NTOP_VERSION_EXTRA to put something extra (e.g. SourceForge rpm version"
48
AC_INIT([ntop],[4.0.3])
50
dnl> The prereq is really 2.53, i.e. automake 1.6, but Darwin uses 2.52...
53
SCRIPTVER="v4.0.3-15-09-2010"
56
dnl> generate the config header
59
AM_CONFIG_HEADER(config.h)
67
echo "Welcome to $PACKAGE_NAME, Version $PACKAGE_VERSION $NTOP_VERSION_EXTRA"
68
echo "Copyright (C) 1998-2010 Luca Deri <deri@ntop.org>"
72
if test $THE_UID -eq 0; then
73
echo "################## WARNING ##################"
75
echo "Running configure and compiling as root might lead"
76
echo "to compilation issues."
78
echo "Please run configure as normal user, not as superuser"
80
echo "#############################################"
84
echo "Configuration script version $SCRIPTVER"
86
echo "************************************************************************"
88
echo "* NOTICE: I know you're used to ignoring output from ./configure *"
90
echo "* ntop has a lot of complexity and interdependences. *"
92
echo "* Please, please AT LEAST read the stuff in these boxes! *"
94
echo "*>>> The ACTION taken by ./configure is shown prefixed with '>>>' *"
96
echo "* If that ACTION is unacceptable, *"
97
echo "*??? Steps to take to fix the problem are shown, prefixed with '???' *"
99
echo "************************************************************************"
102
if test ".${NTOPCONFIGDEBUG}" = "."; then
105
echo " To enable additional, debugging messages during the ./configure"
106
echo " execution, do this before running ./configure:"
108
echo "$ export NTOPCONFIGDEBUG=yes"
112
CONFIGURE_PARAMETERS=$*
114
echo "Configuring ${PACKAGE_NAME} according to your request(s):"
115
echo " ./configure ${CONFIGURE_PARAMETERS}"
118
dnl> This has to be here due to some odd dependency...
121
dnl> Basic sanity check ... does ntop.c exist?
122
AC_CONFIG_SRCDIR([ntop.c])
124
dnl> force configure to use current directory
129
dnl> NTOPCONFIGDEBUG_SETTINGS([init automake])
131
dnl> make NTOPDIR the default for the installation
132
AC_PREFIX_DEFAULT(${NTOPDIR:-/usr/local})
134
# Set constants and defaults
136
MAKE_SHARED_LIBRARY_PARM="-shared -flat_namespace"
140
DEFS="-DHAVE_CONFIG_H"
149
dnl> NTOPCONFIGDEBUG_SETTINGS([ntop defaults])
152
[ +--ntop:---------------------------------------------------------------------+])
155
[ --enable-mysql Enable usage of mysql [[default=disabled]]],
156
[if test "x$enableval" = xyes; then
159
dnl echo "x$enableval"
162
[ac_with_mysql="no"])
164
AC_ARG_ENABLE(efficiency,
165
[ --enable-efficiency Enable computation of ATM network efficiency [[default=disabled]]],
166
[if test "x$enableval" = xyes; then
167
ac_with_efficiency="yes"
169
dnl echo "x$enableval"
170
ac_with_efficiency="no"
172
[ac_with_efficiency="no"])
175
[ --enable-fc Enable Fibre Channel/iSCSI support [[default=disabled]]],
176
[if test "x$enableval" = xyes; then
179
dnl echo "x$enableval"
185
[ +----------------------------------------------------------------------------+])
187
# Checks for programs.
191
dnl> AC_PROG_CXX no c++ code (yet?)
200
dnl> NTOPCONFIGDEBUG_SETTINGS([After ac stuff])
202
dnl> The blocks of code check to see if the various gnu auto* tools are installed
203
dnl> have been replaced by manditory autogen.sh usage.
205
dnl> autoheader stuff...just ignore
206
AH_TEMPLATE([HAVE_INT16_T], [Define for int16 typedef])
207
AH_TEMPLATE([HAVE_INT32_T], [Define for int32 typedef])
208
AH_TEMPLATE([HAVE_INT64_T], [Define for int64 typedef])
209
AH_TEMPLATE([HAVE_INT8_T], [Define for int8 typedef])
210
AH_TEMPLATE([HAVE_UINT64_T], [Define for unsigned int 64 typedef])
211
AH_TEMPLATE([HAVE_U_INT16_T], [Define for unsigned int 16 typedef])
212
AH_TEMPLATE([HAVE_U_INT32_T], [Define for unsigned int 32 typedef])
213
AH_TEMPLATE([HAVE_U_INT64_T], [Define for unsigned int 64 typedef])
214
AH_TEMPLATE([HAVE_U_INT8_T], [Define for unsigned int 8 typedef])
216
dnl> end autoheader stuff
219
[ +--ntop-specific:------------------------------------------------------------+])
221
[ +--external-packages:--------------------------------------------------------+])
224
[ --without-ssl disable HTPPS support [[default=enabled]]],
225
if test "x$withval" = xno; then
226
ac_disable_openssl="yes"
228
ac_disable_openssl="no"
230
ac_disable_openssl="no")
232
AC_ARG_ENABLE(plugins,
233
[ --disable-plugins disable compilation of plugins [[default=enabled]]],
234
if test "x$enableval" = xno; then
235
ac_disable_plugins="yes"
237
ac_disable_plugins="no"
239
ac_disable_plugins="no")
241
AC_ARG_ENABLE(ignoresigpipe,
242
[ --enable-ignoresigpipe Ignore SIGPIPE errors [[default=do not ignore]]],
243
ac_enable_ignoresigpipe="$enableval",
244
ac_enable_ignoresigpipe="no")
247
[ --disable-snmp Disable SNMP support [[default=disable]]],
248
if test "x$enableval" = xno; then
249
ac_disable_snmp="yes"
253
ac_disable_snmp="yes")
255
AC_ARG_ENABLE(jumbo-frames,
256
[ --enable-jumbo-frames Enable Jumbo (9K) Ethernet frames [[default=disabled]]],
257
ac_enable_jumbo_frames="$enableval",
258
ac_enable_jumbo_frames="no")
261
[ --disable-ipv6 use IPv6 [[default=enabled]]],
262
if test "x$enableval" = xno; then
263
ac_disable_ipv6="yes"
267
ac_disable_ipv6="no")
270
dnl> Define the "WITH"s for package root directories ... deal with these later...
273
[ +-External-source-locations:-------------------------------------------------+])
275
AC_ARG_WITH( rrd-home,
276
[ --with-rrd-home=DIR Usually /usr/local/rrdtool-1.2.x],
278
RRD_HOME=/usr/local/rrdtool-1.2.19)
279
AC_ARG_WITH( pcap-root,
280
[ --with-pcap-root=DIR LBNL pcap located in DIR],
281
PCAP_ROOT="$withval",
283
AC_ARG_WITH( gdbm-root,
284
[ --with-gdbm-root=DIR gdbm located in DIR],
285
GDBM_DIRECTORY="$withval",
287
AC_ARG_WITH( gdbm-lib,
288
[ --with-gdbm-lib=DIR or libgdbm located in DIR],
291
AC_ARG_WITH( gdbm-include,
292
[ --with-gdbm-include=DIR or gdbm.h located in DIR],
293
GDBM_INCLUDE="$withval",
296
AC_ARG_WITH( zlib-root,
297
[ --with-zlib-root=DIR zlib located in DIR],
298
ZLIB_DIRECTORY="$withval",
300
AC_ARG_WITH( zlib-lib,
301
[ --with-zlib-lib=DIR or libz located in DIR],
304
AC_ARG_WITH( zlib-include,
305
[ --with-zlib-include=DIR or zlib.h located in DIR],
306
ZLIB_INCLUDE="$withval",
309
AC_ARG_WITH( ossl-root,
310
[ --with-ossl-root=DIR openSSL located in DIR],
311
OSSL_DIRECTORY="$withval",
313
AC_ARG_WITH( ossl-lib,
314
[ --with-ossl-lib=DIR or libssl located in DIR],
317
AC_ARG_WITH( ossl-include,
318
[ --with-ossl-include=DIR or ssl.h located in DIR],
319
OSSL_INCLUDE="$withval",
322
AC_ARG_WITH( memorydebug,
323
[ --with-memorydebug=VALUE Set numeric code for memory debug option],
324
MEMORYDEBUG="$withval",
328
[ +----------------------------------------------------------------------------+])
330
[ +----------------------------------------------------------------------------+])
333
AC_CHECK_FILE(aclocal.m4, , [
335
echo "Invoking aclocal to create aclocal.m4..."
339
AC_CHECK_FILE(depcomp, , [
341
echo "depcomp missing... will install it in this ntop directory."
342
echo " Invoking automake to copy depcomp..."
343
$AUTOMAKE --gnu --copy --add-missing
347
dnl> Networking libraries
348
AC_SEARCH_LIBS([gethostbyname], [nsl resolv])
349
AC_SEARCH_LIBS([socket], [xnet socket])
351
dnl> Handle the root -> lib/include settings
352
NTOP_SET_LIBINC(PCAP)
353
NTOP_SET_LIBINC(GDBM)
354
NTOP_SET_LIBINC(ZLIB)
356
dnl> From here on out, we only use the _INCLUDE and _LIB except for locale and glibconfig
358
dnl> NTOPCONFIGDEBUG_SETTINGS([After set libinc])
361
dnl> Yes, we want to minimize the amount of work before we tell
362
dnl> the user we can't compile for this host, but this has to
363
dnl> to preceed the OS stuff so $CC is set.
367
echo "Checking C compiler program and features..."
370
if test ".${ac_cv_prog_cc_stdc}" = ".no"; then
372
echo "*******************************************************************"
374
echo "* WARNING: Attempting to configure for non ANSI standard C."
376
echo "*>>> This is unsupported."
377
echo "*>>> It will probably fail."
379
echo "* You are welcome to try - but please, keep the ntop-dev"
380
echo "* mailing list updated with your successes or failures..."
382
echo "*******************************************************************"
387
dnl> NTOPCONFIGDEBUG_SETTINGS([After cc stdc test])
389
dnl> Any common settings required to support a specific OS, distribution or release
392
dnl> Add include file locations to CPPFLAGS (for the preprocessor)
393
dnl> and add libraries (location) -L and (names) -l to LDFLAGS.
395
dnl> Skipping cases is, I guess, ok, but always remember that you might have
396
dnl> been grabbed by an earlier target.
402
echo "*******************************************************************"
404
echo "* Checking for unique options for ${target}, ${CC}..."
407
case "${target}:${CC}" in
411
DISTRO=`utils/linuxrelease --distro`
412
RELEASE=`utils/linuxrelease --release`
413
echo "* This appears to be ${DEFINEOS} ${DISTRO} ${RELEASE}"
418
RELEASE=`uname -r | cut -c 3-`
419
echo "* This appears to be ${DEFINEOS}"
421
echo "* 1) Compilation requires various gnu tools from SunFreeware.com or other sources."
426
MAKE_SHARED_LIBRARY_PARM="-bundle -flat_namespace -undefined suppress"
427
echo "* This appears to be ${DEFINEOS} (MacOSX)"
432
RELEASE=`utils/linuxrelease --release | sed -e 's/\.//' -e 's/-.*$//g'`
433
echo "* This appears to be ${DEFINEOS} ${RELEASE}"
437
echo "* This appears to be ${DEFINEOS} (release not checked)"
441
echo "* ${target} is an unknown/unsupported OS"
443
echo "*******************************************************************"
444
if test "x${ac_willfailoverride}" = "xyes"; then
446
echo "* Fasten your seat belt and good luck! If you are injured, the"
447
echo "* development team will disavow any knowledge of your intentions."
449
echo "* Please keep the ntop-dev mailing list updated with any"
450
echo "* successes you have or problems you encounter..."
458
if test ".${MEMORYDEBUG}" = "."; then
459
CPPFLAGS="${CPPFLAGS} -D${DEFINEOS}"
461
CPPFLAGS="${CPPFLAGS} -D${DEFINEOS} -DMEMORY_DEBUG=${MEMORYDEBUG}"
464
if test -d ./configureextra; then
466
dnl> If there is a os/distro/release specific file (additional settings),
467
dnl> run it. Go from least specific to most specific, running ANY that match.
468
dnl> E.g. 'solaris 8' will match solaris 1st then solaris8.
471
echo "* Testing for extra configuration options for ${DEFINEOS} ${DISTRO} ${RELEASE}"
473
if test -f ./configureextra/${DEFINEOS}; then
475
echo "* Executing configureextra/${DEFINEOS}"
476
. ./configureextra/${DEFINEOS}
477
CONFIGURE_PARAMETERS="${CONFIGURE_PARAMETERS} + configureextra/${DEFINEOS}"
479
if test ".${DISTRO}" != "."; then
480
if test -f ./configureextra/${DEFINEOS}${DISTRO}; then
482
echo "* Executing configureextra/${DEFINEOS}${DISTRO}"
483
. ./configureextra/${DEFINEOS}${DISTRO}
484
CONFIGURE_PARAMETERS="${CONFIGURE_PARAMETERS} + configureextra/${DEFINEOS}${DISTRO}"
486
if test ".${RELEASE}" != "." &&
487
test -f ./configureextra/${DEFINEOS}${DISTRO}${RELEASE}; then
489
echo "* Executing configureextra/${DEFINEOS}${DISTRO}${RELEASE}"
490
. ./configureextra/${DEFINEOS}${DISTRO}${RELEASE}
491
CONFIGURE_PARAMETERS="${CONFIGURE_PARAMETERS} + configureextra/${DEFINEOS}${DISTRO}${RELEASE}"
494
if test ".${RELEASE}" != "." &&
495
test -f ./configureextra/${DEFINEOS}${RELEASE}; then
497
echo "* Executing configureextra/${DEFINEOS}${RELEASE}"
498
. ./configureextra/${DEFINEOS}${RELEASE}
499
CONFIGURE_PARAMETERS="${CONFIGURE_PARAMETERS} + configureextra/${DEFINEOS}${RELEASE}"
505
echo "*******************************************************************"
508
dnl> Last chance default (if there is an os-specific value, set it above)
510
if test ".${LOCALEDIR}" = "."; then
511
LOCALEDIR="/usr/lib/locale"
514
dnl> Add /usr/local/ /opt/local
515
CFLAGS="${CFLAGS} -I/usr/local/include -I/opt/local/include"
516
CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/local/include"
517
LDFLAGS="${LDFLAGS} -L/usr/local/lib -L/opt/local/lib"
522
echo "Test the compiler and setup CFLAGS..."
529
AC_MSG_CHECKING([if compiler accepts -g (debugging information)])
541
AC_MSG_CHECKING([if compiler accepts -W (warning flags)])
543
CFLAGS="$CFLAGS -Wshadow -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
551
dnl> add pic flag in any case this makes sure all our code is relocatable
552
case "${target}:${CC}" in
554
CFLAGS="$CFLAGS "`grep pic_flag= /usr/bin/glibtool | head -n1 | sed -e 's/.*pic_flag=//' -e 's/"//g'`
557
CFLAGS="$CFLAGS "`grep pic_flag= libtool | head -n1 | sed -e 's/.*pic_flag=//' -e 's/"//g'`
561
dnl> Presets for the make flags go here...
563
CPPFLAGS="${CPPFLAGS}"
566
dnl> NTOPCONFIGDEBUG_SETTINGS([After presets])
568
AC_CHECK_LIB([pfring], [pfring_open], LDFLAGS="${LDFLAGS} -lpfring")
571
echo "Critical library/include tests..."
574
dnl> Without these, don't even BOTHER testing the parameters...
576
dnl> We also process the ROOT/DIRECTORY entries first so we have reasonable
577
dnl> CPPFLAGS, LDFLAGS and LIBS values for the AC_CHECK_LIBS and AC_CHECK_HEADERS macros.
581
dnl> user defined directory passed as option at configuration time
584
if test ".${PCAPRING_DIR}" != .; then
585
if test ".${PCAP_ROOT}" != .; then
587
echo "*******************************************************************"
589
echo "* WARNING: libpcap checking in ${PCAP_ROOT} skipped"
590
echo "* we have taken libpcap from ${PCAPRING_DIR}"
593
echo "*******************************************************************"
597
if test ".${PCAP_ROOT}" != .; then
598
if test -d $PCAP_ROOT &&
599
test -r $PCAP_ROOT/libpcap.a &&
600
test -r $PCAP_ROOT/pcap.h; then
601
PCAP_ROOT=`cd ${PCAP_ROOT} && pwd`
602
CORELIBS="${CORELIBS} -L$PCAP_ROOT -lpcap"
603
INCS="${INCS} -I$PCAP_ROOT"
604
AC_MSG_RESULT([found in $PCAP_ROOT])
606
AC_MSG_RESULT([not found in ${PCAP_ROOT}])
607
AC_MSG_RESULT([ *** FATAL ERROR *** ])
608
AC_MSG_RESULT([ It looks that you don't have some files needed to use the pcap library.])
609
AC_MSG_RESULT([ Please check the source tree, compile and, optionally, install the software.])
610
AC_MSG_RESULT([ When finished please re-run this program.])
611
AC_MSG_RESULT([ You can download the latest source tarball at http://www.tcpdump.org])
612
AC_MSG_ERROR([ The LBL Packet Capture Library development tree seems corrupted or incomplete!])
614
elif test -d /usr/local &&
615
test -r /usr/local/lib/libpcap.a &&
616
test -r /usr/local/include/pcap.h; then
617
PCAP_ROOT="/usr/local"
618
CORELIBS="${CORELIBS} -L$PCAP_ROOT/lib -lpcap"
619
INCS="${INCS} -I$PCAP_ROOT/include"
620
AC_MSG_RESULT([found in $PCAP_ROOT])
622
dnl> installation used by most packagers
624
elif test -r /usr/lib/libpcap.a &&
625
test -r /usr/include/pcap.h; then
626
PCAP_ROOT="standard installation"
627
CORELIBS="${CORELIBS} -lpcap"
628
AC_MSG_RESULT([found in $PCAP_ROOT])
630
dnl> installation used by OSX
632
elif test -r /usr/lib/libpcap.A.dylib &&
633
test -r /usr/include/pcap.h; then
634
PCAP_ROOT="standard OSX installation"
635
CORELIBS="${CORELIBS} -lpcap"
636
AC_MSG_RESULT([found in $PCAP_ROOT])
638
dnl> unusual and more complex installation used by some packagers
639
dnl> (e.g. Red Hat Linux)
641
elif test -r /usr/lib/libpcap.a &&
642
test -r /usr/include/pcap/pcap.h; then
643
PCAP_ROOT="semi-standard installation"
644
CORELIBS="${CORELIBS} -lpcap"
645
INCS="${INCS} -I/usr/include/pcap"
646
AC_MSG_RESULT([found in $PCAP_ROOT])
648
AC_CHECK_LIB(pcap, pcap_lookupdev, , [
649
AC_MSG_RESULT([ *** FATAL ERROR *** ])
650
AC_MSG_RESULT([ It looks that you don't have the libpcap distribution installed.])
651
AC_MSG_RESULT([ Download, compile and, optionally, install it.])
652
AC_MSG_RESULT([ When finished please re-run this program.])
653
AC_MSG_RESULT([ You can download the latest source tarball at http://www.tcpdump.org/])
654
AC_MSG_ERROR([ The LBL Packet Capture Library, libpcap, was not found! ])
658
AC_CHECK_LIB([pcap], [pcap_next_ex], AC_DEFINE_UNQUOTED(HAVE_PCAP_NEXT_EX, 1, [pcap has pcap_next_ex]))
660
AC_MSG_CHECKING([for gdbm])
663
if (test ".${GDBM_LIB}" != "." &&
664
test ! -d ${GDBM_LIB}) ||
665
(test ".${GDBM_INCLUDE}" != "." &&
666
test ! -d ${GDBM_INCLUDE}); then
668
echo "*******************************************************************"
670
echo "* ERROR: You specified or implied a non-existent directory for"
672
echo "* --with-gdbm-lib=${GDBM_LIB}"
673
echo "* --with-gdbm-include=${GDBM_INCLUDE}"
675
echo "*>>> Continuing without libgdbm is impossible."
677
echo "*??? 1. Correct the --with-gdbm-xxxxx option and rerun"
678
echo "*??? ./configure"
680
echo "*******************************************************************"
684
NTOP_APPENDS([${GDBM_INCLUDE}], [${GDBM_LIB}], [gdbm])
687
AC_CHECK_HEADERS([gdbm.h])
688
AC_CHECK_LIB([gdbm], [gdbm_open])
690
if test ".${ac_cv_header_gdbm_h}" != ".yes" ||
691
test ".${ac_cv_lib_gdbm_gdbm_open}" != ".yes"; then
693
echo "*******************************************************************"
695
echo "* ERROR: gdbm header or library routines are missing"
696
echo "* (yes means it was found, no means it was not found)"
698
echo "* gdbm.h...${ac_cv_header_gdbm_h}"
699
echo "* gdbm_open() in -lgdbm...${ac_cv_lib_gdbm_gdbm_open}"
701
echo "*>>> No way to proceed."
703
echo "*??? 1. Install libgdbm"
704
echo "*??? and Rerun ./configure"
705
echo "*??? or 2. Use the --with-gdbm-xxxxx= options"
707
echo "*******************************************************************"
709
AC_MSG_ERROR(Unable to continue... aborting ./configure)
713
AC_CHECK_HEADERS([capi.h])
714
if test "x$ac_cv_header_capi_h" = "xyes"; then
715
AC_CHECK_LIB([fastbit], [fastbit_init])
716
if test "x$ac_cv_lib_fastbit_fastbit_init" = "xyes"; then
717
AC_DEFINE_UNQUOTED(HAVE_FASTBIT, 1, [use fastbit])
721
dnl> Define the arguments we accept...
723
dnl> In this version of the configure file, we use AC_ARG_WITH for whole external
724
dnl> programs and AC_ARG_ENABLE for features of ntop itself. Since they're the
725
dnl> same as to processing, we don't separate them here.
727
dnl> And it keeps them together in the ./configure --help output
729
dnl> Remember, there shouldn't be any processing in these... that's below when
730
dnl> we test for libraries. It's ok to set values via AC_DEFINE_UNQUOTED().
734
dnl> Test the enable, disable and with's for unreasonable combinations.
739
if test ".${ac_disable_plugins}" = ".yes"; then
740
echo " ...Disabled via ./configure command line option --disable-plugins"
743
echo " ...(Default) Requested. Disable via ./configure command line option --disable-plugins."
748
echo "Jumbo (9k) Ethernet Frames?"
749
if test ".$ac_enable_jumbo_frames" = ".yes"; then
750
echo " ...Requested via ./configure command line option --enable-jumbo-frames."
751
AC_DEFINE_UNQUOTED(MAKE_WITH_JUMBO_FRAMES, 1, [Define for Jumbo (9k) Ethernet Frames])
753
echo " ...(Default) Disabled. Request via ./configure command line option --enable-jumbo-frames."
757
echo "Processing the rest of the ROOT/DIRECTORY entries"
759
dnl> So we have even more reasonable CPPFLAGS, LDFLAGS and LIBS values for
760
dnl> the AC_CHECK_LIB and AC_CHECK_HEADER macros.
763
if test ".${ac_disable_openssl}" != ".yes"; then
764
if (test ".${OSSL_LIB}" != "." &&
765
test ! -d ${OSSL_LIB}) ||
766
(test ".${OSSL_INCLUDE}" != "." &&
767
test ! -d ${OSSL_INCLUDE}); then
769
echo "*******************************************************************"
771
echo "* ERROR: You specified or implied a non-existent directory for"
772
echo "* the openSSL library:"
773
if test ".${OSSL_LIB}" != "."; then
774
echo "* --with-ossl-lib=${OSSL_LIB}"
776
if test ".${OSSL_INCLUDE}" != "."; then
777
echo "* --with-ossl-include=${OSSL_INCLUDE}"
780
echo "*>>> Continuing without the --with-ossl-xxxxx values"
782
echo "* ./configure should complete 'successfully'"
784
echo "* ntop may find openSSL installed in a standard location."
786
echo "* If not found, ntop will disable code dependent upon"
787
echo "* openSSL meaning no https:// support."
789
echo "* Read the remaining messages carefully!"
791
echo "*??? 1. Correct the --with-ossl-xxxxx option and rerun"
792
echo "*??? ./configure"
793
echo "*??? or 2. Install the openSSL package and rerun ./configure"
795
echo "*******************************************************************"
801
NTOP_APPENDS([${OSSL_INCLUDE}], [${OSSL_LIB}], [gdbm])
805
if (test ".${ZLIB_LIB}" != "." &&
806
test ! -d ${ZLIB_LIB}) ||
807
(test ".${ZLIB_INCLUDE}" != "." &&
808
test ! -d ${ZLIB_INCLUDE}); then
810
echo "*******************************************************************"
812
echo "* ERROR: You specified or implied a non-existent directory for"
814
if test ".${ZLIB_LIB}" != "."; then
815
echo "* --with-zlib-lib=${ZLIB_LIB}"
817
if test ".${ZLIB_INCLUDE}" != "."; then
818
echo "* --with-zlib-include=${ZLIB_INCLUDE}"
821
echo "*>>> Continuing without the --with-zlib-xxxxx values"
823
echo "* ./configure should complete 'successfully'"
825
echo "* ntop may find zlib installed in a standard location."
827
echo "* If not found, ntop will disable code dependent upon zlib"
828
echo "* meaning no compressed web pages or input files."
830
echo "* Read the remaining messages carefully!"
832
echo "*??? 1. Correct the --with-zlib-xxxxx option and rerun"
833
echo "*??? ./configure"
834
echo "*??? or 2. Install the zlib package and rerun ./configure"
836
echo "*******************************************************************"
842
NTOP_APPENDS([${ZLIB_INCLUDE}], [${ZLIB_LIB}], [z])
845
if test ".${LOCALEDIR}" != "." &&
846
test ! -d ${LOCALEDIR}; then
848
echo "*******************************************************************"
850
echo "* WARNING: You specified a non-existent directory for locale files"
851
echo "* --with-localedir=${LOCALEDIR}"
853
echo "*>>> Since we just pass this through to the run-time, we're only"
854
echo "*>>> going to warn you here, but ntop might or might not function"
855
echo "*>>> as expected."
857
echo "*??? 1. Correct the --with-localedir option and rerun"
858
echo "*??? ./configure"
860
echo "*******************************************************************"
865
dnl> Specific compiler feature tests
872
AC_C_BIGENDIAN([AC_DEFINE_UNQUOTED(CFG_BIG_ENDIAN, 1, [ntop built for big endian machine])],
873
[AC_DEFINE_UNQUOTED(CFG_LITTLE_ENDIAN, 1, [ntop built for little endian machine])],
874
[AC_DEFINE_UNQUOTED(CFG_UNKNOWN_ENDIAN, 1, [ntop built for unknown machine])])
877
dnl> NTOPCONFIGDEBUG_SETTINGS([After libraries])
880
echo "Testing headers and functions..."
888
# Standard c stuff - must have
889
AC_CHECK_HEADERS([float.h stddef.h stdlib.h string.h pcre.h])
890
AC_CHECK_HEADERS([errno.h fcntl.h limits.h math.h signal.h stdarg.h unistd.h])
891
AC_CHECK_HEADERS([stdio.h strings.h])
892
AC_CHECK_HEADERS([sys/ioctl.h sys/socket.h sys/time.h sys/types.h])
894
# Optional - have workaround...
895
AC_CHECK_HEADERS([setjmp.h ieeefp.h])
896
AC_CHECK_HEADERS([shadow.h])
897
AC_CHECK_HEADERS([sys/utsname.h])
900
AC_CHECK_HEADERS([netinet/in.h])
901
AC_CHECK_HEADERS([arpa/inet.h arpa/nameser.h])
902
AC_CHECK_HEADERS([net/ethernet.h])
904
AC_CHECK_LIB([z], [zlibVersion], [], [
905
echo "Error! You need to have zlib."
910
if test -d "$RRD_HOME"; then
911
AC_MSG_RESULT(checking for RRD home... yes)
913
RRD_HOME=/usr/local/rrdtool
914
if test -d "$RRD_HOME"; then
915
AC_MSG_RESULT(Checking rrdtool in $RRD_HOME)
921
RRD_LIB="-L${RRD_HOME}/lib -lrrd_th"
923
if test -f "$RRD_HOME/lib/librrd_th.so"; then
924
AC_MSG_RESULT(checking for rrdtool... yes)
926
if test -f "$RRD_HOME/lib/librrd_th.dylib"; then # OSX
927
AC_MSG_RESULT(checking for rrdtool... yes)
929
if test -f "$RRD_HOME/lib/librrd_th.a"; then
930
AC_MSG_RESULT(checking for rrdtool... yes)
932
AC_CHECK_LIB([rrd_th], [main])
933
if test ".${ac_cv_lib_rrd_th_main}" != ".yes"; then
934
AC_MSG_ERROR(Unable to find RRD at $RRD_HOME: please use --with-rrd-home=DIR);
935
AC_MSG_ERROR(RRD source can be downloaded from http://www.rrdtool.org/);
944
if test -d "${RRD_HOME}/include"; then
945
RRD_INC="-I${RRD_HOME}/include"
948
dnl> The failed recheck stuff below is courtesy of Chris Turbeville [turbo@verio.net]
949
dnl> Chris developed this for Solaris 9, confirming work I had done earlier for FreeBSD
950
dnl> And thank to Julien TOUCHE [julien.touche@lycos.com] for the OpenBSD dependencies
951
AC_CHECK_HEADERS([net/if.h], [], [], [
952
#ifdef HAVE_SYS_TYPES_H
953
#include <sys/types.h>
955
#ifdef HAVE_SYS_SOCKET_H
956
#include <sys/socket.h>
959
AC_CHECK_HEADER([net/if_dl.h],[
960
AC_DEFINE_UNQUOTED(HAVE_IFLIST_SYSCTL, 1, [use sysctl support for fetch interface informations])
963
AC_CHECK_HEADERS([netinet/if_ether.h], [], [], [
964
#ifdef HAVE_SYS_TYPES_H
965
#include <sys/types.h>
967
#ifdef HAVE_SYS_SOCKET_H
968
#include <sys/socket.h>
970
#ifdef HAVE_NETINET_IN_H
971
#include <netinet/in.h>
976
AC_CHECK_HEADERS([netinet/in_systm.h])
977
AC_CHECK_HEADERS([netinet/ip.h], [], [], [
978
#ifdef HAVE_SYS_TYPES_H
979
#include <sys/types.h>
981
#ifdef HAVE_NETINET_IN_SYSTM_H
982
#include <netinet/in_systm.h>
984
#ifdef HAVE_NETINET_IN_H
985
#include <netinet/in.h>
987
AC_CHECK_HEADERS([netinet/ip_icmp.h], [], [], [
988
#ifdef HAVE_SYS_TYPES_H
989
#include <sys/types.h>
991
#ifdef HAVE_SYS_SOCKET_H
992
#include <sys/socket.h>
994
#ifdef HAVE_NETINET_IN_H
995
#include <netinet/in.h>
997
#ifdef HAVE_NETINET_IN_SYSTM_H
998
#include <netinet/in_systm.h>
1000
#ifdef HAVE_NETINET_IP_H
1001
#include <netinet/ip.h>
1003
AC_CHECK_HEADERS([netinet/tcp.h])
1004
AC_CHECK_HEADERS([netinet/udp.h], [], [], [
1005
#ifdef HAVE_SYS_TYPES_H
1006
#include <sys/types.h>
1008
#ifdef HAVE_NETINET_IN_H
1009
#include <netinet/in.h>
1011
AC_CHECK_HEADERS([sys/param.h])
1012
AC_CHECK_HEADERS([net/if_dl.h])
1013
AC_CHECK_HEADERS([sys/sysctl.h], [], [], [
1014
#ifdef HAVE_SYS_PARAM_H
1015
#include <sys/param.h>
1017
AC_CHECK_HEADERS([net/route.h], [], [], [
1018
#ifdef HAVE_SYS_TYPES_H
1019
#include <sys/types.h>
1021
#ifdef HAVE_SYS_SOCKET_H
1022
#include <sys/socket.h>
1025
dnl> Note - if ethertype is missing, ntop.h has the critical #defines extracted...
1026
AC_CHECK_HEADERS([ethertype.h])
1027
AC_CHECK_HEADERS([net/ppp_defs.h])
1028
AC_CHECK_HEADERS([linux/if_pppox.h], [], [], [
1029
#ifdef HAVE_NET_IF_H
1032
#ifdef HAVE_NETINET_IF_ETHER_H
1033
#include <netinet/if_ether.h>
1036
dnl> OpenSSL ... if not disabled...
1037
if test ".${ac_disable_openssl}" != ".yes"; then
1038
AC_CHECK_HEADERS([openssl/rsa.h openssl/crypto.h openssl/x509.h openssl/pem.h openssl/ssl.h openssl/err.h])
1039
AC_CHECK_LIB([crypto], [SSLeay_version])
1040
AC_CHECK_LIB([ssl], [SSL_accept])
1043
dnl> Security related
1044
dnl> Note: on some systems, e.g. FreeBSD, crypt() is defined in unistd.
1045
AC_CHECK_HEADERS([crypt.h pwd.h security/pam_appl.h shadow.h])
1048
AC_CHECK_HEADERS([dirent.h])
1049
AC_CHECK_HEADERS([dlfcn.h dl.h])
1050
AC_CHECK_HEADERS([getopt.h])
1051
AC_CHECK_HEADERS([if.h])
1052
AC_CHECK_HEADERS([inttypes.h])
1053
AC_CHECK_HEADERS([memory.h])
1054
AC_CHECK_HEADERS([sys/ldr.h])
1055
AC_CHECK_HEADERS([sys/param.h])
1056
AC_CHECK_HEADERS([sys/select.h])
1057
AC_CHECK_HEADERS([sys/sockio.h])
1058
AC_CHECK_HEADERS([sys/stat.h])
1059
AC_CHECK_HEADERS([sys/un.h])
1060
AC_CHECK_HEADERS([sys/wait.h])
1061
AC_CHECK_HEADERS([zlib.h])
1063
dnl> Multithreading...
1064
dnl> pthread.h is required,
1065
dnl> sched.h or sys/sched.h are optional, but improves performance
1066
AC_CHECK_HEADERS([sched.h sys/sched.h])
1067
AC_CHECK_HEADERS([pthread.h])
1069
AC_MSG_CHECKING([if r/w locks are supported])
1071
#include <pthread.h>
1080
, [ AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_RW_LOCK, 1, [pthread has rw locks]) ], [AC_MSG_RESULT(no)]
1083
dnl> Optional, used for -L parameter
1084
AC_CHECK_HEADERS([sys/syslog.h syslog.h])
1087
case "$ac_disable_ipv6" in
1091
AC_DEFINE_UNQUOTED(INET6, 1, [Enable/disable ipv6 support])
1092
AC_CHECK_HEADERS([ip6.h icmp6.h])
1093
AC_CHECK_HEADERS([netinet/ip6.h netinet/icmp6.h], [], [], [
1094
#if HAVE_SYS_TYPES_H
1095
#include <sys/types.h>
1097
#if HAVE_NETINET_IN_H
1098
#include <netinet/in.h>
1100
AC_CHECK_FUNCS([sysctl])
1104
AC_CHECK_FUNCS(finite, ,
1105
[AC_CHECK_FUNCS(isfinite, ,
1106
[AC_MSG_CHECKING(for isfinite with <math.h>)
1107
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; isfinite(f)]])],[AC_MSG_RESULT(yes)
1108
AC_DEFINE(HAVE_ISFINITE,1,we have the isinfinite function)],[AC_MSG_RESULT(no)])])])
1109
AC_CHECK_FUNCS(isinf, ,
1110
[AC_MSG_CHECKING(for isinf with <math.h>)
1111
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; isinf(f)]])],[AC_MSG_RESULT(yes)
1112
AC_DEFINE(HAVE_ISINF,1,we have the isinf function)],[AC_MSG_RESULT(no)])])
1115
dnl> Autoconf2: AC_CHECK_TYPE(pid_t, int)
1117
dnl> Autoconf2: AC_CHECK_TYPE(size_t, unsigned)
1122
AC_CHECK_TYPEDEF(u_int64_t, sys/types.h)
1123
AC_CHECK_TYPEDEF(uint64_t, sys/types.h)
1124
AC_CHECK_TYPEDEF(u_int32_t, sys/types.h)
1125
AC_CHECK_TYPEDEF(u_int16_t, sys/types.h)
1126
AC_CHECK_TYPEDEF(u_int8_t, sys/types.h)
1127
AC_CHECK_TYPEDEF(int64_t, sys/types.h)
1128
AC_CHECK_TYPEDEF(int32_t, sys/types.h)
1129
AC_CHECK_TYPEDEF(int16_t, sys/types.h)
1130
AC_CHECK_TYPEDEF(int8_t, sys/types.h)
1132
dnl> If this fails, it could be a bad -l which is going to kill
1133
dnl> ALL the tests... so do the trivial compile test...
1136
AC_MSG_CHECKING([trivial compile])
1138
[AC_LANG_PROGRAM([[#include <unistd.h>]],
1140
rm -f conftest.$ac_objext conftest$ac_exeext
1141
(eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
1142
(eval $ac_link) 2> trivialcompilemessage
1144
if test ".${ac_status}" = ".0"; then
1149
echo "*******************************************************************"
1151
echo "* ERROR: A trivial c compile has failed. Something is seriously wrong."
1153
echo "* Check your --with-xxxxx-xxxxx parameters - if a library (-l)"
1154
echo "* is not found in the locations given (-L) it causes these global"
1155
echo "* compile problems. The library list, includes and flags used are:"
1157
echo "* LIBS=${LIBS}"
1158
echo "* INCS=${INCS}"
1159
echo "* CPPFLAGS=${CPPFLAGS}"
1160
echo "* LDFLAGS=${LDFLAGS}"
1162
echo "* The compile error message is:"
1164
cat trivialcompilemessage
1166
echo "*>>> No way to proceed."
1168
echo "*??? 1. Correct the --with-xxxxx-xxxxx parameters"
1169
echo "*??? and Rerun ./configure"
1171
echo "*******************************************************************"
1173
AC_MSG_ERROR(Unable to continue... aborting ./configure)
1179
AC_CHECK_LIB([c], [backtrace])
1180
AC_CHECK_LIB([c], [crypt], , [AC_CHECK_LIB([crypt], [crypt])])
1181
AC_CHECK_LIB([c], [crypt_get_format_get_format], , [AC_CHECK_LIB([crypt], [crypt_get_format])])
1182
AC_CHECK_LIB([c], [getopt_long])
1184
dnl> Plugin load routine...
1185
dnl> Most systems... special cases in the platform specific...
1186
AC_CHECK_LIB([c], [dlopen], , [AC_CHECK_LIB([dl], [dlopen])])
1188
dnl> Hokey test for GNU extension dladdr...
1189
dnl> From the above, we should have either -lc or -ldl already depending upon where we found dlopen...
1190
dnl> But, we need to specify __USE_GNU, JUST for this...
1191
AC_MSG_CHECKING([for dladdr (GNU extension)])
1192
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
1194
#include <dlfcn.h>]], [[dladdr(0,0)]])],[AC_MSG_RESULT(yes)
1195
AC_DEFINE_UNQUOTED(HAVE_DLADDR, 1, [dladdr is defined])],[AC_MSG_RESULT(no)])
1198
dnl> Check for both sin and ceil - some implementations split them
1199
AC_CHECK_LIB([c], [sin], , [AC_CHECK_LIB([m], [sin])])
1200
AC_CHECK_LIB([c], [ceil], , [AC_CHECK_LIB([m], [ceil])])
1202
dnl> Multithreading libraries
1203
AC_CHECK_LIB(pthread, pthread_create, , [
1204
AC_CHECK_LIB(pthreads, pthread_create, , [
1205
AC_CHECK_LIB(c_r, pthread_create)
1208
AC_CHECK_LIB(posix4, sem_init)
1210
dnl> Functions and types
1212
AC_PROG_GCC_TRADITIONAL
1213
dnl> do not use AC_FUNC_MALLOC ... because we have our own replacement...
1215
AC_FUNC_SETVBUF_REVERSED
1219
dnl> AC_FUNC_VPRINTF
1221
AC_CHECK_FUNCS([alarm])
1222
AC_CHECK_FUNCS([endpwent])
1223
AC_CHECK_FUNCS([gethostbyaddr gethostbyname gethostname])
1224
dnl> Note, we've already tested for gethostbyaddr_r to find it's library, above.
1225
dnl> This test is to get HAVE_GETHOSTBYADDR_R set...
1226
AC_CHECK_FUNCS([gethostbyaddr_r])
1227
AC_CHECK_FUNCS([getpass])
1228
AC_CHECK_FUNCS([gettimeofday])
1229
AC_CHECK_FUNCS([localtime_r])
1230
AC_CHECK_FUNCS([memchr memset])
1231
AC_CHECK_FUNCS([putenv])
1232
AC_CHECK_FUNCS([select socket])
1233
AC_CHECK_FUNCS([snprintf])
1234
AC_CHECK_FUNCS([sqrtf])
1235
AC_CHECK_FUNCS([strcasecmp strncasecmp strcasestr])
1236
AC_CHECK_FUNCS([strchr strrchr])
1237
AC_CHECK_FUNCS([strcspn])
1238
AC_CHECK_FUNCS([strdup])
1239
AC_CHECK_FUNCS([strerror])
1240
AC_CHECK_FUNCS([strpbrk])
1241
AC_CHECK_FUNCS([strsignal])
1242
AC_CHECK_FUNCS([strspn])
1243
AC_CHECK_FUNCS([strstr])
1244
AC_CHECK_FUNCS([strtoul])
1245
AC_CHECK_FUNCS([uname])
1247
dnl> Test for strtok_r (we have our own defn if it's not available)
1248
AC_CHECK_FUNCS([strtok_r])
1250
dnl> NTOPCONFIGDEBUG_SETTINGS([After all tests])
1253
echo "Now, let's check for problems with what we've found..."
1255
echo " Testing Required libraries and headers**"
1257
AC_MSG_CHECKING([for required C headers])
1258
if test ".${ac_cv_header_errno_h}" = ".no" ||
1259
test ".${ac_cv_header_fcntl_h}" = ".no" ||
1260
test ".${ac_cv_header_float_h}" = ".no" ||
1261
test ".${ac_cv_header_limits_h}" = ".no" ||
1262
test ".${ac_cv_header_stddef_h}" = ".no" ||
1263
test ".${ac_cv_header_stdlib_h}" = ".no" ||
1264
test ".${ac_cv_header_stdio_h}" = ".no" ||
1265
test ".${ac_cv_header_string_h}" = ".no" ||
1266
test ".${ac_cv_header_strings_h}" = ".no" ||
1267
test ".${ac_cv_header_unistd_h}" = ".no" ||
1268
test ".${ac_cv_header_sys_ioctl_h}" = ".no" ||
1269
test ".${ac_cv_header_sys_socket_h}" = ".no" ||
1270
test ".${ac_cv_header_sys_time_h}" = ".no" ||
1271
test ".${ac_cv_header_sys_types_h}" = ".no"; then
1274
echo "*******************************************************************"
1276
echo "* ERROR: Basic c library routines are missing."
1277
echo "* (yes means it was found, no means it was not found)"
1279
echo "* errno.h..."${ac_cv_header_errno_h}
1280
echo "* fcntl.h...${ac_cv_header_fcntl_h}"
1281
echo "* float.h...${ac_cv_header_float_h}"
1282
echo "* limits.h...${ac_cv_header_limits_h}"
1283
echo "* stddef.h...${ac_cv_header_stddef_h}"
1284
echo "* stdlib.h...${ac_cv_header_stdlib_h}"
1285
echo "* stdio.h...${ac_cv_header_stdio_h}"
1286
echo "* string.h...${ac_cv_header_string_h}"
1287
echo "* strings.h...${ac_cv_header_strings_h}"
1288
echo "* unistd.h...${ac_cv_header_unistd_h}"
1289
echo "* sys/ioctl.h...${ac_cv_header_sys_ioctl_h}"
1290
echo "* sys/socket.h...${ac_cv_header_sys_socket_h}"
1291
echo "* sys/time.h...${ac_cv_header_sys_time_h}"
1292
echo "* sys/types.h...${ac_cv_header_sys_types_h}"
1294
echo "*>>> No way to proceed."
1296
echo "*??? 1. Install the necessary c compiler libraries/headers"
1297
echo "*??? and Rerun ./configure"
1299
echo "*******************************************************************"
1301
AC_MSG_ERROR(Unable to continue... aborting ./configure)
1306
AC_MSG_CHECKING([for crypt])
1307
if (test ".${ac_cv_lib_c_crypt}" != ".yes" &&
1308
test ".${ac_cv_lib_crypt_crypt}" != ".yes"); then
1311
echo "*******************************************************************"
1313
echo "* ERROR: 1. Basic c library routines are missing."
1314
echo "* (yes means it was found, no means it was not found)"
1316
echo "* crypt.h...${ac_cv_header_crypt_h} (optional)"
1317
echo "* crypt() in -lc...${ac_cv_lib_c_crypt} -lcrypt...${ac_cv_lib_crypt_crypt}"
1319
echo "*>>> No way to proceed."
1321
echo "*??? 1. Install the necessary c compiler libraries/headers"
1322
echo "*??? and Rerun ./configure"
1324
echo "*******************************************************************"
1326
AC_MSG_ERROR(Unable to continue... aborting ./configure)
1330
if (test ".${ac_cv_lib_c_crypt_get_format}" = ".yes") ||
1331
(test ".${ac_cv_lib_crypt_crypt_get_format}" = ".yes"); then
1332
AC_DEFINE_UNQUOTED(HAVE_CRYPTGETFORMAT, 1, [Have crypt_get_format() function])
1335
AC_MSG_CHECKING([for dynamic load module])
1336
if test ".${DEFINEOS}" = ".DARWIN"; then
1337
AC_MSG_RESULT(skipping - ntop emulates function in ntop_darwin.c)
1338
elif test ".${ac_cv_lib_dl_dlopen}" != ".yes" &&
1339
test ".${ac_cv_lib_c_dlopen}" != ".yes" &&
1340
test ".${ac_cv_lib_c_load}" != ".yes" &&
1341
test ".${ac_cv_lib_dld_shl_load}" != ".yes"; then
1344
echo "*******************************************************************"
1346
echo "* ERROR: Critical c library routine is missing."
1347
echo "* (yes means it was found, no means it was not found)"
1349
echo "* dlopen() in -ldl...${ac_cv_lib_dl_dlopen} or -lc...${ac_cv_lib_c_dlopen}"
1351
echo "*>>> No way to proceed."
1353
echo "*??? 1. Install the necessary c compiler libraries/headers"
1354
echo "*??? and Rerun ./configure"
1356
echo "*******************************************************************"
1358
AC_MSG_ERROR(Unable to continue... aborting ./configure)
1364
echo "-------------------------------------------------------------------"
1366
echo " **Testing Optional libraries and headers**"
1370
AC_MSG_CHECKING([for Multithreading])
1372
if test ".${ac_cv_header_pthread_h}" != ".yes" ||
1373
(test ".${ac_cv_lib_pthread_pthread_create}" != ".yes" &&
1374
test ".${ac_cv_lib_pthreads_pthread_create}" != ".yes" &&
1375
test ".${ac_cv_lib_c_r_pthread_create}" != ".yes"); then
1378
echo "*******************************************************************"
1380
echo "* ERROR: We are unable to find a header/library required"
1381
echo "* to support multi-threading."
1383
echo "*>>> ntop will not be configured"
1386
echo "* (yes means it was found, no means it was not found)"
1388
echo "* pthread.h...${ac_cv_header_pthread_h}"
1389
echo "* pthread_create() in -lpthread...${ac_cv_lib_pthread_pthread_create} -lpthreads...${ac_cv_lib_pthreads_pthread_create} -lc_r...${ac_cv_lib_c_r_pthread_create}"
1391
echo "*>>> No way to proceed."
1393
echo "*??? 1. Install the necessary headers and libraries."
1394
echo "*??? and rerun ./configure"
1396
echo "*******************************************************************"
1398
AC_MSG_ERROR(Unable to continue... aborting ./configure)
1403
if test ".${ac_disable_openssl}" != ".yes"; then
1404
AC_MSG_CHECKING([for openSSL])
1405
if test ".${ac_cv_header_openssl_crypto_h}" = ".yes" &&
1406
test ".${ac_cv_header_openssl_err_h}" = ".yes" &&
1407
test ".${ac_cv_header_openssl_pem_h}" = ".yes" &&
1408
test ".${ac_cv_header_openssl_rsa_h}" = ".yes" &&
1409
test ".${ac_cv_header_openssl_ssl_h}" = ".yes" &&
1410
test ".${ac_cv_header_openssl_x509_h}" = ".yes" &&
1411
test ".${ac_cv_lib_ssl_SSL_accept}" = ".yes"; then
1413
AC_DEFINE_UNQUOTED(HAVE_OPENSSL, 1, [OPENSSL is available])
1417
echo "*******************************************************************"
1419
echo "* WARNING: One or more items required for openSSL are missing:"
1420
echo "* (yes means it was found, no means it was not found)"
1422
echo "* openssl/crypto.h...${ac_cv_header_openssl_crypto_h}"
1423
echo "* openssl/err.h...${ac_cv_header_openssl_err_h}"
1424
echo "* openssl/pem.h...${ac_cv_header_openssl_pem_h}"
1425
echo "* openssl/rsa.h...${ac_cv_header_openssl_rsa_h}"
1426
echo "* openssl/ssl.h...${ac_cv_header_openssl_ssl_h}"
1427
echo "* openssl/x509.h...${ac_cv_header_openssl_x509_h}"
1428
echo "* libssl.so or libssl.a...${ac_cv_lib_ssl_SSL_accept}"
1430
echo "*>>> ntop will be built without openSSL"
1432
echo "*??? 1. Install the necessary headers and libraries."
1433
echo "*??? and rerun ./configure"
1435
echo "*******************************************************************"
1442
dnl> Test the various things we need for zlib...
1443
AC_MSG_CHECKING([for zlib])
1444
if test ".${ac_disable_zlib}" = ".yes"; then
1445
AC_MSG_WARN(Skipping at your request)
1446
elif test ".${ac_cv_header_zlib_h}" = ".yes" &&
1447
test ".${ac_cv_lib_z_zlibVersion}" = ".yes"; then
1449
AC_DEFINE_UNQUOTED(MAKE_WITH_ZLIB, 1, [ZLIB is available])
1453
echo "*******************************************************************"
1455
echo "* WARNING: One or more items required for zlib are missing:"
1456
echo "* (yes means it was found, no means it was not found)"
1458
echo "* zlib.h...${ac_cv_header_zlib_h}"
1459
echo "* libz.so or libz.a...${ac_cv_lib_z_zlibVersion}"
1461
echo "*>>> ntop will be built without zlib"
1463
echo "*??? 1. Install the necessary headers and libraries."
1464
echo "*??? and rerun ./configure"
1466
echo "*******************************************************************"
1472
dnl> Network Efficiency
1474
if test "x$ac_with_efficiency" = "xyes"; then
1475
AC_DEFINE_UNQUOTED(ENABLE_EFFICIENCY, 1, [Compute ATM network efficiency])
1479
dnl> Fibre Channel, iSCSI... support
1481
if test "x$ac_with_fc" = "xyes"; then
1482
AC_DEFINE_UNQUOTED(ENABLE_FC, 1, [Enable Fibre Channel support])
1488
if test "x$ac_with_mysql" = "xyes"; then
1490
AC_CHECK_TOOL(MYSQL, mysql_config)
1491
if test "x$ac_cv_prog_ac_ct_MYSQL" = "xmysql_config"; then
1493
OLD_CPPFLAGS="${CPPFLAGS}"
1494
LIBS="${LIBS} `mysql_config --libs_r`"
1495
CPPFLAGS="${CPPFLAGS} `mysql_config --include`"
1496
AC_CHECK_LIB([mysqlclient_r], [mysql_query])
1497
if test ".${ac_cv_lib_mysqlclient_r_mysql_query}" = ".no"; then
1501
dnl> MySQL 4.x or better
1503
AC_CHECK_HEADERS([mysql.h])
1504
if test ".${ac_cv_header_mysql_h}" != ".yes"; then
1505
echo "MySQL not found. Database support disabled";
1508
echo "MySQL support enabled";
1509
INCS="${INCS} `mysql_config --include`"
1512
CPPFLAGS="${OLD_CPPFLAGS}"
1520
if test ".${ac_disable_snmp}" != ".yes"; then
1521
AC_CHECK_TOOL(NETSNMP, net-snmp-config)
1522
if test "x$ac_cv_prog_ac_ct_NETSNMP" = "xnet-snmp-config"; then
1523
AC_DEFINE_UNQUOTED(HAVE_SNMP, 1, [SNMP is supported])
1524
SNMPLIBS="`net-snmp-config --libs`"
1525
SNMPLIBS="`echo ${SNMPLIBS}|sed -e s,'-R../lib',,g`"
1526
echo "net-snmp libs: ${SNMPLIBS}"
1527
LIBS="${LIBS} ${SNMPLIBS}"
1528
dnl remove unecessary path
1529
LIBS=`echo ${LIBS}|sed -e s,'-R../lib',,g`
1530
INCS="${INCS} `net-snmp-config --cflags`"
1532
AC_MSG_RESULT(NETSNMP is not present: SNMP support is disabled)
1537
SAVED_CFLAGS=$CFLAGS
1543
AC_CHECK_TOOL(PYTHON, python-config)
1546
if test "x$ac_cv_prog_ac_ct_PYTHON" != "xpython-config"; then
1547
if test -f "/etc/debian_version"; then
1548
AC_MSG_RESULT(Please install python-dev and rerun configure)
1551
AC_MSG_RESULT(>>>> Unable to locate python-config: using workaround <<<<)
1552
dnl> Silly workaround for RedHat-like distro
1553
AC_CHECK_TOOL(PYTHON, python)
1554
if test "x$ac_cv_prog_ac_ct_PYTHON" = "xpython"; then
1555
PYTHON_CONFIG="./configureextra/python-config"
1557
PYTHON_CONFIG="python-config"
1561
PYTHON_CONFIG="python-config"
1564
if test "x$PYTHON_CONFIG" != "x"; then
1565
PYTHON_LIBS="`$PYTHON_CONFIG --libs`"
1566
if test "x$PYTHON_LIBS" = "x"; then
1567
AC_MSG_RESULT(Python[-devel] support is present but misconfigured)
1571
dnl echo "Python libs: ${PYTHON_LIBS}"
1572
LIBS="${LIBS} ${PYTHON_LIBS}"
1574
dnl remove unecessary path
1575
dnl line below workaround for OSX 10.6 (Snow Leopard)
1576
PYTHON_INCS=`$PYTHON_CONFIG --cflags | sed -e "s/-arch i386 -arch ppc -arch x86_64//"`
1577
INCS="${INCS} ${PYTHON_INCS}"
1580
CFLAGS="$CFLAGS $INCS"
1581
AC_MSG_CHECKING([Checking python version])
1582
AC_TRY_COMPILE([ #include <Python.h> ],
1583
[ #if (PY_MAJOR_VERSION < 2) || (PY_MINOR_VERSION < 6)
1584
#error "Your python is too old"
1587
[ AC_MSG_RESULT(Python 2.6 or newer is available) ; AC_DEFINE_UNQUOTED(HAVE_PYTHON, 1, [Python is supported])] ,
1588
[ AC_MSG_RESULT(Old python installed); echo ""; echo "Please install python 2.6 or newer. Python support disabled"; CFLAGS=$SAVED_CFLAGS; INCS=$SAVED_INCS; LIBS=$SAVED_LIBS])
1592
AC_MSG_RESULT(Python[-devel] support is not present)
1593
CFLAGS=$SAVED_CFLAGS
1598
dnl> SCTP - RFC 3286
1600
AC_MSG_CHECKING([sctp])
1602
#include "confdefs.h"
1603
#include <netinet/sctp.h>
1604
#include <sys/socket.h>],
1605
[socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);],
1606
AC_DEFINE_UNQUOTED(HAVE_SCTP, 1, [SCTP is supported])
1612
dnl> Test for pthread_atfork()
1613
if test ".${ac_cv_header_pthread_h}" = ".yes"; then
1614
AC_MSG_CHECKING([pthread_atfork])
1616
#include "confdefs.h"
1617
#include <pthread.h>],
1618
[pthread_atfork(NULL, NULL, NULL);],
1619
AC_DEFINE_UNQUOTED(HAVE_PTHREAD_ATFORK,
1621
[pthread_atfork() exists])
1623
ac_has_pthread_atfork=yes,
1625
ac_has_pthread_atfork=no)
1627
ac_has_pthread_atfork=no
1631
echo "Miscelaneous settings..."
1635
dnl> GNU gcc backtrace?
1637
AC_MSG_CHECKING([for gcc backtrace])
1638
if test ".${ac_cv_lib_c_backtrace}" = ".yes"; then
1639
AC_MSG_RESULT([found - automatic SIGSEGV backtrace enabled via -K])
1640
AC_DEFINE_UNQUOTED(HAVE_BACKTRACE, 1, [backtrace() is available])
1642
AC_MSG_RESULT([not found])
1648
AC_MSG_CHECKING([for gcc getopt_long])
1649
if test ".${ac_cv_lib_c_getopt_long}" = ".yes"; then
1650
AC_MSG_RESULT([found - long command line options are enabled])
1651
AC_DEFINE_UNQUOTED(HAVE_GETOPT_LONG, 1, [getopt_long() is available])
1653
AC_MSG_RESULT([not found - long command line options are enabled using ntop code])
1655
echo "*******************************************************************"
1657
echo "* NOTE: getopt_long does not appear to be provided on this system."
1659
echo "*>>> No worries - activating our built-in (libiberty) version."
1660
echo "*>>> ntop should work properly."
1662
echo "*******************************************************************"
1664
mv utils/getopt/*[ch] .
1668
dnl> Test for facilitynames
1670
if test ".${ac_cv_header_sys_syslog_h}" = ".yes" ||
1671
test ".${ac_cv_header_syslog_h}" = ".yes" ; then
1672
AC_MSG_CHECKING([for facilitynames - define SYSLOG_NAMES option])
1674
#include "confdefs.h"
1677
#define SYSLOG_NAMES
1678
#if defined(HAVE_SYS_SYSLOG_H)
1679
#include <sys/syslog.h>
1680
#elif defined(HAVE_SYSLOG_H)
1683
[void * x = (void*) &(facilitynames[0]);],
1684
AC_MSG_RESULT(available)
1685
AC_DEFINE_UNQUOTED(HAVE_FACILITYNAMES,
1687
[glibc syslog.h or sys/syslog.h with facilitynames[] option]),
1688
AC_MSG_RESULT(unavailable))
1692
dnl> Test ether_header has ea
1694
AC_MSG_CHECKING([if ether_header uses ether_addr structs])
1696
# include <sys/types.h>
1698
/* osf3 has REALLY good prototyes */
1702
# include <sys/socket.h>
1703
# include <net/if.h>
1704
# include <netinet/in.h>
1705
# include <netinet/if_ether.h>],
1707
sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)],
1709
AC_DEFINE_UNQUOTED(CFG_ETHER_HEADER_HAS_EA,
1711
[ether_header uses ether_addr structs])],
1712
[AC_MSG_RESULT(no)])
1715
dnl> check for ip6 address used by sFlow...
1717
if test "${ac_disable_plugins}" != ".yes"; then
1718
AC_MSG_CHECKING([if in6_addr is defined for sFlowPlugin])
1720
# include <sys/types.h>
1721
# include <netinet/in.h>
1722
# include <netinet/in_systm.h>
1723
# include <sys/socket.h>
1724
# include <netinet/ip.h>
1726
[struct in6_addr tmp;],
1728
AC_DEFINE_UNQUOTED(HAVE_IN6_ADDR,
1730
[For sFlowPlugin.c to define in6_addr for environments without it.])],
1731
[AC_MSG_RESULT(no)])
1737
AC_DEFINE_UNQUOTED(RETSIGTYPE, void, [temporary definition])
1742
if test ".${CCLD}" = "."; then
1746
dnl> Anything required for the memory debug options?
1747
if test ".${MEMORYDEBUG}" != "."; then
1748
case "${MEMORYDEBUG}" in
1752
LIBS="${LIBS} -lefence"
1753
echo "*******************************************************************"
1754
echo "*--with-memorydebug=2:"
1756
echo "* ElectricFence added to LIBS per your request"
1758
echo "*******************************************************************"
1766
echo "*******************************************************************"
1768
echo "* WARNING: The --with-memorydebug= value ${MEMORYDEBUG} is not recognized."
1771
echo "*>>> Continuing, but may build bad code"
1773
echo "*??? 1. Fix/Remove --with-memorydebug"
1775
echo "*******************************************************************"
1783
echo "-------------------------------------------------------------------"
1785
if test "x${AWK}" = "x"; then
1787
echo "*******************************************************************"
1789
echo "* WARNING: The test for AWK indicates you do not have any"
1790
echo "* version of Awk installed."
1792
echo "*>>> Unable to remove duplicates from LIBS and INCS."
1793
echo "* ntop should work ok"
1795
echo "*******************************************************************"
1799
echo "Removing dups and misplaced entries from LIBS and INCS..."
1800
LIBS=`echo ${LIBS} | ${ac_cv_prog_AWK} '{ \
1801
for(i=NF; i>0; i--) { \
1802
if ($i in fields) { } else { fields[[$i]]="."; out[[i]]=$i } \
1804
for(i=1; i<=NF; i++) { \
1805
if (i in out) { printf("%s ", out[[i]]) } \
1809
INCS=`echo ${INCS} | ${ac_cv_prog_AWK} '{ \
1810
for(i=NF; i>0; i--) { \
1811
if ($i in fields) { } else { fields[[$i]]="."; out[[i]]=$i } \
1813
for(i=1; i<=NF; i++) { \
1814
if (i in out) { printf("%s ", out[[i]]) } \
1820
dnl> GeoIP (http://www.maxmind.com/)
1821
AC_CHECK_LIB([GeoIP], [GeoIP_record_by_ipnum], AC_DEFINE_UNQUOTED(HAVE_GEOIP, 1, [GeoIP support is present]))
1822
AC_CHECK_LIB([GeoIP], [GeoIP_name_by_ipnum_v6], AC_DEFINE_UNQUOTED(HAVE_GEOIP_V6_SUPPORT, 1, [GeoIP V6 support is present]))
1824
if test ".${ac_cv_lib_GeoIP_GeoIP_record_by_ipnum}" = ".yes"; then
1825
LIBS="$LIBS -lGeoIP"
1827
if test -f "GeoLiteCity.dat"; then
1828
echo "GeoLiteCity.dat already present"
1830
if test -f "3rd_party/GeoLiteCity.dat.gz"; then
1831
cp 3rd_party/GeoLiteCity.dat.gz .
1833
wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
1836
gunzip GeoLiteCity.dat.gz
1841
if test -f "GeoIPASNum.dat"; then
1842
echo "GeoIPASNum.dat already present"
1844
if test -f "3rd_party/GeoIPASNum.dat.gz"; then
1845
cp 3rd_party/GeoIPASNum.dat.gz .
1847
wget http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
1850
gunzip GeoIPASNum.dat.gz
1853
AC_MSG_RESULT(Please install GeoIP (http://www.maxmind.com/))
1857
cp "3rd_party/oui.txt.gz" .
1858
cp "3rd_party/specialMAC.txt.gz" .
1860
if test -d ./configureextra; then
1862
dnl> If there is a os/distro/release specific file (additional settings),
1863
dnl> run it. Go from least specific to most specific, running ANY that match.
1864
dnl> E.g. 'solaris 8' will match solaris 1st then solaris8.
1867
echo "Testing for special final configuration options for ${DEFINEOS} ${DISTRO} ${RELEASE}"
1869
if test -f ./configureextra/final_${DEFINEOS}; then
1871
echo " Executing configureextra/final_${DEFINEOS}"
1872
. ./configureextra/final_${DEFINEOS}
1875
if test ".${DISTRO}" != "."; then
1876
if test -f ./configureextra/final_${DEFINEOS}${DISTRO}; then
1878
echo " Executing configureextra/final_${DEFINEOS}${DISTRO}"
1879
. ./configureextra/final_${DEFINEOS}${DISTRO}
1882
if test ".${RELEASE}" != "." &&
1883
test -f ./configureextra/final_${DEFINEOS}${DISTRO}${RELEASE}; then
1885
echo " Executing configureextra/final_${DEFINEOS}${DISTRO}${RELEASE}"
1886
. ./configureextra/final_${DEFINEOS}${DISTRO}${RELEASE}
1890
if test ".${RELEASE}" != "." &&
1891
test -f ./configureextra/final_${DEFINEOS}${RELEASE}; then
1893
echo " Executing configureextra/final_${DEFINEOS}${RELEASE}"
1894
. ./configureextra/final_${DEFINEOS}${RELEASE}
1900
dnl> NTOPCONFIGDEBUG_SETTINGS([final])
1903
echo "==================================================================="
1905
echo "This is your $PACKAGE $VERSION configuration:"
1907
echo "Host System Type : ${host}"
1908
if test ".${build_alias}" != .; then
1909
echo " Note: --build=${build_alias} specified"
1911
echo "Preprocessor (cppflags) : ${CPPFLAGS}"
1912
echo "Compiler (cflags) : ${CC} ${CFLAGS}"
1913
echo "Defines : ${DEFS}"
1914
echo "Loader (ldflags) : ${LDFLAGS}"
1915
echo "Include path : ${INCS}"
1916
echo "System Libs : ${LIBS}"
1917
echo "Locale : ${LOCALEDIR}"
1918
if test ".${MEMORYDEBUG}" != .; then
1919
echo "Memory Debug : ${MEMORYDEBUG}"
1922
echo "External packages:"
1924
NTOP_RPT_LOC([LBL pcap], [${PCAP_LIB}], [${PCAP_INCLUDE}])
1925
NTOP_RPT_LOC([GNU gdbm], [${GDBM_LIB}], [${GDBM_INCLUDE}])
1926
if test ".${ac_disable_zlib}" != ".yes"; then
1927
NTOP_RPT_LOC([zlib ], [${ZLIB_LIB}], [${ZLIB_INCLUDE}])
1930
if test ".${ac_disable_openssl}" != ".yes"; then
1931
NTOP_RPT_LOC([openSSL ], [${OSSL_LIB}], [${OSSL_INCLUDE}])
1935
echo "Install directories:"
1937
echo " Default prefix: ${ac_default_prefix}"
1938
echo " Install into: ${prefix} (default or via --prefix request)"
1941
dnl> Fix as in some platform (e.g. OSX) the datarootdir is not expanded properly
1942
dnl> and it contains the ${prefix} variable
1943
if test "x$prefix" = xNONE; then
1944
prefix=${ac_default_prefix}
1946
datarootdir=`echo $datarootdir|sed -e s,'${prefix}',$prefix,g`
1949
CFG_DATAFILE_DIR=$datadir/ntop
1951
test "x$prefix" = xNONE && prefix=${ac_default_prefix}
1952
eval echo "$CFG_DATAFILE_DIR"
1954
AC_DEFINE_UNQUOTED(CFG_DATAFILE_DIR,"$CFG_DATAFILE_DIR", [Data file directory])
1955
echo " Data files are in $CFG_DATAFILE_DIR"
1957
CFG_CONFIGFILE_DIR=$sysconfdir/ntop
1958
CFG_CONFIGFILE_DIR=`(
1959
test "x$prefix" = xNONE && prefix=${ac_default_prefix}
1960
eval echo "$CFG_CONFIGFILE_DIR"
1962
AC_DEFINE_UNQUOTED(CFG_CONFIGFILE_DIR,"$CFG_CONFIGFILE_DIR", [Configuration file directory])
1963
echo " Config files are in $CFG_CONFIGFILE_DIR"
1965
CFG_RUN_DIR=$localstatedir/ntop
1967
test "x$prefix" = xNONE && prefix=${ac_default_prefix}
1968
eval echo "$CFG_RUN_DIR"
1970
AC_DEFINE_UNQUOTED(CFG_RUN_DIR,"$CFG_RUN_DIR", [Run files directory])
1971
echo " Run directory is $CFG_RUN_DIR"
1973
CFG_PLUGIN_DIR=$libdir/ntop/plugins
1975
test "x$prefix" = xNONE && prefix=${ac_default_prefix}
1976
test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1977
eval echo "$CFG_PLUGIN_DIR"
1979
AC_DEFINE_UNQUOTED(CFG_PLUGIN_DIR,"$CFG_PLUGIN_DIR", [Plugin installation directory])
1980
echo " Plugin files are in $CFG_PLUGIN_DIR"
1982
CFG_DBFILE_DIR=$localstatedir/ntop
1984
test "x$prefix" = xNONE && prefix=${ac_default_prefix}
1985
eval echo "$CFG_DBFILE_DIR"
1987
AC_DEFINE_UNQUOTED(CFG_DBFILE_DIR,"$CFG_DBFILE_DIR", [Database file directory])
1988
echo " Database files are in $CFG_DBFILE_DIR"
1991
echo "-------------------------------------------------------------------"
1993
echo "Creating files..."
1997
AC_SUBST(CFG_CONFIGFILE_DIR)
1998
AC_SUBST(CFG_DATAFILE_DIR)
1999
AC_SUBST(CFG_DBFILE_DIR)
2006
AC_SUBST(LIBTOOL_DEPS)
2007
AC_SUBST(MAKE_SHARED_LIBRARY_PARM)
2008
AC_SUBST(NTOP_VERSION_EXTRA)
2011
AC_SUBST(CFG_PLUGIN_DIR)
2014
dnl> AC_SUBST(CFG_RUN_DIR)
2016
AC_SUBST(SO_VERSION_PATCH)
2023
AC_CONFIG_FILES([Makefile])
2024
AC_CONFIG_MACRO_DIR([m4])
2026
if test ".${ac_disable_plugins}" != ".yes"; then
2027
AC_CONFIG_FILES([plugins/Makefile])
2028
dnl> AC_CONFIG_FILES([plugins/pep/Makefile])
2036
/bin/rm -f version.c
2037
echo $PACKAGE_VERSION $NTOP_VERSION_EXTRA | sed -e 's/.*/char * version = "&";/' > version.c
2038
osRelease=`uname -r`
2039
osName=`./config.guess | sed -e "s/unknown/${osRelease}/g"`
2040
echo "${osName}" | sed -e 's/.*/char * osName = "&";/' >> version.c
2041
echo "char * author = \"Luca Deri <deri@ntop.org>\";" >> version.c
2042
dnl> This is an odd format, but it matches cpp's __DATE__ and __TIME__ macros...
2043
date +"%b %e %Y %k:%M:%S" | sed -e 's/.*/char * configureDate = "&";/' >> version.c
2044
echo "#define buildDateIs __DATE__ \" \" __TIME__" >> version.c
2045
echo "char * buildDate = buildDateIs;" >> version.c
2046
echo $CONFIGURE_PARAMETERS | sed -e 's/.*/char * configure_parameters = "&";/' >> version.c
2047
echo ${host} | sed -e 's/.*/char * host_system_type = "&";/' >> version.c
2048
echo ${target} | sed -e 's/.*/char * target_system_type = "&";/' >> version.c
2049
echo ${CPP} ${CPPFLAGS} | sed -e 's/.*/char * compiler_cppflags = "&";/' >> version.c
2050
echo ${CC} ${CFLAGS} ${DEFS} | sed -e 's/.*/char * compiler_cflags = "&";/' >> version.c
2051
echo ${INCS} | sed -e 's/.*/char * include_path = "&";/' >> version.c
2052
echo ${LDFLAGS} ${LIBS} | sed -e 's/.*/char * system_libs = "&";/' >> version.c
2053
echo ${prefix} | sed -e 's/.*/char * install_path = "&";/' >> version.c
2055
echo ${LOCALEDIR} | sed -e 's/.*/char * locale_dir = "&";/' >> version.c
2056
echo ${DISTRO} | sed -e 's/.*/char * distro = "&";/' >> version.c
2057
echo ${RELEASE} | sed -e 's/.*/char * release = "&";/' >> version.c
2058
echo ${FORCE_RUNTIME_PARM} | sed -e 's/.*/char * force_runtime = "&";/' >> version.c
2060
echo "" >> version.c
2061
echo "/* Memory Debug: */" >> version.c
2062
echo "#ifdef MEMORY_DEBUG" >> version.c
2063
echo " char * memoryDebug = \"" ${MEMORYDEBUG} "\";" >>version.c
2064
echo "#endif /* MEMORY_DEBUG */" >> version.c
2069
echo "Copying patched versions of some configure-related files for Mac OS X"
2070
cp packages/MacOSX/lt* .
2072
ln -s /usr/bin/glibtool libtool
2078
echo "==================================================================="
2081
echo "*******************************************************************"
2083
echo "* NOTE: ./configure is now complete!"
2085
echo "* All of the obviously FATAL errors would cause you to"
2086
echo "* abort before this point, so while you SHOULD scroll"
2087
echo "* back and check for error/warning/note messages,"
2088
echo "* you probably will not..."
2091
echo "++ If you like ntop, please do not forget to support its"
2092
echo "++ development. See SUPPORT_NTOP.txt for more information."
2094
echo "++ Thanks for supporting ntop!"
2097
echo "* NEXT STEP(S):"
2099
case "${target}:${CC}" in
2100
*-*-freebsd[[45]]*:*gcc* )
2102
echo "*WARNING: You may encounter a problem building ntop for this OS!"
2104
case "${target}:${CC}" in
2105
*-*-freebsd5*:*gcc* )
2106
echo "*FreeBSD5: Where the following messages are repeated many times:"
2108
echo "*FreeBSD5: expr: illegal option -- l"
2109
echo "*FreeBSD5: usage: expr [-e] expression"
2111
echo "*FreeBSD5: To avoid this, according to the note on man expr,"
2112
echo "*FreeBSD5: \"Compatibility with previous implementations\","
2113
echo "*FreeBSD5: set the flag EXPR_COMPAT before typing make."
2115
echo "*FreeBSD5: (Under bash, \$ export EXPR_COMPAT=Y will suffice.)"
2119
echo "*FreeBSD4,5: Do not use the -j option (e.g. make -j2) to try to make "
2120
echo "*FreeBSD4,5: ntop in parallel."
2121
echo "*FreeBSD4,5: "
2122
echo "*FreeBSD4,5: Although the plugins/Makefile contains the .NOTPARALLEL tag"
2123
echo "*FreeBSD4,5: it seems that it's not respected. If you make in parallel,"
2124
echo "*FreeBSD4,5: you will see the following errors:"
2125
echo "*FreeBSD4,5: "
2126
echo "*FreeBSD4,5: Making all in plugins"
2127
echo "*FreeBSD4,5: Making all in ."
2128
echo "*FreeBSD4,5: gcc -bundle -flat_namespace -undefined suppress -o .libs/libicmpPlugin.so icmpPlugin.o"
2129
echo "*FreeBSD4,5: gcc: suppress: No such file or directory"
2130
echo "*FreeBSD4,5: "
2131
echo "*FreeBSD4,5: etc."
2132
echo "*FreeBSD4,5: "
2137
if test ".${HAS_ERROR}" = ".yes"; then
2139
echo "*>>>> An ERROR has occured - please review the output before"
2140
echo "*>>>> continuing to make ntop!"
2141
elif test ".${HAS_WARNING}" = ".yes"; then
2143
echo "*>>>> A WARNING message was generated - please review the"
2144
echo "*>>>> output before continuing to make ntop!"
2148
echo "* Building ntop requires GNU Make, so to build ntop, type"
2149
echo "* 'make' (or on *BSD and Solaris systems, 'gmake')"
2151
echo "*******************************************************************"