Make the FFT Anaylsis optional and disabled by default until further discussion.
[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['soundtouch'],
46     libraries['samplerate'],
47     libraries['jack'],
48     libraries['glade2'],
49     libraries['libglademm']
50 ])
51
52 if gtkardour['FFT_ANALYSIS']:
53         gtkardour.Merge ([libraries['fftw3f']])
54
55 if gtkardour['VST']:
56     gtkardour.Merge ([ libraries['fst']])
57
58 skipped_files=Split("""
59 connection_editor.cc
60 """)
61
62 gtkardour_files=Split("""
63 about.cc
64 actions.cc
65 add_route_dialog.cc
66 ardour_dialog.cc
67 ardour_ui.cc
68 ardour_ui2.cc
69 ardour_ui_dependents.cc
70 ardour_ui_dialogs.cc
71 ardour_ui_ed.cc
72 ardour_ui_mixer.cc
73 ardour_ui_options.cc
74 audio_clock.cc
75 audio_time_axis.cc
76 automation_gain_line.cc
77 automation_line.cc
78 automation_pan_line.cc
79 automation_time_axis.cc
80 axis_view.cc
81 canvas-imageframe.c
82 canvas-simpleline.c
83 simpleline.cc
84 canvas-simplerect.c
85 simplerect.cc
86 canvas-waveview.c
87 color_manager.cc
88 crossfade_edit.cc
89 crossfade_view.cc
90 curvetest.cc
91 default_keys.cc
92 editing.cc
93 editor.cc
94 editor_actions.cc
95 editor_audiotrack.cc
96 editor_canvas.cc
97 editor_canvas_events.cc
98 editor_cursors.cc
99 editor_edit_groups.cc
100 editor_export_audio.cc
101 editor_hscroller.cc
102 editor_imageframe.cc
103 editor_keyboard.cc
104 editor_keys.cc
105 editor_markers.cc
106 editor_mixer.cc
107 editor_mouse.cc
108 editor_nudge.cc
109 editor_ops.cc
110 editor_region_list.cc
111 editor_route_list.cc
112 editor_rulers.cc
113 editor_scrub.cc
114 editor_selection_list.cc
115 editor_tempodisplay.cc
116 editor_timefx.cc
117 export_dialog.cc
118 export_session_dialog.cc
119 export_region_dialog.cc
120 export_range_markers_dialog.cc
121 gain_automation_time_axis.cc
122 gain_meter.cc
123 ghostregion.cc
124 glade_path.cc
125 glade_factory.cc
126 grouped_buttons.cc
127 gtk-custom-hruler.c
128 gtk-custom-ruler.c
129 imageframe.cc
130 imageframe_socket_handler.cc
131 imageframe_time_axis.cc
132 imageframe_time_axis_group.cc
133 imageframe_time_axis_view.cc
134 imageframe_view.cc
135 io_selector.cc
136 keyboard.cc
137 location_ui.cc
138 main.cc
139 marker.cc
140 marker_time_axis.cc
141 marker_time_axis_view.cc
142 marker_view.cc
143 meter_bridge.cc
144 meter_bridge_strip.cc
145 mixer_strip.cc
146 mixer_ui.cc
147 new_session_dialog.cc
148 option_editor.cc
149 opts.cc
150 pan_automation_time_axis.cc
151 panner2d.cc
152 panner_ui.cc
153 playlist_selector.cc
154 plugin_selector.cc
155 plugin_ui.cc
156 prompter.cc
157 public_editor.cc
158 redirect_automation_line.cc
159 redirect_automation_time_axis.cc
160 redirect_box.cc
161 region_editor.cc
162 region_gain_line.cc
163 region_selection.cc
164 regionview.cc
165 route_params_ui.cc
166 route_redirect_selection.cc
167 route_ui.cc
168 selection.cc
169 sfdb_ui.cc
170 send_ui.cc
171 streamview.cc
172 taperegionview.cc
173 tempo_dialog.cc
174 time_axis_view.cc
175 time_axis_view_item.cc
176 time_selection.cc
177 utils.cc
178 version.cc
179 visual_time_axis.cc
180 waveview.cc
181 """)
182
183 fft_analysis_files=Split("""
184 analysis_window.cc
185 fft_graph.cc
186 fft_result.cc
187 """)
188
189 glade_files=glob.glob('glade/*.glade')
190
191 intl_files = gtkardour_files + glade_files + glob.glob('*.h')
192
193 mtest_files=Split("""
194 mtest.cc
195 """)
196
197 itest_files=Split("""
198 itest.cc
199 """)
200
201 extra_sources = []
202 vst_files = [ 'vst_pluginui.cc' ]
203
204 if env['VST']:
205    extra_sources += vst_files
206
207 if env['FFT_ANALYSIS']:
208         extra_sources += fft_analysis_files
209
210
211 intl_files += extra_sources
212
213 gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
214 gtkardour.Append(CXXFLAGS="-DDATA_DIR=\\\""+final_prefix+"/share\\\"")
215 gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")
216 gtkardour.Append(CXXFLAGS="-DGLADEPATH=\\\""+final_prefix+"/share/ardour/glade\\\"")
217
218 versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'
219
220 gtkardour.Append(CXXFLAGS=versionflag)
221
222 gtkardour.VersionBuild(['version.cc','version.h'], 'SConscript')
223
224 executable = 'ardour.bin'
225
226 ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
227 mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
228 itest = gtkardour.Program(target = 'itest', source = itest_files)
229
230 Default(ardour)
231
232 if env['VERSIONED']:
233     Default (env.VersionedExecutable ('tagged_executable', ardour))
234
235 if env['NLS']:
236     Export('gtkardour', 'intl_files')
237     SConscript ('po/SConscript')
238     
239 #install
240
241
242 env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour', ardour))
243 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour'), 'ardour2_ui.rc'))
244 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour'), 'ardour.menus'))
245 env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour'), 'ardour.bindings'))
246 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour'), 'splash.ppm'))
247 env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour/glade'), glade_files))
248
249 #dist
250 env.Alias ('tarball', env.Distribute (env['DISTTREE'],
251                                       [ 'SConscript',
252                                         'i18n.h', 'gettext.h',
253                                         'editor_xpms', 'misc_xpms',
254                                         'crossfade_xpms.h', 'meter_xpms.h',
255                                         'ardour2_ui.rc', 'splash.ppm',
256                                         'ardour.menus', 'ardour.bindings'
257                                         ] +
258                                       gtkardour_files + vst_files + glade_files +
259                                       glob.glob('po/*.po') + glob.glob('*.h')))
260
261 # generate a prototype full-featured ardour_ui.rc file
262
263 env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
264      grep set_name $SOURCES | \
265 sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
266 grep -v '\\.' | sort | uniq | \
267 awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
268   fg[NORMAL] =   { 0, 0, 0 }\\n\
269   fg[ACTIVE] =   { 0, 0, 0 }\\n\
270   fg[SELECTED] = { 0, 0, 0 }\\n\
271   bg[NORMAL] =   { 0, 0, 0 }\\n\
272   bg[ACTIVE] =   { 0, 0, 0 }\\n\
273   bg[SELECTED] = { 0, 0, 0 }\\n\
274 }\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
275   $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
276      grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
277  sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
278  sort | uniq | \
279  awk '{ printf ("style \\"%s\\"\\n{\\n\
280   fg[NORMAL] =   { 0, 0, 0 }\\n\
281   fg[ACTIVE] =   { 0, 0, 0 }\\n\
282 }\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;
283 """
284 ))