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