waf_pouet.py (1299B)
1 # Module exported and used for configuring the package pouet 2 # 3 # To try the changes, you may have to remove the cache and the existing package, for example: 4 # $ rm -rf /home/user/waf/playground/distnet/packages/app/1.0.0 /tmp/distnetcache/app/1.0.0 5 # $ waf configure_all build_all package publish 6 7 import os 8 9 def options(opt): 10 # project-specific options go here 11 pass 12 13 def configure(conf): 14 pass 15 # one possibility is to specify the configuration variables explicitly: 16 # conf.env.append_value('DEFINES_pouet', 'pouet=1') 17 # conf.env.append_value('INCLUDES_pouet', os.path.dirname(os.path.abspath(__file__))) 18 # conf.env.append_value('LIB_pouet', ['prepouet', 'pouet']) 19 20 if conf.variant == 'linux_64_release': 21 # the other project will get -lm in the variant 22 conf.env.LIB_m = ['m'] 23 conf.env.LIB_prepouet = 'prepouet' 24 25 def build(bld): 26 # another possibility is to create a fake library 27 noarch = os.path.dirname(os.path.abspath(__file__)) 28 base = os.path.dirname(noarch) 29 p = os.path.join(base, bld.variant) 30 tg = bld.read_shlib(name='pouet', paths=[p]) 31 tg.export_defines = 'pouet=1' 32 tg.export_includes = noarch 33 tg.use = 'prepouet m'.split() 34 35 # and again, you have the choice of making fake libraries, or to use variables 36 #tg2 = bld.read_shlib(name='prepouet', paths=[p]) 37 #tg2.use = 'm' 38