Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GCC 4.8 && Boost 1.5.4 #253

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 20 additions & 5 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
#
Expand All @@ -33,8 +36,11 @@ 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)
)

# Use a newer gcc on FreeBSD
Expand Down Expand Up @@ -251,10 +257,19 @@ 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)):
env.Append(CXXFLAGS = ['-std=c++11'])
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
if FreeBSD:
Expand Down