From d18f479967c4d2d8ac22c7aa49f1df8dd6db1116 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Sun, 12 Jul 2015 14:12:50 -0500 Subject: [PATCH] Don't hardcode g++ into build --- .travis.yml | 2 +- ext/v8/extconf.rb | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 692cbb8..ff3ec2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ notifications: before_install: - gem update --system 2.1.11 script: - - CXX=g++-4.8 bundle exec rake compile + - bundle exec rake compile - bundle exec rspec spec/c sudo: false addons: diff --git a/ext/v8/extconf.rb b/ext/v8/extconf.rb index 9896721..17bbbd7 100644 --- a/ext/v8/extconf.rb +++ b/ext/v8/extconf.rb @@ -1,5 +1,5 @@ require 'mkmf' -RbConfig::MAKEFILE_CONFIG['CXX'] = ENV['CXX'] if ENV['CXX'] +cxx = RbConfig::MAKEFILE_CONFIG['CXX'] = ENV['CXX'] if ENV['CXX'] have_library('pthread') have_library('objc') if RUBY_PLATFORM =~ /darwin/ @@ -10,7 +10,10 @@ $CPPFLAGS += " -rdynamic" unless $CPPFLAGS.split.include? "-rdynamic" unless RUB $CPPFLAGS += " -fPIC" unless $CPPFLAGS.split.include? "-rdynamic" or RUBY_PLATFORM =~ /darwin/ $CPPFLAGS += " -std=c++11" -$LDFLAGS += " -stdlib=libstdc++" + +if cxx =~ /clang/ + $LDFLAGS += " -stdlib=libstdc++" +end CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/ if CONFIG['warnflags']