As using up till now Mingw version 1.1, I switched to
MingW version 2.003.
With both versions I could compile Ntop until version 2.1.3
After this version  till 2.1.56  I could not compile Ntop and
got 2 errors : 
main.o(.text+0x1f3a):main.c: undefined reference to `getopt_long'
plugin.o(.text+0x290):plugin.c: undefined reference to `rrdPluginEntryFctn'
make: *** [ntop] Error 1 

which I can fix  as mailed earlier, but it is not the right way.
I know Ntop compiling via Mingw has lowest priority for design team.
Allthough I attach the doc for Mingw version 2  Ntop build.

cheers
Jac

 
Jac Engel d.d. 03-01-30

Description 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).


Building Ntop
-------------
This was last tested against the stable release ntop-2.1.3 from
http://sourceforge.net/project/showfiles.php?group_id=17233


Prerequisites:

  1) MinGW      (available from http://www.mingw.org)
     This was tested against MinGW-2.0.0-3.exe
     Note: -I installed it in C:\Mingw2 
           -copied mingw32-make.exe to make.exe 

  2) GNU Make   (available from http://www.mingw.org)
     This was tested with GNU Make v3.79.1, (comes with MinGW-2.0.0-3.exe)

  3) WinPCAP developer's pack (available from
     http://winpcap.polito.it/install/bin/WinPcap_2_3.zip
     This was tested with Release 2.3 of WinPcap 
     Note: I unzipped (use folder names) it in C:\Mingw2
           and executed C:\Mingw2\WPdpack\Drivers\WinPcap_2_3.exe

  4) gdbm for win32/mingw (from http://sourceforge.net/projects/mingwrep)
     This was tested with gdbm-1.8.0-20010430.zip
     Note: I unzipped (use folder names) it in C:\Mingw2\gdbm

  5) ntop  (available from sourceforge.net )
     This was tested with stable version ntop-2.1.3 
       http://prdownloads.sourceforge.net/ntop/ntop-2.1.3.tar.gz?download
     Note: I unzipped (use folder names) in C:\ntop-2.1.3

  6) UnxUtils package UnxUtils.zip at:

     http://www.wzw.tu-muenchen.de/~syring/win32/UnxUtils.html
     Note : I unzipped  only patch.exe and rm.exe  to C:\mingw2\bin
            rm.exe is required as defined in  ntop\makefile.mingw  to make ntop.
            Patch.exe is only required if diff files are available. 

Steps

  1) Install all prerequisites and
     Open Dos command box and CD to C:\ntop-2.1.3\
     Add to PATH variable  C:\Mingw2\bin\  
     path C:\MinGW2\bin\;%path%
     ( don't forget the last backslash !)
  
  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 libwpcap.a os found )

        result :
        INC_GDBM=-Ic:/Mingw2/gdbm/include
        INC_WPDPACK=-Ic:/Mingw2/wpdpack/include
        
        LIB_GDBM=-Lc:/Mingw2/gdbm/lib
        LIB_WPDPACK=-Lc:/Mingw2/wpdpack/lib

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

     3a) Build zlib

         cd gdchart0.94c/zlib-1.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

     Create directory e.g. C:\ntop , copy ntop.exe and the html
     subdirectory hierarchy.

     Ntop dependent files are libgdm-2.dll and wpcap.dll.

     Copy libgdbm-2.dll (exists in C:\Mingw2\gdbm\bin) to C:\ntop
     ( wpcap.dll exists in C:\WINNT\system32 after install of WinPcap2_3.exe , so
       this dir is already in your PATH variable ) .

  6) Use it

     Execute ntop.exe from the install directory. 
     Run ntop in console :  ntop.exe /c  <options>
     Run ntop as a service : ntop.exe /i <options>

     You can get command line help by running ntop.exe -h

Reply via email to