On Mon, Sep 23, 2013 at 10:33 AM, Francis Stevens <
francis.stev...@bristow.co.uk> wrote:

> I have also hit this compilation issue, also on an old RedHat system.
> Looking in the sources for the file libclamav/7z/Types.h for 0.97.8 there
> are some edits that seem to be working around this issue which don't appear
> in the corresponding Types.h file for 0.98.  The diff output is a bit long
> so here are the relevant bits...
>
> at line 13
>
> /* aCaB -- lame workaround for "Byte" refef */
> #include <zconf.h>
>
> at line 46
>
> /* aCaB -- use Byte defined in zconf.h
> typedef unsigned char Byte;
> */
>
> making these changes to the Types.h file with 0.98 enables the compile to
> complete.
>
> I have compiled 0.98 on CentOS6.4 without issues so this is probably
> related to the gcc version or some such.
>
> FAS


This is due to a change I had made in November 2012 to how the zlib linking
checks are done in the configure script. If you have a few extra moments,
can you apply the below-pasted patchfile and re-run configure? If your
compile works with just this patch (and without the changes you made to
zconf.h), we will better know how to proceed from here. The diff is in
unified diff format. If you need me to convert the diff from unified to
traditional, let me know.

Thanks,

Shawn

The patch:

 diff --git a/configure b/configure
index 0158088..4109375 100755
--- a/configure
+++ b/configure
@@ -15952,7 +15952,7 @@ $as_echo "$as_me: WARNING: ****** stability
problems to the ClamAV developers!"
     if test "$ZLIB_HOME" != "/usr"; then
        CPPFLAGS="$CPPFLAGS -I$ZLIB_HOME/include"
        save_LDFLAGS="$LDFLAGS"
-       LDFLAGS="$LDFLAGS -Wl,-rpath=$ZLIB_HOME/lib"
+       LDFLAGS="$LDFLAGS -L$ZLIB_HOME/lib"
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in
-lz" >&5
 $as_echo_n "checking for inflateEnd in -lz... " >&6; }
 if ${ac_cv_lib_z_inflateEnd+:} false; then :
@@ -15990,7 +15990,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd"
>&5
 $as_echo "$ac_cv_lib_z_inflateEnd" >&6; }
 if test "x$ac_cv_lib_z_inflateEnd" = xyes; then :
-  LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -Wl,-rpath=$ZLIB_HOME/lib -lz";
FRESHCLAM_LIBS="$FRESHCLAM_LIBS -Wl,-rpath=$ZLIB_HOME/lib -lz"
+  LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -L$ZLIB_HOME/lib -lz";
FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$ZLIB_HOME/lib -lz"
 else
   as_fn_error $? "Please install zlib and zlib-devel packages" "$LINENO" 5
 fi
diff --git a/configure.ac b/configure.ac
index 1287602..b769f5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -557,8 +557,8 @@ else
     if test "$ZLIB_HOME" != "/usr"; then
        CPPFLAGS="$CPPFLAGS -I$ZLIB_HOME/include"
        save_LDFLAGS="$LDFLAGS"
-       LDFLAGS="$LDFLAGS -Wl,-rpath=$ZLIB_HOME/lib"
-       AC_CHECK_LIB([z], [inflateEnd], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS
-Wl,-rpath=$ZLIB_HOME/lib -lz"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS
-Wl,-rpath=$ZLIB_HOME/lib -lz"], AC_MSG_ERROR([Please install zlib and
zlib-devel packages]))
+       LDFLAGS="$LDFLAGS -L$ZLIB_HOME/lib"
+       AC_CHECK_LIB([z], [inflateEnd], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS
-L$ZLIB_HOME/lib -lz"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$ZLIB_HOME/lib
-lz"], AC_MSG_ERROR([Please install zlib and zlib-devel packages]))
        AC_CHECK_LIB([z], [gzopen], [], AC_MSG_ERROR([Your zlib is missing
gzopen()]))
        LDFLAGS="$save_LDFLAGS"
     else
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to