Compiling Clamav 0.88.5 from source on OpenBSD 3.7

28 10 2006

Fed up with getting messages from freshclam saying my clamav installation was out of date, and reluctant to update one of my OpenBSD installations to latest release, I set about trying to figure out how to compile clamav from source.

I started by downloading the latest stable source from www.clamav.net (0.88.5) and tried a simple

./configure
make

I was under no illusions that this would probably fail and it did:

...
/usr/local/lib/libclamav.so.1.17: undefined reference to `pthread_mutex_lock'
/usr/local/lib/libclamav.so.1.17: undefined reference to `pthread_join'
collect2: ld returned 1 exit status

Much google-ing later I was still having no luck … I tried a number of different ./configure arguments which I found in my ports tree at /usr/ports/security/clamav/Makefile until I found this thread started by Charles Farinella on the OpenBSD Misc List

I followed the instructions in this thread to the letter; found the block of text in the configure script:

openbsd*)
    if test "$have_pthreads" = "yes"; then
	LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread"
	if test "$use_cr" = "no"; then
	    CLAMD_LIBS="$CLAMD_LIBS -pthread"
	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread"
	else
	    CLAMD_LIBS="$CLAMD_LIBS -pthread -lc_r"
	    CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r"
	fi
	TH_SAFE="-thread-safe"

and changed LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread" to LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
did a

./configure --disable-cr --disable-clamav
make
make install

and WOO-HOO all was good!!!

Just a couple of things, After installation I tried a freshclam and it complained that I should edit /usr/local/etc/clamd|freshclam.conf files - these are usually kept in /etc not /usr/local/etc so I cd’d to /usr/local/etc renamed the conf files and soft linked the files in /etc to /usr/local/etc and voilla!



Preventing Image Hotlinks With Apache Configuration Files

27 10 2006


Updating The ClamAV Daemon on OpenBSD 3.7

25 10 2006


Setting Up a Local Nameserver on Mac OS X 10.4.x

23 10 2006