@@ -73,6 +73,9 @@ IS_WINDOWS := 0
73
73
IS_AMD64 := 0
74
74
IS_AARCH64 := 0
75
75
LIBC ?=
76
+ HAS_CRANELIFT := 0
77
+ HAS_LLVM := 0
78
+ HAS_SINGLEPASS := 0
76
79
77
80
# Test Windows apart because it doesn't support `uname -s`.
78
81
ifeq ($(OS ) , Windows_NT)
@@ -113,6 +116,7 @@ compilers :=
113
116
# #
114
117
115
118
compilers += cranelift
119
+ HAS_CRANELIFT := 1
116
120
117
121
# #
118
122
# LLVM
@@ -137,6 +141,10 @@ else
137
141
endif
138
142
endif
139
143
144
+ ifneq (, $(findstring llvm,$(compilers ) ) )
145
+ HAS_LLVM := 1
146
+ endif
147
+
140
148
# #
141
149
# Singlepass
142
150
# #
@@ -147,6 +155,10 @@ ifeq ($(IS_WINDOWS), 0)
147
155
endif
148
156
endif
149
157
158
+ ifneq (, $(findstring singlepass,$(compilers ) ) )
159
+ HAS_SINGLEPASS := 1
160
+ endif
161
+
150
162
151
163
152
164
# ####
@@ -163,12 +175,14 @@ compilers_engines :=
163
175
# The Cranelift case.
164
176
# #
165
177
166
- compilers_engines += cranelift-jit
178
+ ifeq ($(HAS_CRANELIFT, 1 ) )
179
+ compilers_engines += cranelift-jit
167
180
168
- ifeq ($(IS_WINDOWS ) , 0)
169
- ifeq ($(IS_AMD64), 1)
170
- ifneq ($(LIBC, musl))
171
- compilers_engines += cranelift-native
181
+ ifeq ($(IS_WINDOWS), 0)
182
+ ifeq ($(IS_AMD64), 1)
183
+ ifneq ($(LIBC, musl))
184
+ compilers_engines += cranelift-native
185
+ endif
172
186
endif
173
187
endif
174
188
endif
@@ -177,8 +191,7 @@ endif
177
191
# The LLVM case.
178
192
# #
179
193
180
- # If `compilers` contains `llvm`.
181
- ifneq (, $(findstring llvm,$(compilers ) ) )
194
+ ifeq ($(HAS_LLVM ) , 1)
182
195
ifeq ($(IS_WINDOWS), 0)
183
196
ifeq ($(IS_AMD64), 1)
184
197
compilers_engines += llvm-jit
@@ -193,8 +206,7 @@ endif
193
206
# The Singlepass case.
194
207
# #
195
208
196
- # If `compilers` contains `singlepass`.
197
- ifneq (, $(findstring singlepass,$(compilers ) ) )
209
+ ifeq ($(HAS_SINGLEPASS ) , 1)
198
210
ifeq ($(IS_WINDOWS), 0)
199
211
if ($(IS_AMD64), 1)
200
212
compilers_engines += singlepass-jit
0 commit comments