Hello all,

Can you please apply the following patch?  It allows ClamAV to build on
KFreeBSD (Gnu Libc on a FreeBSD kernel).  I have been carrying this
patch locally for a while, as this seemed like a Debian only project,
but it seems like it is making some progress, so I am now asking if this
can be merged.

Thanks,

--- clamav-0.88.1.orig/configure.in
+++ clamav-0.88.1/configure.in
@@ -365,6 +365,21 @@
        ;;
     esac
     ;;
+kfreebsd*-gnu)
+    AC_DEFINE(C_KFREEBSD_GNU,1,[target is kfreebsd-gnu])
+    if test "$have_pthreads" = "yes"; then
+       LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread"
+       TH_SAFE="-thread-safe"
+       AC_DEFINE(CL_THREAD_SAFE,1,[thread safe])
+       AC_DEFINE(_REENTRANT,1,[thread safe])
+       CLAMD_LIBS="$CLAMD_LIBS -lpthread"
+       CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread"
+       if test "$want_clamuko" = "yes"; then
+           AC_DEFINE(CLAMUKO,1,[enable clamuko])
+       fi
+       CLAMSCAN_LIBS="$CLAMSCAN_LIBS -lpthread"
+    fi
+    ;;
 cygwin*)
     AC_DEFINE(C_CYGWIN,1,[os is cygwin])
     if test "$test_clamav" = "yes"; then
--- clamav-0.88.1.orig/clamav-config.h.in
+++ clamav-0.88.1/clamav-config.h.in
@@ -54,6 +54,9 @@
 /* os is irix */
 #undef C_IRIX

+/* target is kfreebsd-gnu */
+#undef C_KFREEBSD_GNU
+
 /* target is linux */
 #undef C_LINUX

--- clamav-0.88.1.orig/libclamav/blob.c
+++ clamav-0.88.1/libclamav/blob.c
@@ -405,7 +405,8 @@
                (int)(sizeof(fullname) - 9 - strlen(dir)), filename);
 #endif

-#if    defined(C_LINUX) || defined(C_BSD) || defined(HAVE_MKSTEMP) || 
defined(C_SOLARIS) || defined(C_CYGWIN) || defined(C_QNX6)
+#if    defined(C_LINUX) || defined(C_BSD) || defined(HAVE_MKSTEMP) || 
defined(C_SOLARIS) || defined(C_CYGWIN) || defined(C_QNX6) || 
defined(C_KFREEBSD_GNU)
+
        cli_dbgmsg("fileblobSetFilename: mkstemp(%s)\n", fullname);
        fd = mkstemp(fullname);
 #else
--- clamav-0.88.1.orig/libclamav/mbox.c
+++ clamav-0.88.1/libclamav/mbox.c
@@ -3049,7 +3049,7 @@
                return i;
        ptr = &buf[--len];

-#if    defined(UNIX) || defined(C_LINUX) || defined(C_DARWIN)  /* watch - it 
may be in shared text area */
+#if    defined(UNIX) || defined(C_LINUX) || defined(C_DARWIN) || 
defined(C_KFREEBSD_GNU) /* watch - it may be in shared text area */
        do
                if(*ptr)
                        *ptr = '\0';
--- clamav-0.88.1.orig/libclamav/untar.c
+++ clamav-0.88.1/libclamav/untar.c
@@ -245,7 +245,7 @@
                        }
                        snprintf(fullname, sizeof(fullname) - 1 - suffixLen, 
"%s/%.*sXXXXXX", dir,
                                (int)(sizeof(fullname) - 9 - suffixLen - 
strlen(dir)), name);
-#if    defined(C_LINUX) || defined(C_BSD) || defined(HAVE_MKSTEMP) || 
defined(C_SOLARIS) || defined(C_CYGWIN)
+#if    defined(C_LINUX) || defined(C_BSD) || defined(HAVE_MKSTEMP) || 
defined(C_SOLARIS) || defined(C_CYGWIN) || defined(C_KFREEBSD_GNU)
                        fd = mkstemp(fullname);
 #else
                        (void)mktemp(fullname);


-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | <SirDibos> Culus: are you awake?        |
|  [EMAIL PROTECTED]             | <Culus> no                              |
|  http://www.lobefin.net/~steve |                                         |
 --------------------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to