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