merge pre- and post-fader processor boxes; start removing Placement (not finished...
[ardour.git] / libs / ardour / wscript
1 #!/usr/bin/env python
2 import autowaf
3 import os
4 import glob
5
6 # Version of this package (even if built as a child)
7 MAJOR = '3'
8 MINOR = '0'
9 MICRO = '0'
10 LIBARDOUR_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
11
12 # Library version (UNIX style major, minor, micro)
13 # major increment <=> incompatible changes
14 # minor increment <=> compatible changes (additions)
15 # micro increment <=> no interface changes
16 LIBARDOUR_LIB_VERSION = '3.0.0'
17
18 # Variables for 'waf dist'
19 APPNAME = 'libardour'
20 VERSION = LIBARDOUR_VERSION
21
22 # Mandatory variables
23 srcdir = '.'
24 blddir = 'build'
25
26 path_prefix = 'libs/ardour/'
27
28 def set_options(opt):
29         autowaf.set_options(opt)
30
31 def check_header_and_define(conf, header, define):
32         conf.check(header_name=header, define_name=define)
33         if conf.env[define]:
34                 conf.env.append_value('CCFLAGS', '-D' + define)
35                 conf.env.append_value('CXXFLAGS', '-D' + define)
36
37 def configure(conf):
38         autowaf.build_version_files(path_prefix+'ardour/version.h', path_prefix+'version.cc',
39                         'libardour3', MAJOR, MINOR, MICRO)
40         autowaf.configure(conf)
41         autowaf.check_tool(conf, 'compiler_cxx')
42         autowaf.check_pkg(conf, 'aubio', uselib_store='AUBIO', atleast_version='0.3.2')
43         autowaf.check_pkg(conf, 'jack', uselib_store='JACK', atleast_version='0.109.0')
44         autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
45         autowaf.check_pkg(conf, 'lrdf', uselib_store='LRDF', atleast_version='0.4.0')
46         autowaf.check_pkg(conf, 'samplerate', uselib_store='SAMPLERATE', atleast_version='0.1.0')
47         autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
48         autowaf.check_pkg(conf, 'slv2', uselib_store='SLV2', atleast_version='0.6.4', mandatory=False)
49         autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18')
50         autowaf.check_pkg(conf, 'soundtouch-1.0', uselib_store='SOUNDTOUCH', mandatory=False)
51         autowaf.check_pkg(conf, 'cppunit', uselib_store='CPPUNIT', atleast_version='1.12.0', mandatory=False)
52         autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
53         autowaf.check_pkg(conf, 'flac', uselib_store='FLAC', atleast_version='1.2.1')
54
55         # we don't try to detect this, since its part of our source tree
56
57         conf.env.append_value('CXXFLAGS', '-DUSE_RUBBERBAND')
58         conf.define('HAVE_RUBBERBAND', 1)
59
60         check_header_and_define(conf, 'sys/vfs.h', 'HAVE_SYS_VFS_H')
61         check_header_and_define(conf, 'wordexp.h', 'HAVE_WORDEXP')
62
63         conf.env.append_value('CCFLAGS', '-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE')
64         conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
65
66         conf.write_config_header('libardour-config.h')
67
68         # Boost headers
69         autowaf.check_header(conf, 'boost/shared_ptr.hpp')
70         autowaf.check_header(conf, 'boost/weak_ptr.hpp')
71
72 def build(bld):
73         # Library
74         obj = bld.new_task_gen('cxx', 'shlib')
75         obj.source = '''
76                 amp.cc
77                 analyser.cc
78                 audio_buffer.cc
79                 audio_diskstream.cc
80                 audio_library.cc
81                 audio_playlist.cc
82                 audio_playlist_importer.cc
83                 audio_port.cc
84                 audio_region_importer.cc
85                 audio_track.cc
86                 audio_track_importer.cc
87                 audioanalyser.cc
88                 audioengine.cc
89                 audiofile_tagger.cc
90                 audiofilesource.cc
91                 audioregion.cc
92                 audiosource.cc
93                 auditioner.cc
94                 automatable.cc
95                 automation.cc
96                 automation_control.cc
97                 automation_list.cc
98                 beats_frames_converter.cc
99                 broadcast_info.cc
100                 buffer.cc
101                 buffer_set.cc
102                 bundle.cc
103                 chan_count.cc
104                 chan_mapping.cc
105                 configuration.cc
106                 control_protocol_manager.cc
107                 control_protocol_search_path.cc
108                 crossfade.cc
109                 cycle_timer.cc
110                 default_click.cc
111                 delivery.cc
112                 directory_names.cc
113                 diskstream.cc
114                 element_import_handler.cc
115                 element_importer.cc
116                 enums.cc
117                 event_type_map.cc
118                 export_channel.cc
119                 export_channel_configuration.cc
120                 export_file_io.cc
121                 export_filename.cc
122                 export_format_base.cc
123                 export_format_manager.cc
124                 export_format_specification.cc
125                 export_formats.cc
126                 export_handler.cc
127                 export_preset.cc
128                 export_processor.cc
129                 export_profile_manager.cc
130                 export_status.cc
131                 export_timespan.cc
132                 export_utilities.cc
133                 file_source.cc
134                 filename_extensions.cc
135                 filesystem_paths.cc
136                 filter.cc
137                 find_session.cc
138                 gain.cc
139                 gdither.cc
140                 globals.cc
141                 import.cc
142                 internal_return.cc
143                 internal_send.cc
144                 interpolation.cc
145                 io.cc
146                 io_processor.cc
147                 jack_slave.cc
148                 ladspa_plugin.cc
149                 location.cc
150                 location_importer.cc
151                 meter.cc
152                 midi_buffer.cc
153                 midi_clock_slave.cc
154                 midi_diskstream.cc
155                 midi_model.cc
156                 midi_patch_manager.cc
157                 midi_playlist.cc
158                 midi_port.cc
159                 midi_region.cc
160                 midi_ring_buffer.cc
161                 midi_source.cc
162                 midi_state_tracker.cc
163                 midi_stretch.cc
164                 midi_track.cc
165                 mix.cc
166                 mtc_slave.cc
167                 mute_master.cc
168                 named_selection.cc
169                 onset_detector.cc
170                 panner.cc
171                 pcm_utils.cc
172                 playlist.cc
173                 playlist_factory.cc
174                 plugin.cc
175                 plugin_insert.cc
176                 plugin_manager.cc
177                 port.cc
178                 port_insert.cc
179                 port_set.cc
180                 processor.cc
181                 quantize.cc
182                 rc_configuration.cc
183                 recent_sessions.cc
184                 region.cc
185                 region_factory.cc
186                 resampled_source.cc
187                 return.cc
188                 reverse.cc
189                 route.cc
190                 route_group.cc
191                 send.cc
192                 session.cc
193                 session_butler.cc
194                 session_click.cc
195                 session_command.cc
196                 session_configuration.cc
197                 session_directory.cc
198                 session_events.cc
199                 session_export.cc
200                 session_metadata.cc
201                 session_midi.cc
202                 session_process.cc
203                 session_state.cc
204                 session_state_utils.cc
205                 session_time.cc
206                 session_transport.cc
207                 session_utils.cc
208                 smf_source.cc
209                 sndfile_helpers.cc
210                 sndfileimportable.cc
211                 sndfilesource.cc
212                 source.cc
213                 source_factory.cc
214                 strip_silence.cc
215                 svn_revision.cc
216                 tape_file_matcher.cc
217                 template_utils.cc
218                 tempo.cc
219                 tempo_map_importer.cc
220                 ticker.cc
221                 track.cc
222                 transient_detector.cc
223                 user_bundle.cc
224                 utils.cc
225                 version.cc
226         '''
227         obj.export_incdirs = ['.']
228         obj.includes     = ['.', '../surfaces/control_protocol']
229         obj.name         = 'libardour'
230         obj.target       = 'ardour'
231         obj.uselib       = 'GLIBMM AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF'
232         obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib'
233         obj.vnum         = LIBARDOUR_LIB_VERSION
234         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
235         obj.cxxflags     = ['-DPACKAGE="libardour3"']
236         obj.cxxflags     += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
237         obj.cxxflags     += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
238         obj.cxxflags     += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
239         obj.cxxflags     += ['-DLOCALEDIR="' + os.path.join(
240                         os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
241         obj.cxxflags     += ['-DVAMP_DIR="' + os.path.join(
242                         os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
243         obj.source += ' rb_effect.cc '
244         obj.uselib_local += ' librubberband '
245         #obj.source += ' st_stretch.cc st_pitch.cc '
246         #obj.uselib += ' SOUNDTOUCH '
247         if bld.env['HAVE_SLV2']:
248                 obj.source += ' lv2_plugin.cc lv2_event_buffer.cc uri_map.cc '
249                 obj.uselib += ' SLV2 '
250                 
251         if bld.env['HAVE_CPPUNIT']:
252                 # Unit tests
253                 testobj              = bld.new_task_gen('cxx', 'program')
254                 testobj.source       = '''
255                         interpolation.cc
256                         tests/interpolation-test.cc
257                         tests/testrunner.cpp
258                 '''
259                 testobj.includes     = obj.includes + ['../pbd/']
260                 testobj.uselib       = 'CPPUNIT SIGCPP JACK GLIBMM SAMPLERATE'
261                 testobj.target       = 'run-tests'
262                 testobj.install_path = ''
263
264 def shutdown():
265         autowaf.shutdown()
266