mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
committed by
Vinnie Falco
parent
95a573b755
commit
93f1a05f5c
14
.travis.yml
14
.travis.yml
@@ -3,8 +3,18 @@ compiler:
|
|||||||
- gcc
|
- gcc
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get update -qq
|
- sudo apt-get update -qq
|
||||||
- sudo apt-get install -qq libboost1.48-all-dev protobuf-compiler libprotobuf-dev libssl-dev exuberant-ctags
|
- sudo apt-get install -qq python-software-properties
|
||||||
script: scons && npm install && npm test
|
- 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:
|
notifications:
|
||||||
email:
|
email:
|
||||||
false
|
false
|
||||||
|
|||||||
26
SConstruct
26
SConstruct
@@ -8,6 +8,7 @@ import glob
|
|||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
OSX = bool(platform.mac_ver()[0])
|
OSX = bool(platform.mac_ver()[0])
|
||||||
FreeBSD = bool('FreeBSD' == platform.system())
|
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])
|
Debian = bool(Linux and 'debian' == platform.linux_distribution()[0])
|
||||||
Archlinux = bool(Linux and ('','','') == platform.linux_distribution()) #Arch still has issues with the platform module
|
Archlinux = bool(Linux and ('','','') == platform.linux_distribution()) #Arch still has issues with the platform module
|
||||||
|
|
||||||
|
USING_CLANG = OSX
|
||||||
|
|
||||||
#
|
#
|
||||||
# We expect this to be set
|
# We expect this to be set
|
||||||
#
|
#
|
||||||
@@ -33,8 +36,12 @@ else:
|
|||||||
# scons tools
|
# scons tools
|
||||||
#
|
#
|
||||||
|
|
||||||
|
HONOR_ENVS = ['CC', 'CXX', 'PATH']
|
||||||
|
|
||||||
env = Environment(
|
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
|
# Use a newer gcc on FreeBSD
|
||||||
@@ -251,10 +258,19 @@ env.Append(CXXFLAGS = ['-O1', '-pthread', '-Wno-invalid-offsetof', '-Wformat']+D
|
|||||||
#
|
#
|
||||||
env.Append(CXXFLAGS = ['-frtti'])
|
env.Append(CXXFLAGS = ['-frtti'])
|
||||||
|
|
||||||
if (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) == 6):
|
UBUNTU_GCC_48_INSTALL_STEPS = '''
|
||||||
env.Append(CXXFLAGS = ['-std=c++0x'])
|
https://ripple.com/wiki/Ubuntu_build_instructions#Ubuntu_versions_older_than_13.10_:_Install_gcc_4.8'''
|
||||||
elif (int(GCC_VERSION[0]) > 4 or (int(GCC_VERSION[0]) == 4 and int(GCC_VERSION[1]) >= 7)):
|
|
||||||
env.Append(CXXFLAGS = ['-std=c++11'])
|
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
|
# FreeBSD doesn't support O_DSYNC
|
||||||
if FreeBSD:
|
if FreeBSD:
|
||||||
|
|||||||
Reference in New Issue
Block a user