Improved sfdb API.
[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['gtkmm2ext'],
28 #    libraries['flowcanvas'],
29     libraries['midi++2'],
30     libraries['pbd3'],
31     libraries['gtkmm2'],
32     libraries['glib2'],
33     libraries['libgnomecanvas2'],
34     libraries['libgnomecanvasmm'],
35     libraries['sysmidi'],
36     libraries['sndfile'],
37     libraries['lrdf'],
38     libraries['glibmm2'],
39     libraries['pangomm'],
40     libraries['atkmm'],
41     libraries['gdkmm2'],
42     libraries['sigc2'],
43     libraries['gtk2'],
44     libraries['xml'],
45     libraries['xslt'],
46     libraries['soundtouch'],
47     libraries['samplerate'],
48     libraries['jack'],
49     libraries['glade2'],
50     libraries['libglademm']
51 ])
52
53 if gtkardour['DMALLOC']:
54         gtkardour.Merge([libraries['dmalloc']])
55         gtkardour.Append(CCFLAGS='-DUSE_DMALLOC')
56
57 if gtkardour['FFT_ANALYSIS']:
58         gtkardour.Merge ([libraries['fftw3f']])
59         gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS')
60
61 if gtkardour['VST']:
62     gtkardour.Merge ([ libraries['fst']])
63
64 skipped_files=Split("""
65 connection_editor.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 automation_gain_line.cc
83 automation_line.cc
84 automation_pan_line.cc
85 automation_time_axis.cc
86 axis_view.cc
87 canvas-imageframe.c
88 canvas-simpleline.c
89 simpleline.cc
90 canvas-simplerect.c
91 simplerect.cc
92 canvas-waveview.c
93 color_manager.cc
94 crossfade_edit.cc
95 crossfade_view.cc
96 curvetest.cc
97 editing.cc
98 editor.cc
99 editor_actions.cc
100 editor_audio_import.cc
101 editor_audiotrack.cc
102 editor_canvas.cc
103 editor_canvas_events.cc
104 editor_cursors.cc
105 editor_edit_groups.cc
106 editor_export_audio.cc
107 editor_hscroller.cc
108 editor_imageframe.cc
109 editor_keyboard.cc
110 editor_keys.cc
111 editor_markers.cc
112 editor_mixer.cc
113 editor_mouse.cc
114 editor_nudge.cc
115 editor_ops.cc
116 editor_region_list.cc
117 editor_route_list.cc
118 editor_rulers.cc
119 editor_scrub.cc
120 editor_selection_list.cc
121 editor_tempodisplay.cc
122 editor_timefx.cc
123 export_dialog.cc
124 export_session_dialog.cc
125 export_region_dialog.cc
126 export_range_markers_dialog.cc
127 gain_automation_time_axis.cc
128 gain_meter.cc
129 ghostregion.cc
130 glade_path.cc
131 glade_factory.cc
132 grouped_buttons.cc
133 gtk-custom-hruler.c
134 gtk-custom-ruler.c
135 imageframe.cc
136 imageframe_socket_handler.cc
137 imageframe_time_axis.cc
138 imageframe_time_axis_group.cc
139 imageframe_time_axis_view.cc
140 imageframe_view.cc
141 io_selector.cc
142 keyboard.cc
143 location_ui.cc
144 main.cc
145 marker.cc
146 marker_time_axis.cc
147 marker_time_axis_view.cc
148 marker_view.cc
149 meter_bridge.cc
150 meter_bridge_strip.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_editor.cc
168 region_gain_line.cc
169 region_selection.cc
170 regionview.cc
171 route_params_ui.cc
172 route_redirect_selection.cc
173 route_ui.cc
174 selection.cc
175 sfdb_ui.cc
176 send_ui.cc
177 streamview.cc
178 taperegionview.cc
179 tempo_dialog.cc
180 time_axis_view.cc
181 time_axis_view_item.cc
182 time_selection.cc
183 utils.cc
184 version.cc
185 visual_time_axis.cc
186 waveview.cc
187 """)
188
189 fft_analysis_files=Split("""
190 analysis_window.cc
191 fft_graph.cc
192 fft_result.cc
193 """)
194
195 glade_files=glob.glob('glade/*.glade')
196 pixmap_files=glob.glob('pixmaps/*.xpm')
197
198 intl_files = gtkardour_files + glade_files + glob.glob('*.h')
199
200 mtest_files=Split("""
201 mtest.cc
202 """)
203
204 itest_files=Split("""
205 itest.cc
206 """)
207
208 extra_sources = []
209 vst_files = [ 'vst_pluginui.cc' ]
210
211 if env['VST']:
212    extra_sources += vst_files
213
214 if env['FFT_ANALYSIS']:
215         extra_sources += fft_analysis_files
216
217
218 intl_files += extra_sources
219
220 gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
221 gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
222 gtkardour.Append(CXXFLAGS="-DGLADEPATH=\\\""+final_prefix+"/share/ardour/glade\\\"")
223
224 versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
225
226 gtkardour.Append(CXXFLAGS=versionflag)
227
228 gtkardour.VersionBuild(['version.cc','version.h'], 'SConscript')
229
230 executable = 'ardour.bin'
231
232 ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
233 mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
234 itest = gtkardour.Program(target = 'itest', source = itest_files)
235
236 my_subst_dict = { }
237 my_subst_dict['%INSTALL_PREFIX%'] = install_prefix
238
239 ardoursh = env.SubstInFile ('ardour.sh','ardour.sh.in', SUBST_DICT = my_subst_dict);
240 env.AddPostAction (ardoursh, Chmod ('$TARGET', 0755))
241
242 Default(ardour)
243
244 if env['VERSIONED']:
245     Default (env.VersionedExecutable ('tagged_executable', ardour))
246
247 if env['NLS']:
248     Export('gtkardour', 'intl_files')
249     SConscript ('po/SConscript')
250     
251 #install
252
253 # the executable - into the library dir
254 env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), ardour))
255 # the script - into the bin dir
256 env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour2', ardoursh))
257 # configuration files
258 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour2_ui.rc'))
259 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.menus'))
260 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.bindings'))
261 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.colors'))
262 # data files
263 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2'), 'splash.ppm'))
264 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/pixmaps'), pixmap_files))
265 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/glade'), glade_files))
266
267 #dist
268 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
269                                       [ 'SConscript',
270                                         'i18n.h', 'gettext.h',
271                                         'ardour2_ui.rc', 'splash.ppm',
272                                         'ardour.menus', 'ardour.bindings', 'ardour.colors',
273                                         'editor_xpms'
274                                         ] +
275                                       gtkardour_files + vst_files + glade_files + pixmap_files +
276                                       glob.glob('po/*.po') + glob.glob('*.h')))
277
278 # generate a prototype full-featured ardour_ui.rc file
279
280 env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
281      grep set_name $SOURCES | \
282 sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
283 grep -v '\\.' | sort | uniq | \
284 awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
285   fg[NORMAL] =   { 0, 0, 0 }\\n\
286   fg[ACTIVE] =   { 0, 0, 0 }\\n\
287   fg[SELECTED] = { 0, 0, 0 }\\n\
288   bg[NORMAL] =   { 0, 0, 0 }\\n\
289   bg[ACTIVE] =   { 0, 0, 0 }\\n\
290   bg[SELECTED] = { 0, 0, 0 }\\n\
291 }\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
292   $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
293      grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
294  sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
295  sort | uniq | \
296  awk '{ printf ("style \\"%s\\"\\n{\\n\
297   fg[NORMAL] =   { 0, 0, 0 }\\n\
298   fg[ACTIVE] =   { 0, 0, 0 }\\n\
299 }\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;
300 """
301 ))