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