Burton,
I use RM (and PATCH) from GNU unix_utils.
When makefile.mingw is changed from  "rm $@"  to "rm -f $@" this will work
for GNU RM.exe
All other RM  lines in makefile.mingw use "rm -f $@"
I tested also rm.bat this works also ok.

A version.c file will only be created  if I changed the  7 echo lines to
(added between  ' ' what should go into version.c
  added between " " what should be displayed on the screen) :

        @echo 'char *version = "$(VERSION)";' > $@
        @echo 'char *osName  = "$(OSNAME)";' >> $@
        @echo 'char *author  = "Luca Deri <[EMAIL PROTECTED]>";' >> $@
        @echo 'char *compiler_cflags = "$(CFLAGS)";' >> $@
        @echo 'char *core_libs       = "$(LIBS)";' >> $@
        @echo 'char *system_libs     = "$(LDIRS)";' >> $@
      echo "Created version.c..."

Burton ,I attached the buildmingw.txt file I use to
succesful build ntop on Win2K with all prerequisites defined.

from cvs 02-06-13 I added 2 changes which will be patched into the cvs I
hope :
1) implemented above described echo changes
2) applied the patch for ntop_win32.c from Juan Ramon Duarte
[[EMAIL PROTECTED]]
so that the problem I reported is fixed about that the first option ,in this
case -i1, is always ignored in command e.g : ntop /i -i1 -w4000 to run
ntop as a service.
Juan Ramon Duarte has sent this patch to [EMAIL PROTECTED] , I attached this
diff file he sent also.

Last remark, with this version.c file I see the results on the
About-Configuration page
displayed as defined in version.c EXCEPT for: Ntop Version = 2.0.99rc2 and
Os = WinNT/2K/XP

Note: I never sent patches to [EMAIL PROTECTED] only I report my findings to
ntop or ntop-dev .


Jac





-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Burton M. Strauss III
Sent: Friday, June 14, 2002 4:14 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [Ntop-dev] New ntop commit (author burton)


Wrong answer...

The BEST answer is to get a copy of fileutils-4.1 compiled under MinGW.
That seems to be hard to track down.  I thought I had one, but it was
fileutils-4.0 and the one missing was... <drum-roll /> rm.  I found another,
but it's not actually MinGW, rather a separate port of the standard utils to
Win32.

Anyway, as a kludgy work-around, I added a .bat version of rm to the
documentation and Luca put it into the cvs.  Unfortunately it's under
gdchart0.94c, which is probably sub optimal.  I've listed it below.  It does
the "if exist" test and should not cause the problem.

Also, while I'm on the soap box, please be aware that I don't have access to
[EMAIL PROTECTED] and don't see what you sent - but it seems like we've been
working at cross purposes on the Makefiles.  I'll be honest, I've ignored a
lot of your work and done it myself, differently, for three reasons...

1. I was working on adding MORE to the version.c file, not removing it
2. (as were many of my patches when I first started), you need to remember
to do things in a common, portable way, not just ones unique to your
particular setup.
3. I haven't seen all of your patches because I don't see that mail box.
4. If you're going to whine about a commit, please change the subject to
something meaningful, so people can find the messages in the back-traffic...

Anyway, back to rm.bat - stick it somewhere on your path.  I'll email Luca
separately and ask him to move it to the ntop directory from the
gdchart0.94c directory.

With this, it should, correctly, create versions.c that looks like this:

char *version = "2.0.99RC2+";
char *osName  = "Windows-MinGW";
char *author  = "Luca Deri <[EMAIL PROTECTED]>";
char *compiler_cflags =
"-O -DHAVE_FCNTL_H=1 -DHAVE_PCAP_H=1 -DHAVE_STDARG_H=1 -I. -Id:/MinGW/includ
e -Id:/MinGW/wpdpack/include -Id:/MinGW/wpdpack/include/NET -I../gdchart0.94
c";
char *core_libs       = "-lgdbm -lwpcap -lgdchart -lgd -lpng -lz -lwsock32";
char *system_libs     =
"-Ld:/MinGW/wpdpack/lib -Ld:/MinGW/lib -L../gdchart0.94c -L../gdchart0.94c/z
lib-1.1.4 -L../gdchart0.94c/gd-1.8.3 -L../gdchart0.94c/gd-1.8.3/libpng-1.2.1
";





@echo off
if /%1 == /-f shift
if /%1 == / goto :usage
:loop
if /%1 == / goto :done
if exist %1 del %1
shift
goto :loop
goto :done
:usage
echo "Usage:  rm [-f] file [, file ...]"
:done

-----Burton


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Jac Engel
Sent: Thursday, June 13, 2002 12:03 PM
To: [EMAIL PROTECTED]
Subject: RE: [Ntop-dev] New ntop commit (author burton)


>>Notable:
>>1) Fixed Makefile.mingw to generate the version.c file correctly,
>>   fixed zlib and libpng version numbers, fixed the major version number
>>   for ntop.exe and the "OSname".  Removed the rpm, deb, etc. generation
>>   stuff, since it's not meaningful under MinGW.
>>-----Burton (Ref BMS0084 & various whines on the mailing list)

Compiling Ntop cvs 02-06-13
Make of ntop failed error:

  rm: version.c: No such file or directory
  make: *** [version.c] Error 1

workaround : created version.c file (0 bytes) in ntop dir

 ntop about-configuration shows :(NOT version  :2.0.99rc2+ and OS
=Windows-MinGW
as stated in makefile.mingw )
Basic information
ntop version 2.0.99rc2
Built on 11/06/2002
OS WinNT/2K/XP



Jac


_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://lists.ntop.org/mailman/listinfo/ntop-dev

_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://lists.ntop.org/mailman/listinfo/ntop-dev

_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://lists.ntop.org/mailman/listinfo/ntop-dev

Jac Engel d.d. 02-06-14

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 2002-06-13 snapshot from
http://snapshot.ntop.org.


Prerequisites:

  1) MinGW      (available from http://www.mingw.org)
     This was tested against MinGW-1.1.tar.gz
     Note: I installed it in C:\Mingw

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

  3) WinPCAP developer's pack (available from
     http://winpcap.polito.it/install/bin/WinPcap_2_3.exe
     This was tested with Release 2.3 of WinPcap 

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

  5) ntop  (available from http://www.ntop.org)
     This was tested with http://snapshot.ntop.org/tgz/ntop-02-06-13.tgz
     Note: I installed it in C:\ntop-02-06-13

  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:\mingw\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
     
     Add to PATH variable  C:\Mingw\bin  

  
  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:/Mingw/gdbm/include
        INC_WPDPACK=-Ic:/Mingw/wpdpack/include
        
        LIB_GDBM=-Lc:/Mingw/gdbm/lib
        LIB_WPDPACK=-Lc:/Mingw/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:\Mingw\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.  You can get command
     line help by running ntop.exe -h

     (more to come..)

Attachment: ntop_win32.c.diff
Description: Binary data

Reply via email to