root/trunk/libffado/src/SConscript

Revision 1765, 9.6 kB (checked in by ppalmers, 11 years ago)

put everything related to iso streaming into one CPP file. this should give the compiler some more freedom to optimize.

Line 
1 #
2 # Copyright (C) 2007-2008 Arnold Krille
3 # Copyright (C) 2007-2008 Pieter Palmers
4 #
5 # This file is part of FFADO
6 # FFADO = Free Firewire (pro-)audio drivers for linux
7 #
8 # FFADO is based upon FreeBoB.
9 #
10 # This program is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 2 of the License, or
13 # (at your option) version 3 of the License.
14 #
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 #
23
24 import os
25
26 Import( 'env' )
27
28 libenv = env.Clone()
29
30 libenv.MergeFlags( "-I#/ -I#/src" )
31
32 ffado_source = env.Split( '\
33         devicemanager.cpp \
34         ffado.cpp \
35         ffadodevice.cpp \
36         debugmodule/debugmodule.cpp \
37         DeviceStringParser.cpp \
38         libieee1394/ARMHandler.cpp \
39         libieee1394/configrom.cpp \
40         libieee1394/csr1212.c \
41         libieee1394/CycleTimerHelper.cpp \
42         libieee1394/ieee1394service.cpp \
43         libieee1394/IEC61883.cpp \
44         libieee1394/IsoHandlerManager.cpp \
45         libstreaming/StreamProcessorManager.cpp \
46         libstreaming/util/cip.c \
47         libstreaming/generic/StreamProcessor.cpp \
48         libstreaming/generic/Port.cpp \
49         libstreaming/generic/PortManager.cpp \
50         libutil/cmd_serialize.cpp \
51         libutil/DelayLockedLoop.cpp \
52         libutil/IpcRingBuffer.cpp \
53         libutil/PacketBuffer.cpp \
54         libutil/Configuration.cpp \
55         libutil/OptionContainer.cpp \
56         libutil/PosixMessageQueue.cpp \
57         libutil/PosixSharedMemory.cpp \
58         libutil/PosixMutex.cpp \
59         libutil/PosixThread.cpp \
60         libutil/ringbuffer.c \
61         libutil/StreamStatistics.cpp \
62         libutil/SystemTimeSource.cpp \
63         libutil/TimestampedBuffer.cpp \
64         libutil/Watchdog.cpp \
65         libcontrol/Element.cpp \
66         libcontrol/BasicElements.cpp \
67         libcontrol/MatrixMixer.cpp \
68         libcontrol/CrossbarRouter.cpp \
69         libcontrol/ClockSelect.cpp \
70         libcontrol/Nickname.cpp \
71 ')
72
73 if env['SERIALIZE_USE_EXPAT']:
74         ffado_source.append('libutil/serialize_expat.cpp')
75         ffado_source.append('libutil/serialize_expat_xml.cpp')
76 else:
77         ffado_source.append('libutil/serialize_libxml.cpp')
78
79 bebob_source = env.Split( '\
80         bebob/bebob_avdevice.cpp \
81         bebob/bebob_avdevice_subunit.cpp \
82         bebob/bebob_avplug.cpp \
83         bebob/bebob_dl_bcd.cpp \
84         bebob/bebob_dl_codes.cpp \
85         bebob/bebob_dl_mgr.cpp \
86         bebob/bebob_functionblock.cpp \
87         bebob/bebob_mixer.cpp \
88         bebob/focusrite/focusrite_generic.cpp \
89         bebob/focusrite/focusrite_saffire.cpp \
90         bebob/focusrite/focusrite_saffirepro.cpp \
91         bebob/focusrite/focusrite_cmd.cpp \
92         bebob/terratec/terratec_device.cpp \
93         bebob/terratec/terratec_cmd.cpp \
94         bebob/edirol/edirol_fa101.cpp \
95         bebob/edirol/edirol_fa66.cpp \
96         bebob/esi/quatafire610.cpp \
97         bebob/mackie/onyxmixer.cpp \
98 ' )
99
100 bebob_pkgdata = env.Split( '\
101         maudio/refdesign.xml \
102         maudio/fw410.xml \
103         maudio/fwap.xml \
104 ' )
105
106 maudio_source =  env.Split( '\
107         maudio/maudio_avdevice.cpp \
108 ' )
109
110 maudio_pkgdata = env.Split( '\
111 ' )     
112
113 genericavc_source =  env.Split( '\
114         genericavc/avc_avdevice.cpp \
115         genericavc/stanton/scs.cpp \
116 ' )
117
118 genericavc_pkgdata = env.Split( '\
119 ' )     
120
121 fireworks_source =  env.Split( '\
122         fireworks/fireworks_device.cpp \
123         fireworks/fireworks_control.cpp \
124         fireworks/fireworks_firmware.cpp \
125         fireworks/efc/efc_avc_cmd.cpp \
126         fireworks/efc/efc_cmd.cpp \
127         fireworks/efc/efc_cmds_hardware.cpp \
128         fireworks/efc/efc_cmds_hardware_ctrl.cpp \
129         fireworks/efc/efc_cmds_flash.cpp \
130         fireworks/efc/efc_cmds_mixer.cpp \
131         fireworks/efc/efc_cmds_monitor.cpp \
132         fireworks/efc/efc_cmds_ioconfig.cpp \
133         fireworks/fireworks_session_block.cpp \
134         fireworks/audiofire/audiofire_device.cpp \
135 ' )
136
137 fireworks_pkgdata =  env.Split( '\
138 ' )
139
140 oxford_source =  env.Split( '\
141         oxford/oxford_device.cpp \
142         libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp \
143 ' )
144
145 oxford_pkgdata = env.Split( '\
146 ' )     
147
148 motu_source = env.Split( '\
149         motu/motu_avdevice.cpp \
150         motu/motu_controls.cpp \
151         motu/motu_mark3_controls.cpp \
152         motu/motu_mixerdefs.cpp \
153         motu/motu_mark3_mixerdefs.cpp \
154         motu/motu_mixer.cpp \
155         libstreaming/motu/MotuPort.cpp \
156         libstreaming/motu/MotuPortInfo.cpp \
157         libstreaming/motu/MotuReceiveStreamProcessor.cpp \
158         libstreaming/motu/MotuTransmitStreamProcessor.cpp \
159 ' )
160
161 dice_source = env.Split( '\
162         dice/dice_avdevice.cpp \
163         dice/dice_eap.cpp \
164         dice/focusrite/focusrite_eap.cpp \
165         dice/focusrite/saffire_pro40.cpp \
166         dice/focusrite/saffire_pro24.cpp \
167 ' )
168
169 bounce_source = env.Split( '\
170         bounce/bounce_avdevice.cpp \
171         bounce/bounce_slave_avdevice.cpp \
172 ' )
173
174 metric_halo_source = env.Split( '\
175         metrichalo/mh_avdevice.cpp \
176 ' )
177
178 rme_source = env.Split( '\
179         rme/rme_shm.cpp \
180         rme/rme_avdevice.cpp \
181         rme/rme_avdevice_settings.cpp \
182         rme/fireface_flash.cpp \
183         rme/fireface_hw.cpp \
184         rme/fireface_settings_ctrls.cpp \
185         libstreaming/rme/RmePort.cpp \
186         libstreaming/rme/RmePortInfo.cpp \
187         libstreaming/rme/RmeReceiveStreamProcessor.cpp \
188         libstreaming/rme/RmeTransmitStreamProcessor.cpp \
189 ' )
190
191 amdtp_source = env.Split( '\
192         libstreaming/amdtp/AmdtpPort.cpp \
193         libstreaming/amdtp/AmdtpPortInfo.cpp \
194         libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \
195         libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \
196 ' )
197
198 libavc_source = env.Split( '\
199         libavc/streamformat/avc_extended_stream_format.cpp \
200         libavc/musicsubunit/avc_descriptor_music.cpp \
201         libavc/musicsubunit/avc_musicsubunit.cpp \
202         libavc/audiosubunit/avc_audiosubunit.cpp \
203         libavc/audiosubunit/avc_descriptor_audio.cpp \
204         libavc/audiosubunit/avc_function_block.cpp \
205         libavc/descriptors/avc_descriptor_cmd.cpp \
206         libavc/descriptors/avc_descriptor.cpp \
207         libavc/general/avc_extended_subunit_info.cpp \
208         libavc/general/avc_unit_info.cpp \
209         libavc/general/avc_generic.cpp \
210         libavc/general/avc_subunit_info.cpp \
211         libavc/general/avc_connect.cpp \
212         libavc/general/avc_signal_format.cpp \
213         libavc/general/avc_extended_cmd_generic.cpp \
214         libavc/general/avc_extended_plug_info.cpp \
215         libavc/general/avc_plug_info.cpp \
216         libavc/general/avc_unit.cpp \
217         libavc/general/avc_subunit.cpp \
218         libavc/general/avc_plug.cpp \
219         libavc/general/avc_vendor_dependent_cmd.cpp \
220         libavc/avc_definitions.cpp \
221         libavc/ccm/avc_signal_source.cpp \
222 ' )
223
224 source = ffado_source
225 pkgdata = []
226 if env['ENABLE_BEBOB']:
227         env['ENABLE_GENERICAVC'] = True
228         libenv.MergeFlags( "-DENABLE_BEBOB" )
229         source += bebob_source
230         pkgdata += bebob_pkgdata
231 if env['ENABLE_MAUDIO']:
232         env['ENABLE_GENERICAVC'] = True
233         libenv.MergeFlags( "-DENABLE_MAUDIO" )
234         source += maudio_source
235         pkgdata += maudio_pkgdata
236 if env['ENABLE_FIREWORKS']:
237         env['ENABLE_GENERICAVC'] = True
238         libenv.MergeFlags( "-DENABLE_FIREWORKS" )
239         source += fireworks_source
240         pkgdata += fireworks_pkgdata
241 if env['ENABLE_OXFORD']:
242         env['ENABLE_GENERICAVC'] = True
243         libenv.MergeFlags( "-DENABLE_OXFORD" )
244         source += oxford_source
245         pkgdata += oxford_pkgdata
246 if env['ENABLE_MOTU']:
247         libenv.MergeFlags( "-DENABLE_MOTU" )
248         source += motu_source
249 if env['ENABLE_DICE']:
250         env['ENABLE_GENERICAVC'] = True
251         libenv.MergeFlags( "-DENABLE_DICE" )
252         source += dice_source
253 if env['ENABLE_METRIC_HALO']:
254         libenv.MergeFlags( "-DENABLE_METRIC_HALO" )
255         source += metric_halo_source
256 if env['ENABLE_RME']:
257         libenv.MergeFlags( "-DENABLE_RME" )
258         source += rme_source
259 if env['ENABLE_BOUNCE']:
260         env['ENABLE_GENERICAVC'] = True
261         libenv.MergeFlags( "-DENABLE_BOUNCE" )
262         source += bounce_source
263
264 if env['ENABLE_GENERICAVC']:
265         libenv.MergeFlags( "-DENABLE_GENERICAVC" )
266         source += libavc_source
267         source += amdtp_source
268         source += genericavc_source
269         pkgdata += genericavc_pkgdata
270
271 if not env.GetOption( "clean" ):
272         libenv.MergeFlags( "-lrt" )
273         libenv.MergeFlags( env['LIBRAW1394_FLAGS'] )
274         libenv.MergeFlags( env['LIBIEC61883_FLAGS'] )
275         if not env['SERIALIZE_USE_EXPAT']:
276                 libenv.MergeFlags( env['LIBXML26_FLAGS'] )
277         else:
278                 libenv.PrependUnique( LIBS=["expat"] )
279         if env['REQUIRE_LIBAVC']:
280                 libenv.MergeFlags( env['LIBAVC1394_FLAGS'] )
281
282 # add the libconfig
283 libenv.MergeFlags( "-I#/external/libconfig" )
284 libenv.MergeFlags( "-L"+env['build_base']+"external/libconfig" )
285 libenv.MergeFlags( "-lconfigpp" )
286
287 libname_versioned = "libffado.so.%s" % libenv['VERSION']
288 libname_versioned_short = "libffado.so.%s" % libenv['VERSION'].split('.')[0]
289
290 libenv.MergeFlags( "-Wl,-soname=%s" % libname_versioned_short )
291 ffadolib = libenv.SharedLibrary( "ffado", source )
292
293 #libenv.Install( "$libdir", ffadolib )
294 installer = libenv.InstallAs ( "$libdir/%s" % libname_versioned , ffadolib )
295
296 # if stripping would be something for us
297 #libenv.AddPostAction(installer, [['strip', env['STRIPFLAGS'], t[0].path]])
298
299 # make the required links
300 libenv.NoCache( '$libdir/%s' % libname_versioned )
301 libenv.AddPostAction(installer, [['rm', '-f', '$libdir/libffado.so', '$libdir/%s' % libname_versioned_short],
302                                  ['cd', '$libdir',
303                                  '&&','ln', '-s', libname_versioned_short, 'libffado.so',
304                                  '&&','ln', '-s', installer[0].name, libname_versioned_short,
305                                  ]
306                                 ])
307
308 if libenv['BUILD_STATIC_LIB']:
309     ffadolib_static = libenv.StaticLibrary( "ffado", source )
310
311 #
312 # Install the pkgdata to $sharedir
313 #
314 for data in pkgdata:
315         libenv.Install( "$sharedir", data )
316
317 #
318 # For the debugging apps
319 #
320 env2 = libenv.Clone()
321 env2.PrependUnique( LIBPATH=env['build_base']+"src" )
322 env2.PrependUnique( LIBS="ffado" )
323
324 apps = { \
325         "test-debugmodule" : "debugmodule/test_debugmodule.cpp", \
326         "test-dll" : "libutil/test-dll.cpp", \
327         "test-unittests-util" : "libutil/unittests.cpp", \
328         "test-cyclecalc" : "libieee1394/test-cyclecalc.cpp", \
329 }
330
331 installapps = []
332
333 for app in apps.keys():
334         env2.Program( target=app, source = env.Split( apps[app] ) )
335         if app.find( "test" ) == -1:
336                 env2.Install( "$bindir", app )
337
Note: See TracBrowser for help on using the browser.