diff mbox series

[1/3] configure.ac: more carefully detect availability of res_querydomain(3)

Message ID a6f2aaea93c1293e62d5109b10d47a7675a45393.1549290423.git.ps@pks.im (mailing list archive)
State New, archived
Headers show
Series [1/3] configure.ac: more carefully detect availability of res_querydomain(3) | expand

Commit Message

Patrick Steinhardt Feb. 4, 2019, 2:31 p.m. UTC
Since glibc 2.2, the function res_querydomain(3) is implemented as a
define to `__res_querydomain`. Due to this implementation detail, using
`AC_CHECK_LIB` with a symbol name of "res_querydomain" will cause a
linking failure and thus fail to detect its availability. This is why
right now, we try to detect availability of `__res_querydomain` instead.

Unfortunately, this may break on other platforms where there is no
`__res_querydomain` but only the function without leading underscores.
To fix this, we can perform another `AC_CHECK_LIB([resolv],
[res_querydomain], ...)` call in case where the other one was not found
and only raise an error if both symbols weren't found.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Patrick Steinhardt Feb. 22, 2019, 7:52 a.m. UTC | #1
On Mon, Feb 04, 2019 at 03:31:18PM +0100, Patrick Steinhardt wrote:
> Since glibc 2.2, the function res_querydomain(3) is implemented as a
> define to `__res_querydomain`. Due to this implementation detail, using
> `AC_CHECK_LIB` with a symbol name of "res_querydomain" will cause a
> linking failure and thus fail to detect its availability. This is why
> right now, we try to detect availability of `__res_querydomain` instead.
> 
> Unfortunately, this may break on other platforms where there is no
> `__res_querydomain` but only the function without leading underscores.
> To fix this, we can perform another `AC_CHECK_LIB([resolv],
> [res_querydomain], ...)` call in case where the other one was not found
> and only raise an error if both symbols weren't found.
> 
> Signed-off-by: Patrick Steinhardt <ps@pks.im>

Is there anything I can do to get this rolling and improve my
patches? Or did I accidentally pick the wrong mailing list for
the userspace part of nfs?

Patrick
J. Bruce Fields Feb. 22, 2019, 8:40 p.m. UTC | #2
On Fri, Feb 22, 2019 at 08:52:02AM +0100, Patrick Steinhardt wrote:
> On Mon, Feb 04, 2019 at 03:31:18PM +0100, Patrick Steinhardt wrote:
> > Since glibc 2.2, the function res_querydomain(3) is implemented as a
> > define to `__res_querydomain`. Due to this implementation detail, using
> > `AC_CHECK_LIB` with a symbol name of "res_querydomain" will cause a
> > linking failure and thus fail to detect its availability. This is why
> > right now, we try to detect availability of `__res_querydomain` instead.
> > 
> > Unfortunately, this may break on other platforms where there is no
> > `__res_querydomain` but only the function without leading underscores.
> > To fix this, we can perform another `AC_CHECK_LIB([resolv],
> > [res_querydomain], ...)` call in case where the other one was not found
> > and only raise an error if both symbols weren't found.
> > 
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> 
> Is there anything I can do to get this rolling and improve my
> patches? Or did I accidentally pick the wrong mailing list for
> the userspace part of nfs?

This is the right mailing list.  Steve Dickson is the nfs-utils
maintainer, it's probably a good idea to include him directly as well,
sometimes people miss stuff on the list.

--b.
Steve Dickson Feb. 27, 2019, 4:41 p.m. UTC | #3
On 2/22/19 2:52 AM, Patrick Steinhardt wrote:
> On Mon, Feb 04, 2019 at 03:31:18PM +0100, Patrick Steinhardt wrote:
>> Since glibc 2.2, the function res_querydomain(3) is implemented as a
>> define to `__res_querydomain`. Due to this implementation detail, using
>> `AC_CHECK_LIB` with a symbol name of "res_querydomain" will cause a
>> linking failure and thus fail to detect its availability. This is why
>> right now, we try to detect availability of `__res_querydomain` instead.
>>
>> Unfortunately, this may break on other platforms where there is no
>> `__res_querydomain` but only the function without leading underscores.
>> To fix this, we can perform another `AC_CHECK_LIB([resolv],
>> [res_querydomain], ...)` call in case where the other one was not found
>> and only raise an error if both symbols weren't found.
>>
>> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> 
> Is there anything I can do to get this rolling and improve my
> patches? Or did I accidentally pick the wrong mailing list for
> the userspace part of nfs?
Sorry about this... I'm looking at them now... 

steved.

> 
> Patrick
>
Steve Dickson Feb. 27, 2019, 5:14 p.m. UTC | #4
On 2/4/19 9:31 AM, Patrick Steinhardt wrote:
> Since glibc 2.2, the function res_querydomain(3) is implemented as a
> define to `__res_querydomain`. Due to this implementation detail, using
> `AC_CHECK_LIB` with a symbol name of "res_querydomain" will cause a
> linking failure and thus fail to detect its availability. This is why
> right now, we try to detect availability of `__res_querydomain` instead.
> 
> Unfortunately, this may break on other platforms where there is no
> `__res_querydomain` but only the function without leading underscores.
> To fix this, we can perform another `AC_CHECK_LIB([resolv],
> [res_querydomain], ...)` call in case where the other one was not found
> and only raise an error if both symbols weren't found.
> 
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
Committed...

steved.
> ---
>  configure.ac | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 4bf5aea..cb9d921 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -411,7 +411,8 @@ if test "$enable_gss" = yes; then
>  fi
>  
>  dnl libdnsidmap specific checks
> -AC_CHECK_LIB([resolv], [__res_querydomain], , AC_MSG_ERROR(res_querydomain needed))
> +AC_CHECK_LIB([resolv], [__res_querydomain], ,
> +	AC_CHECK_LIB([resolv], [res_querydomain], , AC_MSG_ERROR(res_querydomain needed)))
>  
>  AC_ARG_ENABLE([ldap],
>  	[AS_HELP_STRING([--disable-ldap],[Disable support for LDAP @<:default=detect@:>@])])
>
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index 4bf5aea..cb9d921 100644
--- a/configure.ac
+++ b/configure.ac
@@ -411,7 +411,8 @@  if test "$enable_gss" = yes; then
 fi
 
 dnl libdnsidmap specific checks
-AC_CHECK_LIB([resolv], [__res_querydomain], , AC_MSG_ERROR(res_querydomain needed))
+AC_CHECK_LIB([resolv], [__res_querydomain], ,
+	AC_CHECK_LIB([resolv], [res_querydomain], , AC_MSG_ERROR(res_querydomain needed)))
 
 AC_ARG_ENABLE([ldap],
 	[AS_HELP_STRING([--disable-ldap],[Disable support for LDAP @<:default=detect@:>@])])