summaryrefslogtreecommitdiffstats
path: root/src/ocaml-flexdll.mk
diff options
context:
space:
mode:
authorWilliam <r.3@libertysurf.fr>2012-06-27 14:09:11 (GMT)
committerWilliam <r.3@libertysurf.fr>2012-08-23 21:23:43 (GMT)
commit53ea6fa0b10a97c3323174582cfa84caffcd266a (patch)
tree7d5d072713cad4b0f2c3bb5154b72c636e3f07d6 /src/ocaml-flexdll.mk
parent265514be947b05cc7d513f1852b50ddca8455844 (diff)
downloadmxe-53ea6fa0b10a97c3323174582cfa84caffcd266a.zip
mxe-53ea6fa0b10a97c3323174582cfa84caffcd266a.tar.gz
mxe-53ea6fa0b10a97c3323174582cfa84caffcd266a.tar.bz2
add package ocaml-flexdll
Diffstat (limited to 'src/ocaml-flexdll.mk')
-rw-r--r--src/ocaml-flexdll.mk43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/ocaml-flexdll.mk b/src/ocaml-flexdll.mk
new file mode 100644
index 0000000..92d196b
--- /dev/null
+++ b/src/ocaml-flexdll.mk
@@ -0,0 +1,43 @@
+# This file is part of mingw-cross-env.
+# See doc/index.html for further information.
+
+# zlib
+PKG := ocaml-flexdll
+$(PKG)_IGNORE :=
+$(PKG)_CHECKSUM := 585f066f890c7dca95be7541b4647128335f7df9
+#$(PKG)_CHECKSUM := 76e3d9a8d1182d8ff315793c3ffbbc8e49c92888
+$(PKG)_SUBDIR := flexdll
+$(PKG)_FILE := flexdll-$($(PKG)_VERSION).tar.gz
+$(PKG)_URL := http://alain.frisch.fr/flexdll/$($(PKG)_FILE)
+$(PKG)_DEPS := gcc
+
+define $(PKG)_UPDATE
+ wget -q -O- 'http://alain.frisch.fr/flexdll/' | \
+ $(SED) -n 's,.*flexdll-\([0-9][^>]*\)\.tar.gz.*,\1,ip' | \
+ head -1
+endef
+
+define $(PKG)_BUILD
+ $(MAKE) -C '$(1)' -j '$(JOBS)' \
+ CHAINS=mingw \
+ MINGW_PREFIX=$(TARGET) \
+ all
+ mkdir -p '$(PREFIX)/$(TARGET)/lib/ocaml/flexdll'
+ cd '$(1)' && mv flexlink.exe flexlink
+ cd '$(1)' && strip --remove-section=.comment --remove-section=.note flexlink
+ cd '$(1)' && $(INSTALL) -m 0755 flexdll.h '$(PREFIX)/$(TARGET)/include'
+ cd '$(1)' && $(INSTALL) -m 0755 flexlink flexdll_mingw.o \
+ flexdll_initer_mingw.o \
+ '$(PREFIX)/$(TARGET)/lib/ocaml/flexdll'
+ # create flexdll scripts
+ cd '$(PREFIX)/bin' && ln -sf '$(PREFIX)/$(TARGET)/lib/ocaml/flexdll/flexlink'
+ (echo '#!/bin/sh'; \
+ echo 'exec flexlink -I $(PREFIX)/$(TARGET)/lib -chain mingw -nocygpath "$$@"') \
+ > '$(PREFIX)/bin/$(TARGET)-flexlink'
+ chmod 0755 '$(PREFIX)/bin/$(TARGET)-flexlink'
+
+ echo "testing flexlink..."
+ $(MAKE) -C '$(1)/test' -j '$(JOBS)' dump.exe plug1.dll plug2.dll CC=$(TARGET)-gcc O=o FLEXLINK=$(TARGET)-flexlink
+ #works if wine is installed :
+ #cd '$(1)/test' && ./dump.exe plug1.dll plug2.dll
+endef