Subject: Re: problems compiling clamav
To: Hisashi T Fujinaka <htodd@twofifty.com>
From: Mike M. Volokhov <mishka@apk.od.ua>
List: tech-pkg
Date: 04/16/2004 10:13:55
On Thu, 15 Apr 2004 23:04:16 -0700 (PDT)
Hisashi T Fujinaka <htodd@twofifty.com> wrote:

> Here's the error I keep seeing. Anyone else?
> 
> Making all in clamav-milter
> source='clamav-milter.c' object='clamav-milter.o' libtool=no  depfile='.deps/clamav-milter.Po' tmpdepfile='.deps/clamav-milter.TPo'  depmode=gcc3 /bin/sh ../depcomp  gcc -DHAVE_CONFIG_H -DSENDMAIL_BIN=\"/usr/sbin/sendmail\" -I. -I. -I.. -I../clamd -I../libclamav -I../clamscan   -I/usr/pkg/include -I/usr/include  -O2 -I/usr/pkg/include -I/usr/include -c `test -f 'clamav-milter.c' || echo './'`clamav-milter.c
> /bin/sh ../libtool --mode=link gcc  -O2 -I/usr/pkg/include -I/usr/include   -L/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -o clamav-milter  clamav-milter.o ../clamd/cfgfile.o ../clamd/others.o ../clamscan/getopt.o -L../libclamav -lclamav -L/usr/lib/libmilter -lmilter -lpthread
> *** [buildlink3] Warning: libtool detected -L../libclamav
> *** [buildlink3] Warning: libtool replaced -lclamav with ../libclamav/libclamav.la
> mkdir .libs
> gcc -O2 -I/usr/obj/pkg/mail/clamav/work.i386/.buildlink/include -Wl,-R/usr/pkg/lib -o .libs/clamav-milter clamav-milter.o ../clamd/cfgfile.o ../clamd/others.o ../clamscan/getopt.o  ../libclamav/.libs/libclamav.so -L/usr/obj/pkg/mail/clamav/work.i386/.buildlink/lib -lz -lbz2 /usr/obj/pkg/mail/clamav/work.i386/.buildlink/lib/libgmp.so -L/disk/0/obj/pkg/mail/clamav/work.i386/clamav-0.68-1/libclamav -L/usr/lib/libmilter -lmilter -lpthread -Wl,--rpath -Wl,/usr/pkg/lib -Wl,--rpath -Wl,/usr/obj/pkg/mail/clamav/work.i386/.buildlink/lib
> clamav-milter.o(.text+0x128a): In function `clamfi_envfrom':
> : undefined reference to `strerror_r'
> 
> 

In the clamav-milter.c file (for v 0.68):

	#ifdef TARGET_OS_SOLARIS        /* no strerror_r */

And in the clamav-milter.c file for v. 0.70:

	0.67l   10/3/04 Use new HAVE_STRERROR_R rather than TARGET_OS_SOLARIS
	to determine if strerror_r exists

Thus, to build it with Milter support please pass "-DTARGET_OS_SOLARIS"
flag to C compiler.


But another problems are:

- The PLIST.milter doesn't contains bin/clamav-milter executable, man
  page only.
- The clamav doesn't build on my 2.0C with the following output:

mishka@nostromo:35> make USE_MILTER=YES
===> Checking for vulnerabilities in clamav-0.68.1
===> Overriding tools for clamav-0.68.1
===> Buildlinking for clamav-0.68.1
libmilter is not installed; can't buildlink files.
*** Error code 1

Stop.
make: stopped in /build/pkgsrc/mail/clamav
*** Error code 1

Stop.
make: stopped in /build/pkgsrc/mail/clamav

I.e. it doesn't check for something like _BUILTIN_LIBMILTER as in
libmilter/buildlink2.mk. This is of course a mail/libmilter problem.

--
TIA, Mishka.