waf_pouet.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. import os
  7. def options(opt):
  8. # project-specific options go here
  9. pass
  10. def configure(conf):
  11. pass
  12. # one possibility is to specify the configuration variables explicitly:
  13. # conf.env.append_value('DEFINES_pouet', 'pouet=1')
  14. # conf.env.append_value('INCLUDES_pouet', os.path.dirname(os.path.abspath(__file__)))
  15. # conf.env.append_value('LIB_pouet', ['prepouet', 'pouet'])
  16. if conf.variant == 'linux_64_release':
  17. # the other project will get -lm in the variant
  18. conf.env.LIB_m = ['m']
  19. conf.env.LIB_prepouet = 'prepouet'
  20. def build(bld):
  21. # another possibility is to create a fake library
  22. noarch = os.path.dirname(os.path.abspath(__file__))
  23. base = os.path.dirname(noarch)
  24. p = os.path.join(base, bld.variant)
  25. tg = bld.read_shlib(name='pouet', paths=[p])
  26. tg.export_defines = 'pouet=1'
  27. tg.export_includes = noarch
  28. tg.use = 'prepouet m'.split()
  29. # and again, you have the choice of making fake libraries, or to use variables
  30. #tg2 = bld.read_shlib(name='prepouet', paths=[p])
  31. #tg2.use = 'm'