From 17dc34acd6f658af4a432f8a2f6338d5585d1fd2 Mon Sep 17 00:00:00 2001 From: Andrew Lindesay Date: Sat, 2 Mar 2019 20:23:12 +0100 Subject: [PATCH] HaikuDepot: Build Configure for Python Some operating systems only ship with Python 3 and the binary for this is 'python3' instead of 'python' which causes the Jam build process to fail because it expects to find 'python'. This change will mean that the configure process will detect this case and configure the build to use the correct binary name. Fixes #14938 Change-Id: I30cd0df828792715a54d760b86dd79aee04e2b2f Reviewed-on: https://review.haiku-os.org/c/1134 Reviewed-by: Adrien Destugues --- build/jam/BuildSetup | 4 ++++ configure | 10 ++++++++++ src/apps/haikudepot/build/jam/HdsSchemaGenRules | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 13c9a4a620..895327065f 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -567,6 +567,10 @@ HOST_BE_API_CCFLAGS = -include [ FDirName $(HAIKU_TOP) headers build BeOSBuildCompatibility.h ] ; HOST_BE_API_C++FLAGS = $(HOST_BE_API_CCFLAGS) ; +if ! $(HOST_PYTHON) { + Echo "HOST_PYTHON variable not defined --> will default to 'python'" ; + HOST_PYTHON ?= "python" ; +} #pragma mark - target platform settings diff --git a/configure b/configure index 4667dae2d4..966cdd20a0 100755 --- a/configure +++ b/configure @@ -821,6 +821,15 @@ if [ $HOST_PLATFORM = "darwin" ]; then HOST_EXTENDED_REGEX_SED="sed -E" fi +if command -v "python3" ; then + HOST_PYTHON="python3" +elif command -v "python" ; then + HOST_PYTHON="python" +else + echo "a python interpreter is required" + exit 1 +fi + # check if nasm can actually output ELF files # (the stock version in OSX can't) # XXX: should probably only test for x86* arch @@ -1056,6 +1065,7 @@ HOST_LD ?= ${HOST_GCC_LD} ; HOST_OBJCOPY ?= ${HOST_GCC_OBJCOPY} ; HOST_EXTENDED_REGEX_SED ?= ${HOST_EXTENDED_REGEX_SED} ; HOST_SHA256 ?= ${HOST_SHA256} ; +HOST_PYTHON ?= ${HOST_PYTHON} ; HAIKU_NASM ?= ${HAIKU_NASM} ; HAIKU_BUILD_ATTRIBUTES_DIR ?= "${HAIKU_BUILD_ATTRIBUTES_DIR}" ; diff --git a/src/apps/haikudepot/build/jam/HdsSchemaGenRules b/src/apps/haikudepot/build/jam/HdsSchemaGenRules index c72a3e15e2..8c3bf8c1d5 100644 --- a/src/apps/haikudepot/build/jam/HdsSchemaGenRules +++ b/src/apps/haikudepot/build/jam/HdsSchemaGenRules @@ -45,7 +45,7 @@ rule HdsSchemaGenModel actions HdsSchemaGenModel1 { mkdir -p $(2[3]) - python $(2[2]) -i $(2[1]) --outputdirectory $(2[3]) + $(HOST_PYTHON) $(2[2]) -i $(2[1]) --outputdirectory $(2[3]) touch $(1) } @@ -68,7 +68,7 @@ rule HdsSchemaGenBulkParser actions HdsSchemaGenBulkParser1 { mkdir -p $(2[3]) - python $(2[2]) -i $(2[1]) --outputdirectory $(2[3]) --supportbulkcontainer + $(HOST_PYTHON) $(2[2]) -i $(2[1]) --outputdirectory $(2[3]) --supportbulkcontainer touch $(1) }