root/trunk/libffado/src/SConscript

Revision 1498, 8.8 kB (checked in by ppalmers, 15 years ago)

Merge all changes from 2.0 branch into trunk (since r1361). This _should_ contain all forward merges done in the mean time. At this moment in time both branches should be in sync.

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