From: Stephane Glondu <steph@glondu.net>
Date: Thu, 20 Jan 2022 05:53:28 +0100
Subject: Fix detection of native architectures

---
 src/Makefile  | 4 ++--
 test/Makefile | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 8ad0e2c..715fa8b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -33,7 +33,7 @@ COBJS=bng.$(O) nat_stubs.$(O)
 
 all:: libnums.$(A) nums.cma
 
-ifneq "$(ARCH)" "none"
+ifneq "$(shell command -v $(OCAMLOPT))" ""
 all:: nums.cmxa
 endif
 
@@ -71,7 +71,7 @@ nat_stubs.$(O): bng.h nat.h
 # is installed via findlib
 
 TOINSTALL=nums.cma libnums.$(A) $(CMIS) $(CMIS:.cmi=.mli) $(CMIS:.cmi=.cmti)
-ifneq "$(ARCH)" "none"
+ifneq "$(shell command -v $(OCAMLOPT))" ""
 TOINSTALL+=nums.cmxa nums.$(A) $(CMXS)
 endif
 ifeq "$(NATDYNLINK)" "true"
diff --git a/test/Makefile b/test/Makefile
index 6d7e8d8..43c3db5 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -13,7 +13,7 @@ all:: test.byt
 	@echo "----- Testing in bytecode..."
 	$(OCAMLRUN) -I ../src ./test.byt
 
-ifneq "$(ARCH)" "none"
+ifneq "$(shell command -v $(OCAMLOPT))" ""
 all:: test.exe
 	@echo "----- Testing in native code..."
 	./test.exe
