Need help! Link failed during compile 0.8a34 version

Christian Kreibich christian at whoop.org
Wed Jul 23 07:31:43 PDT 2003


Hi all,

On Tue, 2003-07-22 at 22:11, Robin Sommer wrote:
> On Tue, Jul 22, 2003 at 16:04 -0400, Hongjie Xin wrote:
> 
> > I was trying to compile the package under redhat 9.0.
> 
> Please try the attached patch. It works at least for Debian-based
> systems.

here's an attempt of a configure check for this; it works for my RH9.
Open questions:

- what to do if workaround test fails
- whether to test for other locations of libresolv.a

Let me know if it works for you -- I'm far from an autoconf expert. In
particular, I don't know if it'll work with other autoconf versions
(that's always where the fun starts ...).

Cheers,
Christian.
-- 
________________________________________________________________________
                                          http://www.cl.cam.ac.uk/~cpk25
                                                    http://www.whoop.org
-------------- next part --------------
--- configure.ac	Sun Jul 13 20:18:23 2003
+++ configure.ac.new	Wed Jul 23 15:26:40 2003
@@ -102,6 +102,24 @@
 AC_CHECK_FUNCS(strerror)
 AC_REPLACE_FUNCS(strsep)
 
+dnl Check if ns_initparse and friends do work with -lresolv
+AC_CHECK_LIB(resolv, ns_initparse, bro_ns_foo_works=yes)
+if test "x$bro_ns_foo_works" = x; then
+   dnl Didn't work -- need to check manually if workaround works better
+   AC_MSG_CHECKING([for ns_initparse in /usr/lib/libresolv.a])
+   saved_libs="${LIBS}"
+   LIBS="${LIBS} /usr/lib/libresolv.a"
+   AC_LINK_IFELSE(AC_LANG_PROGRAM([[#include <arpa/nameser.h>]], [[ns_initparse(0,0,0);]]), bro_ns_foo_static_works=yes)
+
+   if test "x$bro_ns_foo_static_works" = x; then
+      LIBS="${saved_libs}"
+      AC_MSG_RESULT(no)
+   else
+      AC_MSG_RESULT(yes)
+   fi
+fi
+
+
 AC_DEFINE(HAVE_READLINE,,[hacked version of libedit])
 
 dnl


More information about the Bro mailing list