1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-21 08:42:23 +00:00

dns/udns: unbreak build on 14-CURRENT

Fix detection of inet_pton() and inet_ntop()
This commit is contained in:
Martin Matuska 2023-02-24 11:09:28 +01:00
parent 5c35cbe93d
commit 956aa4e270
2 changed files with 28 additions and 1 deletions

View File

@ -1,6 +1,6 @@
PORTNAME= udns
PORTVERSION= 0.4
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= dns
MASTER_SITES= http://www.corpit.ru/mjt/udns/

View File

@ -0,0 +1,27 @@
--- configure.orig 2023-02-24 09:54:25 UTC
+++ configure
@@ -83,17 +83,20 @@ else
fi
ac_ign \
- ac_yesno "for inet_pton() && inet_ntop()" \
+ ac_yesno "for working inet_pton() && inet_ntop()" \
ac_have INET_PTON_NTOP \
ac_link <<EOF
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
+#include <string.h>
int main() {
+ char addr[sizeof(struct in_addr)];
char buf[64];
- long x = 0;
- inet_pton(AF_INET, &x, buf);
- return inet_ntop(AF_INET, &x, buf, sizeof(buf));
+ char *localhost = "127.0.0.1";
+ inet_pton(AF_INET, localhost, addr);
+ inet_ntop(AF_INET, addr, buf, sizeof(buf));
+ return strncmp(localhost, buf, sizeof(localhost));
}
EOF