wscript 980 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Frauendorfer, 2010
  4. VERSION='0.0.1'
  5. APPNAME='ruby_test'
  6. # these variables are mandatory ('/' are converted automatically)
  7. top = '.'
  8. out = 'build'
  9. def options(opt):
  10. opt.load('compiler_c')
  11. opt.load('ruby')
  12. def configure(conf):
  13. conf.load('compiler_c')
  14. conf.load('ruby')
  15. # check for ruby
  16. conf.check_ruby_version((1,8,0))
  17. conf.check_ruby_ext_devel()
  18. conf.check_ruby_module('libxml', mandatory=False)
  19. def build(bld):
  20. # Build a ruby extension module
  21. bld(
  22. features = 'c cshlib rubyext',
  23. source = 'rb_mytest.c',
  24. target = 'mytest_ext',
  25. install_path = '${ARCHDIR_RUBY}')
  26. bld.install_files('${LIBDIR_RUBY}', 'Mytest.rb')
  27. if bld.cmd == 'runit':
  28. def foo(bld):
  29. bld.exec_command(bld.env.RUBY + ' -I' + bld.get_variant_dir() + ' -rMytest -e "Mytest.hello()"')
  30. bld.add_post_fun(foo)
  31. # or, another way
  32. bld(source='hello_world.rb')
  33. from waflib.Build import BuildContext
  34. class one(BuildContext):
  35. cmd = 'runit'