From 1ea5aa3272207e9a0f4d8be36d3bfedf93d85316 Mon Sep 17 00:00:00 2001 From: Noel Tiernan Date: Sat, 27 Apr 2013 13:24:16 +0100 Subject: [PATCH] Raspberry PI compile compatibility Stops Makefile detecting processor as Sun processor Uses /usr/bin/python for python2 if python2 doesn't exist, as PI doesn't have specific python2 link Fixes exception for machine detection at startup in armoryengine.py --- armoryengine.py | 1 + cppForSwig/Makefile | 11 ++++++++++- cppForSwig/cryptopp/Makefile | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/armoryengine.py b/armoryengine.py index 6b42c34d5..bd804b2d5 100644 --- a/armoryengine.py +++ b/armoryengine.py @@ -773,6 +773,7 @@ def GetSystemDetails(): # Get CPU name cpuinfo = subprocess_check_output(['cat','/proc/cpuinfo']) + out.CpuStr = "Unknown" for line in cpuinfo.split('\n'): if line.strip().lower().startswith('model name'): out.CpuStr = line.split(':')[1].strip() diff --git a/cppForSwig/Makefile b/cppForSwig/Makefile index ad6f64ae3..df71ee889 100755 --- a/cppForSwig/Makefile +++ b/cppForSwig/Makefile @@ -1,6 +1,7 @@ COMPILER = g++ #COMPILER_OPTS = -c -g -Wall -fPIC -D_DEBUG COMPILER_OPTS = -c -O2 -pipe -fPIC +EGREP = egrep #************************************************************************** LINKER = g++ @@ -12,7 +13,15 @@ DEPSDIR ?= /usr INCLUDE_OPTS += -Icryptopp -DUSE_CRYPTOPP -D__STDC_LIMIT_MACROS LIBRARY_OPTS += -lpthread SWIG_OPTS += -c++ -python -classic -threads -PYVER += `python2 -c 'import sys; print str(sys.version_info[0]) + "." + str(sys.version_info[1])'` + +PYVER_IS_VER2 = $(shell python -c 'import sys; print str(sys.version_info[0]) + "." + str(sys.version_info[1])' | $(EGREP) -c "^2\.") + +ifneq ($(PYVER_IS_VER2),0) # use python instead of python2, if python returns a version of 2.x + PYVER += `python -c 'import sys; print str(sys.version_info[0]) + "." + str(sys.version_info[1])'` +else + PYVER += `python2 -c 'import sys; print str(sys.version_info[0]) + "." + str(sys.version_info[1])'` +endif + UNAME := $(shell uname) diff --git a/cppForSwig/cryptopp/Makefile b/cppForSwig/cryptopp/Makefile index 581d1aa12..b083e3cf0 100755 --- a/cppForSwig/cryptopp/Makefile +++ b/cppForSwig/cryptopp/Makefile @@ -12,6 +12,7 @@ MKDIR = mkdir EGREP = egrep UNAME = $(shell uname) ISX86 = $(shell uname -m | $(EGREP) -c "i.86|x86|i86|amd64") +IS_SUN_CC = $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: Sun") # Default prefix for make install ifeq ($(PREFIX),) @@ -27,7 +28,6 @@ ifeq ($(ISX86),1) GCC42_OR_LATER = $(shell $(CXX) -v 2>&1 | $(EGREP) -c "^gcc version (4.[2-9]|[5-9])") INTEL_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\)") ICC111_OR_LATER = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\) ([2-9][0-9]|1[2-9]|11\.[1-9])") -IS_SUN_CC = $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: Sun") GAS210_OR_LATER = $(shell echo "" | $(AS) -v 2>&1 | $(EGREP) -c "GNU assembler version (2\.[1-9][0-9]|[3-9])") GAS217_OR_LATER = $(shell echo "" | $(AS) -v 2>&1 | $(EGREP) -c "GNU assembler version (2\.1[7-9]|2\.[2-9]|[3-9])") GAS219_OR_LATER = $(shell echo "" | $(AS) -v 2>&1 | $(EGREP) -c "GNU assembler version (2\.19|2\.[2-9]|[3-9])")