root/trunk/libffado/src/SConscript

Revision 755, 8.5 kB (checked in by ppalmers, 16 years ago)

add a scons option to build static versions of the tools

Line 
1 #
2 # Copyright (C) 2007 Arnold Krille
3 # Copyright (C) 2007 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 3 of the License, or
13 # (at your option) any later version.
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.Copy()
31
32 ffado_source = env.Split( '\
33         devicemanager.cpp \
34         ffado.cpp \
35         ffadodevice.cpp \
36         debugmodule/debugmodule.cpp \
37         libavc/streamformat/avc_extended_stream_format.cpp \
38         libavc/musicsubunit/avc_descriptor_music.cpp \
39         libavc/musicsubunit/avc_musicsubunit.cpp \
40         libavc/audiosubunit/avc_audiosubunit.cpp \
41         libavc/audiosubunit/avc_function_block.cpp \
42         libavc/descriptors/avc_descriptor_cmd.cpp \
43         libavc/descriptors/avc_descriptor.cpp \
44         libavc/general/avc_extended_subunit_info.cpp \
45         libavc/general/avc_unit_info.cpp \
46         libavc/general/avc_generic.cpp \
47         libavc/general/avc_subunit_info.cpp \
48         libavc/general/avc_connect.cpp \
49         libavc/general/avc_signal_format.cpp \
50         libavc/general/avc_extended_cmd_generic.cpp \
51         libavc/general/avc_extended_plug_info.cpp \
52         libavc/general/avc_plug_info.cpp \
53         libavc/general/avc_unit.cpp \
54         libavc/general/avc_subunit.cpp \
55         libavc/general/avc_plug.cpp \
56         libavc/general/avc_vendor_dependent_cmd.cpp \
57         libavc/avc_definitions.cpp \
58         libavc/ccm/avc_signal_source.cpp \
59         libieee1394/ARMHandler.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/DelayLockedLoop.cpp \
74         libutil/PacketBuffer.cpp \
75         libutil/OptionContainer.cpp \
76         libutil/PosixThread.cpp \
77         libutil/ringbuffer.c \
78         libutil/serialize.cpp \
79         libutil/StreamStatistics.cpp \
80         libutil/SystemTimeSource.cpp \
81         libutil/Time.c \
82         libutil/TimeSource.cpp \
83         libutil/TimestampedBuffer.cpp \
84         libcontrol/Element.cpp \
85         libcontrol/BasicElements.cpp \
86         libcontrol/MatrixMixer.cpp \
87 ' )
88
89 bebob_source = env.Split( '\
90         bebob/bebob_avdevice.cpp \
91         bebob/bebob_avdevice_subunit.cpp \
92         bebob/bebob_avplug.cpp \
93         bebob/bebob_dl_bcd.cpp \
94         bebob/bebob_dl_codes.cpp \
95         bebob/bebob_dl_mgr.cpp \
96         bebob/bebob_functionblock.cpp \
97         bebob/bebob_mixer.cpp \
98         bebob/focusrite/focusrite_generic.cpp \
99         bebob/focusrite/focusrite_saffire.cpp \
100         bebob/focusrite/focusrite_saffirepro.cpp \
101         bebob/focusrite/focusrite_cmd.cpp \
102         bebob/terratec/terratec_device.cpp \
103         bebob/terratec/terratec_cmd.cpp \
104         maudio/maudio_avdevice.cpp \
105 ' )
106 bebob_pkgdata = env.Split( '\
107         maudio/refdesign.xml \
108         maudio/fw410.xml \
109         maudio/fwap.xml \
110         bebob/ffado_driver_bebob.txt \
111 ' )
112
113 genericavc_source =  env.Split( '\
114         genericavc/avc_avdevice.cpp \
115         genericavc/avc_vendormodel.cpp \
116 ' )
117
118 genericavc_pkgdata = env.Split( '\
119         genericavc/ffado_driver_genericavc.txt \
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/audiofire/audiofire_device.cpp \
135 ' )
136
137 fireworks_pkgdata =  env.Split( '\
138         fireworks/ffado_driver_fireworks.txt \
139 ' )
140
141 motu_source = env.Split( '\
142         motu/motu_avdevice.cpp \
143         libstreaming/motu/MotuPort.cpp \
144         libstreaming/motu/MotuPortInfo.cpp \
145         libstreaming/motu/MotuReceiveStreamProcessor.cpp \
146         libstreaming/motu/MotuTransmitStreamProcessor.cpp \
147 ' )
148
149 dice_source = env.Split( '\
150         dice/dice_avdevice.cpp \
151 ' )
152
153 bounce_source = env.Split( '\
154         bounce/bounce_avdevice.cpp \
155         bounce/bounce_slave_avdevice.cpp \
156         libstreaming/AmdtpSlaveStreamProcessor.cpp \
157 ' )
158
159 metric_halo_source = env.Split( '\
160         metrichalo/mh_avdevice.cpp \
161 ' )
162
163 rme_source = env.Split( '\
164         rme/rme_avdevice.cpp \
165 ' )
166
167 amdtp_source = env.Split( '\
168         libstreaming/amdtp/AmdtpPort.cpp \
169         libstreaming/amdtp/AmdtpPortInfo.cpp \
170         libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \
171         libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \
172 ' )
173
174 # Explicitly make these files dependent on config.h
175 # to make sure they contain the most recent version
176 # #define's
177 version_dependent_files = [
178     "ffado.os", # external API versioning
179     "libutil/serialize.os", # cache versioning
180     ]
181
182
183 source = ffado_source
184 pkgdata = []
185 if env['ENABLE_BEBOB']:
186         libenv.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] )
187         source += bebob_source
188         pkgdata += bebob_pkgdata
189 if env['ENABLE_FIREWORKS']:
190         libenv.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] )
191         source += fireworks_source
192         pkgdata += fireworks_pkgdata
193 if env['ENABLE_MOTU']:
194         libenv.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] )
195         source += motu_source
196 if env['ENABLE_DICE']:
197         libenv.AppendUnique( CCFLAGS=["-DENABLE_DICE"] )
198         source += dice_source
199 if env['ENABLE_METRIC_HALO']:
200         libenv.AppendUnique( CCFLAGS=["-DENABLE_METRIC_HALO"] )
201         source += metric_halo_source
202 if env['ENABLE_RME']:
203         libenv.AppendUnique( CCFLAGS=["-DENABLE_RME"] )
204         source += rme_source
205 if env['ENABLE_BOUNCE']:
206         libenv.AppendUnique( CCFLAGS=["-DENABLE_BOUNCE"] )
207         source += bounce_source
208
209 # The list of devices needing GENERICAVC is controlled in ../SConstruct
210 if env['ENABLE_GENERICAVC']:
211         libenv.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] )
212         source += amdtp_source
213         source += genericavc_source
214         pkgdata += genericavc_pkgdata
215
216 if not env.GetOption( "clean" ):
217         libenv.MergeFlags( "-lrt" )
218         libenv.MergeFlags( env['LIBRAW1394_FLAGS'] )
219         libenv.MergeFlags( env['LIBAVC1394_FLAGS'] )
220         libenv.MergeFlags( env['LIBIEC61883_FLAGS'] )
221         libenv.MergeFlags( env['ALSA_FLAGS'] )
222         libenv.MergeFlags( env['LIBXML26_FLAGS'] )
223
224 #env1.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,-soname -Wl,libffado.so.1 --version-info=1:0:0") )
225 ffadolib = libenv.SharedLibrary( "ffado", source )
226
227 if libenv['BUILD_STATIC_LIB']:
228     ffadolib_static = libenv.StaticLibrary( "ffado", source )
229
230 for file in version_dependent_files:
231     Depends(file, '#/config.h')
232     NoCache(file)
233     AlwaysBuild(file)
234
235 # FIXME: there has to be a better way
236 AlwaysBuild(ffadolib)
237 NoCache(ffadolib)
238
239 #
240 # All the following tries to emulate the versioning of installed libs as seen from libtool...
241 #
242 if False:
243         print "Trying to emulate libtools versioned install"
244         libenv.Alias( "install", libenv.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) )
245         libenv.Ignore( ffadolib, os.path.join('$libdir','libffado.so') )
246         #env.Ignore( os.path.join('$libdir','libffado.so'), ffadolib )
247         #env.Ignore( os.path.join('$libdir','libffado.so.0'), "install" )
248
249         libenv.Alias( "install", libenv.Command(
250                 target="$libdir/libffado.so",
251                 source=libenv['libdir']+"/libffado.so.$LIBVERSION",
252                 action="ln -s $SOURCE $TARGET"
253                 ) )
254         libenv.Alias( "install", libenv.Command(
255                 target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',1)[0],
256                 source=libenv['libdir']+"/libffado.so.$LIBVERSION",
257                 action="ln -s $SOURCE $TARGET"
258                 ) )
259         libenv.Alias( "install", libenv.Command(
260                 target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',2)[0],
261                 source=libenv['libdir']+"/libffado.so.$LIBVERSION",
262                 action="ln -s $SOURCE $TARGET"
263                 ) )
264 else:
265         #print "Doing simple install"
266         libenv.Install( "$libdir", ffadolib )
267
268 #
269 # Install the pkgdata to $sharedir
270 #
271 for data in pkgdata:
272         libenv.Install( "$sharedir", data )
273
274 #
275 # For the debugging apps
276 #
277 env2 = libenv.Copy()
278 env2.PrependUnique( LIBPATH=env['build_base']+"src" )
279 env2.PrependUnique( LIBS="ffado" )
280
281 apps = { \
282         "test-debugmodule" : "debugmodule/test_debugmodule.cpp", \
283         "test-dll" : "libutil/test-dll.cpp", \
284         "test-unittests-util" : "libutil/unittests.cpp", \
285 }
286
287 installapps = []
288
289 for app in apps.keys():
290         env2.Program( target=app, source = env.Split( apps[app] ) )
291         if app.find( "test" ) == -1:
292                 env2.Install( "$bindir", app )
293
Note: See TracBrowser for help on using the browser.