fix linking of windows-vst with gcc > 4.7
[ardour.git] / gtk2_ardour / wscript
1 #!/usr/bin/env python
2 from waflib.extras import autowaf as autowaf
3 from waflib import Options, TaskGen
4 import waflib.Logs as Logs, waflib.Utils as Utils
5 import os
6 import sys
7 import re
8 import time
9 from waflib.Task import Task
10
11 # Version of this package (even if built as a child)
12 MAJOR = '3'
13 MINOR = '0'
14 MICRO = '0'
15 GTK2_ARDOUR_VERSION = "%s.%s.%s" % (MAJOR, MINOR, MICRO)
16
17 # Variables for 'waf dist'
18 APPNAME = 'gtk2_ardour3'
19 VERSION = GTK2_ARDOUR_VERSION
20 I18N_PACKAGE = 'gtk2_ardour3'
21
22 # Mandatory variables
23 top = '.'
24 out = 'build'
25
26 path_prefix = 'gtk2_ardour/'
27
28 gtk2_ardour_sources = [
29         'about.cc',
30         'actions.cc',
31         'add_route_dialog.cc',
32         'ambiguous_file_dialog.cc',
33         'analysis_window.cc',
34         'ardour_button.cc',
35         'ardour_dialog.cc',
36         'ardour_ui.cc',
37         'ardour_ui2.cc',
38         'ardour_ui_dependents.cc',
39         'ardour_ui_dialogs.cc',
40         'ardour_ui_ed.cc',
41         'ardour_ui_mixer.cc',
42         'ardour_ui_options.cc',
43         'ardour_window.cc',
44         'audio_clock.cc',
45         'audio_region_editor.cc',
46         'audio_region_view.cc',
47         'audio_streamview.cc',
48         'audio_time_axis.cc',
49         'automation_controller.cc',
50         'automation_line.cc',
51         'automation_region_view.cc',
52         'automation_streamview.cc',
53         'automation_time_axis.cc',
54         'axis_view.cc',
55         'bundle_manager.cc',
56         'button_joiner.cc',
57         'canvas-flag.cc',
58         'canvas-hit.cc',
59         'canvas-note-event.cc',
60         'canvas-note.cc',
61         'canvas_patch_change.cc',
62         'canvas-simpleline.c',
63         'canvas-simplerect.c',
64         'canvas-sysex.cc',
65         'canvas-waveview.c',
66         'clock_group.cc',
67         'configinfo.cc',
68         'control_point.cc',
69         'control_point_dialog.cc',
70         'curvetest.cc',
71         'debug.cc',
72         'diamond.cc',
73         'edit_note_dialog.cc',
74         'editing.cc',
75         'editor.cc',
76         'editor_actions.cc',
77         'editor_audio_import.cc',
78         'editor_audiotrack.cc',
79         'editor_canvas.cc',
80         'editor_canvas_events.cc',
81         'editor_component.cc',
82         'editor_cursors.cc',
83         'editor_drag.cc',
84         'editor_route_groups.cc',
85         'editor_export_audio.cc',
86         'editor_group_tabs.cc',
87         'editor_keys.cc',
88         'editor_locations.cc',
89         'editor_markers.cc',
90         'editor_mixer.cc',
91         'editor_mouse.cc',
92         'editor_ops.cc',
93         'editor_regions.cc',
94         'editor_routes.cc',
95         'editor_rulers.cc',
96         'editor_selection.cc',
97         'editor_snapshots.cc',
98         'editor_summary.cc',
99         'editor_tempodisplay.cc',
100         'editor_timefx.cc',
101         'engine_dialog.cc',
102         'enums.cc',
103         'export_channel_selector.cc',
104         'export_dialog.cc',
105         'export_file_notebook.cc',
106         'export_filename_selector.cc',
107         'export_format_dialog.cc',
108         'export_format_selector.cc',
109         'export_preset_selector.cc',
110         'export_timespan_selector.cc',
111         'fft.cc',
112         'fft_graph.cc',
113         'fft_result.cc',
114         'gain_meter.cc',
115         'generic_pluginui.cc',
116         'ghostregion.cc',
117         'global_port_matrix.cc',
118         'group_tabs.cc',
119         'gtk-custom-hruler.c',
120         'gtk-custom-ruler.c',
121         'gtk_pianokeyboard.c',
122         'gui_object.cc',
123         'insert_time_dialog.cc',
124         'interthread_progress_window.cc',
125         'io_selector.cc',
126         'keyboard.cc',
127         'keyeditor.cc',
128         'latency_gui.cc',
129         'led.cc',
130         'level_meter.cc',
131         'lineset.cc',
132         'location_ui.cc',
133         'main.cc',
134         'main_clock.cc',
135         'marker.cc',
136         'midi_automation_line.cc',
137         'midi_channel_dialog.cc',
138         'midi_channel_selector.cc',
139         'midi_cut_buffer.cc',
140         'midi_export_dialog.cc',
141         'midi_list_editor.cc',
142         'midi_port_dialog.cc',
143         'midi_region_view.cc',
144         'midi_scroomer.cc',
145         'midi_selection.cc',
146         'midi_streamview.cc',
147         'midi_time_axis.cc',
148         'midi_tracer.cc',
149         'midi_velocity_dialog.cc',
150         'missing_file_dialog.cc',
151         'missing_plugin_dialog.cc',
152         'mixer_actor.cc',
153         'mixer_group_tabs.cc',
154         'mixer_strip.cc',
155         'mixer_ui.cc',
156         'monitor_section.cc',
157         'mono_panner.cc',
158         'mono_panner_editor.cc',
159         'mouse_cursors.cc',
160         'nag.cc',
161         'new_plugin_preset_dialog.cc',
162         'normalize_dialog.cc',
163         'note_player.cc',
164         'option_editor.cc',
165         'opts.cc',
166         'panner2d.cc',
167         'panner_editor.cc',
168         'panner_interface.cc',
169         'panner_ui.cc',
170         'piano_roll_header.cc',
171         'playlist_selector.cc',
172         'plugin_eq_gui.cc',
173         'plugin_selector.cc',
174         'plugin_ui.cc',
175         'port_group.cc',
176         'port_insert_ui.cc',
177         'port_matrix.cc',
178         'port_matrix_body.cc',
179         'port_matrix_column_labels.cc',
180         'port_matrix_component.cc',
181         'port_matrix_grid.cc',
182         'port_matrix_labels.cc',
183         'port_matrix_row_labels.cc',
184         'processor_box.cc',
185         'patch_change_dialog.cc',
186         'progress_reporter.cc',
187         'prompter.cc',
188         'public_editor.cc',
189         'quantize_dialog.cc',
190         'rc_option_editor.cc',
191         'region_editor.cc',
192         'region_gain_line.cc',
193         'region_layering_order_editor.cc',
194         'region_selection.cc',
195         'region_view.cc',
196         'return_ui.cc',
197         'rhythm_ferret.cc',
198         'route_group_dialog.cc',
199         'route_group_menu.cc',
200         'route_params_ui.cc',
201         'route_processor_selection.cc',
202         'route_time_axis.cc',
203         'route_ui.cc',
204         'search_path_option.cc',
205         'selection.cc',
206         'send_ui.cc',
207         'session_import_dialog.cc',
208         'session_metadata_dialog.cc',
209         'session_option_editor.cc',
210         'sfdb_ui.cc',
211         'shuttle_control.cc',
212         'simpleline.cc',
213         'simplerect.cc',
214         'splash.cc',
215         'speaker_dialog.cc',
216         'startup.cc',
217         'step_editor.cc',
218         'step_entry.cc',
219         'stereo_panner.cc',
220         'stereo_panner_editor.cc',
221         'streamview.cc',
222         'strip_silence_dialog.cc',
223         'tape_region_view.cc',
224         'tempo_dialog.cc',
225         'tempo_lines.cc',
226         'theme_manager.cc',
227         'time_axis_view.cc',
228         'time_axis_view_item.cc',
229         'time_fx_dialog.cc',
230         'time_info_box.cc',
231         'time_selection.cc',
232         'track_selection.cc',
233         'track_view_list.cc',
234         'transpose_dialog.cc',
235         'ui_config.cc',
236         'utils.cc',
237         'verbose_cursor.cc',
238         'version.cc',
239         'visibility_group.cc',
240         'volume_controller.cc',
241         'waveview.cc',
242         'window_proxy.cc'
243 ]
244
245 def options(opt):
246     autowaf.set_options(opt)
247
248 def configure(conf):
249     conf.load('misc')
250     conf.load('compiler_cxx')
251     autowaf.build_version_files(
252         path_prefix + 'version.h',
253         path_prefix + 'version.cc',
254         'gtk2_ardour', MAJOR, MINOR, MICRO)
255     autowaf.configure(conf)
256
257     if re.search ("linux", sys.platform) != None:
258         autowaf.check_pkg(conf, 'alsa', uselib_store='ALSA')
259
260     # TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
261
262     autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
263                       atleast_version='1.2.1')
264     autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
265                       atleast_version='2.10.1')
266     autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK',
267                       atleast_version='2.18')
268     autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
269                       atleast_version='2.18')
270     autowaf.check_pkg(conf, 'libgnomecanvas-2.0',
271                       uselib_store='GNOMECANVAS', atleast_version='2.30')
272     autowaf.check_pkg(conf, 'libgnomecanvasmm-2.6',
273                       uselib_store='GNOMECANVASMM', atleast_version='2.16')
274     autowaf.check_pkg(conf, 'ogg', uselib_store='OGG', atleast_version='1.1.2')
275     autowaf.check_pkg(conf, 'x11', uselib_store='X11', atleast_version='1.1', mandatory=False)
276     autowaf.check_pkg(conf, 'fontconfig', uselib_store='FONTCONFIG')
277
278     conf.write_config_header('gtk2ardour-config.h', remove=False)
279
280     # Boost headers
281     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
282     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
283
284 # Add a waf `feature' to allow compilation of things using winegcc
285 from waflib.TaskGen import feature
286 @feature("wine")
287 def set_winegcc(self):
288     self.env.LINK_CXX = self.env.LINK_CC = 'wineg++'
289     self.env.CC = 'winegcc'
290
291 def _doPyp(infileName, deps = False):
292     outStr = ''
293     out = []
294     re_spaces = re.compile("\s+")
295
296     if infileName == '-':
297         fd = sys.stdin
298     else:
299         fd = open(infileName)
300     inLines = fd.readlines()
301     if fd != sys.stdin:
302         fd.close()
303         
304
305     for line in inLines:
306         bits = re_spaces.split(line)
307         if bits[0] == '##include':
308             incName = bits[1]
309             if (deps):
310                 out += [ incName ]
311             else:
312                 # assume included file comes from same place as source file
313                 incName = os.path.join (os.path.dirname (infileName), incName);
314                 outStr += _doPyp(incName)
315         else:
316             if not deps:
317                 outStr += line
318
319     # done
320     if deps:
321         return out
322     else:
323         return outStr
324
325 def include_processor(task):
326     infileName = task.inputs[0].srcpath()
327     outfileName = os.path.join(out, task.outputs[0].bldpath())
328     fdOut = open (outfileName, "w")
329     fdOut.write (_doPyp(infileName))
330     fdOut.close ()
331
332
333 def build_color_scheme(path, prefix):
334     f = open (path, 'r')
335     color_scheme = ''
336     for line in f:
337         if re.search ('^#@color', line):
338             line.strip() # remove newline
339             words = line.split()
340             if len(color_scheme):
341                 color_scheme += ';'
342             color_scheme += prefix
343             color_scheme += '_'
344             color_scheme += words[1]
345             color_scheme += ':'
346             color_scheme += words[2]
347     f.close()
348     return color_scheme
349
350 def build(bld):
351
352     if bld.is_defined('WINDOWS_VST_SUPPORT'):
353         # If we require VST support we build a stub main() and the FST library
354         # here using winegcc, and link it to the GTK front-end library
355         obj = bld(features = 'cxx c cxxprogram wine')
356         obj.source = '''
357                 ../libs/fst/fst.c
358                 ../libs/fst/fstinfofile.c
359                 ../libs/fst/vsti.c
360                 ../libs/fst/vstwin.c
361                 ../vst/winmain.c
362         '''
363         obj.uselib = 'ALSA'
364         obj.use          = [ 'libpbd',
365                              'libmidipp',
366                              'libtaglib',
367                              'libardour',
368                              'libardour_cp',
369                              'libgtk2_ardour',
370                              'libgtkmm2ext',
371                              'libtaglib',
372                              'pthread' ]
373         obj.target = 'ardour-3.0-vst.exe.so'
374         obj.includes  = [ '../libs/fst', '.' ]
375         obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
376         obj.defines = ['_POSIX_SOURCE', 'USE_WS_PREFIX']
377         obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
378         # end of the wine executable
379
380         # now the shared library containing the GTK GUI for ardour
381         obj = bld (features = 'cxx c cxxshlib')
382         obj.source    = gtk2_ardour_sources
383         obj.includes  = [ '../libs/fst', '.' ]
384         obj.name      = 'libgtk2_ardour'
385         obj.target    = 'gtk2_ardour'
386     else:
387         # just the normal executable version of the GTK GUI
388         obj = bld(features = 'cxx c cxxprogram')
389         obj.source    = gtk2_ardour_sources
390         obj.target = 'ardour-3.0'
391         obj.includes = ['.']
392
393     # continue with setup of obj, which could be a shared library
394     # or an executable.
395
396     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
397
398     obj.uselib       = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG ALSA CURL DL'
399     obj.uselib       += ' GTKMM GNOMECANVASMM GNOMECANVAS '
400     obj.uselib       += ' AUDIOUNITS OSX GTKOSX '
401     obj.use          = [ 'libpbd',
402                          'libmidipp',
403                          'libtaglib',
404                          'libardour',
405                          'libardour_cp',
406                          'libgtkmm2ext',
407                          'libtaglib' ]
408     if sys.platform == 'darwin':
409         obj.use += ' libappleutility'
410     obj.defines     = [
411         'PACKAGE="' + I18N_PACKAGE + '"',
412         'VERSIONSTRING="' + bld.env['VERSION'] + '"',
413         'DATA_DIR="' + os.path.normpath(bld.env['DATADIR']) + '"',
414         'CONFIG_DIR="' + os.path.normpath(bld.env['SYSCONFDIR']) + '"',
415         'LOCALEDIR="' + os.path.join(os.path.normpath(bld.env['DATADIR']), 'locale') + '"',
416         'PROGRAM_NAME="' + bld.env['PROGRAM_NAME'] + '"'
417         ]
418     obj.includes += ['../libs']
419
420     if bld.is_defined('HAVE_SUIL'):
421         obj.source += [ 'lv2_plugin_ui.cc' ]
422         obj.use += [ 'SUIL' ]
423
424     if bld.is_defined('FREESOUND'):
425         obj.source +=  [ 'sfdb_freesound_mootcher.cc' ]
426         obj.defines += [ 'FREESOUND' ]
427
428     if bld.is_defined('NEED_INTL'):
429         obj.linkflags = ' -lintl'
430
431     if bld.is_defined('WINDOWS_VST_SUPPORT'):
432         obj.source += [ 'windows_vst_plugin_ui.cc' ]
433         obj.defines += [ 'WINDOWS_VST_SUPPORT' ]
434         obj.use += [ 'X11' ]
435         
436     if bld.is_defined('LXVST_SUPPORT'):
437         obj.source += [ 'linux_vst_gui_support.cc', 'lxvst_plugin_ui.cc' ]
438         obj.defines += [ 'LXVST_SUPPORT' ]
439         obj.use += [ 'X11' ]
440
441     if bld.is_defined('WINDOWS_VST_SUPPORT') or bld.is_defined('LXVST_SUPPORT'):
442         obj.source += [ 'vst_plugin_ui.cc' ]
443         
444     if bld.is_defined('PHONE_HOME'):
445         obj.defines += [ 'PHONE_HOME' ]
446
447     if bld.is_defined('HAVE_COREAUDIO'):
448         TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc']
449         obj.source += [ 'cocoacarbon.mm' ]
450         obj.use += ' libappleutility '
451
452     if bld.is_defined('AUDIOUNIT_SUPPORT'):
453         obj.source += [ 'au_pluginui.mm' ]
454
455     # Wrappers
456
457     wrapper_subst_dict = {
458             'INSTALL_PREFIX' : bld.env['PREFIX'],
459             'LIBDIR'         : os.path.normpath(bld.env['LIBDIR']),
460             'DATADIR'        : os.path.normpath(bld.env['DATADIR']),
461             'SYSCONFDIR'     : os.path.normpath(bld.env['SYSCONFDIR']),
462             'LIBS'           : 'build/libs',
463             'VERSION'        : '3.0',
464             'EXECUTABLE'     : 'build/gtk2_ardour/ardour-3.0'
465     }
466
467     def set_subst_dict(obj, dict):
468         for i in dict:
469             setattr(obj, i, dict[i])
470
471     obj              = bld(features = 'subst', rule= 'chmod 0755 ${TGT}')
472     obj.source       = 'ardev_common.sh.in'
473     obj.target       = 'ardev_common_waf.sh'
474     obj.chmod        = Utils.O755
475     obj.dict         = wrapper_subst_dict
476     set_subst_dict(obj, wrapper_subst_dict)
477
478     obj              = bld(features = 'subst')
479     obj.source       = 'ardour.sh.in'
480     obj.target       = 'ardour3'
481     obj.chmod        = Utils.O755
482     obj.dict         = wrapper_subst_dict
483     obj.install_path = bld.env['BINDIR']
484     set_subst_dict(obj, wrapper_subst_dict)
485
486     if bld.is_defined('WINDOWS_VST_SUPPORT'):
487         obj              = bld(features = 'subst')
488         obj.source       = '../vst/ardourvst.in'
489         obj.target       = 'ardourvst3'
490         obj.chmod        = Utils.O755
491         obj.dict         = wrapper_subst_dict
492         obj.install_path = bld.env['BINDIR']
493         set_subst_dict(obj, wrapper_subst_dict)
494
495     # Font configuration
496
497     dark_rc_subst_dict = {}
498     light_rc_subst_dict = {}
499     font_sizes      = {}
500     base_font       = ""
501
502     # Set up font sizes
503     if bld.is_defined('GTKOSX'): # OS X fonts
504         basefont = ""
505         font_sizes = {
506                 'SMALLER' : '9',
507                 'SMALL' : '10',
508                 'NORMAL' : '11',
509                 'BIG' : '12',
510                 'BIGGER' : '14',
511                 'LARGE' : '18',
512                 'LARGER' : '28',
513                 'HUGER' : '36',
514                 'MASSIVE' : '60',
515         }
516         font_names = {
517                 'MONOSPACE' : 'monospace',
518         }
519     else: # Linux/X11 fonts
520         basefont = '' # unspecified - use system defaults
521         font_sizes = {
522                 'SMALLER' : '8',
523                 'SMALL' : '9',
524                 'NORMAL' : '10',
525                 'BIG' : '14',
526                 'BIGGER' : '16',
527                 'LARGE' : '18',
528                 'LARGER' : '24',
529                 'HUGER' : '34',
530                 'MASSIVE' : '60',
531         }
532         font_names = {
533                 'MONOSPACE' : 'ArdourMono',
534         }
535
536     # Set up font substitution dictionary
537     # @FONT_XXXX@
538     for style in ['', 'BOLD', 'ITALIC']:
539         for sizename,points in iter(font_sizes.items()):
540             if (len (style)):
541                 key = "_".join (['FONT',style,sizename])
542                 fontstyle = " ".join ([basefont,style.lower(),points])
543             else:
544                 key = "_".join (['FONT',sizename])
545                 fontstyle = " ".join ([basefont,points])
546
547             dark_rc_subst_dict[key] = fontstyle
548             light_rc_subst_dict[key] = fontstyle
549
550     # @FONT_SIZE_XXXX@
551     for sizename,points in iter(font_sizes.items()):
552             key = "_".join (['FONT_SIZE',sizename])
553             dark_rc_subst_dict[key] = points
554             light_rc_subst_dict[key] = points
555
556     # various font names, eg @BOLD_MONOSPACE@
557     for font_sym,text in iter(font_names.items()):
558         key = font_sym
559         dark_rc_subst_dict[key] = text
560         light_rc_subst_dict[key] = text
561
562     # RC files
563     dark_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
564         'gtk2_ardour/ardour3_ui_dark.rc.in', 'ARDOUR_DARK')
565     dark_rc_subst_dict['COLPREFIX'] = 'ARDOUR_DARK'
566     light_rc_subst_dict['COLOR_SCHEME'] = build_color_scheme(
567         'gtk2_ardour/ardour3_ui_light.rc.in', 'ARDOUR_LIGHT')
568     light_rc_subst_dict['COLPREFIX'] = 'ARDOUR_LIGHT'
569
570     obj              = bld(features = 'subst')
571     obj.source       = [ 'ardour3_ui_dark.rc.in' ]
572     obj.target       = 'ardour3_ui_dark.rc.pre'
573     obj.install_path = None
574     set_subst_dict(obj, dark_rc_subst_dict)
575
576     obj              = bld(features = 'subst')
577     obj.source       = [ 'ardour3_ui_light.rc.in' ]
578     obj.target       = 'ardour3_ui_light.rc.pre'
579     obj.install_path = None
580     set_subst_dict(obj, light_rc_subst_dict)
581
582     obj              = bld(features = 'subst')
583     obj.source       = [ 'ardour3_styles.rc.in' ]
584     obj.target       = 'ardour3_dark_styles.rc'
585     obj.install_path = None
586     set_subst_dict(obj, dark_rc_subst_dict)
587
588     obj              = bld(features = 'subst')
589     obj.source       = [ 'ardour3_styles.rc.in' ]
590     obj.target       = 'ardour3_light_styles.rc'
591     obj.install_path = None
592     set_subst_dict(obj, light_rc_subst_dict)
593
594     obj              = bld(features = 'subst')
595     obj.source       = [ 'ardour3_fonts.rc.in' ]
596     obj.target       = 'ardour3_dark_fonts.rc'
597     obj.install_path = None
598     set_subst_dict(obj, dark_rc_subst_dict)
599
600     obj              = bld(features = 'subst')
601     obj.source       = [ 'ardour3_fonts.rc.in' ]
602     obj.target       = 'ardour3_light_fonts.rc'
603     obj.install_path = None
604     set_subst_dict(obj, light_rc_subst_dict)
605
606     obj              = bld(rule = 'cp ${SRC} ${TGT}')
607     obj.source       = [ 'ardour3_widget_list.rc' ]
608     obj.target       = 'ardour3_widgets.rc'
609     obj.install_path = None
610
611     obj = bld (rule = include_processor)
612     obj.source = [ 'ardour3_ui_dark.rc.pre' ]
613     # find and add all ##include dependencies as sources
614     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_dark.rc.in').srcpath(), True)
615     obj.target = 'ardour3_ui_dark.rc'
616     obj.install_path = '${SYSCONFDIR}/ardour3'
617
618     obj = bld (rule = include_processor)
619     obj.source = [ 'ardour3_ui_light.rc.pre' ]
620     # find and add all ##include dependencies as sources
621     obj.source += _doPyp (bld.path.find_resource ('ardour3_ui_light.rc.in').srcpath(), True)
622     obj.target = 'ardour3_ui_light.rc'
623     obj.install_path = '${SYSCONFDIR}/ardour3'
624
625     # Menus
626     menus_argv = []
627     if bld.is_defined('GTKOSX'):
628         menus_argv = [ '-E', '-P', '-DGTKOSX' ]
629     else:
630         menus_argv = [ '-E', '-P' ]
631     obj = bld(features = 'command-output')
632     obj.command = 'cpp'
633     obj.command_is_external = True
634     obj.no_inputs = True
635     obj.argv = menus_argv
636     obj.stdin = 'ardour.menus.in'
637     obj.stdout = 'ardour.menus'
638     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
639                       'ardour.menus')
640
641     # Keybindings
642
643     # 'SAE-de-keypad', 'SAE-de-nokeypad', 'SAE-us-keypad',
644     # 'SAE-us-nokeypad', 'ergonomic-us'
645
646     for b in [ 'mnemonic-us' ] :
647         obj = bld(
648             target = b + '.bindings',
649             source = b + '.bindings.in',
650             rule = '../tools/fmt-bindings --platform="%s" --winkey="%s" --accelmap <${SRC} >${TGT}' % (sys.platform, bld.env['WINDOWS_KEY'] )
651             )
652         obj.install_path = os.path.join(bld.env['SYSCONFDIR'], 'ardour3')
653
654     # not modified at present
655     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
656                       'step_editing.bindings')
657     bld.install_files(os.path.join(bld.env['SYSCONFDIR'], 'ardour3'),
658                       'mixer.bindings')
659
660     # Icons/Images
661     bld.install_files('${DATADIR}/ardour3/icons', bld.path.ant_glob('icons/*.png'))
662     bld.install_files('${DATADIR}/ardour3/pixmaps', bld.path.ant_glob('pixmaps/*.xpm'))
663     bld.install_files('${DATADIR}/ardour3', 'splash.png')
664     bld.install_files('${DATADIR}/ardour3', 'ArdourMono.ttf')
665
666     # Default UI configuration
667     bld.install_files('${SYSCONFDIR}/ardour3', 'ardour3_ui_default.conf')
668
669     # Default export stuff
670     bld.install_files('${SYSCONFDIR}/ardour3/export', bld.path.ant_glob('export/*.format'))
671
672     # i18n
673     if bld.is_defined('ENABLE_NLS'):
674         mo_files = bld.path.ant_glob('po/*.mo')
675         for mo in mo_files:
676             lang = os.path.basename(mo.srcpath()).replace('.mo', '')
677             bld.install_as(os.path.join(bld.env['PREFIX'], 'share', 'locale',
678                                         lang, 'LC_MESSAGES', I18N_PACKAGE + '.mo'),
679                            mo)
680
681 def i18n(bld):
682     autowaf.build_i18n(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
683                        'Paul Davis')
684
685 def i18n_pot(bld):
686     autowaf.build_i18n_pot(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
687                        'Paul Davis')
688
689 def i18n_po(bld):
690     autowaf.build_i18n_po(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
691                        'Paul Davis')
692
693 def i18n_mo(bld):
694     autowaf.build_i18n_mo(bld, top, 'gtk2_ardour', I18N_PACKAGE, gtk2_ardour_sources,
695                        'Paul Davis')