Sha256: 9d52a5c5f7cda7f95d7d347693141227525d19e4169b8114280524c0891a169c
Contents?: true
Size: 1.06 KB
Versions: 13
Compression:
Stored size: 1.06 KB
Contents
module Libv8 module Compiler module_function def compiler unless defined?(@compiler) cc = check_gcc_compiler "g++" # Check alternative GCC names # These are common on BSD's after # GCC has been installed by a port cc ||= check_gcc_compiler "g++44" cc ||= check_gcc_compiler "g++46" cc ||= check_gcc_compiler "g++48" if cc.nil? warn "Unable to find a compiler officially supported by v8." warn "It is recommended to use GCC v4.4 or higher" @compiler = cc = 'g++' end puts "Using compiler: #{cc}" @compiler = cc end @compiler end def check_gcc_compiler(name) compiler = `which #{name}` return nil unless $?.success? compiler.chomp! return nil unless `#{compiler} --version` =~ /([0-9]\.[0-9]\.[0-9])/ return nil if $1 < "4.4" compiler end def check_clang_compiler(name) compiler = `which #{name}` return nil unless $?.success? compiler.chomp end end end
Version data entries
13 entries across 13 versions & 3 rubygems