From: Stephen D. <sd...@gm...> - 2005-10-06 19:01:14
|
On 10/5/05, Zoran Vasiljevic <zv...@ar...> wrote: > Hi ! > > I'm confused. Very. > > I need to disable the configure machinery to > define the HAVE_GETNAMEINFO and HAVE_GETADDRINFO > for Darwin builds. Reason: those are broken on > Darwin, and upon that, also MT-unsafe. OTOH, > the classic gethostbyname/gethostbyaddr are > working and are protected by critical section > so I think it is better to use those. > > BUT: I do not see a clear way how to influence > configure NOT to use/define those above ! > > I COULD just > > #ifdef __APPLE > # undef HAVE_GETADDRINFO > # undef HAVE_GETNAMEINFO > #endif > > but this is not elegant. > > Any ideas? > > Zoran > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel > Around line 195 of configure.in there's this test: has_threadsafe_dns=3Dno AC_CHECK_LIB(socket, getaddrinfo) AC_CHECK_LIB(socket, getnameinfo) AC_CHECK_FUNCS(getaddrinfo getnameinfo) if test "${ac_cv_func_getaddrinfo}" =3D "yes" \ -a "${ac_cv_func_getnameinfo}" =3D "yes" ; then has_threadsafe_dns=3Dyes fi if test "${has_threadsafe_dns}" !=3D "yes" ; then AC_HAVE_GETHOSTBYNAME_R AC_HAVE_GETHOSTBYADDR_R if test "${ac_cv_func_gethostbyname_r}" =3D "yes" \ -a "${ac_cv_func_gethostbyaddr_r}" =3D "yes" ; then has_threadsafe_dns=3Dyes fi fi if test "${has_threadsafe_dns}" !=3D "yes" ; then AC_MSG_WARN([dns queries will use non-threadsafe calls which could result in server instability]) fi Maybe you could check if $system =3D=3D Darwin after the first check and set has_threadsafe_dns =3D no. At least this way all the checking is confined to the configure script and not scattered throughout the source. Even better would be to test for the brokenness rather than the platform. Not sure what what the bug is or how easy it would be to check for. Then when Apple fix this we start using getnameinfo again automatically. |