/ext/jscover/extconf.rb

https://bitbucket.org/jameshu/jscover-ruby · Ruby · 20 lines · 15 code · 5 blank · 0 comment · 0 complexity · bbb9d911781db739b7db921a1f3621a4 MD5 · raw file

  1. require 'mkmf'
  2. require 'mini_portile'
  3. recipe = MiniPortile.new "jscover-native", "1.0.0"
  4. recipe.files << 'https://bitbucket.org/jameshu/jscover-native/get/master.tar.gz'
  5. checkpoint = "ports/.#{recipe.name}-#{recipe.version}-#{recipe.host}.installed"
  6. unless File.exist?(checkpoint)
  7. recipe.configure_options = 'CFLAGS=-fPIC CPPFLAGS=-fPIC'
  8. recipe.cook
  9. File.write(checkpoint, '')
  10. end
  11. recipe.activate
  12. $LIBPATH << File.join(recipe.path, 'lib')
  13. $INCFLAGS = $INCFLAGS + " -I#{File.join(recipe.path, 'include')}"
  14. $LIBS = $LIBS + " -ljscoverage -ljs_static -lm -lpthread -lstdc++"
  15. create_makefile('jscover/jscover')