Fix compile when using external version of libltc
[ardour.git] / libs / libltc / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import TaskGen
4 import os
5 import sys
6
7 # Version of this package (even if built as a child)
8 MAJOR = '1'
9 MINOR = '1'
10 MICRO = '1'
11 LIBLTC_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
12
13 # Library version (UNIX style major, minor, micro)
14 # major increment <=> incompatible changes
15 # minor increment <=> compatible changes (additions)
16 # micro increment <=> no interface changes
17 LIBLTC_LIB_VERSION = '1.1.1'
18
19 # Variables for 'waf dist'
20 APPNAME = 'libltc'
21 VERSION = LIBLTC_VERSION
22 I18N_PACKAGE = 'libltc'
23
24 # Mandatory variables
25 top = '.'
26 out = 'build'
27
28 def options(opt):
29     autowaf.set_options(opt)
30
31 def configure(conf):
32     if conf.is_defined('USE_EXTERNAL_LIBS'):
33         autowaf.check_pkg(conf, 'ltc', uselib_store='LIBLTC', atleast_version=LIBLTC_LIB_VERSION, mandatory=True)
34     else:
35         conf.load('compiler_c')
36         autowaf.configure(conf)
37
38 def build(bld):
39     if bld.is_defined('USE_EXTERNAL_LIBS'):
40         return
41     bld (export_includes = ['ltc'],
42          name = 'libltc_includes'
43          )
44
45     bld.stlib (source = ['ltc.c', 'timecode.c', 'encoder.c', 'decoder.c'],
46                cflags = [ '-fPIC' ],
47                includes = ['.'],
48                target = 'libltc',
49                use    = 'libltc_includes'
50                )
51
52 def shutdown():
53     autowaf.shutdown()