~ubuntu-branches/ubuntu/natty/ntop/natty

« back to all changes in this revision

Viewing changes to .pc/fix-wget-during-build.patch/configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Ludovico Cavedon, Jordan Metzmeier, Ludovico Cavedon
  • Date: 2010-12-15 20:06:19 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101215200619-0ojz3iak95ihibun
Tags: 3:4.0.3+dfsg1-1
[ Jordan Metzmeier ]
* New upstream release (Closes: #522042)
* Move data files to /usr/share/ntop (Closes: #595450).
* Package architecture independent data in a separate ntop-data package.
* Use debhelper 7.
* Update Standards-Version to 3.9.1.
* Depend on python-mako.
* Do not include ntop.txt in binary packages as it is a copy of the man
  page.
* Do not include NEWS, as it is outdated.
* Switch to package source version 3.0 (quilt).
* Add password creation to debconf
* Changed init script to fix localization problems (thanks to Alejandro
  Varas <alej0varas@gmail.com>, LP: #257466)
* Remove manual update-rc.d calls from postrm and postinst. debhelper adds
  this for us.
* Add pre-depends on adduser for postinst script.
* Fix errors in the manpages: fix-manpage-errors.patch.
* Added fixes for matching active interfaces.
* Added a watch file.

[ Ludovico Cavedon ]
* Remove direct changes to upstream tree, and move them into specific patch
  files:
  - fix-manpage-errors.patch: fix typos in ntop.8.
  - dot-path.patch: fix path of /usr/bin/dot executable
* Add patches:
  - reduce-autogen-purged-files.patch: prevent agutogen.sh from reamoving
  too many files during cleanup.
  - Add build-without-ntop-darwin.patch, to fix compilation without
  ntop_darwin.c.
* No longer add faq.html, as it is not distributed in the upstream tarball.
* Use ${source:Version} in control file. Have ntop-data recommend
  ntop.
* Rename dirs to ntop.dirs and keep only empty directories that need
  to be created.
* Remove var/lib from ntop.install file, as it is empty (keeping it in
  ntop.dirs).
* Update po files.
* Breaks and Replaces instead of Conflitcs for ntop-data.
* Use a longer package description.
* Remove useless configure options from debian/rules.
* Move private shared libraries libraries in /usr/lib/ntop.
* Add change-plugin-dir.patch for adjusting plugin directory.
* Remove development files.
* Use system library for MochiKit.js.
* Rewrite DEP5 copyright file.
* Repackage upstream tarball in order to remove non-DFSG-compliant code. Add
  get-orig-source.sh script and get-orig-source target in debian/rules.
* Add explanation to README.Debian why geolocation is no longer working.
* Add avoid-copy-maxmind-db.patch to prevent copying of Geo*.dat
  files.
* Remove old unused patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl> TODOs
 
2
 
 
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
 
6
 
 
7
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
8
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>
 
12
dnl>
 
13
dnl> Written Oct2002 by Burton M. Strauss III <burton@ntopsupport.com>
 
14
dnl>     (Loosely based on the earlier ntop version)
 
15
dnl>
 
16
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
17
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.
 
22
dnl>
 
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.
 
27
dnl>
 
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.
 
31
dnl>
 
32
 
 
33
dnl>
 
34
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
35
dnl> this file is processed via 'autoconf' to produce the 'configure' script
 
36
dnl> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
37
dnl>
 
38
 
 
39
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?)
 
43
dnl>
 
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"
 
46
dnl>       into the stamp.
 
47
dnl>
 
48
AC_INIT([ntop],[4.0.3])
 
49
 
 
50
dnl> The prereq is really 2.53, i.e. automake 1.6, but Darwin uses 2.52...
 
51
AC_PREREQ([2.52])
 
52
 
 
53
SCRIPTVER="v4.0.3-15-09-2010"
 
54
 
 
55
dnl>
 
56
dnl> generate the config header
 
57
dnl>
 
58
umask 002
 
59
AM_CONFIG_HEADER(config.h)
 
60
 
 
61
HAS_ERROR=
 
62
HAS_WARNING=
 
63
 
 
64
NTOP_VERSION_EXTRA=""
 
65
 
 
66
echo
 
67
echo "Welcome to $PACKAGE_NAME, Version $PACKAGE_VERSION $NTOP_VERSION_EXTRA"
 
68
echo "Copyright (C) 1998-2010 Luca Deri <deri@ntop.org>"
 
69
 
 
70
 
 
71
THE_UID=`id -u`
 
72
if test $THE_UID -eq 0; then
 
73
   echo "################## WARNING ##################"
 
74
   echo
 
75
   echo "Running configure and compiling as root might lead"
 
76
   echo "to compilation issues."
 
77
   echo
 
78
   echo "Please run configure as normal user, not as superuser"
 
79
   echo
 
80
   echo "#############################################"
 
81
fi
 
82
 
 
83
echo
 
84
echo          "Configuration script version $SCRIPTVER"
 
85
echo
 
86
echo "************************************************************************"
 
87
echo "*                                                                      *"
 
88
echo "* NOTICE:  I know you're used to ignoring output from ./configure      *"
 
89
echo "*                                                                      *"
 
90
echo "*          ntop has a lot of complexity and interdependences.          *"
 
91
echo "*                                                                      *"
 
92
echo "*          Please, please AT LEAST read the stuff in these boxes!      *"
 
93
echo "*                                                                      *"
 
94
echo "*>>> The ACTION taken by ./configure is shown prefixed with '>>>'      *"
 
95
echo "*                                                                      *"
 
96
echo "*    If that ACTION is unacceptable,                                   *"
 
97
echo "*??? Steps to take to fix the problem are shown, prefixed with '???'   *"
 
98
echo "*                                                                      *"
 
99
echo "************************************************************************"
 
100
echo
 
101
 
 
102
if test ".${NTOPCONFIGDEBUG}" = "."; then
 
103
    echo "NOTE:"
 
104
    echo
 
105
    echo "       To enable additional, debugging messages during the ./configure"
 
106
    echo "       execution, do this before running ./configure:"
 
107
    echo
 
108
    echo "$ export NTOPCONFIGDEBUG=yes"
 
109
    echo
 
110
fi
 
111
 
 
112
CONFIGURE_PARAMETERS=$*
 
113
echo
 
114
echo "Configuring ${PACKAGE_NAME} according to your request(s):"
 
115
echo "   ./configure ${CONFIGURE_PARAMETERS}"
 
116
echo
 
117
 
 
118
dnl> This has to be here due to some odd dependency...
 
119
AC_CANONICAL_TARGET
 
120
 
 
121
dnl> Basic sanity check ... does ntop.c exist?
 
122
AC_CONFIG_SRCDIR([ntop.c])
 
123
 
 
124
dnl> force configure to use current directory
 
125
AC_CONFIG_AUX_DIR(.)
 
126
 
 
127
AM_INIT_AUTOMAKE()
 
128
 
 
129
dnl> NTOPCONFIGDEBUG_SETTINGS([init automake])
 
130
 
 
131
dnl> make NTOPDIR the default for the installation
 
132
AC_PREFIX_DEFAULT(${NTOPDIR:-/usr/local})
 
133
 
 
134
# Set constants and defaults
 
135
SO_VERSION_PATCH=
 
136
MAKE_SHARED_LIBRARY_PARM="-shared -flat_namespace"
 
137
 
 
138
AS=
 
139
CCLD=
 
140
DEFS="-DHAVE_CONFIG_H"
 
141
DLLTOOL=
 
142
DYN_FLAGS=
 
143
EXEEXT=
 
144
INCS=
 
145
LIBS=
 
146
OBJDUMP=
 
147
OBJEXT=o
 
148
 
 
149
dnl> NTOPCONFIGDEBUG_SETTINGS([ntop defaults])
 
150
 
 
151
AC_ARG_ENABLE(void,
 
152
              [  +--ntop:---------------------------------------------------------------------+])
 
153
 
 
154
AC_ARG_ENABLE(mysql,
 
155
              [  --enable-mysql              Enable usage of mysql [[default=disabled]]],
 
156
              [if test "x$enableval" = xyes; then
 
157
                  ac_with_mysql="yes"
 
158
              else
 
159
dnl               echo "x$enableval"
 
160
                  ac_with_mysql="no"
 
161
              fi],
 
162
              [ac_with_mysql="no"])
 
163
 
 
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"
 
168
              else
 
169
dnl               echo "x$enableval"
 
170
                  ac_with_efficiency="no"
 
171
              fi],
 
172
              [ac_with_efficiency="no"])
 
173
 
 
174
AC_ARG_ENABLE(fc,
 
175
              [  --enable-fc                 Enable Fibre Channel/iSCSI support [[default=disabled]]],
 
176
              [if test "x$enableval" = xyes; then
 
177
                  ac_with_fc="yes"
 
178
              else
 
179
dnl               echo "x$enableval"
 
180
                  ac_with_fc="no"
 
181
              fi],
 
182
              [ac_with_fc="no"])
 
183
 
 
184
AC_ARG_ENABLE(void,
 
185
              [  +----------------------------------------------------------------------------+])
 
186
 
 
187
# Checks for programs.
 
188
 
 
189
AC_PROG_CPP
 
190
AC_PROG_CC
 
191
dnl> AC_PROG_CXX no c++ code (yet?)
 
192
AC_PROG_INSTALL
 
193
AC_PROG_LN_S
 
194
AC_PROG_MAKE_SET
 
195
 
 
196
 
 
197
AM_ENABLE_SHARED
 
198
AM_PROG_LIBTOOL
 
199
 
 
200
dnl> NTOPCONFIGDEBUG_SETTINGS([After ac stuff])
 
201
 
 
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.
 
204
 
 
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])
 
215
 
 
216
dnl> end autoheader stuff
 
217
 
 
218
AC_ARG_ENABLE(void,
 
219
              [  +--ntop-specific:------------------------------------------------------------+])
 
220
AC_ARG_WITH(void,
 
221
              [  +--external-packages:--------------------------------------------------------+])
 
222
 
 
223
AC_ARG_WITH(ssl,
 
224
              [  --without-ssl               disable HTPPS support [[default=enabled]]],
 
225
              if test "x$withval" = xno; then
 
226
                  ac_disable_openssl="yes"
 
227
              else
 
228
                  ac_disable_openssl="no"
 
229
              fi,
 
230
              ac_disable_openssl="no")
 
231
 
 
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"
 
236
              else
 
237
                  ac_disable_plugins="no"
 
238
              fi,
 
239
              ac_disable_plugins="no")
 
240
 
 
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")
 
245
 
 
246
AC_ARG_ENABLE(snmp,
 
247
              [  --disable-snmp              Disable SNMP support [[default=disable]]],
 
248
              if test "x$enableval" = xno; then
 
249
                  ac_disable_snmp="yes"
 
250
              else
 
251
                  ac_disable_snmp="no"
 
252
              fi,
 
253
              ac_disable_snmp="yes")
 
254
 
 
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")
 
259
 
 
260
AC_ARG_ENABLE(ipv6,
 
261
              [  --disable-ipv6              use IPv6 [[default=enabled]]],
 
262
              if test "x$enableval" = xno; then
 
263
                  ac_disable_ipv6="yes"
 
264
              else
 
265
                  ac_disable_ipv6="no"
 
266
              fi,
 
267
              ac_disable_ipv6="no")
 
268
 
 
269
dnl>
 
270
dnl> Define the "WITH"s for package root directories ... deal with these later...
 
271
dnl>
 
272
AC_ARG_WITH(void,
 
273
              [  +-External-source-locations:-------------------------------------------------+])
 
274
 
 
275
AC_ARG_WITH(  rrd-home,
 
276
              [  --with-rrd-home=DIR        Usually /usr/local/rrdtool-1.2.x],
 
277
              RRD_HOME="$withval",
 
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",
 
282
              PCAP_ROOT=)
 
283
AC_ARG_WITH(  gdbm-root,
 
284
              [  --with-gdbm-root=DIR        gdbm located in DIR],
 
285
              GDBM_DIRECTORY="$withval",
 
286
              GDBM_DIRECTORY=)
 
287
AC_ARG_WITH(  gdbm-lib,
 
288
              [  --with-gdbm-lib=DIR          or libgdbm located in DIR],
 
289
              GDBM_LIB="$withval",
 
290
              GDBM_LIB=)
 
291
AC_ARG_WITH(  gdbm-include,
 
292
              [  --with-gdbm-include=DIR      or gdbm.h located in DIR],
 
293
              GDBM_INCLUDE="$withval",
 
294
              GDBM_INCLUDE=)
 
295
 
 
296
AC_ARG_WITH(  zlib-root,
 
297
              [  --with-zlib-root=DIR        zlib located in DIR],
 
298
              ZLIB_DIRECTORY="$withval",
 
299
              ZLIB_DIRECTORY=)
 
300
AC_ARG_WITH(  zlib-lib,
 
301
              [  --with-zlib-lib=DIR          or libz located in DIR],
 
302
              ZLIB_LIB="$withval",
 
303
              ZLIB_LIB=)
 
304
AC_ARG_WITH(  zlib-include,
 
305
              [  --with-zlib-include=DIR      or zlib.h located in DIR],
 
306
              ZLIB_INCLUDE="$withval",
 
307
              ZLIB_INCLUDE=)
 
308
 
 
309
AC_ARG_WITH(  ossl-root,
 
310
              [  --with-ossl-root=DIR        openSSL located in DIR],
 
311
              OSSL_DIRECTORY="$withval",
 
312
              OSSL_DIRECTORY=)
 
313
AC_ARG_WITH(  ossl-lib,
 
314
              [  --with-ossl-lib=DIR          or libssl located in DIR],
 
315
              OSSL_LIB="$withval",
 
316
              OSSL_LIB=)
 
317
AC_ARG_WITH(  ossl-include,
 
318
              [  --with-ossl-include=DIR      or ssl.h located in DIR],
 
319
              OSSL_INCLUDE="$withval",
 
320
              OSSL_INCLUDE=)
 
321
 
 
322
AC_ARG_WITH(  memorydebug,
 
323
              [  --with-memorydebug=VALUE    Set numeric code for memory debug option],
 
324
              MEMORYDEBUG="$withval",
 
325
              MEMORYDEBUG=)
 
326
 
 
327
AC_ARG_ENABLE(void,
 
328
              [  +----------------------------------------------------------------------------+])
 
329
AC_ARG_WITH(void,
 
330
              [  +----------------------------------------------------------------------------+])
 
331
 
 
332
 
 
333
AC_CHECK_FILE(aclocal.m4, , [
 
334
    echo ""
 
335
    echo "Invoking aclocal to create aclocal.m4..."
 
336
    $ACLOCAL
 
337
    echo ""
 
338
])
 
339
AC_CHECK_FILE(depcomp, , [
 
340
    echo ""
 
341
    echo "depcomp missing... will install it in this ntop directory."
 
342
    echo "  Invoking automake to copy depcomp..."
 
343
    $AUTOMAKE --gnu --copy --add-missing
 
344
    echo ""
 
345
])
 
346
 
 
347
dnl> Networking libraries
 
348
AC_SEARCH_LIBS([gethostbyname], [nsl resolv])
 
349
AC_SEARCH_LIBS([socket], [xnet socket])
 
350
 
 
351
dnl> Handle the root -> lib/include settings
 
352
NTOP_SET_LIBINC(PCAP)
 
353
NTOP_SET_LIBINC(GDBM)
 
354
NTOP_SET_LIBINC(ZLIB)
 
355
 
 
356
dnl> From here on out, we only use the _INCLUDE and _LIB except for locale and glibconfig
 
357
 
 
358
dnl> NTOPCONFIGDEBUG_SETTINGS([After set libinc])
 
359
 
 
360
dnl>
 
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.
 
364
dnl>
 
365
 
 
366
echo
 
367
echo "Checking C compiler program and features..."
 
368
echo
 
369
AM_PROG_CC_STDC
 
370
if test ".${ac_cv_prog_cc_stdc}" = ".no"; then
 
371
    echo
 
372
    echo "*******************************************************************"
 
373
    echo "*"
 
374
    echo "* WARNING: Attempting to configure for non ANSI standard C."
 
375
    echo "*"
 
376
    echo "*>>> This is unsupported."
 
377
    echo "*>>> It will probably fail."
 
378
    echo "*"
 
379
    echo "*    You are welcome to try - but please, keep the ntop-dev"
 
380
    echo "*    mailing list updated with your successes or failures..."
 
381
    echo "*"
 
382
    echo "*******************************************************************"
 
383
    echo
 
384
    HAS_WARNING="yes"
 
385
fi
 
386
 
 
387
dnl> NTOPCONFIGDEBUG_SETTINGS([After cc stdc test])
 
388
 
 
389
dnl> Any common settings required to support a specific OS, distribution or release
 
390
dnl> go here also.
 
391
 
 
392
dnl> Add include file locations to CPPFLAGS (for the preprocessor)
 
393
dnl> and add libraries (location) -L and (names) -l to LDFLAGS.
 
394
 
 
395
dnl> Skipping cases is, I guess, ok, but always remember that you might have
 
396
dnl> been grabbed by an earlier target.
 
397
 
 
398
DISTRO=""
 
399
RELEASE=""
 
400
 
 
401
echo ""
 
402
echo "*******************************************************************"
 
403
echo "*"
 
404
echo "* Checking for unique options for ${target}, ${CC}..."
 
405
echo "*"
 
406
 
 
407
case "${target}:${CC}" in
 
408
 
 
409
    *-*-linux*:* )
 
410
        DEFINEOS="LINUX"
 
411
        DISTRO=`utils/linuxrelease --distro`
 
412
        RELEASE=`utils/linuxrelease --release`
 
413
        echo "* This appears to be ${DEFINEOS} ${DISTRO} ${RELEASE}"
 
414
      ;;
 
415
 
 
416
    *-*-solaris*:* )
 
417
        DEFINEOS="SOLARIS"
 
418
        RELEASE=`uname -r | cut -c 3-`
 
419
        echo "* This appears to be ${DEFINEOS}"
 
420
        echo "*"
 
421
        echo "* 1) Compilation requires various gnu tools from SunFreeware.com or other sources."
 
422
      ;;
 
423
 
 
424
    *-*-darwin*:* )
 
425
        DEFINEOS="DARWIN"
 
426
        MAKE_SHARED_LIBRARY_PARM="-bundle -flat_namespace -undefined suppress"
 
427
        echo "* This appears to be ${DEFINEOS} (MacOSX)"
 
428
      ;;
 
429
 
 
430
    *-*-freebsd*:* )
 
431
        DEFINEOS="FREEBSD"
 
432
        RELEASE=`utils/linuxrelease --release | sed -e 's/\.//' -e 's/-.*$//g'`
 
433
        echo "* This appears to be ${DEFINEOS} ${RELEASE}"
 
434
      ;;
 
435
    *-*-mingw32*:gcc* )
 
436
        DEFINEOS="MINGW"
 
437
        echo "* This appears to be ${DEFINEOS} (release not checked)"
 
438
      ;;
 
439
 
 
440
    * )
 
441
        echo "* ${target} is an unknown/unsupported OS"
 
442
        echo "*"
 
443
        echo "*******************************************************************"
 
444
        if test "x${ac_willfailoverride}" = "xyes"; then
 
445
            echo "*"
 
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."
 
448
            echo "*"
 
449
            echo "*    Please keep the ntop-dev mailing list updated with any"
 
450
            echo "*    successes you have or problems you encounter..."
 
451
            echo "*"
 
452
        else
 
453
            exit 1
 
454
        fi
 
455
      ;;
 
456
esac
 
457
 
 
458
if test ".${MEMORYDEBUG}" = "."; then
 
459
  CPPFLAGS="${CPPFLAGS} -D${DEFINEOS}"
 
460
else
 
461
  CPPFLAGS="${CPPFLAGS} -D${DEFINEOS} -DMEMORY_DEBUG=${MEMORYDEBUG}"
 
462
fi
 
463
 
 
464
if test -d ./configureextra; then
 
465
 
 
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.
 
469
 
 
470
    echo "*"
 
471
    echo "*   Testing for extra configuration options for ${DEFINEOS} ${DISTRO} ${RELEASE}"
 
472
 
 
473
    if test -f ./configureextra/${DEFINEOS}; then
 
474
        echo "*"
 
475
        echo "*    Executing configureextra/${DEFINEOS}"
 
476
        . ./configureextra/${DEFINEOS}
 
477
        CONFIGURE_PARAMETERS="${CONFIGURE_PARAMETERS} + configureextra/${DEFINEOS}"
 
478
    fi
 
479
    if test ".${DISTRO}" != "."; then
 
480
        if test -f ./configureextra/${DEFINEOS}${DISTRO}; then
 
481
            echo "*"
 
482
            echo "*    Executing configureextra/${DEFINEOS}${DISTRO}"
 
483
            . ./configureextra/${DEFINEOS}${DISTRO}
 
484
            CONFIGURE_PARAMETERS="${CONFIGURE_PARAMETERS} + configureextra/${DEFINEOS}${DISTRO}"
 
485
        fi
 
486
        if test ".${RELEASE}" != "." &&
 
487
           test -f ./configureextra/${DEFINEOS}${DISTRO}${RELEASE}; then
 
488
            echo "*"
 
489
            echo "*    Executing configureextra/${DEFINEOS}${DISTRO}${RELEASE}"
 
490
            . ./configureextra/${DEFINEOS}${DISTRO}${RELEASE}
 
491
            CONFIGURE_PARAMETERS="${CONFIGURE_PARAMETERS} + configureextra/${DEFINEOS}${DISTRO}${RELEASE}"
 
492
        fi
 
493
    else
 
494
        if test ".${RELEASE}" != "." &&
 
495
           test -f ./configureextra/${DEFINEOS}${RELEASE}; then
 
496
            echo "*"
 
497
            echo "*    Executing configureextra/${DEFINEOS}${RELEASE}"
 
498
            . ./configureextra/${DEFINEOS}${RELEASE}
 
499
            CONFIGURE_PARAMETERS="${CONFIGURE_PARAMETERS} + configureextra/${DEFINEOS}${RELEASE}"
 
500
        fi
 
501
    fi
 
502
fi
 
503
 
 
504
echo "*"
 
505
echo "*******************************************************************"
 
506
 
 
507
dnl>
 
508
dnl> Last chance default (if there is an os-specific value, set it above)
 
509
dnl>
 
510
if test ".${LOCALEDIR}" = "."; then
 
511
    LOCALEDIR="/usr/lib/locale"
 
512
fi
 
513
 
 
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"
 
518
 
 
519
PWD=`pwd`
 
520
 
 
521
echo
 
522
echo "Test the compiler and setup CFLAGS..."
 
523
echo
 
524
case "$CFLAGS" in
 
525
    *-g* )
 
526
        ;;
 
527
    * )
 
528
        CFLAGS="$CFLAGS -g"
 
529
        AC_MSG_CHECKING([if compiler accepts -g (debugging information)])
 
530
        oCFLAGS=$CFLAGS
 
531
        CFLAGS="-g $CFLAGS"
 
532
        AC_TRY_COMPILE( ,
 
533
                       return 0 ,
 
534
                       AC_MSG_RESULT(yes),
 
535
                       CFLAGS="${oCFLAGS}"
 
536
                       AC_MSG_RESULT(no)
 
537
                      )
 
538
        ;;
 
539
esac
 
540
 
 
541
AC_MSG_CHECKING([if compiler accepts -W (warning flags)])
 
542
oCFLAGS=$CFLAGS
 
543
CFLAGS="$CFLAGS -Wshadow -Wpointer-arith -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
 
544
AC_TRY_COMPILE( ,
 
545
               return 0 ,
 
546
               AC_MSG_RESULT(yes),
 
547
               CFLAGS="${oCFLAGS}"
 
548
               AC_MSG_RESULT(no)
 
549
              )
 
550
 
 
551
dnl> add pic flag in any case this makes sure all our code is relocatable
 
552
case "${target}:${CC}" in
 
553
    *-*-darwin*:* )
 
554
        CFLAGS="$CFLAGS "`grep pic_flag= /usr/bin/glibtool | head -n1 | sed -e 's/.*pic_flag=//' -e 's/"//g'`
 
555
        ;;
 
556
    * )
 
557
        CFLAGS="$CFLAGS "`grep pic_flag= libtool | head -n1 | sed -e 's/.*pic_flag=//' -e 's/"//g'`
 
558
        ;;
 
559
esac
 
560
 
 
561
dnl> Presets for the make flags go here...
 
562
CFLAGS="${CFLAGS}"
 
563
CPPFLAGS="${CPPFLAGS}"
 
564
LDFLAGS="${LDFLAGS}"
 
565
 
 
566
dnl> NTOPCONFIGDEBUG_SETTINGS([After presets])
 
567
 
 
568
AC_CHECK_LIB([pfring], [pfring_open], LDFLAGS="${LDFLAGS} -lpfring")
 
569
 
 
570
echo
 
571
echo "Critical library/include tests..."
 
572
echo
 
573
dnl>
 
574
dnl>  Without these, don't even BOTHER testing the parameters...
 
575
dnl>
 
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.
 
578
dnl>
 
579
 
 
580
dnl>
 
581
dnl> user defined directory passed as option at configuration time
 
582
dnl>
 
583
 
 
584
if test ".${PCAPRING_DIR}" != .; then
 
585
   if test ".${PCAP_ROOT}" != .; then
 
586
     echo
 
587
     echo "*******************************************************************"
 
588
     echo "*"
 
589
     echo "* WARNING: libpcap checking in ${PCAP_ROOT} skipped"
 
590
     echo "*          we have taken libpcap from ${PCAPRING_DIR}"
 
591
     echo "*"
 
592
     echo "*"
 
593
     echo "*******************************************************************"
 
594
     echo
 
595
   fi
 
596
else
 
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])
 
605
  else
 
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!])
 
613
  fi
 
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])
 
621
dnl>
 
622
dnl> installation used by most packagers
 
623
dnl>
 
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])
 
629
dnl>
 
630
dnl> installation used by OSX
 
631
dnl>
 
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])
 
637
dnl>
 
638
dnl> unusual and more complex installation used by some packagers
 
639
dnl> (e.g. Red Hat Linux)
 
640
dnl>
 
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])
 
647
else
 
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! ])
 
655
                     ])
 
656
fi
 
657
fi
 
658
AC_CHECK_LIB([pcap], [pcap_next_ex], AC_DEFINE_UNQUOTED(HAVE_PCAP_NEXT_EX, 1, [pcap has pcap_next_ex]))
 
659
 
 
660
AC_MSG_CHECKING([for gdbm])
 
661
AC_MSG_RESULT([])
 
662
 
 
663
if (test ".${GDBM_LIB}" != "."      &&
 
664
    test ! -d ${GDBM_LIB})              ||
 
665
   (test ".${GDBM_INCLUDE}" != "."  &&
 
666
    test ! -d ${GDBM_INCLUDE}); then
 
667
    echo
 
668
    echo "*******************************************************************"
 
669
    echo "*"
 
670
    echo "* ERROR:    You specified or implied a non-existent directory for"
 
671
    echo "*           libgdbm:"
 
672
    echo "*               --with-gdbm-lib=${GDBM_LIB}"
 
673
    echo "*               --with-gdbm-include=${GDBM_INCLUDE}"
 
674
    echo "*"
 
675
    echo "*>>> Continuing without libgdbm is impossible."
 
676
    echo "*"
 
677
    echo "*???     1. Correct the --with-gdbm-xxxxx option and rerun"
 
678
    echo "*???        ./configure"
 
679
    echo "*"
 
680
    echo "*******************************************************************"
 
681
    echo
 
682
    exit 1
 
683
else
 
684
    NTOP_APPENDS([${GDBM_INCLUDE}], [${GDBM_LIB}], [gdbm])
 
685
fi
 
686
 
 
687
AC_CHECK_HEADERS([gdbm.h])
 
688
AC_CHECK_LIB([gdbm], [gdbm_open])
 
689
 
 
690
if test ".${ac_cv_header_gdbm_h}" != ".yes" ||
 
691
   test ".${ac_cv_lib_gdbm_gdbm_open}" != ".yes"; then
 
692
    echo
 
693
    echo "*******************************************************************"
 
694
    echo "*"
 
695
    echo "* ERROR: gdbm header or library routines are missing"
 
696
    echo "*           (yes means it was found, no means it was not found)"
 
697
    echo "*"
 
698
    echo "*              gdbm.h...${ac_cv_header_gdbm_h}"
 
699
    echo "*              gdbm_open() in -lgdbm...${ac_cv_lib_gdbm_gdbm_open}"
 
700
    echo "*"
 
701
    echo "*>>> No way to proceed."
 
702
    echo "*"
 
703
    echo "*???     1. Install libgdbm"
 
704
    echo "*???    and Rerun ./configure"
 
705
    echo "*???  or 2. Use the --with-gdbm-xxxxx= options"
 
706
    echo "*"
 
707
    echo "*******************************************************************"
 
708
    echo
 
709
    AC_MSG_ERROR(Unable to continue... aborting ./configure)
 
710
fi
 
711
 
 
712
dnl> FastBit
 
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])
 
718
 fi
 
719
fi
 
720
 
 
721
dnl> Define the arguments we accept...
 
722
dnl>
 
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.
 
726
dnl>
 
727
dnl>   And it keeps them together in the ./configure --help output
 
728
dnl>
 
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().
 
731
 
 
732
dnl> So, we...
 
733
 
 
734
dnl> Test the enable, disable and with's for unreasonable combinations.
 
735
 
 
736
echo
 
737
echo "Plugins?"
 
738
PLUGINS=
 
739
if test ".${ac_disable_plugins}" = ".yes"; then
 
740
    echo "    ...Disabled via ./configure command line option --disable-plugins"
 
741
else
 
742
    PLUGINS=plugins
 
743
    echo "    ...(Default) Requested. Disable via ./configure command line option --disable-plugins."
 
744
fi
 
745
 
 
746
 
 
747
echo
 
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])
 
752
else
 
753
    echo "    ...(Default) Disabled. Request via ./configure command line option --enable-jumbo-frames."
 
754
fi
 
755
 
 
756
echo
 
757
echo "Processing the rest of the ROOT/DIRECTORY entries"
 
758
echo
 
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.
 
761
 
 
762
dnl> Openssl
 
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
 
768
        echo
 
769
        echo "*******************************************************************"
 
770
        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}"
 
775
        fi
 
776
        if test ".${OSSL_INCLUDE}" != "."; then
 
777
            echo "*               --with-ossl-include=${OSSL_INCLUDE}"
 
778
        fi
 
779
        echo "*"
 
780
        echo "*>>> Continuing without the --with-ossl-xxxxx values"
 
781
        echo "*"
 
782
        echo "*        ./configure should complete 'successfully'"
 
783
        echo "*"
 
784
        echo "*        ntop may find openSSL installed in a standard location."
 
785
        echo "*"
 
786
        echo "*        If not found, ntop will disable code dependent upon"
 
787
        echo "*        openSSL meaning no https:// support."
 
788
        echo "*"
 
789
        echo "*    Read the remaining messages carefully!"
 
790
        echo "*"
 
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"
 
794
        echo "*"
 
795
        echo "*******************************************************************"
 
796
        echo
 
797
        OSSL_LIB=
 
798
        OSSL_INCLUDE=
 
799
        HAS_WARNING="yes"
 
800
    else
 
801
        NTOP_APPENDS([${OSSL_INCLUDE}], [${OSSL_LIB}], [gdbm])
 
802
    fi
 
803
fi
 
804
 
 
805
if (test ".${ZLIB_LIB}" != "."      &&
 
806
    test ! -d ${ZLIB_LIB})              ||
 
807
   (test ".${ZLIB_INCLUDE}" != "."  &&
 
808
    test ! -d ${ZLIB_INCLUDE}); then
 
809
    echo
 
810
    echo "*******************************************************************"
 
811
    echo "*"
 
812
    echo "* ERROR:    You specified or implied a non-existent directory for"
 
813
    echo "*           zlib:"
 
814
    if test ".${ZLIB_LIB}" != "."; then
 
815
        echo "*               --with-zlib-lib=${ZLIB_LIB}"
 
816
    fi
 
817
    if test ".${ZLIB_INCLUDE}" != "."; then
 
818
        echo "*               --with-zlib-include=${ZLIB_INCLUDE}"
 
819
    fi
 
820
    echo "*"
 
821
    echo "*>>> Continuing without the --with-zlib-xxxxx values"
 
822
    echo "*"
 
823
    echo "*        ./configure should complete 'successfully'"
 
824
    echo "*"
 
825
    echo "*        ntop may find zlib installed in a standard location."
 
826
    echo "*"
 
827
    echo "*        If not found, ntop will disable code dependent upon zlib"
 
828
    echo "*        meaning no compressed web pages or input files."
 
829
    echo "*"
 
830
    echo "*    Read the remaining messages carefully!"
 
831
    echo "*"
 
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"
 
835
    echo "*"
 
836
    echo "*******************************************************************"
 
837
    echo
 
838
    ZLIB_LIB=
 
839
    ZLIB_INCLUDE=
 
840
    HAS_WARNING="yes"
 
841
else
 
842
    NTOP_APPENDS([${ZLIB_INCLUDE}], [${ZLIB_LIB}], [z])
 
843
fi
 
844
 
 
845
if test ".${LOCALEDIR}" != "." &&
 
846
   test ! -d ${LOCALEDIR}; then
 
847
    echo
 
848
    echo "*******************************************************************"
 
849
    echo "*"
 
850
    echo "* WARNING:  You specified a non-existent directory for locale files"
 
851
    echo "*                  --with-localedir=${LOCALEDIR}"
 
852
    echo "*"
 
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."
 
856
    echo "*"
 
857
    echo "*???     1. Correct the --with-localedir option and rerun"
 
858
    echo "*???        ./configure"
 
859
    echo "*"
 
860
    echo "*******************************************************************"
 
861
    echo
 
862
    HAS_WARNING="yes"
 
863
fi
 
864
 
 
865
dnl> Specific compiler feature tests
 
866
AC_C_CONST
 
867
AC_C_VOLATILE
 
868
AC_C_INLINE
 
869
AC_C_CHAR_UNSIGNED
 
870
AC_C_LONG_DOUBLE
 
871
 
 
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])])
 
875
 
 
876
 
 
877
dnl> NTOPCONFIGDEBUG_SETTINGS([After libraries])
 
878
 
 
879
echo
 
880
echo "Testing headers and functions..."
 
881
echo
 
882
 
 
883
AC_HEADER_STDC
 
884
AC_HEADER_DIRENT
 
885
AC_HEADER_SYS_WAIT
 
886
AC_HEADER_TIME
 
887
 
 
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])
 
893
 
 
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])
 
898
 
 
899
# Network
 
900
AC_CHECK_HEADERS([netinet/in.h])
 
901
AC_CHECK_HEADERS([arpa/inet.h arpa/nameser.h])
 
902
AC_CHECK_HEADERS([net/ethernet.h])
 
903
 
 
904
AC_CHECK_LIB([z], [zlibVersion], [], [
 
905
        echo "Error! You need to have zlib."
 
906
        exit -1
 
907
        ])
 
908
 
 
909
# RRD
 
910
if test -d "$RRD_HOME"; then
 
911
   AC_MSG_RESULT(checking for RRD home... yes)
 
912
else
 
913
   RRD_HOME=/usr/local/rrdtool
 
914
   if test -d "$RRD_HOME"; then
 
915
      AC_MSG_RESULT(Checking rrdtool in $RRD_HOME)
 
916
   else
 
917
      RRD_HOME=/usr/local
 
918
   fi
 
919
fi
 
920
 
 
921
RRD_LIB="-L${RRD_HOME}/lib -lrrd_th"
 
922
 
 
923
if test -f "$RRD_HOME/lib/librrd_th.so"; then
 
924
   AC_MSG_RESULT(checking for rrdtool... yes)
 
925
else
 
926
  if test -f "$RRD_HOME/lib/librrd_th.dylib"; then # OSX
 
927
     AC_MSG_RESULT(checking for rrdtool... yes)
 
928
  else
 
929
     if test -f "$RRD_HOME/lib/librrd_th.a"; then
 
930
       AC_MSG_RESULT(checking for rrdtool... yes)
 
931
     else
 
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/);
 
936
       else
 
937
         RRD_LIB=
 
938
       fi
 
939
     fi
 
940
  fi
 
941
fi
 
942
 
 
943
RRD_INC=
 
944
if test -d "${RRD_HOME}/include"; then
 
945
  RRD_INC="-I${RRD_HOME}/include"
 
946
fi
 
947
 
 
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>
 
954
#endif
 
955
#ifdef HAVE_SYS_SOCKET_H
 
956
#include <sys/socket.h>
 
957
#endif])
 
958
 
 
959
AC_CHECK_HEADER([net/if_dl.h],[
 
960
AC_DEFINE_UNQUOTED(HAVE_IFLIST_SYSCTL,   1, [use sysctl support for fetch interface informations])
 
961
])
 
962
 
 
963
AC_CHECK_HEADERS([netinet/if_ether.h], [], [], [
 
964
#ifdef HAVE_SYS_TYPES_H
 
965
#include <sys/types.h>
 
966
#endif
 
967
#ifdef HAVE_SYS_SOCKET_H
 
968
#include <sys/socket.h>
 
969
#endif
 
970
#ifdef HAVE_NETINET_IN_H
 
971
#include <netinet/in.h>
 
972
#endif
 
973
#ifdef HAVE_NET_IF_H
 
974
#include <net/if.h>
 
975
#endif])
 
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>
 
980
#endif
 
981
#ifdef HAVE_NETINET_IN_SYSTM_H
 
982
#include <netinet/in_systm.h>
 
983
#endif
 
984
#ifdef HAVE_NETINET_IN_H
 
985
#include <netinet/in.h>
 
986
#endif])
 
987
AC_CHECK_HEADERS([netinet/ip_icmp.h], [], [], [
 
988
#ifdef HAVE_SYS_TYPES_H
 
989
#include <sys/types.h>
 
990
#endif
 
991
#ifdef HAVE_SYS_SOCKET_H
 
992
#include <sys/socket.h>
 
993
#endif
 
994
#ifdef HAVE_NETINET_IN_H
 
995
#include <netinet/in.h>
 
996
#endif
 
997
#ifdef HAVE_NETINET_IN_SYSTM_H
 
998
#include <netinet/in_systm.h>
 
999
#endif
 
1000
#ifdef HAVE_NETINET_IP_H
 
1001
#include <netinet/ip.h>
 
1002
#endif])
 
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>
 
1007
#endif
 
1008
#ifdef HAVE_NETINET_IN_H
 
1009
#include <netinet/in.h>
 
1010
#endif])
 
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>
 
1016
#endif])
 
1017
AC_CHECK_HEADERS([net/route.h], [], [], [
 
1018
#ifdef HAVE_SYS_TYPES_H
 
1019
#include <sys/types.h>
 
1020
#endif
 
1021
#ifdef HAVE_SYS_SOCKET_H
 
1022
#include <sys/socket.h>
 
1023
#endif])
 
1024
 
 
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
 
1030
#include <net/if.h>
 
1031
#endif
 
1032
#ifdef HAVE_NETINET_IF_ETHER_H
 
1033
#include <netinet/if_ether.h>
 
1034
#endif])
 
1035
 
 
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])
 
1041
fi
 
1042
 
 
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])
 
1046
 
 
1047
## Other
 
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])
 
1062
 
 
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])
 
1068
 
 
1069
AC_MSG_CHECKING([if r/w locks are supported])
 
1070
AC_TRY_RUN([
 
1071
#include <pthread.h>
 
1072
 
 
1073
int main()
 
1074
{
 
1075
        pthread_rwlock_t t;
 
1076
        return 0;
 
1077
}
 
1078
 
 
1079
]
 
1080
, [ AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(HAVE_RW_LOCK, 1, [pthread has rw locks]) ], [AC_MSG_RESULT(no)]
 
1081
)
 
1082
 
 
1083
dnl> Optional, used for -L parameter
 
1084
AC_CHECK_HEADERS([sys/syslog.h syslog.h])
 
1085
 
 
1086
dnl> IPv6
 
1087
case "$ac_disable_ipv6" in
 
1088
        yes|''|autodetect)
 
1089
                ;;
 
1090
        no)
 
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>
 
1096
                #endif
 
1097
                #if HAVE_NETINET_IN_H
 
1098
                #include <netinet/in.h>
 
1099
                #endif])
 
1100
                AC_CHECK_FUNCS([sysctl])
 
1101
                ;;
 
1102
esac
 
1103
 
 
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)])])
 
1113
 
 
1114
AC_TYPE_PID_T
 
1115
dnl> Autoconf2: AC_CHECK_TYPE(pid_t, int)
 
1116
AC_TYPE_SIZE_T
 
1117
dnl> Autoconf2: AC_CHECK_TYPE(size_t, unsigned)
 
1118
AC_HEADER_TIME
 
1119
AC_STRUCT_TM
 
1120
AC_STRUCT_TIMEZONE
 
1121
 
 
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)
 
1131
 
 
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...
 
1134
case "${CC}" in
 
1135
  *gcc* )
 
1136
    AC_MSG_CHECKING([trivial compile])
 
1137
    AC_LANG_CONFTEST(
 
1138
    [AC_LANG_PROGRAM([[#include <unistd.h>]],
 
1139
                     [[int i=0;]])])
 
1140
    rm -f conftest.$ac_objext conftest$ac_exeext
 
1141
    (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 
1142
    (eval $ac_link) 2> trivialcompilemessage
 
1143
    ac_status=$?
 
1144
    if test ".${ac_status}" = ".0"; then
 
1145
        AC_MSG_RESULT(ok)
 
1146
    else
 
1147
        AC_MSG_WARN(error)
 
1148
        echo
 
1149
        echo "*******************************************************************"
 
1150
        echo "*"
 
1151
        echo "* ERROR: A trivial c compile has failed.  Something is seriously wrong."
 
1152
        echo "*"
 
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:"
 
1156
        echo "*"
 
1157
        echo "*        LIBS=${LIBS}"
 
1158
        echo "*        INCS=${INCS}"
 
1159
        echo "*        CPPFLAGS=${CPPFLAGS}"
 
1160
        echo "*        LDFLAGS=${LDFLAGS}"
 
1161
        echo "*"
 
1162
        echo "*        The compile error message is:"
 
1163
        echo "*"
 
1164
        cat trivialcompilemessage
 
1165
        echo "*"
 
1166
        echo "*>>> No way to proceed."
 
1167
        echo "*"
 
1168
        echo "*???     1. Correct the --with-xxxxx-xxxxx parameters"
 
1169
        echo "*???    and Rerun ./configure"
 
1170
        echo "*"
 
1171
        echo "*******************************************************************"
 
1172
        echo
 
1173
        AC_MSG_ERROR(Unable to continue... aborting ./configure)
 
1174
    fi
 
1175
    ;;
 
1176
esac
 
1177
 
 
1178
 
 
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])
 
1183
 
 
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])])
 
1187
 
 
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>
 
1193
#define __USE_GNU
 
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)])
 
1196
 
 
1197
 
 
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])])
 
1201
 
 
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)
 
1206
    ])
 
1207
])
 
1208
AC_CHECK_LIB(posix4, sem_init)
 
1209
 
 
1210
dnl> Functions and types
 
1211
AC_FUNC_FORK
 
1212
AC_PROG_GCC_TRADITIONAL
 
1213
dnl> do not use AC_FUNC_MALLOC ... because we have our own replacement...
 
1214
AC_FUNC_MEMCMP
 
1215
AC_FUNC_SETVBUF_REVERSED
 
1216
AC_TYPE_SIGNAL
 
1217
AC_FUNC_STAT
 
1218
AC_FUNC_STRFTIME
 
1219
dnl> AC_FUNC_VPRINTF
 
1220
 
 
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])
 
1246
 
 
1247
dnl> Test for strtok_r (we have our own defn if it's not available)
 
1248
AC_CHECK_FUNCS([strtok_r])
 
1249
 
 
1250
dnl> NTOPCONFIGDEBUG_SETTINGS([After all tests])
 
1251
 
 
1252
echo
 
1253
echo "Now, let's check for problems with what we've found..."
 
1254
echo
 
1255
echo "   Testing Required libraries and headers**"
 
1256
echo
 
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
 
1272
    AC_MSG_WARN(error)
 
1273
    echo
 
1274
    echo "*******************************************************************"
 
1275
    echo "*"
 
1276
    echo "* ERROR: Basic c library routines are missing."
 
1277
    echo "*           (yes means it was found, no means it was not found)"
 
1278
    echo "*"
 
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}"
 
1293
    echo "*"
 
1294
    echo "*>>> No way to proceed."
 
1295
    echo "*"
 
1296
    echo "*???     1. Install the necessary c compiler libraries/headers"
 
1297
    echo "*???    and Rerun ./configure"
 
1298
    echo "*"
 
1299
    echo "*******************************************************************"
 
1300
    echo
 
1301
    AC_MSG_ERROR(Unable to continue... aborting ./configure)
 
1302
else
 
1303
    AC_MSG_RESULT(ok)
 
1304
fi
 
1305
 
 
1306
AC_MSG_CHECKING([for crypt])
 
1307
if (test ".${ac_cv_lib_c_crypt}" != ".yes" &&
 
1308
    test ".${ac_cv_lib_crypt_crypt}" != ".yes"); then
 
1309
    AC_MSG_WARN(error)
 
1310
    echo
 
1311
    echo "*******************************************************************"
 
1312
    echo "*"
 
1313
    echo "* ERROR: 1. Basic c library routines are missing."
 
1314
    echo "*           (yes means it was found, no means it was not found)"
 
1315
    echo "*"
 
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}"
 
1318
    echo "*"
 
1319
    echo "*>>> No way to proceed."
 
1320
    echo "*"
 
1321
    echo "*???     1. Install the necessary c compiler libraries/headers"
 
1322
    echo "*???    and Rerun ./configure"
 
1323
    echo "*"
 
1324
    echo "*******************************************************************"
 
1325
    echo
 
1326
    AC_MSG_ERROR(Unable to continue... aborting ./configure)
 
1327
else
 
1328
    AC_MSG_RESULT(ok)
 
1329
fi
 
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])
 
1333
fi
 
1334
 
 
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
 
1342
    AC_MSG_WARN(error)
 
1343
    echo
 
1344
    echo "*******************************************************************"
 
1345
    echo "*"
 
1346
    echo "* ERROR: Critical c library routine is missing."
 
1347
    echo "*           (yes means it was found, no means it was not found)"
 
1348
    echo "*"
 
1349
    echo "*              dlopen() in -ldl...${ac_cv_lib_dl_dlopen} or -lc...${ac_cv_lib_c_dlopen}"
 
1350
    echo "*"
 
1351
    echo "*>>> No way to proceed."
 
1352
    echo "*"
 
1353
    echo "*???     1. Install the necessary c compiler libraries/headers"
 
1354
    echo "*???    and Rerun ./configure"
 
1355
    echo "*"
 
1356
    echo "*******************************************************************"
 
1357
    echo
 
1358
    AC_MSG_ERROR(Unable to continue... aborting ./configure)
 
1359
else
 
1360
    AC_MSG_RESULT(ok)
 
1361
fi
 
1362
 
 
1363
echo
 
1364
echo "-------------------------------------------------------------------"
 
1365
echo
 
1366
echo "   **Testing Optional libraries and headers**"
 
1367
echo
 
1368
 
 
1369
dnl> Multithreaded:
 
1370
AC_MSG_CHECKING([for Multithreading])
 
1371
 
 
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
 
1376
    AC_MSG_WARN(error)
 
1377
    echo
 
1378
    echo "*******************************************************************"
 
1379
    echo "*"
 
1380
    echo "* ERROR:    We are unable to find a header/library required"
 
1381
    echo "*           to support multi-threading."
 
1382
    echo "*"
 
1383
    echo "*>>>    ntop will not be configured"
 
1384
    echo "*"
 
1385
    echo "*    Missing:"
 
1386
    echo "*           (yes means it was found, no means it was not found)"
 
1387
    echo "*"
 
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}"
 
1390
    echo "*"
 
1391
    echo "*>>> No way to proceed."
 
1392
    echo "*"
 
1393
    echo "*???     1. Install the necessary headers and libraries."
 
1394
    echo "*???    and rerun ./configure"
 
1395
    echo "*"
 
1396
    echo "*******************************************************************"
 
1397
    echo
 
1398
    AC_MSG_ERROR(Unable to continue... aborting ./configure)
 
1399
fi
 
1400
AC_MSG_RESULT(ok)
 
1401
 
 
1402
dnl> openSSL:
 
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
 
1412
        AC_MSG_RESULT(ok)
 
1413
        AC_DEFINE_UNQUOTED(HAVE_OPENSSL, 1, [OPENSSL is available])
 
1414
    else
 
1415
        AC_MSG_WARN(error)
 
1416
        echo
 
1417
        echo "*******************************************************************"
 
1418
        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)"
 
1421
        echo "*"
 
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}"
 
1429
        echo "*"
 
1430
        echo "*>>>    ntop will be built without openSSL"
 
1431
        echo "*"
 
1432
        echo "*???     1. Install the necessary headers and libraries."
 
1433
        echo "*???    and rerun ./configure"
 
1434
        echo "*"
 
1435
        echo "*******************************************************************"
 
1436
        echo
 
1437
        HAS_WARNING="yes"
 
1438
    fi
 
1439
fi
 
1440
 
 
1441
dnl> zlib:
 
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
 
1448
    AC_MSG_RESULT(ok)
 
1449
    AC_DEFINE_UNQUOTED(MAKE_WITH_ZLIB, 1, [ZLIB is available])
 
1450
else
 
1451
    AC_MSG_WARN(error)
 
1452
    echo
 
1453
    echo "*******************************************************************"
 
1454
    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)"
 
1457
    echo "*"
 
1458
    echo "*                  zlib.h...${ac_cv_header_zlib_h}"
 
1459
    echo "*                  libz.so or libz.a...${ac_cv_lib_z_zlibVersion}"
 
1460
    echo "*"
 
1461
    echo "*>>>    ntop will be built without zlib"
 
1462
    echo "*"
 
1463
    echo "*???     1. Install the necessary headers and libraries."
 
1464
    echo "*???    and rerun ./configure"
 
1465
    echo "*"
 
1466
    echo "*******************************************************************"
 
1467
    echo
 
1468
    HAS_WARNING="yes"
 
1469
fi
 
1470
 
 
1471
dnl>
 
1472
dnl> Network Efficiency
 
1473
dnl>
 
1474
if test "x$ac_with_efficiency" = "xyes"; then
 
1475
    AC_DEFINE_UNQUOTED(ENABLE_EFFICIENCY, 1, [Compute ATM network efficiency])
 
1476
fi
 
1477
 
 
1478
dnl>
 
1479
dnl> Fibre Channel, iSCSI... support
 
1480
dnl>
 
1481
if test "x$ac_with_fc" = "xyes"; then
 
1482
    AC_DEFINE_UNQUOTED(ENABLE_FC, 1, [Enable Fibre Channel support])
 
1483
fi
 
1484
 
 
1485
dnl>
 
1486
dnl> MySQL
 
1487
dnl>
 
1488
if test "x$ac_with_mysql" = "xyes"; then
 
1489
 
 
1490
AC_CHECK_TOOL(MYSQL, mysql_config)
 
1491
if test "x$ac_cv_prog_ac_ct_MYSQL" = "xmysql_config"; then
 
1492
  OLD_LIBS="${LIBS}"
 
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
 
1498
    LIBS="${OLD_LIBS}"
 
1499
  else
 
1500
  dnl>
 
1501
  dnl> MySQL 4.x or better
 
1502
  dnl>
 
1503
    AC_CHECK_HEADERS([mysql.h])
 
1504
    if test ".${ac_cv_header_mysql_h}" != ".yes"; then
 
1505
      echo "MySQL not found. Database support disabled";
 
1506
      LIBS="${OLD_LIBS}"
 
1507
    else
 
1508
      echo "MySQL support enabled";
 
1509
      INCS="${INCS} `mysql_config --include`"
 
1510
    fi
 
1511
  fi
 
1512
  CPPFLAGS="${OLD_CPPFLAGS}"
 
1513
fi
 
1514
 
 
1515
fi
 
1516
 
 
1517
dnl>
 
1518
dnl> NET-SNMP
 
1519
dnl>
 
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`"
 
1531
  else
 
1532
    AC_MSG_RESULT(NETSNMP is not present: SNMP support is disabled)
 
1533
  fi
 
1534
fi
 
1535
 
 
1536
SAVED_INCS=$INCS
 
1537
SAVED_CFLAGS=$CFLAGS
 
1538
SAVED_LIBS=$LIBS
 
1539
 
 
1540
dnl>
 
1541
dnl> PYTHON
 
1542
dnl>
 
1543
  AC_CHECK_TOOL(PYTHON, python-config)
 
1544
  PYTHON_CONFIG=""
 
1545
 
 
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)
 
1549
           exit 1
 
1550
        else
 
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"
 
1556
        else
 
1557
          PYTHON_CONFIG="python-config"
 
1558
        fi
 
1559
     fi
 
1560
  else
 
1561
     PYTHON_CONFIG="python-config"
 
1562
  fi
 
1563
 
 
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)     
 
1568
    else
 
1569
    
 
1570
 
 
1571
    dnl echo "Python libs: ${PYTHON_LIBS}"
 
1572
    LIBS="${LIBS} ${PYTHON_LIBS}"
 
1573
 
 
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}"
 
1578
 
 
1579
OLD_CFLAGS=$CFLAGS
 
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"
 
1585
          #endif
 
1586
          ],
 
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])
 
1589
fi
 
1590
 
 
1591
else
 
1592
    AC_MSG_RESULT(Python[-devel] support is not present)
 
1593
    CFLAGS=$SAVED_CFLAGS
 
1594
    INCS=$SAVED_INCS
 
1595
fi
 
1596
 
 
1597
dnl>
 
1598
dnl> SCTP - RFC 3286
 
1599
dnl>
 
1600
AC_MSG_CHECKING([sctp])
 
1601
AC_TRY_LINK([
 
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])
 
1607
AC_MSG_RESULT(yes)
 
1608
ac_has_sctp=yes,
 
1609
AC_MSG_RESULT(no)
 
1610
ac_has_sctp=no)
 
1611
 
 
1612
dnl> Test for pthread_atfork()
 
1613
if test ".${ac_cv_header_pthread_h}" = ".yes"; then
 
1614
    AC_MSG_CHECKING([pthread_atfork])
 
1615
    AC_TRY_LINK([
 
1616
        #include "confdefs.h"
 
1617
        #include <pthread.h>],
 
1618
        [pthread_atfork(NULL, NULL, NULL);],
 
1619
        AC_DEFINE_UNQUOTED(HAVE_PTHREAD_ATFORK,
 
1620
                                1,
 
1621
                                [pthread_atfork() exists])
 
1622
        AC_MSG_RESULT(yes)
 
1623
        ac_has_pthread_atfork=yes,
 
1624
        AC_MSG_RESULT(no)
 
1625
        ac_has_pthread_atfork=no)
 
1626
else
 
1627
    ac_has_pthread_atfork=no
 
1628
fi
 
1629
 
 
1630
echo
 
1631
echo "Miscelaneous settings..."
 
1632
echo
 
1633
 
 
1634
dnl>
 
1635
dnl> GNU gcc backtrace?
 
1636
dnl>
 
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])
 
1641
else
 
1642
    AC_MSG_RESULT([not found])
 
1643
fi
 
1644
 
 
1645
dnl>
 
1646
dnl> getopt_long?
 
1647
dnl>
 
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])
 
1652
else
 
1653
    AC_MSG_RESULT([not found - long command line options are enabled using ntop code])
 
1654
    echo
 
1655
    echo "*******************************************************************"
 
1656
    echo "*"
 
1657
    echo "* NOTE: getopt_long does not appear to be provided on this system."
 
1658
    echo "*"
 
1659
    echo "*>>>    No worries - activating our built-in (libiberty) version."
 
1660
    echo "*>>>    ntop should work properly."
 
1661
    echo "*"
 
1662
    echo "*******************************************************************"
 
1663
    echo
 
1664
    mv utils/getopt/*[ch] .
 
1665
fi
 
1666
 
 
1667
dnl>
 
1668
dnl> Test for facilitynames
 
1669
dnl>
 
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])
 
1673
    AC_TRY_COMPILE([
 
1674
        #include "confdefs.h"
 
1675
        #include <stdarg.h>
 
1676
        #include <stdio.h>
 
1677
        #define SYSLOG_NAMES
 
1678
        #if defined(HAVE_SYS_SYSLOG_H)
 
1679
        #include <sys/syslog.h>
 
1680
        #elif defined(HAVE_SYSLOG_H)
 
1681
        #include <syslog.h>
 
1682
        #endif],
 
1683
        [void * x = (void*) &(facilitynames[0]);],
 
1684
        AC_MSG_RESULT(available)
 
1685
        AC_DEFINE_UNQUOTED(HAVE_FACILITYNAMES,
 
1686
                           1,
 
1687
                           [glibc syslog.h or sys/syslog.h with facilitynames[] option]),
 
1688
        AC_MSG_RESULT(unavailable))
 
1689
fi
 
1690
 
 
1691
dnl>
 
1692
dnl> Test ether_header has ea
 
1693
dnl>
 
1694
AC_MSG_CHECKING([if ether_header uses ether_addr structs])
 
1695
AC_TRY_COMPILE([
 
1696
#       include <sys/types.h>
 
1697
#       if __STDC__
 
1698
        /* osf3 has REALLY good prototyes */
 
1699
        struct mbuf;
 
1700
        struct rtentry;
 
1701
#       endif
 
1702
#       include <sys/socket.h>
 
1703
#       include <net/if.h>
 
1704
#       include <netinet/in.h>
 
1705
#       include <netinet/if_ether.h>],
 
1706
    [u_int i =
 
1707
         sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)],
 
1708
    [AC_MSG_RESULT(yes)
 
1709
     AC_DEFINE_UNQUOTED(CFG_ETHER_HEADER_HAS_EA,
 
1710
                        1,
 
1711
                        [ether_header uses ether_addr structs])],
 
1712
    [AC_MSG_RESULT(no)])
 
1713
 
 
1714
dnl>
 
1715
dnl> check for ip6 address used by sFlow...
 
1716
dnl>
 
1717
if test "${ac_disable_plugins}" != ".yes"; then
 
1718
    AC_MSG_CHECKING([if in6_addr is defined for sFlowPlugin])
 
1719
    AC_TRY_COMPILE([
 
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>
 
1725
        ],
 
1726
        [struct in6_addr tmp;],
 
1727
        [AC_MSG_RESULT(yes)
 
1728
         AC_DEFINE_UNQUOTED(HAVE_IN6_ADDR,
 
1729
                            1,
 
1730
                            [For sFlowPlugin.c to define in6_addr for environments without it.])],
 
1731
        [AC_MSG_RESULT(no)])
 
1732
fi
 
1733
 
 
1734
dnl>
 
1735
dnl> Temporary
 
1736
dnl>
 
1737
AC_DEFINE_UNQUOTED(RETSIGTYPE, void, [temporary definition])
 
1738
 
 
1739
dnl>
 
1740
dnl> Finish up...
 
1741
dnl>
 
1742
if test ".${CCLD}" = "."; then
 
1743
    CCLD=${CC}
 
1744
fi
 
1745
 
 
1746
dnl> Anything required for the memory debug options?
 
1747
if test ".${MEMORYDEBUG}" != "."; then
 
1748
  case "${MEMORYDEBUG}" in
 
1749
    1)
 
1750
        ;;
 
1751
    2)
 
1752
        LIBS="${LIBS} -lefence"
 
1753
        echo "*******************************************************************"
 
1754
        echo "*--with-memorydebug=2:"
 
1755
        echo "*"
 
1756
        echo "*  ElectricFence added to LIBS per your request"
 
1757
        echo "*"
 
1758
        echo "*******************************************************************"
 
1759
        ;;
 
1760
    3)
 
1761
        ;;
 
1762
    4)
 
1763
        ;;
 
1764
    *)
 
1765
        echo
 
1766
        echo "*******************************************************************"
 
1767
        echo "*"
 
1768
        echo "* WARNING:    The --with-memorydebug= value ${MEMORYDEBUG} is not recognized."
 
1769
        echo "*"
 
1770
        echo "*"
 
1771
        echo "*>>> Continuing, but may build bad code"
 
1772
        echo "*"
 
1773
        echo "*???     1. Fix/Remove --with-memorydebug"
 
1774
        echo "*"
 
1775
        echo "*******************************************************************"
 
1776
        echo
 
1777
        HAS_WARNING="yes"
 
1778
        ;;
 
1779
  esac
 
1780
fi
 
1781
 
 
1782
echo
 
1783
echo "-------------------------------------------------------------------"
 
1784
echo
 
1785
if test "x${AWK}" = "x"; then
 
1786
    echo
 
1787
    echo "*******************************************************************"
 
1788
    echo "*"
 
1789
    echo "* WARNING:    The test for AWK indicates you do not have any"
 
1790
    echo "*             version of Awk installed."
 
1791
    echo "*"
 
1792
    echo "*>>> Unable to remove duplicates from LIBS and INCS."
 
1793
    echo "*    ntop should work ok"
 
1794
    echo "*"
 
1795
    echo "*******************************************************************"
 
1796
    echo
 
1797
    HAS_WARNING="yes"
 
1798
else
 
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 } \
 
1803
        } \
 
1804
        for(i=1; i<=NF; i++) { \
 
1805
            if (i in out) { printf("%s ", out[[i]]) } \
 
1806
        } \
 
1807
        print "" \
 
1808
    }'`
 
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 } \
 
1812
        } \
 
1813
        for(i=1; i<=NF; i++) { \
 
1814
            if (i in out) { printf("%s ", out[[i]]) } \
 
1815
        } \
 
1816
        print "" \
 
1817
    }'`
 
1818
fi
 
1819
 
 
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]))
 
1823
 
 
1824
if test ".${ac_cv_lib_GeoIP_GeoIP_record_by_ipnum}" = ".yes"; then
 
1825
LIBS="$LIBS -lGeoIP"
 
1826
 
 
1827
if test -f "GeoLiteCity.dat"; then
 
1828
   echo "GeoLiteCity.dat already present"
 
1829
else
 
1830
   if test -f "3rd_party/GeoLiteCity.dat.gz"; then
 
1831
     cp 3rd_party/GeoLiteCity.dat.gz .
 
1832
   else
 
1833
     wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
 
1834
   fi
 
1835
 
 
1836
   gunzip GeoLiteCity.dat.gz
 
1837
fi
 
1838
 
 
1839
dnl> --------
 
1840
 
 
1841
if test -f "GeoIPASNum.dat"; then
 
1842
   echo "GeoIPASNum.dat already present"
 
1843
else
 
1844
   if test -f "3rd_party/GeoIPASNum.dat.gz"; then
 
1845
     cp 3rd_party/GeoIPASNum.dat.gz .
 
1846
   else
 
1847
     wget http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
 
1848
   fi
 
1849
 
 
1850
   gunzip GeoIPASNum.dat.gz
 
1851
fi
 
1852
else
 
1853
AC_MSG_RESULT(Please install GeoIP (http://www.maxmind.com/))
 
1854
exit 1
 
1855
fi
 
1856
 
 
1857
cp "3rd_party/oui.txt.gz" .
 
1858
cp "3rd_party/specialMAC.txt.gz" .
 
1859
 
 
1860
if test -d ./configureextra; then
 
1861
 
 
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.
 
1865
 
 
1866
    echo ""
 
1867
    echo "Testing for special final configuration options for ${DEFINEOS} ${DISTRO} ${RELEASE}"
 
1868
 
 
1869
    if test -f ./configureextra/final_${DEFINEOS}; then
 
1870
        echo ""
 
1871
        echo "    Executing configureextra/final_${DEFINEOS}"
 
1872
        . ./configureextra/final_${DEFINEOS}
 
1873
        echo ""
 
1874
    fi
 
1875
    if test ".${DISTRO}" != "."; then
 
1876
        if test -f ./configureextra/final_${DEFINEOS}${DISTRO}; then
 
1877
            echo ""
 
1878
            echo "    Executing configureextra/final_${DEFINEOS}${DISTRO}"
 
1879
            . ./configureextra/final_${DEFINEOS}${DISTRO}
 
1880
            echo ""
 
1881
        fi
 
1882
        if test ".${RELEASE}" != "." &&
 
1883
           test -f ./configureextra/final_${DEFINEOS}${DISTRO}${RELEASE}; then
 
1884
            echo ""
 
1885
            echo "    Executing configureextra/final_${DEFINEOS}${DISTRO}${RELEASE}"
 
1886
            . ./configureextra/final_${DEFINEOS}${DISTRO}${RELEASE}
 
1887
            echo ""
 
1888
        fi
 
1889
    else
 
1890
        if test ".${RELEASE}" != "." &&
 
1891
           test -f ./configureextra/final_${DEFINEOS}${RELEASE}; then
 
1892
            echo ""
 
1893
            echo "    Executing configureextra/final_${DEFINEOS}${RELEASE}"
 
1894
            . ./configureextra/final_${DEFINEOS}${RELEASE}
 
1895
            echo ""
 
1896
        fi
 
1897
    fi
 
1898
fi
 
1899
 
 
1900
dnl> NTOPCONFIGDEBUG_SETTINGS([final])
 
1901
 
 
1902
echo
 
1903
echo "==================================================================="
 
1904
echo
 
1905
echo "This is your $PACKAGE $VERSION configuration:"
 
1906
echo
 
1907
echo "Host System Type        : ${host}"
 
1908
if test ".${build_alias}" != .; then
 
1909
    echo "                        Note: --build=${build_alias} specified"
 
1910
fi
 
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}"
 
1920
fi
 
1921
echo
 
1922
echo "External packages:"
 
1923
echo
 
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}])
 
1928
fi
 
1929
 
 
1930
if test ".${ac_disable_openssl}" != ".yes"; then
 
1931
    NTOP_RPT_LOC([openSSL ], [${OSSL_LIB}], [${OSSL_INCLUDE}])
 
1932
fi
 
1933
 
 
1934
echo
 
1935
echo "Install directories:"
 
1936
echo
 
1937
echo "    Default prefix: ${ac_default_prefix}"
 
1938
echo "    Install into:   ${prefix} (default or via --prefix request)"
 
1939
echo
 
1940
 
 
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}
 
1945
fi
 
1946
datarootdir=`echo $datarootdir|sed -e s,'${prefix}',$prefix,g`
 
1947
 
 
1948
 
 
1949
CFG_DATAFILE_DIR=$datadir/ntop
 
1950
CFG_DATAFILE_DIR=`(
 
1951
    test "x$prefix" = xNONE && prefix=${ac_default_prefix}
 
1952
    eval echo "$CFG_DATAFILE_DIR"
 
1953
)`
 
1954
AC_DEFINE_UNQUOTED(CFG_DATAFILE_DIR,"$CFG_DATAFILE_DIR", [Data file directory])
 
1955
echo "    Data files are in     $CFG_DATAFILE_DIR"
 
1956
 
 
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"
 
1961
)`
 
1962
AC_DEFINE_UNQUOTED(CFG_CONFIGFILE_DIR,"$CFG_CONFIGFILE_DIR", [Configuration file directory])
 
1963
echo "    Config files are in   $CFG_CONFIGFILE_DIR"
 
1964
 
 
1965
CFG_RUN_DIR=$localstatedir/ntop
 
1966
CFG_RUN_DIR=`(
 
1967
    test "x$prefix" = xNONE && prefix=${ac_default_prefix}
 
1968
    eval echo "$CFG_RUN_DIR"
 
1969
)`
 
1970
AC_DEFINE_UNQUOTED(CFG_RUN_DIR,"$CFG_RUN_DIR", [Run files directory])
 
1971
echo "    Run directory is      $CFG_RUN_DIR"
 
1972
 
 
1973
CFG_PLUGIN_DIR=$libdir/ntop/plugins
 
1974
CFG_PLUGIN_DIR=`(
 
1975
  test "x$prefix" = xNONE && prefix=${ac_default_prefix}
 
1976
  test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
 
1977
  eval echo "$CFG_PLUGIN_DIR"
 
1978
)`
 
1979
AC_DEFINE_UNQUOTED(CFG_PLUGIN_DIR,"$CFG_PLUGIN_DIR", [Plugin installation directory])
 
1980
echo "    Plugin files are in   $CFG_PLUGIN_DIR"
 
1981
 
 
1982
CFG_DBFILE_DIR=$localstatedir/ntop
 
1983
CFG_DBFILE_DIR=`(
 
1984
  test "x$prefix" = xNONE && prefix=${ac_default_prefix}
 
1985
  eval echo "$CFG_DBFILE_DIR"
 
1986
)`
 
1987
AC_DEFINE_UNQUOTED(CFG_DBFILE_DIR,"$CFG_DBFILE_DIR", [Database file directory])
 
1988
echo "    Database files are in $CFG_DBFILE_DIR"
 
1989
 
 
1990
echo
 
1991
echo "-------------------------------------------------------------------"
 
1992
echo
 
1993
echo "Creating files..."
 
1994
echo
 
1995
AC_SUBST(AS)
 
1996
AC_SUBST(CCLD)
 
1997
AC_SUBST(CFG_CONFIGFILE_DIR)
 
1998
AC_SUBST(CFG_DATAFILE_DIR)
 
1999
AC_SUBST(CFG_DBFILE_DIR)
 
2000
AC_SUBST(DEFS)
 
2001
AC_SUBST(DLLTOOL)
 
2002
AC_SUBST(DYN_FLAGS)
 
2003
AC_SUBST(EXEEXT)
 
2004
AC_SUBST(INCS)
 
2005
AC_SUBST(SNMP_LIBS)
 
2006
AC_SUBST(LIBTOOL_DEPS)
 
2007
AC_SUBST(MAKE_SHARED_LIBRARY_PARM)
 
2008
AC_SUBST(NTOP_VERSION_EXTRA)
 
2009
AC_SUBST(OBJDUMP)
 
2010
AC_SUBST(OBJEXT)
 
2011
AC_SUBST(CFG_PLUGIN_DIR)
 
2012
AC_SUBST(CORELIBS)
 
2013
AC_SUBST(PLUGINS)
 
2014
dnl> AC_SUBST(CFG_RUN_DIR)
 
2015
AC_SUBST(SCRIPTVER)
 
2016
AC_SUBST(SO_VERSION_PATCH)
 
2017
AC_SUBST(RRD_LIB)
 
2018
AC_SUBST(RRD_INC)
 
2019
AC_SUBST(GEO_DIR)
 
2020
AC_SUBST(GETOPT_H)
 
2021
AC_SUBST(GETOPT_C)
 
2022
 
 
2023
AC_CONFIG_FILES([Makefile])
 
2024
AC_CONFIG_MACRO_DIR([m4])
 
2025
 
 
2026
if test ".${ac_disable_plugins}" != ".yes"; then
 
2027
    AC_CONFIG_FILES([plugins/Makefile])
 
2028
dnl>    AC_CONFIG_FILES([plugins/pep/Makefile])
 
2029
fi
 
2030
 
 
2031
AC_OUTPUT
 
2032
 
 
2033
echo
 
2034
echo "version.c..."
 
2035
echo
 
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
 
2054
 
 
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
 
2059
 
 
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
 
2065
 
 
2066
case "${host}" in
 
2067
    *darwin* )
 
2068
        echo
 
2069
        echo "Copying patched versions of some configure-related files for Mac OS X"
 
2070
        cp packages/MacOSX/lt* .
 
2071
        rm -f libtool
 
2072
        ln -s  /usr/bin/glibtool libtool
 
2073
        echo
 
2074
        ;;
 
2075
esac
 
2076
 
 
2077
echo
 
2078
echo "==================================================================="
 
2079
echo
 
2080
echo
 
2081
echo "*******************************************************************"
 
2082
echo "*"
 
2083
echo "* NOTE: ./configure is now complete!"
 
2084
echo "*"
 
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..."
 
2089
echo "*"
 
2090
echo "++"
 
2091
echo "++    If you like ntop, please do not forget to support its"
 
2092
echo "++    development. See SUPPORT_NTOP.txt for more information."
 
2093
echo "++"
 
2094
echo "++              Thanks for supporting ntop!"
 
2095
echo "++"
 
2096
echo "*"
 
2097
echo "* NEXT STEP(S):"
 
2098
 
 
2099
case "${target}:${CC}" in
 
2100
  *-*-freebsd[[45]]*:*gcc* )
 
2101
    echo "*"
 
2102
    echo "*WARNING: You may encounter a problem building ntop for this OS!"
 
2103
    echo "*"
 
2104
    case "${target}:${CC}" in
 
2105
      *-*-freebsd5*:*gcc* )
 
2106
        echo "*FreeBSD5: Where the following messages are repeated many times:"
 
2107
        echo "*FreeBSD5: "
 
2108
        echo "*FreeBSD5:    expr: illegal option -- l"
 
2109
        echo "*FreeBSD5:    usage: expr [-e] expression"
 
2110
        echo "*FreeBSD5: "
 
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."
 
2114
        echo "*FreeBSD5: "
 
2115
        echo "*FreeBSD5: (Under bash, \$ export EXPR_COMPAT=Y will suffice.)"
 
2116
        echo "*"
 
2117
        ;;
 
2118
    esac
 
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: "
 
2133
    echo "*"
 
2134
    ;;
 
2135
esac
 
2136
 
 
2137
if test ".${HAS_ERROR}" = ".yes"; then
 
2138
    echo "*"
 
2139
    echo "*>>>>  An ERROR has occured - please review the output before"
 
2140
    echo "*>>>>  continuing to make ntop!"
 
2141
elif test ".${HAS_WARNING}" = ".yes"; then
 
2142
    echo "*"
 
2143
    echo "*>>>>  A WARNING message was generated - please review the"
 
2144
    echo "*>>>>  output before continuing to make ntop!"
 
2145
fi
 
2146
 
 
2147
echo "*"
 
2148
echo "*    Building ntop requires GNU Make, so to build ntop, type"
 
2149
echo "*    'make' (or on *BSD and Solaris systems, 'gmake')"
 
2150
echo "*"
 
2151
echo "*******************************************************************"
 
2152
echo
 
2153
 
 
2154
exit 0