Returns (i.e. sidechains).
[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
52         conf.env.append_value('CXXFLAGS', '-DUSE_RUBBERBAND')
53         conf.define('HAVE_RUBBERBAND', 1)
54
55         check_header_and_define(conf, 'sys/vfs.h', 'HAVE_SYS_VFS_H')
56         check_header_and_define(conf, 'wordexp.h', 'HAVE_WORDEXP')
57
58         conf.env.append_value('CCFLAGS', '-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE')
59         conf.env.append_value('CXXFLAGS', '-DENABLE_NLS')
60
61         conf.env.append_value('CXXFLAGS', '-DHAVE_WAFCONFIG_H')
62         conf.write_config_header('wafconfig.h')
63
64         # Boost headers
65         autowaf.check_header(conf, 'boost/shared_ptr.hpp')
66         autowaf.check_header(conf, 'boost/weak_ptr.hpp')
67
68 def build(bld):
69         # Library
70         obj = bld.new_task_gen('cxx', 'shlib')
71         obj.source = '''
72                 amp.cc
73                 analyser.cc
74                 audio_buffer.cc
75                 audio_diskstream.cc
76                 audio_library.cc
77                 audio_playlist.cc
78                 audio_playlist_importer.cc
79                 audio_port.cc
80                 audio_region_importer.cc
81                 audio_track.cc
82                 audio_track_importer.cc
83                 audioanalyser.cc
84                 audioengine.cc
85                 audiofile_tagger.cc
86                 audiofilesource.cc
87                 audioregion.cc
88                 audiosource.cc
89                 auditioner.cc
90                 automatable.cc
91                 automation.cc
92                 automation_control.cc
93                 automation_list.cc
94                 beats_frames_converter.cc
95                 broadcast_info.cc
96                 buffer.cc
97                 buffer_set.cc
98                 bundle.cc
99                 chan_count.cc
100                 chan_mapping.cc
101                 configuration.cc
102                 control_outputs.cc
103                 control_protocol_manager.cc
104                 control_protocol_search_path.cc
105                 crossfade.cc
106                 cycle_timer.cc
107                 default_click.cc
108                 directory_names.cc
109                 diskstream.cc
110                 element_import_handler.cc
111                 element_importer.cc
112                 enums.cc
113                 event_type_map.cc
114                 export_channel.cc
115                 export_channel_configuration.cc
116                 export_file_io.cc
117                 export_filename.cc
118                 export_format_base.cc
119                 export_format_manager.cc
120                 export_format_specification.cc
121                 export_formats.cc
122                 export_handler.cc
123                 export_preset.cc
124                 export_processor.cc
125                 export_profile_manager.cc
126                 export_status.cc
127                 export_timespan.cc
128                 export_utilities.cc
129                 file_source.cc
130                 filename_extensions.cc
131                 filesystem_paths.cc
132                 filter.cc
133                 find_session.cc
134                 gain.cc
135                 gdither.cc
136                 globals.cc
137                 import.cc
138                 io.cc
139                 io_processor.cc
140                 jack_slave.cc
141                 ladspa_plugin.cc
142                 location.cc
143                 location_importer.cc
144                 meter.cc
145                 midi_buffer.cc
146                 midi_clock_slave.cc
147                 midi_diskstream.cc
148                 midi_model.cc
149                 midi_patch_manager.cc
150                 midi_playlist.cc
151                 midi_port.cc
152                 midi_region.cc
153                 midi_ring_buffer.cc
154                 midi_source.cc
155                 midi_state_tracker.cc
156                 midi_stretch.cc
157                 midi_track.cc
158                 mix.cc
159                 mtc_slave.cc
160                 named_selection.cc
161                 onset_detector.cc
162                 panner.cc
163                 pcm_utils.cc
164                 playlist.cc
165                 playlist_factory.cc
166                 plugin.cc
167                 plugin_insert.cc
168                 plugin_manager.cc
169                 port.cc
170                 port_insert.cc
171                 port_set.cc
172                 processor.cc
173                 quantize.cc
174                 recent_sessions.cc
175                 region.cc
176                 region_factory.cc
177                 resampled_source.cc
178                 return.cc
179                 reverse.cc
180                 route.cc
181                 route_group.cc
182                 send.cc
183                 session.cc
184                 session_butler.cc
185                 session_click.cc
186                 session_command.cc
187                 session_directory.cc
188                 session_events.cc
189                 session_export.cc
190                 session_metadata.cc
191                 session_midi.cc
192                 session_process.cc
193                 session_state.cc
194                 session_state_utils.cc
195                 session_time.cc
196                 session_transport.cc
197                 session_utils.cc
198                 smf_source.cc
199                 sndfile_helpers.cc
200                 sndfileimportable.cc
201                 sndfilesource.cc
202                 source.cc
203                 source_factory.cc
204                 strip_silence.cc
205                 svn_revision.cc
206                 tape_file_matcher.cc
207                 template_utils.cc
208                 tempo.cc
209                 tempo_map_importer.cc
210                 ticker.cc
211                 track.cc
212                 transient_detector.cc
213                 user_bundle.cc
214                 utils.cc
215                 version.cc
216         '''
217         obj.export_incdirs = ['.']
218         obj.includes     = ['.', '../surfaces/control_protocol']
219         obj.name         = 'libardour'
220         obj.target       = 'ardour'
221         obj.uselib       = 'GLIBMM AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF'
222         obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib'
223         obj.vnum         = LIBARDOUR_LIB_VERSION
224         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
225         obj.cxxflags     = ['-DPACKAGE="libardour3"']
226         obj.cxxflags     += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
227         obj.cxxflags     += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
228         obj.cxxflags     += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
229         obj.cxxflags     += ['-DLOCALEDIR="' + os.path.join(
230                         os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
231         obj.cxxflags     += ['-DVAMP_DIR="' + os.path.join(
232                         os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
233         obj.source += ' rb_effect.cc '
234         obj.uselib_local += ' librubberband '
235         #obj.source += ' st_stretch.cc st_pitch.cc '
236         #obj.uselib += ' SOUNDTOUCH '
237         if bld.env['HAVE_SLV2']:
238                 obj.source += ' lv2_plugin.cc lv2_event_buffer.cc uri_map.cc '
239                 obj.uselib += ' SLV2 '
240                 obj.cxxflags += ['-DHAVE_SLV2']
241
242 def shutdown():
243         autowaf.shutdown()
244