Skip to content

Commit 4fe715e

Browse files
benbrittainerickt
authored andcommitted
detects python3 on bleeding-edge systems
1 parent 5e5064a commit 4fe715e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Makefile.rules

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ ifndef TARGET_NATIVE_ARCH
8686
TARGET_NATIVE_ARCH := $(ARCH)
8787
endif
8888

89+
PYTHONVERSION := $(shell expr `python -V 2>&1 | cut -f1 -d. | sed -e 's/Python //'`)
90+
91+
ifeq "$(PYTHONVERSION)" "3"
92+
PYTHON := python2
93+
endif
94+
95+
ifndef PYTHON
96+
PYTHON := python
97+
endif
98+
8999
# The rule to create the LLVMBuild Makefile fragment as well as the llvm-config
90100
# library table.
91101
#
@@ -97,7 +107,7 @@ endif
97107
$(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules \
98108
$(PROJ_OBJ_ROOT)/Makefile.config
99109
$(Echo) Constructing LLVMBuild project information.
100-
$(Verb) $(LLVMBuildTool) \
110+
$(Verb) $(PYTHON) $(LLVMBuildTool) \
101111
--native-target "$(TARGET_NATIVE_ARCH)" \
102112
--enable-targets "$(TARGETS_TO_BUILD)" \
103113
--enable-optional-components "$(OPTIONAL_COMPONENTS)" \

0 commit comments

Comments
 (0)