Class: Libv8::Builder

Inherits:
Object
  • Object
show all
Includes:
Arch, Compiler, Make
Defined in:
ext/libv8/builder.rb

Instance Method Summary collapse

Methods included from Make

make

Methods included from Compiler

check_clang_compiler, check_gcc_compiler, compiler

Methods included from Arch

libv8_arch, rubinius?, x64?, x86_64_from_arch_flag, x86_64_from_build_cpu, x86_64_from_byte_length

Instance Method Details

#build_libv8!Object



27
28
29
30
31
32
# File 'ext/libv8/builder.rb', line 27

def build_libv8!
  Dir.chdir(File.expand_path '../../../vendor/v8', __FILE__) do
    puts `env CXX=#{compiler} LINK=#{compiler} #{make} #{make_flags}`
  end
  return $?.exitstatus
end

#make_flags(*flags) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'ext/libv8/builder.rb', line 12

def make_flags(*flags)
  profile = enable_config('debug') ? 'debug' : 'release'

  # FreeBSD uses gcc 4.2 by default which leads to
  # compilation failures due to warnings about aliasing.
  # http://svnweb.freebsd.org/ports/head/lang/v8/Makefile?view=markup
  flags << "strictaliasing=off" if RUBY_PLATFORM.include?("freebsd") and !check_gcc_compiler(compiler)

  # Fix Malformed archive issue caused by GYP creating thin archives by
  # default.
  flags << "ARFLAGS.target=crs"

  "#{libv8_arch}.#{profile} #{flags.join ' '}"
end