diff options
-rw-r--r-- | Makefile | 49 | ||||
-rw-r--r-- | cglibivy.c | 15 | ||||
-rw-r--r-- | civy.c | 19 | ||||
-rw-r--r-- | civyloop.c | 30 | ||||
-rw-r--r-- | debian/changelog.3.10.2 | 38 | ||||
-rw-r--r-- | debian/changelog.3.11.2 | 50 | ||||
-rw-r--r-- | debian/control | 6 | ||||
-rwxr-xr-x | debian/rules | 3 | ||||
-rw-r--r-- | examples/Makefile | 2 |
9 files changed, 175 insertions, 37 deletions
@@ -2,15 +2,32 @@ DESTDIR = / -OCAMLC = ocamlc -g +DEBUG = n + + +OCAMLC = ocamlc OCAMLMLI = ocamlc OCAMLOPT = ocamlopt -unsafe OCAMLDEP=ocamldep -OCAMLFLAGS= + +ifeq ($(DEBUG),y) +OCAMLFLAGS = -g +else +OCAMLFLAGS = +endif + OCAMLOPTFLAGS= -CFLAGS=-Wall +CFLAGS+=-Wall +OCAMLINC=-I `ocamlc -where` GLIBINC=`pkg-config --cflags glib-2.0` +LBITS := $(shell getconf LONG_BIT) +ifeq ($(LBITS),64) + FPIC=-fPIC +endif + + + IVY = ivy.ml ivyLoop.ml IVYCMO= $(IVY:.ml=.cmo) @@ -30,12 +47,21 @@ TKIVYCMO= $(TKIVY:.ml=.cmo) TKIVYCMI= $(TKIVY:.ml=.cmi) TKIVYCMX= $(TKIVY:.ml=.cmx) +UNAME = $(shell uname -s) + +ifeq ("$(UNAME)","Darwin") + LIBRARYS = -L/opt/local/lib +endif + LIBS = ivy-ocaml.cma ivy-ocaml.cmxa glibivy-ocaml.cma glibivy-ocaml.cmxa # tkivy-ocaml.cma tkivy-ocaml.cmxa all : $(LIBS) +DISTRO=`ocamlc -version` + deb : + cp debian/changelog.$(DISTRO) debian/changelog dpkg-buildpackage -rfakeroot ivy : ivy-ocaml.cma ivy-ocaml.cmxa @@ -53,22 +79,22 @@ desinstall : cd `ocamlc -where`; rm -f $(INST_FILES) ivy-ocaml.cma : $(IVYCMO) civy.o civyloop.o - ocamlmklib -o ivy-ocaml $^ -livy + ocamlmklib -o ivy-ocaml $^ $(LIBRARYS) -livy ivy-ocaml.cmxa : $(IVYCMX) civy.o civyloop.o - ocamlmklib -o ivy-ocaml $^ -livy + ocamlmklib -o ivy-ocaml $^ $(LIBRARYS) -livy glibivy-ocaml.cma : $(GLIBIVYCMO) civy.o cglibivy.o - ocamlmklib -o glibivy-ocaml $^ -lglibivy `pkg-config --libs glib-2.0` -lpcre + ocamlmklib -o glibivy-ocaml $^ $(LIBRARYS) -lglibivy `pkg-config --libs glib-2.0` -lpcre glibivy-ocaml.cmxa : $(GLIBIVYCMX) civy.o cglibivy.o - ocamlmklib -o glibivy-ocaml $^ -lglibivy `pkg-config --libs glib-2.0` -lpcre + ocamlmklib -o glibivy-ocaml $^ $(LIBRARYS) -lglibivy `pkg-config --libs glib-2.0` -lpcre tkivy-ocaml.cma : $(TKIVYCMO) civy.o ctkivy.o - ocamlmklib -o tkivy-ocaml $^ -livy -ltclivy + ocamlmklib -o tkivy-ocaml $^ $(LIBRARYS) -livy -ltclivy tkivy-ocaml.cmxa : $(TKIVYCMX) civy.o ctkivy.o - ocamlmklib -o tkivy-ocaml $^ -livy -ltclivy + ocamlmklib -o tkivy-ocaml $^ $(LIBRARYS) -livy -ltclivy .SUFFIXES: .SUFFIXES: .ml .mli .mly .mll .cmi .cmo .cmx .c .o .out .opt @@ -76,7 +102,8 @@ tkivy-ocaml.cmxa : $(TKIVYCMX) civy.o ctkivy.o .ml.cmo : $(OCAMLC) $(OCAMLFLAGS) $(INCLUDES) -c $< .c.o : - $(CC) -Wall -c $(GLIBINC) $< + + $(CC) -Wall -c $(FPIC) -I /opt/local/include/ $(OCAMLINC) $(GLIBINC) $< .mli.cmi : $(OCAMLMLI) $(OCAMLFLAGS) -c $< .ml.cmx : @@ -91,7 +118,7 @@ tkivy-ocaml.cmxa : $(TKIVYCMX) civy.o ctkivy.o $(OCAMLOPT) -o $@ unix.cmxa -I . ivy-ocaml.cmxa $< -cclib -livy clean: - \rm -f *.cm* *.o *.a .depend *~ *.out *.opt .depend *.so *_stamp + \rm -fr *.cm* *.o *.a .depend *~ *.out *.opt .depend *.so *-stamp debian/ivy-ocaml debian/files debian/ivy-ocaml.debhelper.log debian/ivy-ocaml.substvars debian/*~ .depend: $(OCAMLDEP) $(INCLUDES) *.mli *.ml > .depend @@ -2,14 +2,16 @@ #include <string.h> #include <stdio.h> #include <getopt.h> -#include <timer.h> +#include <Ivy/timer.h> +#include <Ivy/ivychannel.h> +#include <Ivy/ivyglibloop.h> +#include <Ivy/version.h> #include <glib.h> #include <caml/mlvalues.h> #include <caml/fail.h> #include <caml/callback.h> #include <caml/memory.h> #include <caml/alloc.h> -#include "ivyglibloop.h" value ivy_GtkmainLoop(value unit) { @@ -19,18 +21,23 @@ value ivy_GtkmainLoop(value unit) extern void cb_delete_channel(void *delete_read); extern void cb_read_channel(Channel ch, HANDLE fd, void *closure); +extern void cb_write_channel(Channel ch, HANDLE fd, void *closure); value ivy_GtkchannelSetUp(value fd, value closure_name) { Channel c; value * closure = caml_named_value(String_val(closure_name)); - c = IvyGlibChannelSetUp((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); +#if IVYMINOR_VERSION == 8 + c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); +#else + c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); +#endif return Val_int(c); } value ivy_GtkchannelClose(value ch) { - IvyGlibChannelClose((Channel)Int_val(ch)); + IvyChannelRemove((Channel)Long_val(ch)); return Val_unit; } @@ -2,9 +2,9 @@ #include <string.h> #include <stdio.h> #include <getopt.h> -#include <ivy.h> -#include <ivyloop.h> -#include <timer.h> +#include <Ivy/ivy.h> +#include <Ivy/ivyloop.h> +#include <Ivy/timer.h> #include <caml/mlvalues.h> #include <caml/fail.h> #include <caml/callback.h> @@ -54,35 +54,38 @@ void ClosureCallback(IvyClientPtr app, void *closure, int argc, char **argv) /* Copie de argv dans t avec ajout d'un pointeur nul a la fin */ for(i=0; i < argc; i++) t[i] = argv[i]; t[argc] = (char*)0L; - callback2(*(value*)closure, Val_int((int)app), copy_string_array((char const **)t)); + callback2(*(value*)closure, Val_long(app), copy_string_array((char const **)t)); } value ivy_bindMsg(value cb_name, value regexp) { value * closure = caml_named_value(String_val(cb_name)); MsgRcvPtr id = IvyBindMsg(ClosureCallback, (void*)closure, String_val(regexp)); - return Val_int((int)id); + return Val_long(id); } value ivy_unbindMsg(value id) { - IvyUnbindMsg((MsgRcvPtr)Int_val(id)); + IvyUnbindMsg((MsgRcvPtr)Long_val(id)); return Val_unit; } value ivy_name_of_client(value c) { - return copy_string(IvyGetApplicationName((IvyClientPtr)Int_val(c))); + return copy_string(IvyGetApplicationName((IvyClientPtr)Long_val(c))); } value ivy_host_of_client(value c) { - return copy_string(IvyGetApplicationHost((IvyClientPtr)Int_val(c))); + return copy_string(IvyGetApplicationHost((IvyClientPtr)Long_val(c))); } void cb_delete_channel(void *delete_read) { } +void cb_write_channel(Channel ch, HANDLE fd, void *closure) +{ +} void cb_read_channel(Channel ch, HANDLE fd, void *closure) { @@ -2,9 +2,10 @@ #include <string.h> #include <stdio.h> #include <getopt.h> -#include <ivy.h> -#include <ivyloop.h> -#include <timer.h> +#include <Ivy/ivy.h> +#include <Ivy/ivyloop.h> +#include <Ivy/timer.h> +#include <Ivy/version.h> #include <caml/mlvalues.h> #include <caml/fail.h> #include <caml/callback.h> @@ -13,14 +14,18 @@ value ivy_mainLoop(value unit) { - IvyMainLoop (0); +#if IVYMINOR_VERSION == 8 + IvyMainLoop (NULL,NULL); +#else + IvyMainLoop (); +#endif return Val_unit; } void timer_cb(TimerId id, void *data, unsigned long delta) { value closure = *(value*)data; - callback(closure, Val_int((int) id)); + callback(closure, Val_long(id)); } value ivy_timerRepeatafter(value nb_ticks,value delay, value closure_name) @@ -33,8 +38,9 @@ value ivy_timerRepeatafter(value nb_ticks,value delay, value closure_name) /* Data associated to Channel callbacks is the couple of delete and read closures */ -void cb_delete_channel(void *delete_read); -void cb_read_channel(Channel ch, HANDLE fd, void *closure); +extern void cb_delete_channel(void *delete_read); +extern void cb_read_channel(Channel ch, HANDLE fd, void *closure); +extern void cb_write_channel(Channel ch, HANDLE fd, void *closure); value ivy_channelSetUp(value fd, value closure_name) @@ -42,19 +48,23 @@ value ivy_channelSetUp(value fd, value closure_name) Channel c; value * closure = caml_named_value(String_val(closure_name)); - c = IvyChannelSetUp((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); +#if IVYMINOR_VERSION == 8 + c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); +#else + c = IvyChannelAdd((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); +#endif return Val_int(c); } value ivy_timerRemove(value t) { - TimerRemove((TimerId)Int_val(t)); + TimerRemove((TimerId)Long_val(t)); return Val_unit; } value ivy_channelClose(value ch) { - IvyChannelClose((Channel)Int_val(ch)); + IvyChannelRemove((Channel)Long_val(ch)); return Val_unit; } diff --git a/debian/changelog.3.10.2 b/debian/changelog.3.10.2 new file mode 100644 index 0000000..89afc10 --- /dev/null +++ b/debian/changelog.3.10.2 @@ -0,0 +1,38 @@ +ivy-ocaml (1.1-7) unstable; urgency=low + + * Updated for ocaml 3.10.2 + + -- Pascal Brisset (Hecto) <pascal.brisset@enac.fr> Fri, 23 May 2008 23:18:00 +0200 + +ivy-ocaml (1.1-6) unstable; urgency=low + + * Updated for ocaml 3.10.1 + + -- Pascal Brisset (Hecto) <pascal.brisset@enac.fr> Mon, 25 Feb 2008 10:31:49 +0100 + +ivy-ocaml (1.1-5) unstable; urgency=low + + * Updated for ocaml 3.10 + + -- Pascal Brisset (Hecto) <pascal.brisset@enac.fr> Tue, 04 Sep 2007 20:41:49 +0200 + +ivy-ocaml (1.1-4) unstable; urgency=low + + * Updated for ocaml 3.09.2-6 + + -- Antoine Drouin (Poine) <poine@recherche.enac.fr> Fri, 04 Aug 2006 13:40:54 +0200 + +ivy-ocaml (1.1-3) unstable; urgency=low + + * Updated for ivy 3.8 + + -- Antoine Drouin (Poine) <poine@recherche.enac.fr> Fri, 28 Jul 2006 13:40:54 +0200 + +ivy-ocaml (1.0-2) unstable; urgency=low + + * Updated for ocaml 3.09 + + * Initial Release. + + -- Pascal Brisset (Hecto) <pascal.brisset@enac.fr> Thu, 7 Oct 2004 13:40:54 +0200 + diff --git a/debian/changelog.3.11.2 b/debian/changelog.3.11.2 new file mode 100644 index 0000000..eb649f9 --- /dev/null +++ b/debian/changelog.3.11.2 @@ -0,0 +1,50 @@ +ivy-ocaml (1.1-11) unstable; urgency=low + + * Support of ivy-c_3.11.6, OSX and Linux 64bit + + -- Gautier Hattenberger <gautier.hattenberger@enac.fr> Wed, 1 Dec 2010 10:43:29 +0100 + +ivy-ocaml (1.1-10) unstable; urgency=low + + * Updated for ocaml 3.11.2 + + -- Pascal Brisset (Hecto) <pascal.brisset@enac.fr> Thu, 25 Feb 2010 09:58:29 +0100 + +ivy-ocaml (1.1-7) unstable; urgency=low + + * Updated for ocaml 3.10.2 + + -- Pascal Brisset (Hecto) <pascal.brisset@enac.fr> Fri, 23 May 2008 23:18:00 +0200 + +ivy-ocaml (1.1-6) unstable; urgency=low + + * Updated for ocaml 3.10.1 + + -- Pascal Brisset (Hecto) <pascal.brisset@enac.fr> Mon, 25 Feb 2008 10:31:49 +0100 + +ivy-ocaml (1.1-5) unstable; urgency=low + + * Updated for ocaml 3.10 + + -- Pascal Brisset (Hecto) <pascal.brisset@enac.fr> Tue, 04 Sep 2007 20:41:49 +0200 + +ivy-ocaml (1.1-4) unstable; urgency=low + + * Updated for ocaml 3.09.2-6 + + -- Antoine Drouin (Poine) <poine@recherche.enac.fr> Fri, 04 Aug 2006 13:40:54 +0200 + +ivy-ocaml (1.1-3) unstable; urgency=low + + * Updated for ivy 3.8 + + -- Antoine Drouin (Poine) <poine@recherche.enac.fr> Fri, 28 Jul 2006 13:40:54 +0200 + +ivy-ocaml (1.0-2) unstable; urgency=low + + * Updated for ocaml 3.09 + + * Initial Release. + + -- Pascal Brisset (Hecto) <pascal.brisset@enac.fr> Thu, 7 Oct 2004 13:40:54 +0200 + diff --git a/debian/control b/debian/control index d1cbb70..7707a38 100644 --- a/debian/control +++ b/debian/control @@ -1,13 +1,13 @@ Source: ivy-ocaml Section: net Priority: optional -Maintainer: Pascal Brisset (Hecto) <pascal.brisset@enac.fr> -Build-Depends: debhelper (>= 4.0.0) +Maintainer: Gautier Hattenberger <gautier.hattenberger@enac.fr> +Build-Depends: debhelper (>= 4.0.0), ocaml-nox, ivy-c-dev (>=3.8), libglib2.0-dev, libpcre3-dev, ivy-c(>=3.8) Standards-Version: 3.6.1 Package: ivy-ocaml Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} ocaml-nox (= 3.08.2-1), ivy-c +Depends: ${shlibs:Depends}, ${misc:Depends}, ocaml-nox-${F:OCamlABI}, ivy-c(>= 3.8) Description: Ocaml binding for the Ivy software bus This package provides the bindings for the Ivy software bus. Standalone linking and with the glib mainloop are provided. diff --git a/debian/rules b/debian/rules index 6a369dc..a6550e0 100755 --- a/debian/rules +++ b/debian/rules @@ -10,6 +10,7 @@ #export DH_VERBOSE=1 +OCAMLABI := $(shell ocamlc -version) CFLAGS = -Wall -g @@ -90,7 +91,7 @@ binary-arch: build install # dh_makeshlibs dh_installdeb dh_shlibdeps - dh_gencontrol + dh_gencontrol -- -VF:OCamlABI="$(OCAMLABI)" dh_md5sums dh_builddeb diff --git a/examples/Makefile b/examples/Makefile index fe4cb48..d110fd0 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -5,6 +5,8 @@ OCAMLMLI = ocamlc -I .. OCAMLOPT = ocamlopt OCAMLDEP=ocamldep +all: ivyprobe.out glibivyprobe.out + ivyprobe.out : ivyprobe.cmo ivyivyprobe.cmo $(OCAMLC) -custom -o $@ unix.cma ivy-ocaml.cma $^ |