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