Strip trailing whitespace from waf scripts.
[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                 configuration.cc
101                 control_protocol_manager.cc
102                 control_protocol_search_path.cc
103                 crossfade.cc
104                 cycle_timer.cc
105                 default_click.cc
106                 directory_names.cc
107                 diskstream.cc
108                 element_import_handler.cc
109                 element_importer.cc
110                 enums.cc
111                 event_type_map.cc
112                 export_channel.cc
113                 export_channel_configuration.cc
114                 export_file_io.cc
115                 export_filename.cc
116                 export_format_base.cc
117                 export_format_manager.cc
118                 export_format_specification.cc
119                 export_formats.cc
120                 export_handler.cc
121                 export_preset.cc
122                 export_processor.cc
123                 export_profile_manager.cc
124                 export_status.cc
125                 export_timespan.cc
126                 export_utilities.cc
127                 file_source.cc
128                 filename_extensions.cc
129                 filesystem_paths.cc
130                 filter.cc
131                 find_session.cc
132                 gain.cc
133                 gdither.cc
134                 globals.cc
135                 import.cc
136                 io.cc
137                 io_processor.cc
138                 jack_slave.cc
139                 ladspa_plugin.cc
140                 location.cc
141                 location_importer.cc
142                 meter.cc
143                 midi_buffer.cc
144                 midi_clock_slave.cc
145                 midi_diskstream.cc
146                 midi_model.cc
147                 midi_patch_manager.cc
148                 midi_playlist.cc
149                 midi_port.cc
150                 midi_region.cc
151                 midi_ring_buffer.cc
152                 midi_source.cc
153                 midi_state_tracker.cc
154                 midi_stretch.cc
155                 midi_track.cc
156                 mix.cc
157                 mtc_slave.cc
158                 named_selection.cc
159                 onset_detector.cc
160                 panner.cc
161                 pcm_utils.cc
162                 playlist.cc
163                 playlist_factory.cc
164                 plugin.cc
165                 plugin_insert.cc
166                 plugin_manager.cc
167                 port.cc
168                 port_insert.cc
169                 port_set.cc
170                 processor.cc
171                 quantize.cc
172                 recent_sessions.cc
173                 region.cc
174                 region_factory.cc
175                 resampled_source.cc
176                 reverse.cc
177                 route.cc
178                 route_group.cc
179                 send.cc
180                 session.cc
181                 session_butler.cc
182                 session_click.cc
183                 session_command.cc
184                 session_directory.cc
185                 session_events.cc
186                 session_export.cc
187                 session_metadata.cc
188                 session_midi.cc
189                 session_process.cc
190                 session_state.cc
191                 session_state_utils.cc
192                 session_time.cc
193                 session_transport.cc
194                 session_utils.cc
195                 smf_source.cc
196                 sndfile_helpers.cc
197                 sndfileimportable.cc
198                 sndfilesource.cc
199                 source.cc
200                 source_factory.cc
201                 strip_silence.cc
202                 svn_revision.cc
203                 tape_file_matcher.cc
204                 template_utils.cc
205                 tempo.cc
206                 tempo_map_importer.cc
207                 ticker.cc
208                 track.cc
209                 transient_detector.cc
210                 user_bundle.cc
211                 utils.cc
212                 version.cc
213         '''
214         obj.export_incdirs = ['.']
215         obj.includes     = ['.', '../surfaces/control_protocol']
216         obj.name         = 'libardour'
217         obj.target       = 'ardour'
218         obj.uselib       = 'GLIBMM AUBIO SIGCPP XML UUID JACK SNDFILE SAMPLERATE LRDF'
219         obj.uselib_local = 'libpbd libmidipp libevoral libvamphost libvampplugin libtaglib'
220         obj.vnum         = LIBARDOUR_LIB_VERSION
221         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
222         obj.cxxflags     = ['-DPACKAGE="libardour3"']
223         obj.cxxflags     += ['-DDATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"']
224         obj.cxxflags     += ['-DCONFIG_DIR="' + os.path.normpath(bld.env['CONFIGDIR']) + '"']
225         obj.cxxflags     += ['-DMODULE_DIR="' + os.path.normpath(bld.env['LIBDIR']) + '"']
226         obj.cxxflags     += ['-DLOCALEDIR="' + os.path.join(
227                         os.path.normpath(bld.env['DATADIR']), 'locale') + '"']
228         obj.cxxflags     += ['-DVAMP_DIR="' + os.path.join(
229                         os.path.normpath(bld.env['LIBDIR']), 'ardour3', 'vamp') + '"']
230         obj.source += ' rb_effect.cc '
231         obj.uselib_local += ' librubberband '
232         #obj.source += ' st_stretch.cc st_pitch.cc '
233         #obj.uselib += ' SOUNDTOUCH '
234         if bld.env['HAVE_SLV2']:
235                 obj.source += ' lv2_plugin.cc lv2_event_buffer.cc uri_map.cc '
236                 obj.uselib += ' LRDF SLV2'
237                 obj.cxxflags += ['-DHAVE_SLV2']
238
239 def shutdown():
240         autowaf.shutdown()
241