Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ ifeq ($(SRCDIR),build)
MATCHCOMPILER:=yes
endif
ifeq ($(MATCHCOMPILER),yes)
# Find available Python interpreter
PYTHON_INTERPRETER := $(shell which python)
ifndef PYTHON_INTERPRETER
PYTHON_INTERPRETER := $(shell which python3)
endif
ifndef PYTHON_INTERPRETER
$(error Did not find a Python interpreter)
endif
ifdef VERIFY
matchcompiler_S := $(shell python tools/matchcompiler.py --verify)
matchcompiler_S := $(shell $(PYTHON_INTERPRETER) tools/matchcompiler.py --verify)
else
matchcompiler_S := $(shell python tools/matchcompiler.py)
matchcompiler_S := $(shell $(PYTHON_INTERPRETER) tools/matchcompiler.py)
endif
libcppdir:=build
else
Expand Down
12 changes: 10 additions & 2 deletions tools/dmake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,18 @@ int main(int argc, char **argv)
<< " MATCHCOMPILER:=yes\n"
<< "endif\n";
fout << "ifeq ($(MATCHCOMPILER),yes)\n"
<< " # Find available Python interpreter\n"
<< " PYTHON_INTERPRETER := $(shell which python)\n"
<< " ifndef PYTHON_INTERPRETER\n"
<< " PYTHON_INTERPRETER := $(shell which python3)\n"
<< " endif\n"
<< " ifndef PYTHON_INTERPRETER\n"
<< " $(error Did not find a Python interpreter)\n"
<< " endif\n"
<< " ifdef VERIFY\n"
<< " matchcompiler_S := $(shell python tools/matchcompiler.py --verify)\n"
<< " matchcompiler_S := $(shell $(PYTHON_INTERPRETER) tools/matchcompiler.py --verify)\n"
<< " else\n"
<< " matchcompiler_S := $(shell python tools/matchcompiler.py)\n"
<< " matchcompiler_S := $(shell $(PYTHON_INTERPRETER) tools/matchcompiler.py)\n"
<< " endif\n"
<< " libcppdir:=build\n"
<< "else\n"
Expand Down