]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/ocaml/mk/checktools.mk
update
[l4.git] / l4 / pkg / ocaml / mk / checktools.mk
index 85b23187f357c9621bd0bc57588ca18bfe4c788a..b5b5a8fc6a2bc0aba9a9d3748d9cab4fab65c513 100644 (file)
@@ -1,12 +1,20 @@
 
-ifeq ($(shell sh -c "command -v $(CAMLOPT)"),)
+CMD_CAMLOPT := $(shell sh -c "command -v $(CAMLOPT)")
+ifeq ($(CMD_CAMLOPT),)
 TARGET :=
-text := $(shell echo -e "\033[32mHost tool '$(CAMLOPT)' missing, skipping build.\033[0m")
+text := $(shell echo "\033[32mHost tool '$(CAMLOPT)' missing, skipping build.\033[0m")
 $(info $(text))
+else
+  CMD_CAMLOPT := $(shell sh -c "command -v ocamlrun")
+  ifneq ($(shell file $(CMD_CAMLOPT) | grep x86-64),)
+    TARGET :=
+    text := $(shell echo "\033[32mHost tool '$(CAMLOPT)' is 64bit, cannot build 32bit targets, skipping build.\033[0m")
+    $(info $(text))
+  endif
 endif
 
 ifeq ($(shell sh -c "command -v $(CAMLC)"),)
 TARGET :=
-text := $(shell echo -e "\033[32mHost tool '$(CAMLC)' missing, skipping build.\033[0m")
+text := $(shell echo "\033[32mHost tool '$(CAMLC)' missing, skipping build.\033[0m")
 $(info $(text))
 endif