2 # Copyright (C) 2007-2008 Arnold Krille
3 # Copyright (C) 2007-2008 Pieter Palmers
5 # This file is part of FFADO
6 # FFADO = Free Firewire (pro-)audio drivers for linux
8 # FFADO is based upon FreeBoB.
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.
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.
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/>.
30 libenv.MergeFlags( "-I#/ -I#/src" )
32 ffado_source = env.Split( '\
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 \
73 if env['SERIALIZE_USE_EXPAT']:
74 ffado_source.append('libutil/serialize_expat.cpp')
75 ffado_source.append('libutil/serialize_expat_xml.cpp')
77 ffado_source.append('libutil/serialize_libxml.cpp')
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 bebob/yamaha/yamaha_cmd.cpp \
99 bebob/yamaha/yamaha_avdevice.cpp \
100 bebob/maudio/maudio_normal_avdevice.cpp \
101 bebob/presonus/firebox_avdevice.cpp \
102 bebob/presonus/inspire1394_avdevice.cpp \
105 bebob_pkgdata = env.Split( '\
106 bebob/maudio/refdesign.xml \
107 bebob/maudio/fw410.xml \
108 bebob/maudio/fwap.xml \
111 genericavc_source = env.Split( '\
112 genericavc/avc_avdevice.cpp \
113 genericavc/stanton/scs.cpp \
116 genericavc_pkgdata = env.Split( '\
119 fireworks_source = env.Split( '\
120 fireworks/fireworks_device.cpp \
121 fireworks/fireworks_control.cpp \
122 fireworks/fireworks_firmware.cpp \
123 fireworks/efc/efc_avc_cmd.cpp \
124 fireworks/efc/efc_cmd.cpp \
125 fireworks/efc/efc_cmds_hardware.cpp \
126 fireworks/efc/efc_cmds_hardware_ctrl.cpp \
127 fireworks/efc/efc_cmds_flash.cpp \
128 fireworks/efc/efc_cmds_mixer.cpp \
129 fireworks/efc/efc_cmds_monitor.cpp \
130 fireworks/efc/efc_cmds_ioconfig.cpp \
131 fireworks/fireworks_session_block.cpp \
132 fireworks/audiofire/audiofire_device.cpp \
135 fireworks_pkgdata = env.Split( '\
138 oxford_source = env.Split( '\
139 oxford/oxford_device.cpp \
140 libstreaming/amdtp-oxford/AmdtpOxfordReceiveStreamProcessor.cpp \
143 oxford_pkgdata = env.Split( '\
146 motu_source = env.Split( '\
147 motu/motu_avdevice.cpp \
148 motu/motu_controls.cpp \
149 motu/motu_mark3_controls.cpp \
150 motu/motu_mixerdefs.cpp \
151 motu/motu_mark3_mixerdefs.cpp \
152 motu/motu_mixer.cpp \
153 libstreaming/motu/MotuPort.cpp \
154 libstreaming/motu/MotuPortInfo.cpp \
155 libstreaming/motu/MotuReceiveStreamProcessor.cpp \
156 libstreaming/motu/MotuTransmitStreamProcessor.cpp \
159 dice_source = env.Split( '\
160 dice/dice_avdevice.cpp \
161 dice/dice_firmware_loader.cpp \
163 dice/focusrite/focusrite_eap.cpp \
164 dice/focusrite/saffire_pro40.cpp \
165 dice/focusrite/saffire_pro24.cpp \
166 dice/focusrite/saffire_pro14.cpp \
167 dice/maudio/profire_2626.cpp \
168 dice/presonus/firestudio_tube.cpp \
169 dice/presonus/firestudio_project.cpp \
172 bounce_source = env.Split( '\
173 bounce/bounce_avdevice.cpp \
174 bounce/bounce_slave_avdevice.cpp \
177 metric_halo_source = env.Split( '\
178 metrichalo/mh_avdevice.cpp \
181 rme_source = env.Split( '\
183 rme/rme_avdevice.cpp \
184 rme/rme_avdevice_settings.cpp \
185 rme/fireface_flash.cpp \
186 rme/fireface_hw.cpp \
187 rme/fireface_settings_ctrls.cpp \
188 libstreaming/rme/RmePort.cpp \
189 libstreaming/rme/RmePortInfo.cpp \
190 libstreaming/rme/RmeReceiveStreamProcessor.cpp \
191 libstreaming/rme/RmeTransmitStreamProcessor.cpp \
194 digidesign_source = env.Split( '\
195 digidesign/digidesign_avdevice.cpp \
196 libstreaming/digidesign/DigidesignPort.cpp \
197 libstreaming/digidesign/DigidesignPortInfo.cpp \
198 libstreaming/digidesign/DigidesignReceiveStreamProcessor.cpp \
199 libstreaming/digidesign/DigidesignTransmitStreamProcessor.cpp \
202 amdtp_source = env.Split( '\
203 libstreaming/amdtp/AmdtpPort.cpp \
204 libstreaming/amdtp/AmdtpPortInfo.cpp \
205 libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \
206 libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \
209 libavc_source = env.Split( '\
210 libavc/streamformat/avc_extended_stream_format.cpp \
211 libavc/musicsubunit/avc_descriptor_music.cpp \
212 libavc/musicsubunit/avc_musicsubunit.cpp \
213 libavc/audiosubunit/avc_audiosubunit.cpp \
214 libavc/audiosubunit/avc_descriptor_audio.cpp \
215 libavc/audiosubunit/avc_function_block.cpp \
216 libavc/descriptors/avc_descriptor_cmd.cpp \
217 libavc/descriptors/avc_descriptor.cpp \
218 libavc/general/avc_extended_subunit_info.cpp \
219 libavc/general/avc_unit_info.cpp \
220 libavc/general/avc_generic.cpp \
221 libavc/general/avc_subunit_info.cpp \
222 libavc/general/avc_connect.cpp \
223 libavc/general/avc_signal_format.cpp \
224 libavc/general/avc_extended_cmd_generic.cpp \
225 libavc/general/avc_extended_plug_info.cpp \
226 libavc/general/avc_plug_info.cpp \
227 libavc/general/avc_unit.cpp \
228 libavc/general/avc_subunit.cpp \
229 libavc/general/avc_plug.cpp \
230 libavc/general/avc_vendor_dependent_cmd.cpp \
231 libavc/avc_definitions.cpp \
232 libavc/ccm/avc_signal_source.cpp \
235 source = ffado_source
237 if env['ENABLE_BEBOB']:
238 env['ENABLE_GENERICAVC'] = True
239 libenv.MergeFlags( "-DENABLE_BEBOB" )
240 source += bebob_source
241 pkgdata += bebob_pkgdata
242 if env['ENABLE_FIREWORKS']:
243 env['ENABLE_GENERICAVC'] = True
244 libenv.MergeFlags( "-DENABLE_FIREWORKS" )
245 source += fireworks_source
246 pkgdata += fireworks_pkgdata
247 if env['ENABLE_OXFORD']:
248 env['ENABLE_GENERICAVC'] = True
249 libenv.MergeFlags( "-DENABLE_OXFORD" )
250 source += oxford_source
251 pkgdata += oxford_pkgdata
252 if env['ENABLE_MOTU']:
253 libenv.MergeFlags( "-DENABLE_MOTU" )
254 source += motu_source
255 if env['ENABLE_DICE']:
256 env['ENABLE_GENERICAVC'] = True
257 libenv.MergeFlags( "-DENABLE_DICE" )
258 source += dice_source
259 if env['ENABLE_METRIC_HALO']:
260 libenv.MergeFlags( "-DENABLE_METRIC_HALO" )
261 source += metric_halo_source
262 if env['ENABLE_RME']:
263 libenv.MergeFlags( "-DENABLE_RME" )
265 if env['ENABLE_DIGIDESIGN']:
266 libenv.MergeFlags( "-DENABLE_DIGIDESIGN" )
267 source += digidesign_source
268 if env['ENABLE_BOUNCE']:
269 env['ENABLE_GENERICAVC'] = True
270 libenv.MergeFlags( "-DENABLE_BOUNCE" )
271 source += bounce_source
273 if env['ENABLE_GENERICAVC']:
274 libenv.MergeFlags( "-DENABLE_GENERICAVC" )
275 source += libavc_source
276 source += amdtp_source
277 source += genericavc_source
278 pkgdata += genericavc_pkgdata
280 if not env.GetOption( "clean" ):
281 libenv.MergeFlags( "-lrt -lpthread" )
282 libenv.MergeFlags( env['LIBRAW1394_FLAGS'] )
283 libenv.MergeFlags( env['LIBIEC61883_FLAGS'] )
284 libenv.MergeFlags( env['LIBCONFIG_FLAGS'] )
285 if not env['SERIALIZE_USE_EXPAT']:
286 libenv.MergeFlags( env['LIBXML26_FLAGS'] )
288 libenv.PrependUnique( LIBS=["expat"] )
289 libenv.MergeFlags( "-DSERIALIZE_USE_EXPAT" )
290 if env['REQUIRE_LIBAVC']:
291 libenv.MergeFlags( env['LIBAVC1394_FLAGS'] )
293 libname_versioned = "libffado.so.%s" % libenv['VERSION']
294 libname_versioned_short = "libffado.so.%s" % libenv['VERSION'].split('.')[0]
296 libenv.MergeFlags( "-Wl,-soname=%s" % libname_versioned_short )
297 ffadolib = libenv.SharedLibrary( "ffado", source )
299 #libenv.Install( "$libdir", ffadolib )
300 installer = libenv.InstallAs ( "$libdir/%s" % libname_versioned , ffadolib )
302 # if stripping would be something for us
303 #libenv.AddPostAction(installer, [['strip', env['STRIPFLAGS'], t[0].path]])
305 # make the required links
306 libenv.NoCache( '$libdir/%s' % libname_versioned )
307 libenv.AddPostAction(installer, [['rm', '-f', '$libdir/libffado.so', '$libdir/%s' % libname_versioned_short],
309 '&&','ln', '-s', libname_versioned_short, 'libffado.so',
310 '&&','ln', '-s', installer[0].name, libname_versioned_short,
314 if libenv['BUILD_STATIC_LIB']:
315 ffadolib_static = libenv.StaticLibrary( "ffado", source )
318 # Install the pkgdata to $sharedir
321 libenv.Install( "$sharedir", data )
324 # For the debugging apps
326 env2 = libenv.Clone()
327 env2.PrependUnique( LIBPATH=env['build_base']+"src" )
328 env2.PrependUnique( LIBS="ffado" )
331 "test-debugmodule" : "debugmodule/test_debugmodule.cpp", \
332 "test-dll" : "libutil/test-dll.cpp", \
333 "test-unittests-util" : "libutil/unittests.cpp", \
334 "test-cyclecalc" : "libieee1394/test-cyclecalc.cpp", \
339 for app in apps.keys():
340 env2.Program( target=app, source = env.Split( apps[app] ) )
341 if app.find( "test" ) == -1:
342 env2.Install( "$bindir", app )