root/trunk/libffado/src/SConscript

Revision 1672, 9.8 kB (checked in by jwoithe, 15 years ago)

RME: create templates for streaming objects for the RME driver. They are based on the MOTU stream processor and still contain a lot of MOTU-specific code. This will be elimintated over time, but for now these objects should not be used as a reference for the RME devices.

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 env.AppendUnique( CPPPATH=["#/", "#/src"] )
29
30 libenv = env.Clone()
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/IsoHandler.cpp \
45         libieee1394/IsoHandlerManager.cpp \
46         libstreaming/StreamProcessorManager.cpp \
47         libstreaming/util/cip.c \
48         libstreaming/generic/StreamProcessor.cpp \
49         libstreaming/generic/Port.cpp \
50         libstreaming/generic/PortManager.cpp \
51         libutil/cmd_serialize.cpp \
52         libutil/DelayLockedLoop.cpp \
53         libutil/IpcRingBuffer.cpp \
54         libutil/PacketBuffer.cpp \
55         libutil/Configuration.cpp \
56         libutil/OptionContainer.cpp \
57         libutil/PosixMessageQueue.cpp \
58         libutil/PosixSharedMemory.cpp \
59         libutil/PosixMutex.cpp \
60         libutil/PosixThread.cpp \
61         libutil/ringbuffer.c \
62         libutil/StreamStatistics.cpp \
63         libutil/SystemTimeSource.cpp \
64         libutil/TimestampedBuffer.cpp \
65         libutil/Watchdog.cpp \
66         libcontrol/Element.cpp \
67         libcontrol/BasicElements.cpp \
68         libcontrol/MatrixMixer.cpp \
69         libcontrol/CrossbarRouter.cpp \
70         libcontrol/ClockSelect.cpp \
71         libcontrol/Nickname.cpp \
72 ')
73
74 if env['SERIALIZE_USE_EXPAT']:
75         ffado_source.append('libutil/serialize_expat.cpp')
76         ffado_source.append('libutil/serialize_expat_xml.cpp')
77 else:
78         ffado_source.append('libutil/serialize_libxml.cpp')
79
80 bebob_source = env.Split( '\
81         bebob/bebob_avdevice.cpp \
82         bebob/bebob_avdevice_subunit.cpp \
83         bebob/bebob_avplug.cpp \
84         bebob/bebob_dl_bcd.cpp \
85         bebob/bebob_dl_codes.cpp \
86         bebob/bebob_dl_mgr.cpp \
87         bebob/bebob_functionblock.cpp \
88         bebob/bebob_mixer.cpp \
89         bebob/focusrite/focusrite_generic.cpp \
90         bebob/focusrite/focusrite_saffire.cpp \
91         bebob/focusrite/focusrite_saffirepro.cpp \
92         bebob/focusrite/focusrite_cmd.cpp \
93         bebob/terratec/terratec_device.cpp \
94         bebob/terratec/terratec_cmd.cpp \
95         bebob/edirol/edirol_fa101.cpp \
96         bebob/edirol/edirol_fa66.cpp \
97         bebob/esi/quatafire610.cpp \
98         bebob/mackie/onyxmixer.cpp \
99 ' )
100
101 bebob_pkgdata = env.Split( '\
102         maudio/refdesign.xml \
103         maudio/fw410.xml \
104         maudio/fwap.xml \
105 ' )
106
107 maudio_source =  env.Split( '\
108         maudio/maudio_avdevice.cpp \
109 ' )
110
111 maudio_pkgdata = env.Split( '\
112 ' )     
113
114 genericavc_source =  env.Split( '\
115         genericavc/avc_avdevice.cpp \
116         genericavc/stanton/scs.cpp \
117 ' )
118
119 genericavc_pkgdata = env.Split( '\
120 ' )     
121
122 fireworks_source =  env.Split( '\
123         fireworks/fireworks_device.cpp \
124         fireworks/fireworks_control.cpp \
125         fireworks/fireworks_firmware.cpp \
126         fireworks/efc/efc_avc_cmd.cpp \
127         fireworks/efc/efc_cmd.cpp \
128         fireworks/efc/efc_cmds_hardware.cpp \
129         fireworks/efc/efc_cmds_hardware_ctrl.cpp \
130         fireworks/efc/efc_cmds_flash.cpp \
131         fireworks/efc/efc_cmds_mixer.cpp \
132         fireworks/efc/efc_cmds_monitor.cpp \
133         fireworks/efc/efc_cmds_ioconfig.cpp \
134         fireworks/fireworks_session_block.cpp \
135         fireworks/audiofire/audiofire_device.cpp \
136 ' )
137
138 fireworks_pkgdata =  env.Split( '\
139 ' )
140
141 oxford_source =  env.Split( '\
142         oxford/oxford_device.cpp \
143         libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp \
144 ' )
145
146 oxford_pkgdata = env.Split( '\
147 ' )     
148
149 motu_source = env.Split( '\
150         motu/motu_avdevice.cpp \
151         motu/motu_controls.cpp \
152         libstreaming/motu/MotuPort.cpp \
153         libstreaming/motu/MotuPortInfo.cpp \
154         libstreaming/motu/MotuReceiveStreamProcessor.cpp \
155         libstreaming/motu/MotuTransmitStreamProcessor.cpp \
156 ' )
157
158 dice_source = env.Split( '\
159         dice/dice_avdevice.cpp \
160         dice/dice_eap.cpp \
161         dice/focusrite/saffire_pro40.cpp \
162 ' )
163
164 bounce_source = env.Split( '\
165         bounce/bounce_avdevice.cpp \
166         bounce/bounce_slave_avdevice.cpp \
167 ' )
168
169 metric_halo_source = env.Split( '\
170         metrichalo/mh_avdevice.cpp \
171 ' )
172
173 rme_source = env.Split( '\
174         rme/rme_shm.cpp \
175         rme/rme_avdevice.cpp \
176         rme/rme_avdevice_settings.cpp \
177         rme/fireface_flash.cpp \
178         rme/fireface_hw.cpp \
179         rme/fireface_settings_ctrls.cpp \
180         libstreaming/rme/RmePort.cpp \
181         libstreaming/rme/RmePortInfo.cpp \
182         libstreaming/rme/RmeReceiveStreamProcessor.cpp \
183         libstreaming/rme/RmeTransmitStreamProcessor.cpp \
184 ' )
185
186 amdtp_source = env.Split( '\
187         libstreaming/amdtp/AmdtpPort.cpp \
188         libstreaming/amdtp/AmdtpPortInfo.cpp \
189         libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \
190         libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \
191 ' )
192
193 libavc_source = env.Split( '\
194         libavc/streamformat/avc_extended_stream_format.cpp \
195         libavc/musicsubunit/avc_descriptor_music.cpp \
196         libavc/musicsubunit/avc_musicsubunit.cpp \
197         libavc/audiosubunit/avc_audiosubunit.cpp \
198         libavc/audiosubunit/avc_descriptor_audio.cpp \
199         libavc/audiosubunit/avc_function_block.cpp \
200         libavc/descriptors/avc_descriptor_cmd.cpp \
201         libavc/descriptors/avc_descriptor.cpp \
202         libavc/general/avc_extended_subunit_info.cpp \
203         libavc/general/avc_unit_info.cpp \
204         libavc/general/avc_generic.cpp \
205         libavc/general/avc_subunit_info.cpp \
206         libavc/general/avc_connect.cpp \
207         libavc/general/avc_signal_format.cpp \
208         libavc/general/avc_extended_cmd_generic.cpp \
209         libavc/general/avc_extended_plug_info.cpp \
210         libavc/general/avc_plug_info.cpp \
211         libavc/general/avc_unit.cpp \
212         libavc/general/avc_subunit.cpp \
213         libavc/general/avc_plug.cpp \
214         libavc/general/avc_vendor_dependent_cmd.cpp \
215         libavc/avc_definitions.cpp \
216         libavc/ccm/avc_signal_source.cpp \
217 ' )
218
219 source = ffado_source
220 pkgdata = []
221 if env['ENABLE_BEBOB']:
222         libenv.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] )
223         source += bebob_source
224         pkgdata += bebob_pkgdata
225 if env['ENABLE_MAUDIO']:
226         libenv.AppendUnique( CCFLAGS=["-DENABLE_MAUDIO"] )
227         source += maudio_source
228         pkgdata += maudio_pkgdata
229 if env['ENABLE_FIREWORKS']:
230         libenv.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] )
231         source += fireworks_source
232         pkgdata += fireworks_pkgdata
233 if env['ENABLE_OXFORD']:
234         libenv.AppendUnique( CCFLAGS=["-DENABLE_OXFORD"] )
235         source += oxford_source
236         pkgdata += oxford_pkgdata
237 if env['ENABLE_MOTU']:
238         libenv.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] )
239         source += motu_source
240 if env['ENABLE_DICE']:
241         libenv.AppendUnique( CCFLAGS=["-DENABLE_DICE"] )
242         source += dice_source
243 if env['ENABLE_METRIC_HALO']:
244         libenv.AppendUnique( CCFLAGS=["-DENABLE_METRIC_HALO"] )
245         source += metric_halo_source
246 if env['ENABLE_RME']:
247         libenv.AppendUnique( CCFLAGS=["-DENABLE_RME"] )
248         source += rme_source
249 if env['ENABLE_BOUNCE']:
250         libenv.AppendUnique( CCFLAGS=["-DENABLE_BOUNCE"] )
251         source += bounce_source
252
253 # The list of devices needing GENERICAVC is controlled in ../SConstruct
254 if env['ENABLE_GENERICAVC']:
255         libenv.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] )
256         source += libavc_source
257         source += amdtp_source
258         source += genericavc_source
259         pkgdata += genericavc_pkgdata
260
261 if not env.GetOption( "clean" ):
262         libenv.MergeFlags( "-lrt" )
263         libenv.MergeFlags( env['LIBRAW1394_FLAGS'] )
264         libenv.MergeFlags( env['LIBIEC61883_FLAGS'] )
265         if not env['SERIALIZE_USE_EXPAT']:
266                 libenv.MergeFlags( env['LIBXML26_FLAGS'] )
267         else:
268                 libenv.PrependUnique( LIBS=["expat"] )
269         if env['REQUIRE_LIBAVC']:
270                 libenv.MergeFlags( env['LIBAVC1394_FLAGS'] )
271
272 # add the libconfig
273 libenv.AppendUnique( CPPPATH=["#/external/libconfig"] )
274 libenv.PrependUnique( LIBPATH=[env['build_base']+"external/libconfig"] )
275 libenv.PrependUnique( LIBS=["libconfigpp"] )
276
277 #env1.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,-soname -Wl,libffado.so.1 --version-info=1:0:0") )
278 ffadolib = libenv.SharedLibrary( "ffado", source )
279
280 if libenv['BUILD_STATIC_LIB']:
281     ffadolib_static = libenv.StaticLibrary( "ffado", source )
282
283 #
284 # All the following tries to emulate the versioning of installed libs as seen from libtool...
285 #
286 if False:
287         print "Trying to emulate libtools versioned install"
288         libenv.Alias( "install", libenv.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) )
289         libenv.Ignore( ffadolib, os.path.join('$libdir','libffado.so') )
290         #env.Ignore( os.path.join('$libdir','libffado.so'), ffadolib )
291         #env.Ignore( os.path.join('$libdir','libffado.so.0'), "install" )
292
293         libenv.Alias( "install", libenv.Command(
294                 target="$libdir/libffado.so",
295                 source=libenv['libdir']+"/libffado.so.$LIBVERSION",
296                 action="ln -s $SOURCE $TARGET"
297                 ) )
298         libenv.Alias( "install", libenv.Command(
299                 target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',1)[0],
300                 source=libenv['libdir']+"/libffado.so.$LIBVERSION",
301                 action="ln -s $SOURCE $TARGET"
302                 ) )
303         libenv.Alias( "install", libenv.Command(
304                 target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',2)[0],
305                 source=libenv['libdir']+"/libffado.so.$LIBVERSION",
306                 action="ln -s $SOURCE $TARGET"
307                 ) )
308 else:
309         #print "Doing simple install"
310         libenv.Install( "$libdir", ffadolib )
311
312 #
313 # Install the pkgdata to $sharedir
314 #
315 for data in pkgdata:
316         libenv.Install( "$sharedir", data )
317
318 #
319 # For the debugging apps
320 #
321 env2 = libenv.Clone()
322 env2.PrependUnique( LIBPATH=env['build_base']+"src" )
323 env2.PrependUnique( LIBS="ffado" )
324
325 apps = { \
326         "test-debugmodule" : "debugmodule/test_debugmodule.cpp", \
327         "test-dll" : "libutil/test-dll.cpp", \
328         "test-unittests-util" : "libutil/unittests.cpp", \
329         "test-cyclecalc" : "libieee1394/test-cyclecalc.cpp", \
330 }
331
332 installapps = []
333
334 for app in apps.keys():
335         env2.Program( target=app, source = env.Split( apps[app] ) )
336         if app.find( "test" ) == -1:
337                 env2.Install( "$bindir", app )
338
Note: See TracBrowser for help on using the browser.