wscript 1016 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # Jérôme Carretero, 2013 (zougloub)
  4. """
  5. Demonstration for building of static+shared libraries.
  6. """
  7. def options(opt):
  8. opt.load('compiler_c gnu_dirs')
  9. def configure(conf):
  10. conf.load('compiler_c gnu_dirs')
  11. def build(bld):
  12. bld(
  13. features='c',
  14. source='test_shlib.c',
  15. # it is -uselib' in this case to avoid propagation of '-shared'
  16. # to the program below. A more explicit alternative is to set
  17. # cflags=bld.env.CFLAGS_cshlib
  18. uselib='cshlib',
  19. target='objects-for-shlib',
  20. )
  21. bld(
  22. features='c',
  23. source='test_shlib.c',
  24. target='objects-for-stlib',
  25. )
  26. bld(
  27. features='c cshlib',
  28. target='something-shared',
  29. vnum='1.2.3',
  30. use='objects-for-shlib',
  31. )
  32. bld(
  33. features='c cstlib',
  34. target = 'something-static',
  35. use='objects-for-stlib',
  36. )
  37. bld(
  38. features='c cprogram',
  39. target='exe-shared',
  40. source='main.c',
  41. use='something-shared',
  42. )
  43. bld(
  44. features='c cprogram',
  45. target='exe-static',
  46. source='main.c',
  47. use='something-static',
  48. )