Commit 7a93e1b5 authored by erwan's avatar erwan

Patch polka to define IID_IUnknown, which is needed for using dllcamlidl.so

I used to patch camlidl and put it in my local opam repo, by that was a terrible idea.
parent a5bb2847
Pipeline #1635 failed with stages
in 5 minutes and 32 seconds
......@@ -28,12 +28,3 @@ test_opam_test:
- opam update
- opam install -y lutin
xxx:
stage: test
script:
- sudo apt-get install -y libgmp-dev libmpfr-dev m4
- opam repo add opam-ocaml-org "https://opam.ocaml.org"
- opam repo add verimag-sync-repo "http://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/test/opam-repository"
- opam update
- opam install -y lutin
......@@ -8,22 +8,6 @@ all:build
-include ./Makefile.local
###################################################
# camlidl clutches...
# "opam install camlidl" does put dllcamlidl.so into stublibs
CAMLIDL=$(shell ocamlfind query camlidl)
STUBLIBS=$(shell dirname $(CAMLIDL))/stublibs
dllcamlidl.so:$(STUBLIBS)/dllcamlidl.so
$(CAMLIDL)/dllcamlidl.so: $(STUBLIBS)/dllcamlidl.so
cp $< $@
fix_camlidl_meta: $(CAMLIDL)/META
cat $(CAMLIDL)/META | sed s/archive\(byte\)/archive\(byte,plugin\)/ > $(CAMLIDL)/META-new
mv $(CAMLIDL)/META-new $(CAMLIDL)/META
# Some more clutches because oasis does not support camlidl
polka/vector.ml: polka/vector.idl
cd polka; make idl
......@@ -32,7 +16,7 @@ lutin-utils/src/lutinUtils.ml: lutin-utils/src/lutinUtils.idl
cd lutin-utils/src/; make
###################################################
build: setup.data $(CAMLIDL)/dllcamlidl.so
build: setup.data
ocaml setup.ml -build
setup.ml:_oasis lutin/src/version.ml polka/vector.ml lutin-utils/src/lutinUtils.ml
......
OASISFormat: 0.4
Name: Lutin
Version: 2.36
Version: 2.37
Authors: Erwan Jahier
Maintainers: erwan.jahier@imag.fr
License: PROP
......
......@@ -74,19 +74,22 @@ $(OBJDIR)/bool_utils_au_plus_2_parmi_3.c : $(OBJDIR)/bool_utils_au_plus_2_parmi_
cd $(OBJDIR) ; ec2c ../$<
ifndef LUTIN
LUTIN=../../../_build/lutin/src/main.native
endif
run: $(OBJDIR)/$(MAIN).$(DLEXT)
../../../bin/lutin$(EXE) call_external_c_code.lut -m Fun_Call -L libm.so -L obj/foo.so \
$(LUTIN) call_external_c_code.lut -m Fun_Call -L libm.so -L obj/foo.so \
-l 10
EXPDIR=`../../../bin/lutin$(EXE) --ocaml-version`
EXPDIR=`$(LUTIN) --ocaml-version`
$(EXPDIR):
[ -d $(EXPDIR) ] || (mkdir -p $(EXPDIR) ; make utest)
test1.rif: clean $(OBJDIR)/$(MAIN).$(DLEXT) $(EXPDIR)
../../../bin/lutin$(EXE) call_external_c_code.lut -m Fun_Call -L libm.so -L obj/foo.so \
$(LUTIN) call_external_c_code.lut -m Fun_Call -L libm.so -L obj/foo.so \
-l 10 -seed 834966010 | sed -e "s/^M//" | grep -v " Version" > test1.rif
test1:test1.rif
......@@ -95,21 +98,21 @@ test1:test1.rif
[ ! -s test1.res ] && make clean
test2.rif:$(EXPDIR)
echo "1.0 1.0" | ../../../bin/lutin$(EXE) -l 1 -L libm.so polar.lut -m cartesian \
echo "1.0 1.0" | $(LUTIN) -l 1 -L libm.so polar.lut -m cartesian \
-seed 1 | grep -v " Version" > test2.rif
test2:test2.rif
echo "1.0 1.0" | ../../../bin/lutin$(EXE) -l 1 -L libm.so polar.lut -m cartesian \
echo "1.0 1.0" | $(LUTIN) -l 1 -L libm.so polar.lut -m cartesian \
-seed 1 | grep -v " Version" > test2.rif
rm -f test2.res && diff -u -i -B $(EXPDIR)/test2.rif.exp test2.rif > test2.res || true
cat test2.res
[ ! -s test2.res ] && make clean
test3.rif: $(OBJDIR) $(OBJDIR)/$(MAIN2).$(DLEXT) $(EXPDIR)
echo "1.0 1.0" | ../../../bin/lutin$(EXE) -l 1 -L $(OBJDIR)/$(MAIN2).$(DLEXT) call_lustre.lut \
echo "1.0 1.0" | $(LUTIN) -l 1 -L $(OBJDIR)/$(MAIN2).$(DLEXT) call_lustre.lut \
-seed 1 | grep -v " Version" > test3.rif
test3: test3.rif
echo "1.0 1.0" | ../../../bin/lutin$(EXE) -l 1 -L $(OBJDIR)/$(MAIN2).$(DLEXT) call_lustre.lut \
echo "1.0 1.0" | $(LUTIN) -l 1 -L $(OBJDIR)/$(MAIN2).$(DLEXT) call_lustre.lut \
-seed 1 | grep -v " Version" > test3.rif
rm -f test3.res && diff -u -i -B $(EXPDIR)/test3.rif.exp test3.rif > test3.res || true
cat test3.res
......
LUTIN=../../../bin/lutin$(EXE)
ifndef LUTIN
LUTIN=../../../_build/lutin/src/main.native
endif
go:
......
......@@ -5,7 +5,7 @@ ifeq ($(HOSTTYPE),win32)
endif
ifndef LUTIN
LUTIN=../../../bin/lutin$(EXE)
LUTIN=../../../_build/lutin/src/main.native
endif
EXPDIR=`$(LUTIN) --ocaml-version`
......
let str="2.36"
let sha="91a7284"
let str="2.37"
let sha="a5bb284"
......@@ -10,6 +10,14 @@
#include "vector.h"
#include "matrix.h"
// necessary for using dllcamlidl.so
typedef struct { unsigned char data[16]; } IID;
IID IID_IUnknown = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x80 } };
IID IID_IX = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x81 } };
IID IID_IY = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x82 } };
const int polka_integer = POLKA_NUM;
/* \section{Lattice tbool} */
......
......@@ -12,6 +12,8 @@
#include "caml/alloc.h"
#include "caml/fail.h"
// extern IID IID_IUnknown;
//extern IID IID_IUnknown, IID_IX, IID_IY;
extern const int camlidl_polka_integer;
static inline void int_set_pkint(long* pres, pkint_t x, bool clear)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment