2835
|
1 # This file is part of mingw-cross-env. |
|
2 # See doc/index.html for further information. |
|
3 |
|
4 # zlib |
|
5 PKG := ocaml-flexdll |
|
6 $(PKG)_IGNORE := |
|
7 $(PKG)_CHECKSUM := 585f066f890c7dca95be7541b4647128335f7df9 |
|
8 $(PKG)_SUBDIR := flexdll |
|
9 $(PKG)_FILE := flexdll-$($(PKG)_VERSION).tar.gz |
|
10 $(PKG)_URL := http://alain.frisch.fr/flexdll/$($(PKG)_FILE) |
|
11 $(PKG)_DEPS := gcc ocaml-native |
|
12 |
|
13 define $(PKG)_UPDATE |
|
14 wget -q -O- 'http://alain.frisch.fr/flexdll/' | \ |
|
15 $(SED) -n 's,.*flexdll-\([0-9][^>]*\)\.tar.gz.*,\1,ip' | \ |
|
16 head -1 |
|
17 endef |
|
18 |
|
19 define $(PKG)_BUILD |
|
20 $(MAKE) -C '$(1)' -j '$(JOBS)' \ |
|
21 CHAINS=mingw \ |
|
22 MINGW_PREFIX=$(TARGET) \ |
|
23 OCAMLOPT=$(PREFIX)/$(TARGET)/bin/ocaml-native/ocamlopt \ |
|
24 all |
|
25 mkdir -p '$(PREFIX)/$(TARGET)/lib/ocaml/flexdll' |
|
26 cd '$(1)' && mv flexlink.exe flexlink |
|
27 cd '$(1)' && strip --remove-section=.comment --remove-section=.note flexlink |
|
28 cd '$(1)' && $(INSTALL) -m 0755 flexdll.h '$(PREFIX)/$(TARGET)/include' |
|
29 cd '$(1)' && $(INSTALL) -m 0755 flexlink flexdll_mingw.o \ |
|
30 flexdll_initer_mingw.o \ |
|
31 '$(PREFIX)/$(TARGET)/lib/ocaml/flexdll' |
|
32 # create flexdll scripts |
|
33 cd '$(PREFIX)/bin' && ln -sf '$(PREFIX)/$(TARGET)/lib/ocaml/flexdll/flexlink' |
|
34 (echo '#!/bin/sh'; \ |
|
35 echo 'exec flexlink -I $(PREFIX)/$(TARGET)/lib -chain mingw -nocygpath "$$@"') \ |
|
36 > '$(PREFIX)/bin/$(TARGET)-flexlink' |
|
37 chmod 0755 '$(PREFIX)/bin/$(TARGET)-flexlink' |
|
38 |
|
39 echo "testing flexlink..." |
|
40 $(MAKE) -C '$(1)/test' -j '$(JOBS)' dump.exe plug1.dll plug2.dll CC=$(TARGET)-gcc O=o FLEXLINK=$(TARGET)-flexlink |
|
41 #works if wine is installed : |
|
42 #cd '$(1)/test' && ./dump.exe plug1.dll plug2.dll |
|
43 endef |