This note describes how to build ntop on win2k using the MinGW
toolchain (MinGW allows you to build native win32 binaries linked
against the Microsoft runtime and not the cygwin runtime).

Prerequistes:

(Tested notes updated for ntop version 2.0.99RC2)
(Most MinGW software is now available through SourceForge at
 http://sourceforge.net/project/showfiles.php?group_id=2435, or
 the MinGW packages repository at http://sourceforge.net/projects/mingwrep/)


  1) MinGW      (available from http://www.mingw.org)
     Tested against mingw-runtime-1.3.tar.gz

  2) GNU C compiler, gcc
     The MinGW port, gcc-2.95.3-20011106.tar.gz was used for testing

  3) GNU Make   (available from http://www.mingw.org)
     This was tested with GNU Make v3.79.1

  4) The following packages from the repository were used for testing,
     honestly, I don't know which are required - I think only libcrypt,
     and w32api, but the others may make it much easier to work under MinGW:

          binutils-2.11.90-20010915.tar.gz
          libcrypt-2.17-20010126.zip
          readline-4.2-20010727.zip
          textutils-2.0-mingw32.zip
          w32api-1.4-2.tar.gz

  5) WinPCAP developer's pack (available from
     This was tested with Release 2.3 of WinPcap, available at 
     http://netgroup-serv.polito.it/winpcap/install/bin/WPdpack_2_3.zip

  6) gdbm for win32/mingw (from http://sourceforge.net/projects/mingwrep)
     This was tested with gdbm-1.8.0-20010430.zip

  7) ntop  (available from http://www.ntop.org)

  8) rm (normally part of fileutils, but seemingly not available for MinGW).
      There is a "usable" version of rm (rm.bat) in the utils/ directory.
      If you don't have a real version of rm, copy this file to somewhere
      on your MinGW path.

Steps

  1) Install all prerequisites

  2) Edit the ntop/Makefile.mingw and fill in the following values:

     INC_GDBM        (where the gdbm header files can be found)
     INC_WPDPACK     (where the winpcap header files can be found)
     LIB_GDBM        (where libgdbm.a is found)
     LIB_WPDPACK     (where libpcap.a is found)

     If you're using a separate gdchart, gd, libpng, or libz, you'll
     also need to change the include and library paths for these as well.

  3) Build the sub-components (starting from the ntop-current directory)

     3a) Build zlib

         cd gdchart0.94c/zlib1.1.4
         make -f Makefile.mingw
         cd ../..

     3b) Build libpng

         cd gdchart0.94c/gd-1.8.3/libpng-1.2.1
         make -f scripts/makefile.mingw
         cd ../../../

     3c) Build gd

         cd gdchart0.94c/gd-1.8.3
         make -f Makefile.mingw
         cd ../..

     3d) Build gdchart

         cd gdchart0.94c
         make -f Makefile.mingw
	 cd ..

  4) Build ntop itself

     cd ntop
     make -f Makefile.mingw


  5) Package ntop and the dependent files

     Into the install directory, copy ntop.exe and the html
     subdirectory hierarchy.

     Ensure that the appropriate DLL's are in your path.  For this
     build, that includes libgdbm-2.dll and wpcap.dll.

     If you have grep installed, the following commandline will tell
     you which files need to be in either the same directory as
     ntop.exe or in the path:

         objdump -p ntop.exe |grep "DLL Name"

  6) Use it

     Execute ntop.exe from the install directory.  You can get command
     line help by running ntop.exe -h

-- 
November 2001 - Scott Renfro <scott@renfro.org>
June 2002 - Burton M. Strauss III <Burton@ntopsupport.com>
