blob: fbfb0816ddbecf0be43d155331012df4a01ebde4 [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001From d67d6b4f981db9612d808bd723176a1d2996d53a Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Mon, 17 Jan 2022 13:21:32 +0100
4Subject: [PATCH] configure.ac: check getprotobynumber_r with AC_TRY_LINK
5
6AC_TRY_COMPILE won't error out if the function is altogether absent
7(e.g. on linux musl C library), the test needs to link all the way.
8
9Upstream-Status: Submitted [via email to socat@dest-unreach.org]
10Signed-off-by: Alexander Kanavin <alex@linutronix.de>
11---
12 configure.ac | 6 +++---
13 1 file changed, 3 insertions(+), 3 deletions(-)
14
15diff --git a/configure.ac b/configure.ac
16index d4acc9e..973a7f2 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -137,13 +137,13 @@ AC_MSG_RESULT($sc_cv_have_prototype_hstrerror)
20 # getprotobynumber_r() is not standardized
21 AC_MSG_CHECKING(for getprotobynumber_r() variant)
22 AC_CACHE_VAL(sc_cv_getprotobynumber_r,
23-[AC_TRY_COMPILE([#include <stddef.h>
24+[AC_TRY_LINK([#include <stddef.h>
25 #include <netdb.h>],[getprotobynumber_r(1,NULL,NULL,1024,NULL);],
26 [sc_cv_getprotobynumber_r=1; tmp_bynum_variant=Linux],
27- [AC_TRY_COMPILE([#include <stddef.h>
28+ [AC_TRY_LINK([#include <stddef.h>
29 #include <netdb.h>],[getprotobynumber_r(1,NULL,NULL,1024);],
30 [sc_cv_getprotobynumber_r=2; tmp_bynum_variant=Solaris],
31- [AC_TRY_COMPILE([#include <stddef.h>
32+ [AC_TRY_LINK([#include <stddef.h>
33 #include <netdb.h>],[getprotobynumber_r(1,NULL,NULL);],
34 [sc_cv_getprotobynumber_r=3; tmp_bynum_variant=AIX],
35