#61314 closed defect (fixed)
unbound @1.12.0: error: use of undeclared identifier 'IF_NAMESIZE'
Reported by: | chrstphrchvz (Christopher Chavez) | Owned by: | nerdling (Jeremy Lavergne) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.6.3 |
Keywords: | Cc: | iefdev (Eric F) | |
Port: | unbound |
Description
Build fails on 10.8 and earlier:
services/listen_dnsport.c:1411:40: error: use of undeclared identifier 'IF_NAMESIZE' char addr_buf[INET6_ADDRSTRLEN + 1 + IF_NAMESIZE + 1 + 16 + 1]; ^ services/listen_dnsport.c:1447:23: error: use of undeclared identifier 'IF_NAMESIZE' char if_index_name[IF_NAMESIZE + 1]; ^ services/listen_dnsport.c:1453:4: warning: implicit declaration of function 'if_indextoname' is invalid in C99 [-Wimplicit-function-declaration] if_indextoname(in6->sin6_scope_id, ^ 1 warning and 2 errors generated.
This is because during configuration net/if.h (which defines IF_NAMESIZE
) isn't detected, so HAVE_NET_IF_H
isn't defined and net/if.h won't be included by source files:
checking for net/if.h... no
Without digging into the configuration check, I'm inclined to think this is similar to #55238 where sys/socket.h needs to be included when using net/if.h on 10.8 and earlier; a future release of legacysupport will include sys/socket.h automatically ([ea4b467559/macports-legacy-support]).
Attachments (2)
Change History (16)
Changed 4 years ago by jmroot (Joshua Root)
Attachment: | config.log added |
---|
comment:1 Changed 4 years ago by jmroot (Joshua Root)
comment:2 Changed 4 years ago by jmroot (Joshua Root)
The autoconf manual even has an example for this: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Header-Portability.html
comment:3 Changed 4 years ago by kencu (Ken)
the current release of legacy-support has the net/if.h fix in it.
comment:4 Changed 4 years ago by iefdev (Eric F)
This got it to work for me. Don't know if the names are the same on all versions though.
-
services/listen_dnsport.c
old new 71 71 #include <systemd/sd-daemon.h> 72 72 #endif 73 73 74 #if __APPLE__ 75 #define HAVE_IFADDRS_H _IFADDRS_H_ 76 #define HAVE_NET_IF_H _NET_IF_H_ 77 #endif 78 74 79 #ifdef HAVE_IFADDRS_H 75 80 #include <ifaddrs.h> 76 81 #endif
Changed 4 years ago by iefdev (Eric F)
Attachment: | patch-ifaddr-net_if.diff added |
---|
comment:5 Changed 4 years ago by iefdev (Eric F)
Cc: | iefdev added |
---|
comment:6 Changed 4 years ago by iefdev (Eric F)
If it's <= 10.8, I should prob use: #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1080
instead.
comment:7 follow-up: 8 Changed 4 years ago by kencu (Ken)
or instead of all this - pretty sure - just add legacysupport and you're done, I think. Haven't tried it, tho.
comment:8 follow-up: 11 Changed 4 years ago by iefdev (Eric F)
Replying to kencu:
or instead of all this - pretty sure - just add legacysupport and you're done, I think. Haven't tried it, tho.
Both 1.0 and 1.1 worked… Go with legacysupport 1.1
?
comment:9 follow-up: 10 Changed 4 years ago by nerdling (Jeremy Lavergne)
Status: | assigned → accepted |
---|
chrstphrchvz also has a PR for 10.8 issues around undefined symbols: will the portgroup addition meld well with those changes?
comment:10 Changed 4 years ago by nerdling (Jeremy Lavergne)
Replying to nerdling: Whoops, mixing up Ports.
comment:11 follow-up: 12 Changed 4 years ago by kencu (Ken)
Replying to iefdev:
Go with
legacysupport 1.1
?
that's what I would do, but it's the perennial practical vs. purity argument, and I always come down on the side of practical.
comment:12 Changed 4 years ago by iefdev (Eric F)
Replying to kencu:
Replying to iefdev:
Go with
legacysupport 1.1
?that's what I would do, but it's the perennial practical vs. purity argument, and I always come down on the side of practical.
I went with that:
$ port -v installed unbound The following ports are currently installed: unbound @1.12.0_1+nghttp2-universal (active) platform='darwin 11' archs='x86_64' date='2020-10-14T19:54:27+0200'
comment:13 Changed 4 years ago by jmroot (Joshua Root)
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Even on current systems, the man page for if_indextoname specifies multiple includes in the synopsis:
Should probably split
net/if.h
into its own AC_CHECK_HEADERS with an additionalsys/socket.h
conditional include on top of the ones in AC_INCLUDES_DEFAULT.