b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From 9b4070944578336506cd0a76de6f733c72d0ca74 Mon Sep 17 00:00:00 2001 |
| 2 | From: "Yann E. MORIN" <yann.morin.1998@free.fr> |
| 3 | Date: Sat, 13 Oct 2018 11:11:15 +0200 |
| 4 | Subject: [PATCH] configure: fix detection of re-entrant resolver functions |
| 5 | |
| 6 | Fixes https://issues.asterisk.org/jira/browse/ASTERISK-21795 |
| 7 | |
| 8 | uClibc does not provide res_nsearch: |
| 9 | asterisk-16.0.0/main/dns.c:506: undefined reference to `res_nsearch' |
| 10 | |
| 11 | Patch coded by Yann E. MORIN: |
| 12 | http://lists.busybox.net/pipermail/buildroot/2018-October/232630.html |
| 13 | |
| 14 | Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> |
| 15 | --- |
| 16 | configure.ac | 6 +++++- |
| 17 | 1 file changed, 5 insertions(+), 1 deletion(-) |
| 18 | |
| 19 | --- a/configure.ac |
| 20 | +++ b/configure.ac |
| 21 | @@ -1484,7 +1484,11 @@ AC_LINK_IFELSE( |
| 22 | #include <arpa/nameser.h> |
| 23 | #endif |
| 24 | #include <resolv.h>], |
| 25 | - [int foo = res_ninit(NULL);])], |
| 26 | + [ |
| 27 | + int foo; |
| 28 | + foo = res_ninit(NULL); |
| 29 | + foo = res_nsearch(NULL, NULL, 0, 0, NULL, 0); |
| 30 | + ])], |
| 31 | AC_MSG_RESULT(yes) |
| 32 | AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.]) |
| 33 | AC_SEARCH_LIBS(res_9_ndestroy, resolv) |