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