Merged with trunk revision 600
[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['flowcanvas'],
30     libraries['midi++2'],
31     libraries['pbd3'],
32     libraries['gtkmm2'],
33     libraries['glib2'],
34     libraries['libgnomecanvas2'],
35     libraries['libgnomecanvasmm'],
36     libraries['sysmidi'],
37     libraries['sndfile'],
38     libraries['flac'],
39     libraries['lrdf'],
40     libraries['glibmm2'],
41     libraries['pangomm'],
42     libraries['atkmm'],
43     libraries['gdkmm2'],
44     libraries['sigc2'],
45     libraries['gtk2'],
46     libraries['xml'],
47     libraries['xslt'],
48     libraries['soundtouch'],
49     libraries['samplerate'],
50     libraries['jack']
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 grouped_buttons.cc
131 gtk-custom-hruler.c
132 gtk-custom-ruler.c
133 imageframe.cc
134 imageframe_socket_handler.cc
135 imageframe_time_axis.cc
136 imageframe_time_axis_group.cc
137 imageframe_time_axis_view.cc
138 imageframe_view.cc
139 io_selector.cc
140 keyboard.cc
141 location_ui.cc
142 main.cc
143 marker.cc
144 marker_time_axis.cc
145 marker_time_axis_view.cc
146 marker_view.cc
147 meter_bridge.cc
148 meter_bridge_strip.cc
149 mixer_strip.cc
150 mixer_ui.cc
151 new_session_dialog.cc
152 option_editor.cc
153 opts.cc
154 pan_automation_time_axis.cc
155 panner2d.cc
156 panner_ui.cc
157 playlist_selector.cc
158 plugin_selector.cc
159 plugin_ui.cc
160 prompter.cc
161 public_editor.cc
162 redirect_automation_line.cc
163 redirect_automation_time_axis.cc
164 redirect_box.cc
165 region_editor.cc
166 region_gain_line.cc
167 region_selection.cc
168 regionview.cc
169 route_params_ui.cc
170 route_redirect_selection.cc
171 route_ui.cc
172 selection.cc
173 sfdb_ui.cc
174 send_ui.cc
175 streamview.cc
176 taperegionview.cc
177 tempo_dialog.cc
178 time_axis_view.cc
179 time_axis_view_item.cc
180 time_selection.cc
181 utils.cc
182 version.cc
183 visual_time_axis.cc
184 waveview.cc
185 """)
186
187 fft_analysis_files=Split("""
188 analysis_window.cc
189 fft_graph.cc
190 fft_result.cc
191 """)
192
193 pixmap_files=glob.glob('pixmaps/*.xpm')
194
195 intl_files = gtkardour_files + glob.glob('*.h')
196
197 mtest_files=Split("""
198 mtest.cc
199 """)
200
201 itest_files=Split("""
202 itest.cc
203 """)
204
205 extra_sources = []
206 vst_files = [ 'vst_pluginui.cc' ]
207
208 if env['VST']:
209    extra_sources += vst_files
210
211 if env['FFT_ANALYSIS']:
212         extra_sources += fft_analysis_files
213
214
215 intl_files += extra_sources
216
217 gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
218 gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
219
220 versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
221
222 gtkardour.Append(CXXFLAGS=versionflag)
223
224 gtkardour.VersionBuild(['version.cc','version.h'], 'SConscript')
225
226 executable = 'ardour.bin'
227
228 ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
229 mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
230 itest = gtkardour.Program(target = 'itest', source = itest_files)
231
232 my_subst_dict = { }
233 my_subst_dict['%INSTALL_PREFIX%'] = install_prefix
234
235 ardoursh = env.SubstInFile ('ardour.sh','ardour.sh.in', SUBST_DICT = my_subst_dict);
236 env.AddPostAction (ardoursh, Chmod ('$TARGET', 0755))
237
238 Default(ardour)
239
240 if env['VERSIONED']:
241     Default (env.VersionedExecutable ('tagged_executable', ardour))
242
243 if env['NLS']:
244     Export('gtkardour', 'intl_files')
245     SConscript ('po/SConscript')
246     
247 #install
248
249 # the executable - into the library dir
250 env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), ardour))
251 # the script - into the bin dir
252 env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour2', ardoursh))
253 # configuration files
254 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour2_ui.rc'))
255 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.menus'))
256 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.bindings'))
257 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.colors'))
258 # data files
259 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2'), 'splash.ppm'))
260 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/pixmaps'), pixmap_files))
261
262 #dist
263 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
264                                       [ 'SConscript',
265                                         'i18n.h', 'gettext.h',
266                                         'ardour.sh.in',
267                                         'ardour2_ui.rc', 'splash.ppm',
268                                         'ardour.menus', 'ardour.bindings', 'ardour.colors',
269                                         'editor_xpms'
270                                         ] +
271                                       gtkardour_files + vst_files + pixmap_files +
272                                       glob.glob('po/*.po') + glob.glob('*.h')))
273
274 # generate a prototype full-featured ardour_ui.rc file
275
276 env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
277      grep set_name $SOURCES | \
278 sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
279 grep -v '\\.' | sort | uniq | \
280 awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
281   fg[NORMAL] =   { 0, 0, 0 }\\n\
282   fg[ACTIVE] =   { 0, 0, 0 }\\n\
283   fg[SELECTED] = { 0, 0, 0 }\\n\
284   bg[NORMAL] =   { 0, 0, 0 }\\n\
285   bg[ACTIVE] =   { 0, 0, 0 }\\n\
286   bg[SELECTED] = { 0, 0, 0 }\\n\
287 }\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
288   $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
289      grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
290  sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
291  sort | uniq | \
292  awk '{ printf ("style \\"%s\\"\\n{\\n\
293   fg[NORMAL] =   { 0, 0, 0 }\\n\
294   fg[ACTIVE] =   { 0, 0, 0 }\\n\
295 }\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;
296 """
297 ))