Skip to contentSkip to conversation

ocaml NetBSD support

PATCH In review Christoph Egger 2 participants 5 messages May 7, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocaml NetBSD support

Hi!

Attached patch adds support for NetBSD to ocaml xenstore.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
Config.mk +4 -0
diff -r 49a69b4bc421 Config.mk
@@ -171,8 +171,12 @@ ifeq ($(OCAML_TOOLS),y)
 ifeq ($(CONFIG_Linux),y)
 OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n")
 else
+ifeq ($(CONFIG_NetBSD),y)
+OCAML_TOOLS := $(shell ocamlopt -v > /dev/null 2>&1 && echo "y" || echo "n")
+else
 OCAML_TOOLS := n
 endif
 endif
+endif
 
 -include $(XEN_ROOT)/.config
tools/ocaml/common.make +8 -0
diff -r 49a69b4bc421 tools/ocaml/common.make
@@ -1,3 +1,5 @@
+include $(XEN_ROOT)/tools/Rules.mk
+
 CC ?= gcc
 OCAMLOPT ?= ocamlopt
 OCAMLC ?= ocamlc
@@ -9,7 +11,13 @@ OCAMLYACC ?= ocamlyacc
 CFLAGS ?= -Wall -fPIC -O2 -Werror
 
 CFLAGS += -I$(TOPLEVEL)/../include -I$(TOPLEVEL)/../libxc
+
+ifeq ($(CONFIG_Linux),y)
 CFLAGS += -I/usr/lib64/ocaml -I/usr/lib/ocaml
+endif
+ifeq ($(CONFIG_NetBSD),y)
+CFLAGS += -I/usr/pkg/lib/ocaml -fPIC
+endif
 
 OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
 OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
tools/ocaml/libs/eventchn/Makefile +1 -0
diff -r 49a69b4bc421 tools/ocaml/libs/eventchn/Makefile
@@ -1,4 +1,5 @@
 TOPLEVEL=../..
+XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
 OBJS = eventchn
tools/ocaml/libs/log/Makefile +1 -0
diff -r 49a69b4bc421 tools/ocaml/libs/log/Makefile
@@ -1,4 +1,5 @@
 TOPLEVEL=../..
+XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
 OBJS = syslog log logs
tools/ocaml/libs/mmap/Makefile +1 -0
diff -r 49a69b4bc421 tools/ocaml/libs/mmap/Makefile
@@ -1,4 +1,5 @@
 TOPLEVEL=../..
+XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
 OBJS = mmap
tools/ocaml/libs/uuid/Makefile +1 -0
diff -r 49a69b4bc421 tools/ocaml/libs/uuid/Makefile
@@ -1,4 +1,5 @@
 TOPLEVEL=../..
+XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
 OBJS = uuid
tools/ocaml/libs/xb/Makefile +1 -0
diff -r 49a69b4bc421 tools/ocaml/libs/xb/Makefile
@@ -1,4 +1,5 @@
 TOPLEVEL=../..
+XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
 CFLAGS += -I../mmap
tools/ocaml/libs/xc/Makefile +1 -0
diff -r 49a69b4bc421 tools/ocaml/libs/xc/Makefile
@@ -1,4 +1,5 @@
 TOPLEVEL=../..
+XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
 CFLAGS += -I../mmap -I./
tools/ocaml/libs/xs/Makefile +1 -0
diff -r 49a69b4bc421 tools/ocaml/libs/xs/Makefile
@@ -1,4 +1,5 @@
 TOPLEVEL=../..
+XEN_ROOT=$(TOPLEVEL)/../..
 include $(TOPLEVEL)/common.make
 
 OCAMLINCLUDE += -I ../xb/
tools/ocaml/xenstored/Makefile +1 -0
diff -r 49a69b4bc421 tools/ocaml/xenstored/Makefile
@@ -1,3 +1,4 @@
+XEN_ROOT = ../../..
 OCAML_TOPLEVEL = ..
 include $(OCAML_TOPLEVEL)/common.make
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 6 lines · Christoph Egger

Hi!

Attached patch adds support for NetBSD to ocaml xenstore.

Hi Christoph,

This is just compilation support though. I suspect the xc bindings where we have a duplicated libxc library need to be patch for netbsd support too (as similar as xc_netbsd.c).

Signature · 1 line
Vincent
#2 lore raw
Quoted 5 lines · On Friday 07 May 2010 14:49:22 Vincent Hanquez wrote:
Quoted 4 lines · Christoph Egger

Hi!

Attached patch adds support for NetBSD to ocaml xenstore.

Quoted 7 lines
Quoted 1 line

Hi Christoph,

This is just compilation support though. I suspect the xc bindings where we have a duplicated libxc library need to be patch for netbsd support too (as similar as xc_netbsd.c).

Why is libxc redundant ? Why don't you reuse the existing one?

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#3 lore raw
Quoted 8 lines · On Friday 07 May 2010 15:39:32 Christoph Egger wrote:
Quoted 7 lines · On Friday 07 May 2010 14:49:22 Vincent Hanquez wrote:
Quoted 5 lines · Christoph Egger

Hi!

Attached patch adds support for NetBSD to ocaml xenstore.

Quoted 7 lines
Quoted 5 lines

Hi Christoph,

This is just compilation support though. I suspect the xc bindings where we have a duplicated libxc library need to be patch for netbsd support too (as similar as xc_netbsd.c).

Why is libxc redundant ? Why don't you reuse the existing one?

Vencent: What is wrong with having an ocaml language binding on top of libxc ? That will gain portibility automatically.

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#4 lore raw
In reply to Christoph Egger
Quoted 1 line · Christoph Egger

Why is libxc redundant ? Why don't you reuse the existing one?

we want to get rid of the redundant copy, but its not as simple as it looks. there's some unfortunate interactions with ocaml and pthread and we have found the hard way in the past, that they don't mix really well.

Signature · 1 line
Vincent