mirror of https://git.wownero.com/dsc/mxe.git
Merge pull request #175 from william3/ocaml-native-core
reorganise native and cross tools between ocaml-native and ocaml-core
This commit is contained in:
commit
bb51bfa278
|
@ -43,11 +43,6 @@ define $(PKG)_BUILD
|
||||||
$(MAKE) -C '$(1)' -j 1 coreboot
|
$(MAKE) -C '$(1)' -j 1 coreboot
|
||||||
$(MAKE) -C '$(1)' -j 1 all
|
$(MAKE) -C '$(1)' -j 1 all
|
||||||
# install ocamldoc and camlp4 (non cross versions)
|
# install ocamldoc and camlp4 (non cross versions)
|
||||||
$(MAKE) -C '$(1)/ocamldoc' -j 1 install
|
|
||||||
cd '$(1)' && BINDIR=$(PREFIX)/$(TARGET)/bin \
|
|
||||||
LIBDIR=$(PREFIX)/$(TARGET)/lib/ocaml \
|
|
||||||
PREFIX=$(PREFIX)/$(TARGET) \
|
|
||||||
./build/partial-install.sh
|
|
||||||
|
|
||||||
####### patch mingw include
|
####### patch mingw include
|
||||||
# Now patch utils/clflags.ml to hardcode mingw-specific include.
|
# Now patch utils/clflags.ml to hardcode mingw-specific include.
|
||||||
|
@ -112,15 +107,14 @@ define $(PKG)_BUILD
|
||||||
$(MAKE) -C '$(1)' -j 1 installopt
|
$(MAKE) -C '$(1)' -j 1 installopt
|
||||||
# Rename all the binaries to target-binary
|
# Rename all the binaries to target-binary
|
||||||
for f in ocamlc ocamlcp ocamlrun ocamldep ocamlmklib ocamlmktop ocamlopt \
|
for f in ocamlc ocamlcp ocamlrun ocamldep ocamlmklib ocamlmktop ocamlopt \
|
||||||
ocamlprof camlp4prof camlp4boot camlp4 camlp4oof camlp4of camlp4o \
|
ocamlprof; do \
|
||||||
camlp4rf camlp4r camlp4orf ocamldoc ocamllex ocamlyacc; do \
|
|
||||||
cp -f $(PREFIX)/$(TARGET)/bin/$$f $(PREFIX)/bin/$(TARGET)-$$f; \
|
cp -f $(PREFIX)/$(TARGET)/bin/$$f $(PREFIX)/bin/$(TARGET)-$$f; \
|
||||||
done
|
done
|
||||||
|
|
||||||
# test ocamlopt
|
# test ocamlopt
|
||||||
cp '$(2).ml' '$(1)/test.ml'
|
cp '$(2).ml' '$(1)/test.ml'
|
||||||
cd '$(1)' && '$(TARGET)-ocamlopt' test.ml
|
cd '$(1)' && '$(TARGET)-ocamlopt' test.ml
|
||||||
# test ocamlbuild
|
# test ocamlbuild from package ocaml-native, now that ocamlopt works
|
||||||
mkdir '$(1)/tmp' && cp '$(2).ml' '$(1)/tmp/test.ml'
|
mkdir '$(1)/tmp' && cp '$(2).ml' '$(1)/tmp/test.ml'
|
||||||
cd '$(1)/tmp' && $(TARGET)-ocamlbuild test.native
|
cd '$(1)/tmp' && $(TARGET)-ocamlbuild test.native
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -16,7 +16,13 @@ define $(PKG)_UPDATE
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(PKG)_BUILD
|
define $(PKG)_BUILD
|
||||||
# patched ocaml source to get ocamlbuild use $(TARGET)-ocamlc, $(TARGET)-ocamlfind, ...
|
# the following script would require ocamlbuild with an option '-ocamlfind'
|
||||||
|
# to work:
|
||||||
|
#(echo '#!/bin/sh'; \
|
||||||
|
# echo 'exec $(PREFIX)/bin/ocamlbuild -use-ocamlfind -ocamlfind $(TARGET)-ocamlfind "$$@"') \
|
||||||
|
# > '$(PREFIX)/bin/$(TARGET)-ocamlbuild'
|
||||||
|
# chmod 0755 '$(PREFIX)/bin/$(TARGET)-ocamlbuild'
|
||||||
|
# As it is not the case, we patche ocaml source to get ocamlbuild use $(TARGET)-ocamlc, $(TARGET)-ocamlfind, ...
|
||||||
cd '$(1)' && ./configure \
|
cd '$(1)' && ./configure \
|
||||||
-prefix '$(PREFIX)/$(TARGET)' \
|
-prefix '$(PREFIX)/$(TARGET)' \
|
||||||
-bindir '$(PREFIX)/$(TARGET)/bin/ocaml-native' \
|
-bindir '$(PREFIX)/$(TARGET)/bin/ocaml-native' \
|
||||||
|
@ -30,10 +36,10 @@ define $(PKG)_BUILD
|
||||||
$(MAKE) -C '$(1)' -j '$(JOBS)' ocamlbuild.native
|
$(MAKE) -C '$(1)' -j '$(JOBS)' ocamlbuild.native
|
||||||
cp -f '$(1)/_build/ocamlbuild/ocamlbuild.native' $(PREFIX)/bin/$(TARGET)-ocamlbuild
|
cp -f '$(1)/_build/ocamlbuild/ocamlbuild.native' $(PREFIX)/bin/$(TARGET)-ocamlbuild
|
||||||
$(MAKE) -C '$(1)' install
|
$(MAKE) -C '$(1)' install
|
||||||
# the following script requires ocamlbuild with option -ocamlfind to work
|
# Rename all the binaries to target-binary
|
||||||
#(echo '#!/bin/sh'; \
|
for f in camlp4 camlp4oof camlp4of camlp4o camlp4rf camlp4r camlp4orf \
|
||||||
# echo 'exec $(PREFIX)/bin/ocamlbuild -use-ocamlfind -ocamlfind $(TARGET)-ocamlfind "$$@"') \
|
ocamldoc ocamllex ocamlyacc; do \
|
||||||
# > '$(PREFIX)/bin/$(TARGET)-ocamlbuild'
|
cp -f $(PREFIX)/$(TARGET)/bin/ocaml-native/$$f $(PREFIX)/bin/$(TARGET)-$$f; \
|
||||||
#chmod 0755 '$(PREFIX)/bin/$(TARGET)-ocamlbuild'
|
done
|
||||||
# test will be done once cross ocamlopt is built
|
# test will be done once cross ocamlopt is built in package ocaml-core
|
||||||
endef
|
endef
|
||||||
|
|
Loading…
Reference in New Issue