allow user tweaking of everything that might have inherent latency; add GUI for track...
[ardour.git] / gtk2_ardour / SConscript
1 # -*- python -*-
2
3 import os
4 import os.path
5 import glob
6
7 Import('env install_prefix final_prefix config_prefix libraries i18n ardour_version')
8
9 gtkardour = env.Copy()
10 gtkmmtests = env.Copy()
11
12 #
13 # this defines the version number of the GTK interface to ardour
14 #
15
16 domain = 'gtk_ardour'
17
18 gtkardour.Append(DOMAIN=domain, MAJOR=1,MINOR=0,MICRO=2)
19 gtkardour.Append(CCFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
20 gtkardour.Append(CXXFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
21 gtkardour.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
22 gtkardour.Append(CPPPATH="#/")  # for top level svn_revision.h
23 #gtkardour.Append(CXXFLAGS="-DFLOWCANVAS_AA")
24 gtkardour.Append(PACKAGE=domain)
25 gtkardour.Append(POTFILE=domain + '.pot')
26
27 gtkardour.Merge ([
28     libraries['ardour'],
29     libraries['ardour_cp'],
30     libraries['gtkmm2ext'],
31     libraries['midi++2'],
32     libraries['pbd'],
33     libraries['gtkmm2'],
34     libraries['glib2'],
35     libraries['libgnomecanvas2'],
36     libraries['libgnomecanvasmm'],
37     libraries['sysmidi'],
38     libraries['sndfile-ardour'],
39     libraries['flac'],
40     libraries['lrdf'],
41     libraries['glibmm2'],
42     libraries['pangomm'],
43     libraries['atkmm'],
44     libraries['gdkmm2'],
45     libraries['sigc2'],
46     libraries['gtk2'],
47     libraries['xml'],
48     libraries['xslt'],
49     libraries['soundtouch'],
50     libraries['samplerate'],
51     libraries['jack']
52 ])
53
54 gtkmmtests.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
55
56 gtkmmtests.Merge ([
57     libraries['gtkmm2'],
58     libraries['glib2'],
59     libraries['glibmm2'],
60     libraries['pangomm'],
61     libraries['atkmm'],
62     libraries['gdkmm2'],
63     libraries['sigc2'],
64     libraries['gtk2']
65 ])
66
67 if gtkardour['DMALLOC']:
68         gtkardour.Merge([libraries['dmalloc']])
69         gtkardour.Append(CCFLAGS='-DUSE_DMALLOC')
70
71 if gtkardour['FFT_ANALYSIS']:
72         gtkardour.Merge ([libraries['fftw3f']])
73         gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS')
74
75 skipped_files=Split("""
76 connection_editor.cc
77 """)
78
79 audiounit_files=Split("""
80 au_pluginui.cc
81 """)
82
83 gtkardour_files=Split("""
84 about.cc
85 actions.cc
86 add_route_dialog.cc
87 add_midi_cc_track_dialog.cc
88 ardour_dialog.cc
89 ardour_ui.cc
90 ardour_ui2.cc
91 ardour_ui_dependents.cc
92 ardour_ui_dialogs.cc
93 ardour_ui_ed.cc
94 ardour_ui_mixer.cc
95 ardour_ui_options.cc
96 audio_clock.cc
97 audio_time_axis.cc
98 audio_region_editor.cc
99 automation_gain_line.cc
100 automation_midi_cc_line.cc
101 automation_line.cc
102 automation_pan_line.cc
103 automation_time_axis.cc
104 midi_time_axis.cc
105 midi_streamview.cc
106 axis_view.cc
107 canvas-simpleline.c
108 simpleline.cc
109 canvas-simplerect.c
110 simplerect.cc
111 canvas-waveview.c
112 crossfade_edit.cc
113 crossfade_view.cc
114 curvetest.cc
115 enums.cc
116 editing.cc
117 editor.cc
118 editor_actions.cc
119 editor_audio_import.cc
120 editor_audiotrack.cc
121 editor_canvas.cc
122 editor_canvas_events.cc
123 editor_cursors.cc
124 editor_edit_groups.cc
125 editor_export_audio.cc
126 editor_hscroller.cc
127 editor_keyboard.cc
128 editor_keys.cc
129 editor_markers.cc
130 editor_mixer.cc
131 editor_mouse.cc
132 editor_nudge.cc
133 editor_ops.cc
134 editor_region_list.cc
135 editor_route_list.cc
136 editor_rulers.cc
137 editor_scrub.cc
138 editor_selection.cc
139 editor_selection_list.cc
140 editor_tempodisplay.cc
141 editor_timefx.cc
142 export_dialog.cc
143 export_session_dialog.cc
144 export_region_dialog.cc
145 export_range_markers_dialog.cc
146 gain_automation_time_axis.cc
147 midi_controller_time_axis.cc
148 gain_meter.cc
149 ghostregion.cc
150 gtk-custom-hruler.c
151 gtk-custom-ruler.c
152 io_selector.cc
153 keyboard.cc
154 ladspa_pluginui.cc
155 latency_gui.cc
156 location_ui.cc
157 main.cc
158 marker.cc
159 mixer_strip.cc
160 mixer_ui.cc
161 new_session_dialog.cc
162 option_editor.cc
163 opts.cc
164 pan_automation_time_axis.cc
165 panner.cc
166 panner2d.cc
167 panner_ui.cc
168 playlist_selector.cc
169 plugin_selector.cc
170 plugin_ui.cc
171 prompter.cc
172 public_editor.cc
173 processor_automation_line.cc
174 processor_automation_time_axis.cc
175 processor_box.cc
176 region_gain_line.cc
177 region_selection.cc
178 region_view.cc
179 audio_region_view.cc
180 midi_region_view.cc
181 tape_region_view.cc
182 route_params_ui.cc
183 route_processor_selection.cc
184 route_ui.cc
185 selection.cc
186 sfdb_ui.cc
187 send_ui.cc
188 streamview.cc
189 audio_streamview.cc
190 tempo_dialog.cc
191 theme_manager.cc
192 time_axis_view.cc
193 time_axis_view_item.cc
194 route_time_axis.cc
195 time_selection.cc
196 utils.cc
197 version.cc
198 waveview.cc
199 """)
200
201 fft_analysis_files=Split("""
202 analysis_window.cc
203 fft_graph.cc
204 fft_result.cc
205 """)
206
207 pixmap_files = glob.glob('pixmaps/*.xpm')
208 icon_files = glob.glob ('icons/*.png')
209
210 intl_files = gtkardour_files + glob.glob('*.h')
211
212 mtest_files=Split("""
213 mtest.cc
214 """)
215
216
217 rcu_files=Split("""
218 rcu.cc
219 """)
220
221 itest_files=Split("""
222 itest.cc
223 """)
224
225 stest_files=Split("""
226 stest.cc
227 """)
228
229 tt_files=Split ("""
230 tt.cc
231 """)
232
233 extra_sources = []
234
235 vst_files = [ 'vst_pluginui.cc' ]
236
237 if env['VST']:
238         extra_sources += vst_files
239         gtkardour.Append (CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")
240
241 cmt_files=Split("""
242 canvas-imageframe.c
243 editor_imageframe.cc
244 imageframe.cc
245 imageframe_socket_handler.cc
246 imageframe_time_axis.cc
247 imageframe_time_axis_group.cc
248 imageframe_time_axis_view.cc
249 imageframe_view.cc
250 marker_time_axis.cc
251 marker_time_axis_view.cc
252 marker_view.cc
253 visual_time_axis.cc
254 """)
255
256 if env['CMT']:
257     extra_sources += cmt_files
258     gtkardour.Append (CCFLAGS="-DWITH_CMT")
259
260 if gtkardour['AUDIOUNITS']:
261     extra_sources += audiounit_files
262     gtkardour.Append(CCFLAGS='-DHAVE_AUDIOUNITS')
263     gtkardour.Append(LINKFLAGS='-framework Carbon')
264     gtkardour.Merge([libraries['appleutility']])
265  
266 if env['FFT_ANALYSIS']:
267         extra_sources += fft_analysis_files
268
269 intl_files += extra_sources
270
271 gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
272 gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
273
274 versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
275
276 gtkardour.Append(CXXFLAGS=versionflag)
277
278 executable = 'ardour-' + ardour_version
279
280 ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
281 ardourlib = gtkardour.SharedLibrary(target = 'ardourgtk', source = gtkardour_files + extra_sources)
282
283 mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
284 itest = gtkardour.Program(target = 'itest', source = itest_files)
285 rcu = gtkardour.Program(target = 'rcu', source = rcu_files)
286 tt = gtkmmtests.Program(target = 'tt', source = tt_files)
287
288 my_subst_dict = { }
289
290 #
291 # null substitution just to avoid ardour.bindings being in svn
292 #
293
294 ardourbindings = env.SubstInFile ('ardour.bindings', 'ardour.bindings.in', SUBST_DICT = my_subst_dict);
295
296 my_subst_dict['%INSTALL_PREFIX%'] = final_prefix
297 my_subst_dict['%LIBDIR%'] = env['LIBDIR']
298 my_subst_dict['%VERSION%'] = ardour_version
299
300 ardoursh = env.SubstInFile ('ardour.sh','ardour.sh.in', SUBST_DICT = my_subst_dict);
301 env.AddPostAction (ardoursh, Chmod ('$TARGET', 0755))
302
303 ardourdev = env.SubstInFile ('ardev_common.sh','ardev_common.sh.in', SUBST_DICT = my_subst_dict);
304 env.AddPostAction (ardourdev, Chmod ('$TARGET', 0755))
305
306 Default(ardourbindings)
307 Default(ardourdev)
308 Default(ardoursh)
309
310 if env['VST']:
311         Default(ardourlib)
312         # the library - into the library dir
313         env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardourlib))
314 else:
315
316         if env['VERSIONED']:
317                 Default (env.VersionedExecutable ('tagged_executable', ardour))
318         else:
319                 Default(ardour)
320
321         #install
322
323         # the executable - into the library dir
324         env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardour))
325         # the script - into the bin dir
326         env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour2', ardoursh))
327
328 if env['NLS']:
329         i18n (gtkardour, gtkardour_files+skipped_files+fft_analysis_files, env)
330     
331 # configuration files
332 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour2_ui_dark.rc'))
333 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour2_ui_light.rc'))
334 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.menus'))
335 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.bindings'))
336 #env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.colors'))
337 # data files
338 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2'), 'splash.png'))
339 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2', 'pixmaps'), pixmap_files))
340 env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2', 'icons'), icon_files))
341
342 env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], []))
343                 
344 #dist
345 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
346                                       [ 'SConscript',
347                                         'i18n.h', 'gettext.h',
348                                         'ardour.sh.in',
349                                         'ardev_common.sh.in',
350                                         'ardev', 'ardbg',
351                                         'ardour2_ui_dark.rc', 'ardour2_ui_light.rc', 'splash.png',
352                                         'ardour.menus', 'ardour.bindings.in',# 'ardour.colors',
353                                         'editor_xpms'
354                                         ] +
355                                       gtkardour_files +
356                                       vst_files +
357                                       pixmap_files +
358                                       icon_files +
359                                       skipped_files +
360                                       audiounit_files + 
361                                       fft_analysis_files +
362                                       glob.glob('po/*.po') + glob.glob('*.h')))
363
364 # generate a prototype full-featured ardour_ui.rc file
365
366 env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
367      grep set_name $SOURCES | \
368 sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
369 grep -v '\\.' | sort | uniq | \
370 awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
371   fg[NORMAL] =   { 0, 0, 0 }\\n\
372   fg[ACTIVE] =   { 0, 0, 0 }\\n\
373   fg[SELECTED] = { 0, 0, 0 }\\n\
374   bg[NORMAL] =   { 0, 0, 0 }\\n\
375   bg[ACTIVE] =   { 0, 0, 0 }\\n\
376   bg[SELECTED] = { 0, 0, 0 }\\n\
377 }\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
378   $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
379      grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
380  sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
381  sort | uniq | \
382  awk '{ printf ("style \\"%s\\"\\n{\\n\
383   fg[NORMAL] =   { 0, 0, 0 }\\n\
384   fg[ACTIVE] =   { 0, 0, 0 }\\n\
385 }\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;
386 """
387 ))