Update build for gcc 4.8.x:

* Use gcc 4.8.x, boost 1.54
* Honor CC,CXX,PATH environment variables
* Prevent compilation with unsupported toolchains
* Print g++ version during Travis build
* Run built-in unit tests after Travis build
This commit is contained in:
Nicholas Dudfield
2014-01-09 09:14:35 +07:00
committed by Vinnie Falco
parent 95a573b755
commit 93f1a05f5c
2 changed files with 33 additions and 7 deletions

View File

@@ -3,8 +3,18 @@ compiler:
- gcc
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq libboost1.48-all-dev protobuf-compiler libprotobuf-dev libssl-dev exuberant-ctags
script: scons && npm install && npm test
- sudo apt-get install -qq python-software-properties
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo add-apt-repository -y ppa:boost-latest/ppa
- sudo apt-get update -qq
- sudo apt-get install -qq libboost1.54-all-dev protobuf-compiler libprotobuf-dev libssl-dev exuberant-ctags
- sudo apt-get install -qq gcc-4.8
- sudo apt-get install -qq g++-4.8
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
- sudo update-alternatives --set gcc /usr/bin/gcc-4.8
- g++ -v
script: scons && ./build/rippled --unittest && npm install && npm test
notifications:
email:
false

View File

@@ -8,6 +8,7 @@ import glob
import os
import platform
import re
import sys
OSX = bool(platform.mac_ver()[0])
FreeBSD = bool('FreeBSD' == platform.system())
@@ -16,6 +17,8 @@ Ubuntu = bool(Linux and 'Ubuntu' == platform.linux_distribution()[0])
Debian = bool(Linux and 'debian' == platform.linux_distribution()[0])
Archlinux = bool(Linux and ('','','') == platform.linux_distribution()) #Arch still has issues with the platform module
USING_CLANG = OSX
#
# We expect this to be set
#
@@ -33,8 +36,12 @@ else:
# scons tools
#
HONOR_ENVS = ['CC', 'CXX', 'PATH']
env = Environment(
tools = ['default', 'protoc']
tools = ['default', 'protoc'],
#ENV = dict((k, os.environ[k]) for k in HONOR_ENVS)
ENV = dict((k, os.environ[k]) for k in HONOR_ENVS if k in os.environ)
)
# Use a newer gcc on FreeBSD
@@ -251,9 +258,18 @@ env.Append(CXXFLAGS = ['-O1', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+D
#
env.Append(CXXFLAGS = ['-frtti'])
if (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) == 6):
env.Append(CXXFLAGS = ['-std=c++0x'])
elif (int(GCC_VERSION[0]) > 4 or (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) >= 7)):
UBUNTU_GCC_48_INSTALL_STEPS = '''
https://ripple.com/wiki/Ubuntu_build_instructions#Ubuntu_versions_older_than_13.10_:_Install_gcc_4.8'''
if not USING_CLANG:
if (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) < 8):
print "\nrippled, using c++11, requires g++ version >= 4.8 to compile"
if Ubuntu:
print UBUNTU_GCC_48_INSTALL_STEPS
sys.exit(1)
else:
env.Append(CXXFLAGS = ['-std=c++11'])
# FreeBSD doesn't support O_DSYNC