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