Full_Name: Tim Mooney Version: 1.2.3 OS: any URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (134.129.106.23) configure.in for openldap 1.2.3 contains the following code: dnl Check for resolver routines AC_CHECK_FUNCS(res_search) 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 fi The problem is that `-lbind' does *not* contain res_search, it contains __res_search, at least for bind 8.2 (and probably 8.1.2, as well, though I haven't looked). If you include `resolv.h', you get a #define res_search __res_search so all is well. 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 #ifdef HAVE_RESOLV_H # include <resolv.h> #endif 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 (or perhaps "instead") do: AC_CHECK_LIB(bind, __res_search) If that succeeds you know you have libbind. From that point on, you just need to 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 resolv.h any place you plan on using the resolver functions anyway. Please let me know if I'm not making sense. :-) Tim
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 Kurt 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) (134.129.106.23) > > >configure.in for openldap 1.2.3 contains the following code: > >dnl Check for resolver routines >AC_CHECK_FUNCS(res_search) >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 >fi > > > >The problem is that `-lbind' does *not* contain res_search, it contains >__res_search, >at least for bind 8.2 (and probably 8.1.2, as well, though I haven't looked). >If >you include `resolv.h', you get a #define res_search __res_search so all is >well. >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 > >#ifdef HAVE_RESOLV_H ># include <resolv.h> >#endif > >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 >(or >perhaps "instead") do: > > AC_CHECK_LIB(bind, __res_search) > >If that succeeds you know you have libbind. From that point on, you just need >to >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 >resolv.h >any place you plan on using the resolver functions anyway. > >Please let me know if I'm not making sense. :-) > >Tim > > >
changed notes changed state Open to Suspended moved from Incoming to Build
changed notes
changed notes changed state Suspended to Closed
Need better AC_CHECK_LIB macro. Quick fix in -devel. released with 1.2.11