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