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