Hi,

I just tried building 0.70rc on RHEL 2.1 and ran into a few
problems.
The first one is the tcpwrappers configure test.
It fails even though tcpwrappers is correctly installed.
The problem seems to be some weirdness needed to properly utilize the
hosts_ctl call used to determine if libwrap is available.
Atleast in the version of tcpwrappers included in RHEL 2.1 (7.6-19) a few
extra lines of code is needed in the configure test.
Like this:
+#include <tcpd.h>
+int deny_severity = 0, allow_severity = 0;

Otherwise deny_severity & allow_severity will be undefined symbols and
linking fails.

I also found that -lwrap needs -lnsl to resolve a few symbols.

I propose the attached patch to deal with this issue. It was made agaist 0.70rc but will apply to the latest snapshot with an offset.
It's based on what is used in the openldap configure script.


The second problem is that autoconf-2.52 and automake-1.6 is required while RHEL 2.1 only has autoconf-2.13 and automake-1.4.
I know those versions are more or less obsolete so I personally don't mind installing newer releases to deal with it.


-tgc
--- clamav-0.70rc/configure.in.orig     Thu Mar 25 13:34:33 2004
+++ clamav-0.70rc/configure.in  Thu Mar 25 13:45:06 2004
@@ -222,18 +222,47 @@
   esac],
 [ tcpw=auto ])
 
-if test x"$tcpw" != xno; then
-  err=no
-  AC_CHECK_HEADER(tcpd.h,,err=yes)
-  AC_CHECK_LIB(wrap,hosts_ctl,true,err=yes)
-  if test x"$err" = xyes; then
-    if test x"$tcpw" = xyes; then
-      AC_MSG_ERROR([tcpwrappers not available])
-    fi
-  else
-    AC_DEFINE(WITH_TCPWRAP,1,[tcpwrappers support])
-    CLAMAV_MILTER_LIBS="-lwrap"
-  fi
+if test $tcpw != no ; then
+        AC_CHECK_HEADERS(tcpd.h,[
+                AC_MSG_CHECKING([for TCP wrappers library])
+                save_LIBS="$LIBS"
+                LIBS="$LIBS -lwrap"
+                AC_TRY_LINK([
+#include <tcpd.h>
+int allow_severity = 0;
+int deny_severity  = 0;
+
+struct request_info *req;
+                ],[
+hosts_access(req)
+                ],[AC_MSG_RESULT([-lwrap])
+                have_wrappers=yes
+                CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lwrap"],[
+                dnl try with -lnsl
+                LIBS="$LIBS -lnsl"
+                AC_TRY_LINK([
+#include <tcpd.h>
+int allow_severity = 0;
+int deny_severity  = 0;
+
+struct request_info *req;
+                ],[
+hosts_access(req)
+                ],[AC_MSG_RESULT([-lwrap -lnsl])
+                have_wrappers=yes
+                CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lwrap -lnsl"],[
+                AC_MSG_RESULT(no)
+                have_wrappers=no
+                LIBS=$save_LIBS])],[
+                have_wrappers=no])],[have_wrappers=no])
+
+        if test $have_wrappers = yes ; then
+                AC_DEFINE(WITH_TCPWRAP,1, [tcpwrappers support])
+        elif test $tcpw = yes ; then
+                AC_MSG_ERROR([could not find TCP wrappers])
+        else
+                AC_MSG_WARN([could not find TCP wrappers, support disabled])
+        fi
 fi
 
 # check for in_port_t definition

Reply via email to