root/trunk/libffado/src/SConscript

Revision 1597, 9.5 kB (checked in by jwoithe, 14 years ago)

RME: begin high-level framework for device control via FFADO dbus interface.

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/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         libstreaming/motu/MotuPort.cpp \
152         libstreaming/motu/MotuPortInfo.cpp \
153         libstreaming/motu/MotuReceiveStreamProcessor.cpp \
154         libstreaming/motu/MotuTransmitStreamProcessor.cpp \
155 ' )
156
157 dice_source = env.Split( '\
158         dice/dice_avdevice.cpp \
159         dice/dice_eap.cpp \
160 ' )
161
162 bounce_source = env.Split( '\
163         bounce/bounce_avdevice.cpp \
164         bounce/bounce_slave_avdevice.cpp \
165 ' )
166
167 metric_halo_source = env.Split( '\
168         metrichalo/mh_avdevice.cpp \
169 ' )
170
171 rme_source = env.Split( '\
172         rme/rme_avdevice.cpp \
173         rme/fireface_flash.cpp \
174         rme/fireface_hw.cpp \
175         rme/fireface_settings_ctrls.cpp \
176 ' )
177
178 amdtp_source = env.Split( '\
179         libstreaming/amdtp/AmdtpPort.cpp \
180         libstreaming/amdtp/AmdtpPortInfo.cpp \
181         libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \
182         libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \
183 ' )
184
185 libavc_source = env.Split( '\
186         libavc/streamformat/avc_extended_stream_format.cpp \
187         libavc/musicsubunit/avc_descriptor_music.cpp \
188         libavc/musicsubunit/avc_musicsubunit.cpp \
189         libavc/audiosubunit/avc_audiosubunit.cpp \
190         libavc/audiosubunit/avc_descriptor_audio.cpp \
191         libavc/audiosubunit/avc_function_block.cpp \
192         libavc/descriptors/avc_descriptor_cmd.cpp \
193         libavc/descriptors/avc_descriptor.cpp \
194         libavc/general/avc_extended_subunit_info.cpp \
195         libavc/general/avc_unit_info.cpp \
196         libavc/general/avc_generic.cpp \
197         libavc/general/avc_subunit_info.cpp \
198         libavc/general/avc_connect.cpp \
199         libavc/general/avc_signal_format.cpp \
200         libavc/general/avc_extended_cmd_generic.cpp \
201         libavc/general/avc_extended_plug_info.cpp \
202         libavc/general/avc_plug_info.cpp \
203         libavc/general/avc_unit.cpp \
204         libavc/general/avc_subunit.cpp \
205         libavc/general/avc_plug.cpp \
206         libavc/general/avc_vendor_dependent_cmd.cpp \
207         libavc/avc_definitions.cpp \
208         libavc/ccm/avc_signal_source.cpp \
209 ' )
210
211 source = ffado_source
212 pkgdata = []
213 if env['ENABLE_BEBOB']:
214         libenv.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] )
215         source += bebob_source
216         pkgdata += bebob_pkgdata
217 if env['ENABLE_MAUDIO']:
218         libenv.AppendUnique( CCFLAGS=["-DENABLE_MAUDIO"] )
219         source += maudio_source
220         pkgdata += maudio_pkgdata
221 if env['ENABLE_FIREWORKS']:
222         libenv.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] )
223         source += fireworks_source
224         pkgdata += fireworks_pkgdata
225 if env['ENABLE_OXFORD']:
226         libenv.AppendUnique( CCFLAGS=["-DENABLE_OXFORD"] )
227         source += oxford_source
228         pkgdata += oxford_pkgdata
229 if env['ENABLE_MOTU']:
230         libenv.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] )
231         source += motu_source
232 if env['ENABLE_DICE']:
233         libenv.AppendUnique( CCFLAGS=["-DENABLE_DICE"] )
234         source += dice_source
235 if env['ENABLE_METRIC_HALO']:
236         libenv.AppendUnique( CCFLAGS=["-DENABLE_METRIC_HALO"] )
237         source += metric_halo_source
238 if env['ENABLE_RME']:
239         libenv.AppendUnique( CCFLAGS=["-DENABLE_RME"] )
240         source += rme_source
241 if env['ENABLE_BOUNCE']:
242         libenv.AppendUnique( CCFLAGS=["-DENABLE_BOUNCE"] )
243         source += bounce_source
244
245 # The list of devices needing GENERICAVC is controlled in ../SConstruct
246 if env['ENABLE_GENERICAVC']:
247         libenv.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] )
248         source += libavc_source
249         source += amdtp_source
250         source += genericavc_source
251         pkgdata += genericavc_pkgdata
252
253 if not env.GetOption( "clean" ):
254         libenv.MergeFlags( "-lrt" )
255         libenv.MergeFlags( env['LIBRAW1394_FLAGS'] )
256         libenv.MergeFlags( env['LIBIEC61883_FLAGS'] )
257         if not env['SERIALIZE_USE_EXPAT']:
258                 libenv.MergeFlags( env['LIBXML26_FLAGS'] )
259         else:
260                 libenv.PrependUnique( LIBS=["expat"] )
261         if env['REQUIRE_LIBAVC']:
262                 libenv.MergeFlags( env['LIBAVC1394_FLAGS'] )
263
264 # add the libconfig
265 libenv.AppendUnique( CPPPATH=["#/external/libconfig"] )
266 libenv.PrependUnique( LIBPATH=[env['build_base']+"external/libconfig"] )
267 libenv.PrependUnique( LIBS=["libconfigpp"] )
268
269 #env1.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,-soname -Wl,libffado.so.1 --version-info=1:0:0") )
270 ffadolib = libenv.SharedLibrary( "ffado", source )
271
272 if libenv['BUILD_STATIC_LIB']:
273     ffadolib_static = libenv.StaticLibrary( "ffado", source )
274
275 #
276 # All the following tries to emulate the versioning of installed libs as seen from libtool...
277 #
278 if False:
279         print "Trying to emulate libtools versioned install"
280         libenv.Alias( "install", libenv.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) )
281         libenv.Ignore( ffadolib, os.path.join('$libdir','libffado.so') )
282         #env.Ignore( os.path.join('$libdir','libffado.so'), ffadolib )
283         #env.Ignore( os.path.join('$libdir','libffado.so.0'), "install" )
284
285         libenv.Alias( "install", libenv.Command(
286                 target="$libdir/libffado.so",
287                 source=libenv['libdir']+"/libffado.so.$LIBVERSION",
288                 action="ln -s $SOURCE $TARGET"
289                 ) )
290         libenv.Alias( "install", libenv.Command(
291                 target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',1)[0],
292                 source=libenv['libdir']+"/libffado.so.$LIBVERSION",
293                 action="ln -s $SOURCE $TARGET"
294                 ) )
295         libenv.Alias( "install", libenv.Command(
296                 target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',2)[0],
297                 source=libenv['libdir']+"/libffado.so.$LIBVERSION",
298                 action="ln -s $SOURCE $TARGET"
299                 ) )
300 else:
301         #print "Doing simple install"
302         libenv.Install( "$libdir", ffadolib )
303
304 #
305 # Install the pkgdata to $sharedir
306 #
307 for data in pkgdata:
308         libenv.Install( "$sharedir", data )
309
310 #
311 # For the debugging apps
312 #
313 env2 = libenv.Clone()
314 env2.PrependUnique( LIBPATH=env['build_base']+"src" )
315 env2.PrependUnique( LIBS="ffado" )
316
317 apps = { \
318         "test-debugmodule" : "debugmodule/test_debugmodule.cpp", \
319         "test-dll" : "libutil/test-dll.cpp", \
320         "test-unittests-util" : "libutil/unittests.cpp", \
321         "test-cyclecalc" : "libieee1394/test-cyclecalc.cpp", \
322 }
323
324 installapps = []
325
326 for app in apps.keys():
327         env2.Program( target=app, source = env.Split( apps[app] ) )
328         if app.find( "test" ) == -1:
329                 env2.Install( "$bindir", app )
330
Note: See TracBrowser for help on using the browser.