extconf.rb 758 B

1234567891011121314151617181920212223242526
  1. require 'mkmf'
  2. require 'set'
  3. begin
  4. require 'libv8'
  5. rescue LoadError
  6. require 'rubygems'
  7. require 'libv8'
  8. end
  9. have_library('objc') if RUBY_PLATFORM =~ /darwin/
  10. #we have to manually prepend the libv8 include path to INCFLAGS
  11. #since find_header() does not actually work as advertized.
  12. #see https://github.com/cowboyd/therubyracer/issues/91
  13. $INCFLAGS.insert 0, "-I#{Libv8.include_path} "
  14. $CPPFLAGS += " -Wall" unless $CPPFLAGS.split.include? "-Wall"
  15. $CPPFLAGS += " -g" unless $CPPFLAGS.split.include? "-g"
  16. $CPPFLAGS += " -rdynamic" unless $CPPFLAGS.split.include? "-rdynamic"
  17. $LDFLAGS.insert 0, "#{Libv8.library_path}/libv8.#{$LIBEXT} "
  18. $LIBS << ' -lpthread'
  19. CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/
  20. create_makefile('v8')