Skip to content

Commit 181050b

Browse files
committed
Upgrade buildsystem to look for python, python3 or python2
1 parent c21020b commit 181050b

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

Make.inc

+7-3
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +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-
BB_TRIPLET_LIBGFORTRAN_CXXABI := $(shell python $(JULIAHOME)/contrib/normalize_triplet.py $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) "$(shell $(FC) --version | head -1)" "$(or $(shell echo '\#include <string>' | $(CXX) $(CXXFLAGS) -x c++ -dM -E - | grep _GLIBCXX_USE_CXX11_ABI | awk '{ print $$3 }' ),1)")
8+
BB_TRIPLET_LIBGFORTRAN_CXXABI := $(shell $(PYTHON) $(JULIAHOME)/contrib/normalize_triplet.py $(or $(XC_HOST),$(XC_HOST),$(BUILD_MACHINE)) "$(shell $(FC) --version | head -1)" "$(or $(shell echo '\#include <string>' | $(CXX) $(CXXFLAGS) -x c++ -dM -E - | grep _GLIBCXX_USE_CXX11_ABI | awk '{ print $$3 }' ),1)")
99
BB_TRIPLET_LIBGFORTRAN := $(subst $(SPACE),-,$(filter-out cxx%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI))))
1010
BB_TRIPLET_CXXABI := $(subst $(SPACE),-,$(filter-out libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI))))
1111
BB_TRIPLET := $(subst $(SPACE),-,$(filter-out cxx%,$(filter-out libgfortran%,$(subst -,$(SPACE),$(BB_TRIPLET_LIBGFORTRAN_CXXABI)))))

deps/tools/find_python2

-16
This file was deleted.

0 commit comments

Comments
 (0)