Configure-diff to check for bind library

Dejan Ilic svedja at lysator.liu.se
Sat Dec 12 01:21:41 GMT 1998


Copy of this mail already sent to samba-bugs
-----

Hi.

 Got annoyed by configure removing the "-lbind" every time.
 The configure should now check for the __inet_addr inc <arpa/inet.h>
 and if found it will check for the bind-library.

 If succesfull in both cases (and thus bind is probably needed during
 link) it will add "-lbind" to LIBS variable.

 If it fail on any of the two tests it will retain the old behaviour
 and additionaly emit a warning if the symbol is found but not the
 library.

 The only real question is if the EGREP regular expression is narrow
 enough to accuratly tell if the include-file is bind's include file.
 I leave that up to you to deceide :-) But it works on my machine and
 I tested all pathological cases I could imagine at this time after
 midnight...

 The diff is against Beta-3 but should work on the later CVS releases
 also if hand-patched.

Dejan
=====================================================================
Dejan Ilic, Tech Univ. of Linkoping, Sweden    Phone:+46-13-473 01 06
Email: svedja at lysator.liu.se   Web: http://www.lysator.liu.se/~svedja
=====================================================================
[finger -l svedja at lysator.liu.se for public PGP key]
-------------- next part --------------
--- configure.in.orig	Fri Dec 11 23:37:04 1998
+++ configure.in	Sat Dec 12 01:59:15 1998
@@ -1079,6 +1079,16 @@
 )
 
 #################################################
+# check if we need to link the Bind library
+AC_MSG_CHECKING(check if we need to link the Bind library)
+AC_EGREP_HEADER(__inet_addr,arpa/inet.h,
+	AC_MSG_RESULT(yes)
+	AC_CHECK_LIB(bind,__inet_addr,
+		[LIBS="$LIBS -lbind"],
+		AC_MSG_WARN([Bind library probably needed but not found !])),
+	AC_MSG_RESULT(no))
+
+#################################################
 # these tests are taken from the GNU fileutils package
 AC_CHECKING(how to get filesystem space usage)
 space=no


More information about the samba-ntdom mailing list