+------ Chuck Swiger wrote (Wed, 28-May-2008, 15:27 -0700):
| 
| On FreeBSD 4.11, the compile fails with:
| 
| [ ... ]
| Making all in .
| source='matcher-ac.c' object='matcher-ac.lo' libtool=yes  DEPDIR=.deps  
| depmode=gcc /bin/zsh ../config/depcomp  /bin/zsh ../libtool -- 
| tag=CC    --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I.. -I./nsis - 
| I./lzma -I/usr/local/include  -g -O2 -c -o matcher-ac.lo matcher-ac.c
| mkdir .libs
|   gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I./nsis -I./lzma -I/usr/local/ 
| include -g -O2 -c matcher-ac.c -Wp,-MD,.deps/matcher-ac.TPlo  -fPIC - 
| DPIC -o .libs/matcher-ac.o
| In file included from matcher.h:35,
|                   from matcher-ac.c:34:
| hashtab.h:112: field `uniques' has incomplete type
| *** Error code 1

Three files required minor patching to compile on FreeBSD 4.11.
All three are related to the old compiler (gcc 2.95.4).
Thusfar, only clamscan has been tested (and its late), so beware.

Cheers,
Chuck

--- libclamav/hashtab.h.orig    Mon May 26 16:06:29 2008
+++ libclamav/hashtab.h Wed May 28 21:16:48 2008
@@ -109,7 +109,7 @@
 /* A basic storage for unique IDs */
 struct uniq {
        uint32_t count;
-        uint32_t uniques[];
+        uint32_t uniques[0];
 };
 
 struct uniq *uniq_init(uint32_t);
--- libclamav/mbox.c.orig       Mon May 26 16:06:29 2008
+++ libclamav/mbox.c    Thu May 29 01:53:06 2008
@@ -4480,22 +4480,23 @@
                return h_errno;
 #else
        /* Single thread the code e.g. VS2005 */
-#ifdef  CL_THREAD_SAFE
+       {
+# ifdef  CL_THREAD_SAFE
        static pthread_mutex_t hostent_mutex = PTHREAD_MUTEX_INITIALIZER;
 
        pthread_mutex_lock(&hostent_mutex);
-#endif
+# endif
        if((hp2 = gethostbyname(hostname)) == NULL) {
-#ifdef  CL_THREAD_SAFE
+# ifdef  CL_THREAD_SAFE
                pthread_mutex_unlock(&hostent_mutex);
-#endif
+# endif
                return h_errno;
        }
        memcpy(hp, hp2, sizeof(struct hostent));
-#ifdef  CL_THREAD_SAFE
+# ifdef  CL_THREAD_SAFE
        pthread_mutex_unlock(&hostent_mutex);
-#endif
-
+# endif
+       }
 #endif
        return 0;
 }
--- shared/network.c.orig       Mon May 26 16:06:28 2008
+++ shared/network.c    Thu May 29 01:58:04 2008
@@ -80,22 +80,23 @@
                return h_errno;
 #else
        /* Single thread the code e.g. VS2005 */
-#ifdef  CL_THREAD_SAFE
+       {
+# ifdef  CL_THREAD_SAFE
        static pthread_mutex_t hostent_mutex = PTHREAD_MUTEX_INITIALIZER;
 
        pthread_mutex_lock(&hostent_mutex);
-#endif
+# endif
        if((hp2 = gethostbyname(hostname)) == NULL) {
-#ifdef  CL_THREAD_SAFE
+# ifdef  CL_THREAD_SAFE
                pthread_mutex_unlock(&hostent_mutex);
-#endif
+# endif
                return h_errno;
        }
        memcpy(hp, hp2, sizeof(struct hostent));
-#ifdef  CL_THREAD_SAFE
+# ifdef  CL_THREAD_SAFE
        pthread_mutex_unlock(&hostent_mutex);
-#endif
-
+# endif
+       }
 #endif
        return 0;
 }

_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://lurker.clamav.net/list/clamav-users.html

Reply via email to