waf

FORK: waf with some random patches
git clone https://git.neptards.moe/neptards/waf.git
Log | Files | Refs | README

wscript (980B)


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