[quagga-dev 10169] [PATCH 2/2] build: Fix build on MacOSX 10.8 (Mountain Lion)

Hasso Tepper hasso.tepper at gmail.com
Sun Jan 13 18:45:29 GMT 2013


Newer MacOSX versions have support for both IPv6 advanced socket API
RFCs (2292 and 3542) switchable in compile time, but neither of these
is default for some strange reason. RFC3542 will be default in future,
but for now we have to declare that we want to use the RFC3542 API
before including <netinet/in.h>.
---
 configure.ac |    3 +++
 lib/zebra.h  |    4 ++++
 2 files changed, 7 insertions(+)

diff --git a/configure.ac b/configure.ac
index 94061c8..37ec853 100755
--- a/configure.ac
+++ b/configure.ac
@@ -470,6 +470,9 @@ m4_define([QUAGGA_INCLUDES],
 #if HAVE_SYS_SOCKET_H
 # include <sys/socket.h>
 #endif
+#ifdef __APPLE__
+# define __APPLE_USE_RFC_3542
+#endif
 #if HAVE_NETINET_IN_H
 # include <netinet/in.h>
 #endif
diff --git a/lib/zebra.h b/lib/zebra.h
index 404b832..ffca7a8 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -142,6 +142,10 @@ typedef int socklen_t;
 #include <sys/sockio.h>
 #endif /* HAVE_SYS_SOCKIO_H */
 
+#ifdef __APPLE__
+#define __APPLE_USE_RFC_3542
+#endif
+
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif /* HAVE_NETINET_IN_H */
-- 
1.7.10.2 (Apple Git-33)





More information about the Quagga-dev mailing list