Fix build on FreeBSD.
authorEdward Tomasz Napierała <trasz@freebsd.org>
Tue, 1 Nov 2011 12:25:49 +0000 (13:25 +0100)
committerBen Pfaff <blp@nicira.com>
Tue, 1 Nov 2011 16:11:52 +0000 (09:11 -0700)
Patch below fixes build on FreeBSD; tested on 10.0-CURRENT.

Signed-off-by: Edward Tomasz Napierala <trasz@FreeBSD.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
configure.ac
lib/meta-flow.h
lib/odp-util.c
lib/ofp-util.c
lib/packets.c
ofproto/in-band.h
vswitchd/system-stats.c

index 3b87e7e0c0829a94855b24f34218412263fa028d..7bac8712f8be223f00b9da3323fde53ddddc8541 100644 (file)
@@ -41,6 +41,7 @@ AC_SYS_LARGEFILE
 
 AC_SEARCH_LIBS([pow], [m])
 AC_SEARCH_LIBS([clock_gettime], [rt])
+AC_SEARCH_LIBS([timer_create], [rt])
 
 OVS_CHECK_COVERAGE
 OVS_CHECK_NDEBUG
index 696b8ca67f83e13f72c9ce36249ef5736b2e1e15..1242f9ff3f81641c12f41ac658908c5b7d8b40dd 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef META_FLOW_H
 #define META_FLOW_H 1
 
+#include <sys/types.h>
+#include <netinet/in.h>
 #include <netinet/ip6.h>
 #include "flow.h"
 #include "packets.h"
index 33672c8c4ba4af77336a3af7597da53990125eca..1e20f49db7b9fb7b5361b842ab075cb69b5f459c 100644 (file)
@@ -19,6 +19,7 @@
 #include "odp-util.h"
 #include <errno.h>
 #include <inttypes.h>
+#include <netinet/in.h>
 #include <netinet/icmp6.h>
 #include <stdlib.h>
 #include <string.h>
index bf03a820ea3123c54b60fb81b445a26b440dd664..b1d35cbb80ae5fe2b8f716fdba1d309620c99e67 100644 (file)
@@ -18,6 +18,8 @@
 #include "ofp-print.h"
 #include <errno.h>
 #include <inttypes.h>
+#include <sys/types.h>
+#include <netinet/in.h>
 #include <netinet/icmp6.h>
 #include <stdlib.h>
 #include "autopath.h"
index 815d4e66be9d0b0b7b007123ba413e56f7f6d916..b704276caae43dfa3eab59b69127025046c011f3 100644 (file)
@@ -18,6 +18,7 @@
 #include "packets.h"
 #include <assert.h>
 #include <arpa/inet.h>
+#include <sys/socket.h>
 #include <netinet/in.h>
 #include <stdlib.h>
 #include "byte-order.h"
index f7f2ec656894e2f8365af9b75f2a8acbcda9e56a..9de72ee6406495f1bc7f65825f9ace59013afcd5 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdbool.h>
 #include <stddef.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 
 struct flow;
 struct in_band;
index b8f8d7e33036e0956a90cfe5c4bc1f233078c7c1..a3b4db44341c337cb94e2b65f83ed9726f1b4d79 100644 (file)
@@ -95,7 +95,11 @@ get_memory_stats(struct shash *stats)
     if (!LINUX) {
         unsigned int pagesize = get_page_size();
         long int phys_pages = sysconf(_SC_PHYS_PAGES);
+#ifdef _SC_AVPHYS_PAGES
         long int avphys_pages = sysconf(_SC_AVPHYS_PAGES);
+#else
+        long int avphys_pages = 0;
+#endif
         int mem_total, mem_used;
 
         if (pagesize <= 0 || phys_pages <= 0 || avphys_pages <= 0) {