Skip to content

Commit 42a7d5d

Browse files
staticfloatKristofferC
authored andcommitted
Upgrade buildsystem to look for python, python3 or python2
(cherry picked from commit 181050b)
1 parent 7ba75c4 commit 42a7d5d

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

Make.inc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,13 +1010,17 @@ else
10101010
UTF8PROC_INC := $(build_includedir)
10111011
endif
10121012

1013+
# We need python for things like BB triplet recognition. We don't really care
1014+
# about version, generally, so just find something that works:
1015+
PYTHON := $(shell which python 2>/dev/null || which python3 2>/dev/null || which python2 2>/dev/null || echo not found)
1016+
10131017
# BinaryBuilder options. We default to "on" for all the projects listed in BB_PROJECTS,
10141018
# but only if contrib/normalize_triplet.py works for our requested triplet.
1015-
ifeq ($(shell python $(JULIAHOME)/contrib/normalize_triplet.py $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) >/dev/null 2>/dev/null; echo $$?),0)
1019+
ifeq ($(shell $(PYTHON) $(JULIAHOME)/contrib/normalize_triplet.py $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) >/dev/null 2>/dev/null; echo $$?),0)
10161020
USE_BINARYBUILDER ?= 1
10171021
else
1018-
ifneq ($(shell python $(JULIAHOME)/contrib/normalize_triplet.py x86_64-linux-gnu),x86_64-linux-gnu)
1019-
$(warning python normalize_triplet.py appears to be non-functional, so BinaryBuilder disabled)
1022+
ifneq ($(shell $(PYTHON) $(JULIAHOME)/contrib/normalize_triplet.py x86_64-linux-gnu),x86_64-linux-gnu)
1023+
$(warning normalize_triplet.py appears to be non-functional (used python interpreter "$(PYTHON)"), so BinaryBuilder disabled)
10201024
endif
10211025
USE_BINARYBUILDER ?= 0
10221026
endif

deps/tools/bb-install.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
# 4 cxx11) # signifies a cxx11 ABI dependency
66

77
# Auto-detect triplet once, create different versions that we use as defaults below for each BB install target
8-
# This is much more efficient than launching `gcc` and `python` once for each BB install target.
9-
BB_TRIPLET_GCCABI_CXXABI := $(shell python $(JULIAHOME)/contrib/normalize_triplet.py $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) "$(shell $(FC) --version | head -1)" "$(shell echo '\#include <string>' | $(CXX) $(CXXFLAGS) -x c++ -dM -E - | grep _GLIBCXX_USE_CXX11_ABI | awk '{ print $$3 }' )")
8+
BB_TRIPLET_GCCABI_CXXABI := $(shell $(PYTHON) $(JULIAHOME)/contrib/normalize_triplet.py $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) "$(shell $(FC) --version | head -1)" "$(shell echo '\#include <string>' | $(CXX) $(CXXFLAGS) -x c++ -dM -E - | grep _GLIBCXX_USE_CXX11_ABI | awk '{ print $$3 }' )")
109
BB_TRIPLET_GCCABI := $(subst $(SPACE),-,$(filter-out cxx%,$(subst -,$(SPACE),$(BB_TRIPLET_GCCABI_CXXABI))))
1110
BB_TRIPLET_CXXABI := $(subst $(SPACE),-,$(filter-out gcc%,$(subst -,$(SPACE),$(BB_TRIPLET_GCCABI_CXXABI))))
1211
BB_TRIPLET := $(subst $(SPACE),-,$(filter-out cxx%,$(filter-out gcc%,$(subst -,$(SPACE),$(BB_TRIPLET_GCCABI_CXXABI)))))

deps/tools/find_python2

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)