Skip to content

Commit a1a5bad

Browse files
committed
adjusted PYTHON_INTERPRETER checks
1 parent f2ead23 commit a1a5bad

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ ifeq ($(SRCDIR),build)
1212
endif
1313
ifeq ($(MATCHCOMPILER),yes)
1414
# Find available Python interpreter
15-
ifndef PYTHON_INTERPRETER
15+
ifeq ($(PYTHON_INTERPRETER),)
1616
PYTHON_INTERPRETER := $(shell which python3)
1717
endif
18-
ifndef PYTHON_INTERPRETER
18+
ifeq ($(PYTHON_INTERPRETER),)
1919
PYTHON_INTERPRETER := $(shell which python)
2020
endif
21-
ifndef PYTHON_INTERPRETER
21+
ifeq ($(PYTHON_INTERPRETER),)
2222
$(error Did not find a Python interpreter)
2323
endif
2424
ifdef VERIFY

tools/dmake.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,16 @@ int main(int argc, char **argv)
243243
<< " MATCHCOMPILER:=yes\n"
244244
<< "endif\n";
245245
// TODO: bail out when matchcompiler.py fails (i.e. invalid PYTHON_INTERPRETER specified)
246+
// TODO: handle "PYTHON_INTERPRETER="
246247
fout << "ifeq ($(MATCHCOMPILER),yes)\n"
247248
<< " # Find available Python interpreter\n"
248-
<< " ifndef PYTHON_INTERPRETER\n"
249+
<< " ifeq ($(PYTHON_INTERPRETER),)\n"
249250
<< " PYTHON_INTERPRETER := $(shell which python3)\n"
250251
<< " endif\n"
251-
<< " ifndef PYTHON_INTERPRETER\n"
252+
<< " ifeq ($(PYTHON_INTERPRETER),)\n"
252253
<< " PYTHON_INTERPRETER := $(shell which python)\n"
253254
<< " endif\n"
254-
<< " ifndef PYTHON_INTERPRETER\n"
255+
<< " ifeq ($(PYTHON_INTERPRETER),)\n"
255256
<< " $(error Did not find a Python interpreter)\n"
256257
<< " endif\n"
257258
<< " ifdef VERIFY\n"
@@ -495,6 +496,7 @@ int main(int argc, char **argv)
495496
fout << "\txmllint --noout --relaxng cppcheck-errors.rng /tmp/errorlist.xml\n";
496497
fout << "\txmllint --noout --relaxng cppcheck-errors.rng /tmp/example.xml\n";
497498
fout << "\ncheckCWEEntries: /tmp/errorlist.xml\n";
499+
// TODO: handle "PYTHON_INTERPRETER="
498500
fout << "\t$(eval PYTHON_INTERPRETER := $(if $(PYTHON_INTERPRETER),$(PYTHON_INTERPRETER),$(shell which python3)))\n";
499501
fout << "\t$(eval PYTHON_INTERPRETER := $(if $(PYTHON_INTERPRETER),$(PYTHON_INTERPRETER),$(shell which python)))\n";
500502
fout << "\t$(eval PYTHON_INTERPRETER := $(if $(PYTHON_INTERPRETER),$(PYTHON_INTERPRETER),$(error Did not find a Python interpreter)))\n";

0 commit comments

Comments
 (0)