[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: res_search check wrong for bind 8.x (ITS#222)

This sort of problem (using macros to rename symbols before
linking) is becoming quite common.  We really need a new
AC_ macro which allows specfication of headers to include
during the test.  I'll look into this for -devel.

For OpenLDAP 1.2 users facing this problem, I recommend
using environmental variable to force the test to true:
	env ac_cv_lib_bind_res_search=yes ./configure


At 05:23 AM 7/9/99 GMT, mooney@dogbert.cc.ndsu.nodak.edu wrote:
>Full_Name: Tim Mooney
>Version: 1.2.3
>OS: any
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (
>configure.in for openldap 1.2.3 contains the following code:
>dnl Check for resolver routines
>if test $ac_cv_func_res_search = "no" ; then
>        AC_CHECK_LIB(bind, res_search)
>        if test "$ac_cv_lib_bind_res_search" = "yes" ; then
>                AC_DEFINE(HAVE_RES_SEARCH,1)
>        else
>                AC_CHECK_LIB(resolv, res_search)
>                if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
>                        AC_DEFINE(HAVE_RES_SEARCH,1)
>                fi
>        fi
>The problem is that `-lbind' does *not* contain res_search, it contains
>at least for bind 8.2 (and probably 8.1.2, as well, though I haven't looked).
>you include `resolv.h', you get a #define res_search __res_search so all is
>The problem is that the configure check above isn't including resolv.h, so the
>check for res_search in `-lbind' can't work.
>You may be able to insert a 
># include <resolv.h>
>in argument 2 of the AC_CHECK_LIB call for bind, but that's not really the way
>AC_CHECK_LIB was meant to be used, so it may not work.
>A more straightforward method (though not without its warts) would be to also
>perhaps "instead") do:
>	AC_CHECK_LIB(bind, __res_search)
>If that succeeds you know you have libbind.  From that point on, you just need
>be sure to include resolv.h so that all the
>	#define func_name	__func_name
>are picked up.  I don't think that's a problem, since you need to include
>any place you plan on using the resolver functions anyway.
>Please let me know if I'm not making sense. :-)