Commit ae571e9c7e for frr
commit ae571e9c7e88937b6a1c03ca2bf4da3c1e6868f4
Author: Donald Sharp <sharpd@nvidia.com>
Date: Sun Nov 8 10:33:46 2026 -0500
build: add include/macos and __APPLE_USE_RFC_3542 to CPPFLAGS on macOS
Expose include/macos (for the compatibility endian.h header) and
__APPLE_USE_RFC_3542 (for RFC 3542 IPv6 socket APIs) in CPPFLAGS on
darwin* hosts so configure header checks and compilation both see them.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
diff --git a/configure.ac b/configure.ac
index ffe59a5fb9..11351d1a3a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1146,6 +1146,22 @@ case "$host_os" in
esac
AC_SUBST([LIBFRR_ENTRY_LDFLAGS])
+dnl macOS specifics. These need to be in CPPFLAGS rather than in some automake
+dnl variable since the checks below use them, too.
+dnl
+dnl - macOS has no <endian.h> (and, depending on the SDK, no htobe64() & co.)
+dnl include/macos/endian.h provides one. It must be an absolute path since
+dnl srcdir is often ".".
+dnl - the RFC 3542 IPv6 socket API (IPV6_PKTINFO, IPV6_HOPLIMIT, IPV6_RECV*)
+dnl is only visible when __APPLE_USE_RFC_3542 is defined. The default there
+dnl is the obsolete RFC 2292 API.
+case "$host_os" in
+ darwin*)
+ frr_abs_srcdir="`cd \"${srcdir}\"; pwd`"
+ CPPFLAGS="-I${frr_abs_srcdir}/include/macos -D__APPLE_USE_RFC_3542 $CPPFLAGS"
+ ;;
+esac
+
dnl -------------------------
dnl Check other header files.
dnl -------------------------