Eric Auer writes:
Hi, Joergen Ibsen (of IbsenSoftware.com / aPack...) was kind and smart enough to write a patch to make ClamAV compile in DJGPP and to do the compiling on his LFN (long file name) aware system. Thanks a lot!
Here some snippets from the "HOWTO".
* I think you do not need much more than BASH, SED and FILEUTILS (CHMOD...) and maybe autoconf. However, this is hard to check because Joergen has DJGPP versions of all the following installed on his system:acnf257b - amak176b - bnu214b - bsh204b - bsn135b - csdpmi5b - dif28b djdev203 - djtzn203 - fil41b - file334b - find41b - flx254b - gcc332b gdb53b - gpp332b - grep24b - mak3791b - pat253b - pdcur24b - sed407b shl2011b - txi46b - txt20b - zlib114b
(All from delorie.com - the home of DJGPP which is a DOS port of GCC/G++ while CygWin, I am told, is ANOTHER port of GCC/G++ for WINDOWS, using shared libraries... if you would avoid stripping reloc info, you could even run CygWin-compiled binaries in DOS with help of WDOSX. Other story...)
* First, get the PATCH from my page (clamav-0.67-dos.diff.gz - the directory contains a precompiled binary, too)
* Second, configure as follows (start a BASH and run the next command there):./configure --disable-bzip2 --disable-pthreads --disable-cr \ --disable-urandom --disable-clamav --disable-clamuko --without-sigtool \ --without-clamd --without-clamdscan --without-clamav-milter --disable-dsig
Without dsig, authenticy of databases is not checked. But avoids GMP library.
* Third, edit the resulting top level Makefile and make SUBDIRS shorter, so that it only contains libclamav and clamscan (which are the directories of the only components which we need when we update the database manually, do not want to create new signatures and do not want to have anything from the ClamAV suite running in the background... All the other features work better in Linux (or Windows) anyway.
* You might want to add an --all-static in the right place in the Makefile in the clamscan directory. Probably an optional step as DJGPP does not link to shared libs normally (links the required libc parts directly into the binary, so you only have to have the small CWSDPMI host installed to run ClamScan).
* Finally, run: make
CCing CCordes of ClamAV.net in the hope that he can forward this information to the right ClamAV people... Maybe future versions can support ClamScan / DOS compilation officially. Be warned that Joergen does not consider the current compile to be stable. But it runs okay for me in DOSEMU / FreeDOS. Unless you want to put the databases (*.cvd files, get them from ClamAV.net) into the default (-> compile time option, e.g. c:/share/clamav/) directory, you have to provide the option --database=...directoryname... to ClamScan to use it.
Some details about the patch: DJ Delorie has done a very good libc port to DOS (even getuid exists and returns 42 :-)), so only little patching was needed:
- the snprintf family is not supported by at least some versions of DJGPP!
- because dent->d_ino does not tell much in DOS, dent->d_namlen is used
- althought not exactly needed, lstat is replaced by stat for the DOS version