summaryrefslogtreecommitdiff
path: root/libs/libltc/wscript
blob: 7938cd18fdf9fa17b2dbd892cd3c8eda938a1102 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python
from waflib.extras import autowaf as autowaf
from waflib import TaskGen
import os
import sys

# Version of this package (even if built as a child)
MAJOR = '1'
MINOR = '1'
MICRO = '1'
LIBLTC_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)

# Library version (UNIX style major, minor, micro)
# major increment <=> incompatible changes
# minor increment <=> compatible changes (additions)
# micro increment <=> no interface changes
LIBLTC_LIB_VERSION = '1.1.1'

# Variables for 'waf dist'
APPNAME = 'libltc'
VERSION = LIBLTC_VERSION
I18N_PACKAGE = 'libltc'

# Mandatory variables
top = '.'
out = 'build'

def options(opt):
    autowaf.set_options(opt)

def configure(conf):
    if conf.is_defined('USE_EXTERNAL_LIBS'):
        autowaf.check_pkg(conf, 'ltc', uselib_store='LIBLTC', atleast_version=LIBLTC_LIB_VERSION, mandatory=True)
    else:
        conf.load('compiler_c')
        autowaf.configure(conf)

def build(bld):
    if bld.is_defined('USE_EXTERNAL_LIBS'):
        return
    bld (export_includes = ['.'],
         includes     = ['.'],
         name = 'libltc_includes'
         )

    bld.stlib (source = ['ltc.c', 'timecode.c', 'encoder.c', 'decoder.c'],
               cflags = [ '-fPIC' ],
               target = 'libltc',
               use    = 'libltc_includes'
               )

def shutdown():
    autowaf.shutdown()