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/configrom.cpp \ |
---|
61 |
libieee1394/csr1212.c \ |
---|
62 |
libieee1394/CycleTimerHelper.cpp \ |
---|
63 |
libieee1394/ieee1394service.cpp \ |
---|
64 |
libieee1394/IEC61883.cpp \ |
---|
65 |
libieee1394/IsoHandler.cpp \ |
---|
66 |
libieee1394/IsoHandlerManager.cpp \ |
---|
67 |
libstreaming/StreamProcessorManager.cpp \ |
---|
68 |
libstreaming/util/cip.c \ |
---|
69 |
libstreaming/generic/StreamProcessor.cpp \ |
---|
70 |
libstreaming/generic/Port.cpp \ |
---|
71 |
libstreaming/generic/PortManager.cpp \ |
---|
72 |
libutil/cmd_serialize.cpp \ |
---|
73 |
libutil/Configuration.cpp \ |
---|
74 |
libutil/OptionContainer.cpp \ |
---|
75 |
libutil/PosixMutex.cpp \ |
---|
76 |
libutil/PosixThread.cpp \ |
---|
77 |
libutil/ringbuffer.c \ |
---|
78 |
libutil/SystemTimeSource.cpp \ |
---|
79 |
libutil/TimestampedBuffer.cpp \ |
---|
80 |
libutil/Watchdog.cpp \ |
---|
81 |
libcontrol/Element.cpp \ |
---|
82 |
libcontrol/BasicElements.cpp \ |
---|
83 |
libcontrol/MatrixMixer.cpp \ |
---|
84 |
libcontrol/ClockSelect.cpp \ |
---|
85 |
libcontrol/Nickname.cpp \ |
---|
86 |
') |
---|
87 |
|
---|
88 |
if env['SERIALIZE_USE_EXPAT']: |
---|
89 |
ffado_source.append('libutil/serialize_expat.cpp') |
---|
90 |
ffado_source.append('libutil/serialize_expat_xml.cpp') |
---|
91 |
else: |
---|
92 |
ffado_source.append('libutil/serialize_libxml.cpp') |
---|
93 |
|
---|
94 |
|
---|
95 |
bebob_source = env.Split( '\ |
---|
96 |
bebob/bebob_avdevice.cpp \ |
---|
97 |
bebob/bebob_avdevice_subunit.cpp \ |
---|
98 |
bebob/bebob_avplug.cpp \ |
---|
99 |
bebob/bebob_dl_bcd.cpp \ |
---|
100 |
bebob/bebob_dl_codes.cpp \ |
---|
101 |
bebob/bebob_dl_mgr.cpp \ |
---|
102 |
bebob/bebob_functionblock.cpp \ |
---|
103 |
bebob/bebob_mixer.cpp \ |
---|
104 |
bebob/focusrite/focusrite_generic.cpp \ |
---|
105 |
bebob/focusrite/focusrite_saffire.cpp \ |
---|
106 |
bebob/focusrite/focusrite_saffirepro.cpp \ |
---|
107 |
bebob/focusrite/focusrite_cmd.cpp \ |
---|
108 |
bebob/terratec/terratec_device.cpp \ |
---|
109 |
bebob/terratec/terratec_cmd.cpp \ |
---|
110 |
bebob/edirol/edirol_fa101.cpp \ |
---|
111 |
bebob/edirol/edirol_fa66.cpp \ |
---|
112 |
bebob/esi/quatafire610.cpp \ |
---|
113 |
bebob/mackie/onyxmixer.cpp \ |
---|
114 |
' ) |
---|
115 |
bebob_pkgdata = env.Split( '\ |
---|
116 |
' ) |
---|
117 |
|
---|
118 |
genericavc_source = env.Split( '\ |
---|
119 |
genericavc/avc_avdevice.cpp \ |
---|
120 |
' ) |
---|
121 |
|
---|
122 |
genericavc_pkgdata = env.Split( '\ |
---|
123 |
' ) |
---|
124 |
|
---|
125 |
fireworks_source = env.Split( '\ |
---|
126 |
fireworks/fireworks_device.cpp \ |
---|
127 |
fireworks/fireworks_control.cpp \ |
---|
128 |
fireworks/fireworks_firmware.cpp \ |
---|
129 |
fireworks/efc/efc_avc_cmd.cpp \ |
---|
130 |
fireworks/efc/efc_cmd.cpp \ |
---|
131 |
fireworks/efc/efc_cmds_hardware.cpp \ |
---|
132 |
fireworks/efc/efc_cmds_hardware_ctrl.cpp \ |
---|
133 |
fireworks/efc/efc_cmds_flash.cpp \ |
---|
134 |
fireworks/efc/efc_cmds_mixer.cpp \ |
---|
135 |
fireworks/efc/efc_cmds_monitor.cpp \ |
---|
136 |
fireworks/efc/efc_cmds_ioconfig.cpp \ |
---|
137 |
fireworks/fireworks_session_block.cpp \ |
---|
138 |
fireworks/audiofire/audiofire_device.cpp \ |
---|
139 |
' ) |
---|
140 |
|
---|
141 |
fireworks_pkgdata = env.Split( '\ |
---|
142 |
' ) |
---|
143 |
|
---|
144 |
motu_source = env.Split( '\ |
---|
145 |
motu/motu_avdevice.cpp \ |
---|
146 |
motu/motu_controls.cpp \ |
---|
147 |
libstreaming/motu/MotuPort.cpp \ |
---|
148 |
libstreaming/motu/MotuPortInfo.cpp \ |
---|
149 |
libstreaming/motu/MotuReceiveStreamProcessor.cpp \ |
---|
150 |
libstreaming/motu/MotuTransmitStreamProcessor.cpp \ |
---|
151 |
' ) |
---|
152 |
|
---|
153 |
amdtp_source = env.Split( '\ |
---|
154 |
libstreaming/amdtp/AmdtpPort.cpp \ |
---|
155 |
libstreaming/amdtp/AmdtpPortInfo.cpp \ |
---|
156 |
libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \ |
---|
157 |
libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \ |
---|
158 |
' ) |
---|
159 |
|
---|
160 |
source = ffado_source |
---|
161 |
pkgdata = [] |
---|
162 |
if env['ENABLE_BEBOB']: |
---|
163 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] ) |
---|
164 |
source += bebob_source |
---|
165 |
pkgdata += bebob_pkgdata |
---|
166 |
if env['ENABLE_FIREWORKS']: |
---|
167 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] ) |
---|
168 |
source += fireworks_source |
---|
169 |
pkgdata += fireworks_pkgdata |
---|
170 |
if env['ENABLE_MOTU']: |
---|
171 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] ) |
---|
172 |
source += motu_source |
---|
173 |
|
---|
174 |
# The list of devices needing GENERICAVC is controlled in ../SConstruct |
---|
175 |
if env['ENABLE_GENERICAVC']: |
---|
176 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] ) |
---|
177 |
source += amdtp_source |
---|
178 |
source += genericavc_source |
---|
179 |
pkgdata += genericavc_pkgdata |
---|
180 |
|
---|
181 |
if not env.GetOption( "clean" ): |
---|
182 |
libenv.MergeFlags( "-lrt" ) |
---|
183 |
libenv.MergeFlags( env['LIBRAW1394_FLAGS'] ) |
---|
184 |
libenv.MergeFlags( env['LIBIEC61883_FLAGS'] ) |
---|
185 |
if not env['SERIALIZE_USE_EXPAT']: |
---|
186 |
libenv.MergeFlags( env['LIBXML26_FLAGS'] ) |
---|
187 |
else: |
---|
188 |
libenv.PrependUnique( LIBS=["expat"] ) |
---|
189 |
|
---|
190 |
# add the libconfig |
---|
191 |
libenv.AppendUnique( CPPPATH=["#/external/libconfig"] ) |
---|
192 |
libenv.PrependUnique( LIBPATH=[env['build_base']+"external/libconfig"] ) |
---|
193 |
libenv.PrependUnique( LIBS=["libconfigpp"] ) |
---|
194 |
|
---|
195 |
libname_versioned = "libffado.so.%s" % libenv['VERSION'] |
---|
196 |
libname_versioned_short = "libffado.so.%s" % libenv['VERSION'].split('.')[0] |
---|
197 |
|
---|
198 |
libenv.AppendUnique( LINKFLAGS = env.Split("-Wl,-soname=%s" % libname_versioned_short) ) |
---|
199 |
ffadolib = libenv.SharedLibrary( "ffado", source ) |
---|
200 |
|
---|
201 |
#libenv.Install( "$libdir", ffadolib ) |
---|
202 |
installer = libenv.InstallAs ( "$libdir/%s" % libname_versioned , ffadolib ) |
---|
203 |
|
---|
204 |
# if stripping would be something for us |
---|
205 |
#libenv.AddPostAction(installer, [['strip', env['STRIPFLAGS'], t[0].path]]) |
---|
206 |
|
---|
207 |
# make the required links |
---|
208 |
libenv.NoCache( '$libdir/%s' % libname_versioned ) |
---|
209 |
libenv.AddPostAction(installer, [['rm', '-f', '$libdir/libffado.so', '$libdir/%s' % libname_versioned_short], |
---|
210 |
['cd', '$libdir', |
---|
211 |
'&&','ln', '-s', libname_versioned_short, 'libffado.so', |
---|
212 |
'&&','ln', '-s', installer[0].name, libname_versioned_short, |
---|
213 |
] |
---|
214 |
]) |
---|
215 |
|
---|
216 |
if libenv['BUILD_STATIC_LIB']: |
---|
217 |
ffadolib_static = libenv.StaticLibrary( "ffado", source ) |
---|
218 |
|
---|
219 |
# |
---|
220 |
# Install the pkgdata to $sharedir |
---|
221 |
# |
---|
222 |
for data in pkgdata: |
---|
223 |
libenv.Install( "$sharedir", data ) |
---|
224 |
|
---|
225 |
# |
---|
226 |
# For the debugging apps |
---|
227 |
# |
---|
228 |
env2 = libenv.Clone() |
---|
229 |
env2.PrependUnique( LIBPATH=env['build_base']+"src" ) |
---|
230 |
env2.PrependUnique( LIBS="ffado" ) |
---|
231 |
|
---|
232 |
apps = { \ |
---|
233 |
} |
---|
234 |
|
---|
235 |
installapps = [] |
---|
236 |
|
---|
237 |
for app in apps.keys(): |
---|
238 |
env2.Program( target=app, source = env.Split( apps[app] ) ) |
---|
239 |
if app.find( "test" ) == -1: |
---|
240 |
env2.Install( "$bindir", app ) |
---|
241 |
|
---|