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 3b87e7e..7bac871 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 696b8ca..1242f9f 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 33672c8..1e20f49 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 bf03a82..b1d35cb 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 815d4e6..b704276 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 f7f2ec6..9de72ee 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 b8f8d7e..a3b4db4 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) {