| 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.Copy() |
|---|
| 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/PacketBuffer.cpp \ |
|---|
| 76 |
libutil/OptionContainer.cpp \ |
|---|
| 77 |
libutil/PosixMutex.cpp \ |
|---|
| 78 |
libutil/PosixThread.cpp \ |
|---|
| 79 |
libutil/ringbuffer.c \ |
|---|
| 80 |
libutil/serialize.cpp \ |
|---|
| 81 |
libutil/StreamStatistics.cpp \ |
|---|
| 82 |
libutil/SystemTimeSource.cpp \ |
|---|
| 83 |
libutil/TimestampedBuffer.cpp \ |
|---|
| 84 |
libutil/Watchdog.cpp \ |
|---|
| 85 |
libcontrol/Element.cpp \ |
|---|
| 86 |
libcontrol/BasicElements.cpp \ |
|---|
| 87 |
libcontrol/MatrixMixer.cpp \ |
|---|
| 88 |
libcontrol/ClockSelect.cpp \ |
|---|
| 89 |
libcontrol/Nickname.cpp \ |
|---|
| 90 |
') |
|---|
| 91 |
|
|---|
| 92 |
bebob_source = env.Split( '\ |
|---|
| 93 |
bebob/bebob_avdevice.cpp \ |
|---|
| 94 |
bebob/bebob_avdevice_subunit.cpp \ |
|---|
| 95 |
bebob/bebob_avplug.cpp \ |
|---|
| 96 |
bebob/bebob_dl_bcd.cpp \ |
|---|
| 97 |
bebob/bebob_dl_codes.cpp \ |
|---|
| 98 |
bebob/bebob_dl_mgr.cpp \ |
|---|
| 99 |
bebob/bebob_functionblock.cpp \ |
|---|
| 100 |
bebob/bebob_mixer.cpp \ |
|---|
| 101 |
bebob/focusrite/focusrite_generic.cpp \ |
|---|
| 102 |
bebob/focusrite/focusrite_saffire.cpp \ |
|---|
| 103 |
bebob/focusrite/focusrite_saffirepro.cpp \ |
|---|
| 104 |
bebob/focusrite/focusrite_cmd.cpp \ |
|---|
| 105 |
bebob/terratec/terratec_device.cpp \ |
|---|
| 106 |
bebob/terratec/terratec_cmd.cpp \ |
|---|
| 107 |
bebob/esi/quatafire610.cpp \ |
|---|
| 108 |
maudio/maudio_avdevice.cpp \ |
|---|
| 109 |
' ) |
|---|
| 110 |
bebob_pkgdata = env.Split( '\ |
|---|
| 111 |
maudio/refdesign.xml \ |
|---|
| 112 |
maudio/fw410.xml \ |
|---|
| 113 |
maudio/fwap.xml \ |
|---|
| 114 |
bebob/ffado_driver_bebob.txt \ |
|---|
| 115 |
' ) |
|---|
| 116 |
|
|---|
| 117 |
genericavc_source = env.Split( '\ |
|---|
| 118 |
genericavc/avc_avdevice.cpp \ |
|---|
| 119 |
genericavc/avc_vendormodel.cpp \ |
|---|
| 120 |
' ) |
|---|
| 121 |
|
|---|
| 122 |
genericavc_pkgdata = env.Split( '\ |
|---|
| 123 |
genericavc/ffado_driver_genericavc.txt \ |
|---|
| 124 |
' ) |
|---|
| 125 |
|
|---|
| 126 |
fireworks_source = env.Split( '\ |
|---|
| 127 |
fireworks/fireworks_device.cpp \ |
|---|
| 128 |
fireworks/fireworks_control.cpp \ |
|---|
| 129 |
fireworks/fireworks_firmware.cpp \ |
|---|
| 130 |
fireworks/efc/efc_avc_cmd.cpp \ |
|---|
| 131 |
fireworks/efc/efc_cmd.cpp \ |
|---|
| 132 |
fireworks/efc/efc_cmds_hardware.cpp \ |
|---|
| 133 |
fireworks/efc/efc_cmds_hardware_ctrl.cpp \ |
|---|
| 134 |
fireworks/efc/efc_cmds_flash.cpp \ |
|---|
| 135 |
fireworks/efc/efc_cmds_mixer.cpp \ |
|---|
| 136 |
fireworks/efc/efc_cmds_monitor.cpp \ |
|---|
| 137 |
fireworks/efc/efc_cmds_ioconfig.cpp \ |
|---|
| 138 |
fireworks/audiofire/audiofire_device.cpp \ |
|---|
| 139 |
' ) |
|---|
| 140 |
|
|---|
| 141 |
fireworks_pkgdata = env.Split( '\ |
|---|
| 142 |
fireworks/ffado_driver_fireworks.txt \ |
|---|
| 143 |
' ) |
|---|
| 144 |
|
|---|
| 145 |
motu_source = env.Split( '\ |
|---|
| 146 |
motu/motu_avdevice.cpp \ |
|---|
| 147 |
motu/motu_controls.cpp \ |
|---|
| 148 |
libstreaming/motu/MotuPort.cpp \ |
|---|
| 149 |
libstreaming/motu/MotuPortInfo.cpp \ |
|---|
| 150 |
libstreaming/motu/MotuReceiveStreamProcessor.cpp \ |
|---|
| 151 |
libstreaming/motu/MotuTransmitStreamProcessor.cpp \ |
|---|
| 152 |
' ) |
|---|
| 153 |
|
|---|
| 154 |
dice_source = env.Split( '\ |
|---|
| 155 |
dice/dice_avdevice.cpp \ |
|---|
| 156 |
' ) |
|---|
| 157 |
|
|---|
| 158 |
bounce_source = env.Split( '\ |
|---|
| 159 |
bounce/bounce_avdevice.cpp \ |
|---|
| 160 |
bounce/bounce_slave_avdevice.cpp \ |
|---|
| 161 |
libstreaming/AmdtpSlaveStreamProcessor.cpp \ |
|---|
| 162 |
' ) |
|---|
| 163 |
|
|---|
| 164 |
metric_halo_source = env.Split( '\ |
|---|
| 165 |
metrichalo/mh_avdevice.cpp \ |
|---|
| 166 |
' ) |
|---|
| 167 |
|
|---|
| 168 |
rme_source = env.Split( '\ |
|---|
| 169 |
rme/rme_avdevice.cpp \ |
|---|
| 170 |
' ) |
|---|
| 171 |
|
|---|
| 172 |
amdtp_source = env.Split( '\ |
|---|
| 173 |
libstreaming/amdtp/AmdtpPort.cpp \ |
|---|
| 174 |
libstreaming/amdtp/AmdtpPortInfo.cpp \ |
|---|
| 175 |
libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \ |
|---|
| 176 |
libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \ |
|---|
| 177 |
' ) |
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
source = ffado_source |
|---|
| 181 |
pkgdata = [] |
|---|
| 182 |
if env['ENABLE_BEBOB']: |
|---|
| 183 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] ) |
|---|
| 184 |
source += bebob_source |
|---|
| 185 |
pkgdata += bebob_pkgdata |
|---|
| 186 |
if env['ENABLE_FIREWORKS']: |
|---|
| 187 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] ) |
|---|
| 188 |
source += fireworks_source |
|---|
| 189 |
pkgdata += fireworks_pkgdata |
|---|
| 190 |
if env['ENABLE_MOTU']: |
|---|
| 191 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] ) |
|---|
| 192 |
source += motu_source |
|---|
| 193 |
if env['ENABLE_DICE']: |
|---|
| 194 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_DICE"] ) |
|---|
| 195 |
source += dice_source |
|---|
| 196 |
if env['ENABLE_METRIC_HALO']: |
|---|
| 197 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_METRIC_HALO"] ) |
|---|
| 198 |
source += metric_halo_source |
|---|
| 199 |
if env['ENABLE_RME']: |
|---|
| 200 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_RME"] ) |
|---|
| 201 |
source += rme_source |
|---|
| 202 |
if env['ENABLE_BOUNCE']: |
|---|
| 203 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_BOUNCE"] ) |
|---|
| 204 |
source += bounce_source |
|---|
| 205 |
|
|---|
| 206 |
# The list of devices needing GENERICAVC is controlled in ../SConstruct |
|---|
| 207 |
if env['ENABLE_GENERICAVC']: |
|---|
| 208 |
libenv.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] ) |
|---|
| 209 |
source += amdtp_source |
|---|
| 210 |
source += genericavc_source |
|---|
| 211 |
pkgdata += genericavc_pkgdata |
|---|
| 212 |
|
|---|
| 213 |
if not env.GetOption( "clean" ): |
|---|
| 214 |
libenv.MergeFlags( "-lrt" ) |
|---|
| 215 |
libenv.MergeFlags( env['LIBRAW1394_FLAGS'] ) |
|---|
| 216 |
libenv.MergeFlags( env['LIBAVC1394_FLAGS'] ) |
|---|
| 217 |
libenv.MergeFlags( env['LIBIEC61883_FLAGS'] ) |
|---|
| 218 |
libenv.MergeFlags( env['LIBXML26_FLAGS'] ) |
|---|
| 219 |
|
|---|
| 220 |
#env1.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,-soname -Wl,libffado.so.1 --version-info=1:0:0") ) |
|---|
| 221 |
ffadolib = libenv.SharedLibrary( "ffado", source ) |
|---|
| 222 |
|
|---|
| 223 |
if libenv['BUILD_STATIC_LIB']: |
|---|
| 224 |
ffadolib_static = libenv.StaticLibrary( "ffado", source ) |
|---|
| 225 |
|
|---|
| 226 |
# |
|---|
| 227 |
# All the following tries to emulate the versioning of installed libs as seen from libtool... |
|---|
| 228 |
# |
|---|
| 229 |
if False: |
|---|
| 230 |
print "Trying to emulate libtools versioned install" |
|---|
| 231 |
libenv.Alias( "install", libenv.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) ) |
|---|
| 232 |
libenv.Ignore( ffadolib, os.path.join('$libdir','libffado.so') ) |
|---|
| 233 |
#env.Ignore( os.path.join('$libdir','libffado.so'), ffadolib ) |
|---|
| 234 |
#env.Ignore( os.path.join('$libdir','libffado.so.0'), "install" ) |
|---|
| 235 |
|
|---|
| 236 |
libenv.Alias( "install", libenv.Command( |
|---|
| 237 |
target="$libdir/libffado.so", |
|---|
| 238 |
source=libenv['libdir']+"/libffado.so.$LIBVERSION", |
|---|
| 239 |
action="ln -s $SOURCE $TARGET" |
|---|
| 240 |
) ) |
|---|
| 241 |
libenv.Alias( "install", libenv.Command( |
|---|
| 242 |
target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',1)[0], |
|---|
| 243 |
source=libenv['libdir']+"/libffado.so.$LIBVERSION", |
|---|
| 244 |
action="ln -s $SOURCE $TARGET" |
|---|
| 245 |
) ) |
|---|
| 246 |
libenv.Alias( "install", libenv.Command( |
|---|
| 247 |
target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',2)[0], |
|---|
| 248 |
source=libenv['libdir']+"/libffado.so.$LIBVERSION", |
|---|
| 249 |
action="ln -s $SOURCE $TARGET" |
|---|
| 250 |
) ) |
|---|
| 251 |
else: |
|---|
| 252 |
#print "Doing simple install" |
|---|
| 253 |
libenv.Install( "$libdir", ffadolib ) |
|---|
| 254 |
|
|---|
| 255 |
# |
|---|
| 256 |
# Install the pkgdata to $sharedir |
|---|
| 257 |
# |
|---|
| 258 |
for data in pkgdata: |
|---|
| 259 |
libenv.Install( "$sharedir", data ) |
|---|
| 260 |
|
|---|
| 261 |
# |
|---|
| 262 |
# For the debugging apps |
|---|
| 263 |
# |
|---|
| 264 |
env2 = libenv.Copy() |
|---|
| 265 |
env2.PrependUnique( LIBPATH=env['build_base']+"src" ) |
|---|
| 266 |
env2.PrependUnique( LIBS="ffado" ) |
|---|
| 267 |
|
|---|
| 268 |
apps = { \ |
|---|
| 269 |
"test-debugmodule" : "debugmodule/test_debugmodule.cpp", \ |
|---|
| 270 |
"test-dll" : "libutil/test-dll.cpp", \ |
|---|
| 271 |
"test-unittests-util" : "libutil/unittests.cpp", \ |
|---|
| 272 |
"test-cyclecalc" : "libieee1394/test-cyclecalc.cpp", \ |
|---|
| 273 |
} |
|---|
| 274 |
|
|---|
| 275 |
installapps = [] |
|---|
| 276 |
|
|---|
| 277 |
for app in apps.keys(): |
|---|
| 278 |
env2.Program( target=app, source = env.Split( apps[app] ) ) |
|---|
| 279 |
if app.find( "test" ) == -1: |
|---|
| 280 |
env2.Install( "$bindir", app ) |
|---|
| 281 |
|
|---|