File: wscript

package info (click to toggle)
slv2 0.6.6%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 1,288 kB
  • ctags: 1,808
  • sloc: python: 10,703; ansic: 5,093; makefile: 44; cpp: 38; sh: 8; lisp: 7
file content (151 lines) | stat: -rw-r--r-- 4,157 bytes parent folder | download
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#!/usr/bin/env python
import autowaf
import Options

# Version of this package (even if built as a child)
SLV2_VERSION = '0.6.6'

# Library version (UNIX style major, minor, micro)
# major increment <=> incompatible changes
# minor increment <=> compatible changes (additions)
# micro increment <=> no interface changes
# Version history:
#   0.0.1 = 0,0,0
#   0.1.0 = 2,0,0
#   0.2.0 = 3,0,0
#   0.3.0 = 4,0,0
#   0.3.1 = 4,0,0
#   0.3.2 = 5,0,1
#   0.4.0 = 6,0,0
#   0.4.1 = 6,0,0 (oops, should have been 6,1,0)
#   0.4.2 = 6,0,0 (oops, should have been 6,2,0)
#   0.4.3 = 6,0,0 (oops, should have been 6,3,0)
#   0.4.4 = 7,0,1
#   0.4.5 = 7,0,1
#   0.5.0 = 8,0,0
#   0.6.0 = 9,0,0 (SVN r1282)
#   0.6.1 = 9,1,0
#   0.6.2 = 9,1,1
#   0.6.4 = 9,2,0
#   0.6.6 = 9,2,0
SLV2_LIB_VERSION = '9.2.0'

# Variables for 'waf dist'
APPNAME = 'slv2'
VERSION = SLV2_VERSION

# Mandatory variables
srcdir = '.'
blddir = 'build'

def set_options(opt):
	autowaf.set_options(opt)
	opt.add_option('--no-jack', action='store_true', default=False, dest='no_jack',
			help="Do not build JACK clients")
	opt.add_option('--test', action='store_true', default=False, dest='build_tests',
			help="Build unit tests")

def configure(conf):
	autowaf.configure(conf)
	autowaf.check_tool(conf, 'compiler_cc')
	autowaf.check_pkg(conf, 'lv2', uselib_store='LV2', atleast_version='1.0', mandatory=True)
	autowaf.check_pkg(conf, 'redland', uselib_store='REDLAND', atleast_version='1.0.6', mandatory=True)
	autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.107.0', mandatory=False)
	conf.env.append_value('CCFLAGS', '-std=c99')
	conf.define('SLV2_VERSION', SLV2_VERSION)
	conf.write_config_header('slv2-config.h')

	conf.env['USE_JACK'] = conf.env['HAVE_JACK'] and not Options.options.no_jack
	conf.env['BUILD_TESTS'] = Options.options.build_tests

	autowaf.print_summary(conf)
	autowaf.display_header('SLV2 Configuration')
	autowaf.display_msg(conf, "Jack clients", str(conf.env['USE_JACK']))
	autowaf.display_msg(conf, "Unit tests", str(conf.env['BUILD_TESTS']))
	print

def build(bld):
	# C Headers
	bld.install_files('${INCLUDEDIR}/slv2', 'slv2/*.h')

	# Pkgconfig file
	autowaf.build_pc(bld, 'SLV2', SLV2_VERSION, ['REDLAND'])

	lib_source = '''
		src/collections.c
		src/plugin.c
		src/pluginclass.c
		src/plugininstance.c
		src/plugins.c
		src/pluginui.c
		src/pluginuiinstance.c
		src/port.c
		src/query.c
		src/scalepoint.c
		src/util.c
		src/value.c
		src/world.c
	'''

	# Library
	obj = bld.new_task_gen('cc', 'shlib')
	obj.export_incdirs = ['.']
	obj.source       = lib_source
	obj.includes     = ['.', './src']
	obj.name         = 'libslv2'
	obj.target       = 'slv2'
	obj.lib          = 'raptor2'
	obj.vnum         = SLV2_LIB_VERSION
	obj.install_path = '${LIBDIR}'
	autowaf.use_lib(bld, obj, 'REDLAND LV2')

	# Static library (for unit test code coverage)
	if bld.env['BUILD_TESTS']:
		obj = bld.new_task_gen('cc', 'staticlib')
		obj.source       = lib_source
		obj.includes     = ['.', './src']
		obj.name         = 'libslv2_static'
		obj.target       = 'slv2_static'
		obj.install_path = ''
		obj.ccflags      = [ '-fprofile-arcs',  '-ftest-coverage' ]

	# Utilities
	utils = '''
		utils/lv2_inspect
		utils/lv2_list
	'''
	for i in utils.split():
		obj = bld.new_task_gen('cc', 'program')
		obj.source       = i + '.c'
		obj.includes     = ['.', './src']
		obj.uselib_local = 'libslv2'
		obj.target       = i
		obj.install_path = '${BINDIR}'

	# JACK Hosts
	hosts = '''
		hosts/lv2_jack_host
		hosts/lv2_simple_jack_host
	'''
	if bld.env['USE_JACK']:
		for i in hosts.split():
			obj = bld.new_task_gen('cc', 'program')
			obj.source       = i + '.c'
			obj.includes     = ['.', './src']
			obj.uselib       = 'JACK'
			obj.uselib_local = 'libslv2'
			obj.target       = i
			obj.install_path = '${BINDIR}'

	# Unit tests
	bld.add_subdirs('test')

	# Documentation
	autowaf.build_dox(bld, 'SLV2', SLV2_VERSION, srcdir, blddir)
	bld.install_files('${HTMLDIR}', blddir + '/default/doc/html/*')
	bld.install_files('${MANDIR}/man3', blddir + '/default/doc/man/man3/*')
	bld.install_files('${MANDIR}/man1', 'doc/*.1')

def shutdown():
	autowaf.shutdown()