]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
configure: fix detection of re-entrant resolver functions
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Wed, 8 Mar 2023 18:26:51 +0000 (19:26 +0100)
committerAsterisk Development Team <asteriskteam@digium.com>
Mon, 8 May 2023 17:55:16 +0000 (17:55 +0000)
uClibc does not provide res_nsearch:
asterisk-16.0.0/main/dns.c:506: undefined reference to `res_nsearch'

Patch coded by Yann E. MORIN:
http://lists.busybox.net/pipermail/buildroot/2018-October/232630.html

ASTERISK-21795 #close

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
[Retrieved from:
https: //git.buildroot.net/buildroot/tree/package/asterisk/0005-configure-fix-detection-of-re-entrant-resolver-funct.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Change-Id: I79296f19e28ec764bbd1e991bf11c416d0b10563
(cherry picked from commit a10b4f5d2c85a7f6c1fbe5e942fec1eea60cff47)

configure
configure.ac

index 62c340a78b1e83118903ba45699044beaf386dac..34598191f0c7f3be2abd457f853c9921d02f8790 100755 (executable)
--- a/configure
+++ b/configure
@@ -19663,7 +19663,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 int
 main ()
 {
-int foo = res_ninit(NULL);
+
+                               int foo;
+                               foo = res_ninit(NULL);
+                               foo = res_nsearch(NULL, NULL, 0, 0, NULL, 0);
+
   ;
   return 0;
 }
index 5aca25269b3d8e582e0c22ab6a589118d253c828..3231450d3ab63570897d7d83a945ec8f52463e4c 100644 (file)
@@ -1494,7 +1494,11 @@ AC_LINK_IFELSE(
                        #include <arpa/nameser.h>
                        #endif
                        #include <resolv.h>],
-                       [int foo = res_ninit(NULL);])],
+                       [
+                               int foo;
+                               foo = res_ninit(NULL);
+                               foo = res_nsearch(NULL, NULL, 0, 0, NULL, 0);
+                       ])],
        AC_MSG_RESULT(yes)
        AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
        AC_SEARCH_LIBS(res_9_ndestroy, resolv)