# # Copyright (C) 2007-2008 Arnold Krille # Copyright (C) 2007-2008 Pieter Palmers # # This file is part of FFADO # FFADO = Free Firewire (pro-)audio drivers for linux # # FFADO is based upon FreeBoB. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # import os Import( 'env' ) env.AppendUnique( CPPPATH=["#/", "#/src"] ) libenv = env.Copy() ffado_source = env.Split( '\ devicemanager.cpp \ ffado.cpp \ ffadodevice.cpp \ debugmodule/debugmodule.cpp \ DeviceStringParser.cpp \ libavc/streamformat/avc_extended_stream_format.cpp \ libavc/musicsubunit/avc_descriptor_music.cpp \ libavc/musicsubunit/avc_musicsubunit.cpp \ libavc/audiosubunit/avc_audiosubunit.cpp \ libavc/audiosubunit/avc_function_block.cpp \ libavc/descriptors/avc_descriptor_cmd.cpp \ libavc/descriptors/avc_descriptor.cpp \ libavc/general/avc_extended_subunit_info.cpp \ libavc/general/avc_unit_info.cpp \ libavc/general/avc_generic.cpp \ libavc/general/avc_subunit_info.cpp \ libavc/general/avc_connect.cpp \ libavc/general/avc_signal_format.cpp \ libavc/general/avc_extended_cmd_generic.cpp \ libavc/general/avc_extended_plug_info.cpp \ libavc/general/avc_plug_info.cpp \ libavc/general/avc_unit.cpp \ libavc/general/avc_subunit.cpp \ libavc/general/avc_plug.cpp \ libavc/general/avc_vendor_dependent_cmd.cpp \ libavc/avc_definitions.cpp \ libavc/ccm/avc_signal_source.cpp \ libieee1394/ARMHandler.cpp \ libieee1394/configrom.cpp \ libieee1394/csr1212.c \ libieee1394/CycleTimerHelper.cpp \ libieee1394/ieee1394service.cpp \ libieee1394/IEC61883.cpp \ libieee1394/IsoHandler.cpp \ libieee1394/IsoHandlerManager.cpp \ libstreaming/StreamProcessorManager.cpp \ libstreaming/util/cip.c \ libstreaming/generic/StreamProcessor.cpp \ libstreaming/generic/Port.cpp \ libstreaming/generic/PortManager.cpp \ libutil/cmd_serialize.cpp \ libutil/DelayLockedLoop.cpp \ libutil/PacketBuffer.cpp \ libutil/OptionContainer.cpp \ libutil/PosixMutex.cpp \ libutil/PosixThread.cpp \ libutil/ringbuffer.c \ libutil/StreamStatistics.cpp \ libutil/SystemTimeSource.cpp \ libutil/TimestampedBuffer.cpp \ libutil/Watchdog.cpp \ libcontrol/Element.cpp \ libcontrol/BasicElements.cpp \ libcontrol/MatrixMixer.cpp \ libcontrol/ClockSelect.cpp \ libcontrol/Nickname.cpp \ ') if env['SERIALIZE_USE_EXPAT']: ffado_source.append('libutil/serialize_expat.cpp') ffado_source.append('libutil/serialize_expat_xml.cpp') else: ffado_source.append('libutil/serialize_libxml.cpp') bebob_source = env.Split( '\ bebob/bebob_avdevice.cpp \ bebob/bebob_avdevice_subunit.cpp \ bebob/bebob_avplug.cpp \ bebob/bebob_dl_bcd.cpp \ bebob/bebob_dl_codes.cpp \ bebob/bebob_dl_mgr.cpp \ bebob/bebob_functionblock.cpp \ bebob/bebob_mixer.cpp \ bebob/focusrite/focusrite_generic.cpp \ bebob/focusrite/focusrite_saffire.cpp \ bebob/focusrite/focusrite_saffirepro.cpp \ bebob/focusrite/focusrite_cmd.cpp \ bebob/terratec/terratec_device.cpp \ bebob/terratec/terratec_cmd.cpp \ bebob/esi/quatafire610.cpp \ maudio/maudio_avdevice.cpp \ ' ) bebob_pkgdata = env.Split( '\ maudio/refdesign.xml \ maudio/fw410.xml \ maudio/fwap.xml \ bebob/ffado_driver_bebob.txt \ ' ) genericavc_source = env.Split( '\ genericavc/avc_avdevice.cpp \ genericavc/avc_vendormodel.cpp \ ' ) genericavc_pkgdata = env.Split( '\ genericavc/ffado_driver_genericavc.txt \ ' ) fireworks_source = env.Split( '\ fireworks/fireworks_device.cpp \ fireworks/fireworks_control.cpp \ fireworks/fireworks_firmware.cpp \ fireworks/efc/efc_avc_cmd.cpp \ fireworks/efc/efc_cmd.cpp \ fireworks/efc/efc_cmds_hardware.cpp \ fireworks/efc/efc_cmds_hardware_ctrl.cpp \ fireworks/efc/efc_cmds_flash.cpp \ fireworks/efc/efc_cmds_mixer.cpp \ fireworks/efc/efc_cmds_monitor.cpp \ fireworks/efc/efc_cmds_ioconfig.cpp \ fireworks/audiofire/audiofire_device.cpp \ ' ) fireworks_pkgdata = env.Split( '\ fireworks/ffado_driver_fireworks.txt \ ' ) motu_source = env.Split( '\ motu/motu_avdevice.cpp \ motu/motu_controls.cpp \ libstreaming/motu/MotuPort.cpp \ libstreaming/motu/MotuPortInfo.cpp \ libstreaming/motu/MotuReceiveStreamProcessor.cpp \ libstreaming/motu/MotuTransmitStreamProcessor.cpp \ ' ) dice_source = env.Split( '\ dice/dice_avdevice.cpp \ ' ) bounce_source = env.Split( '\ bounce/bounce_avdevice.cpp \ bounce/bounce_slave_avdevice.cpp \ libstreaming/AmdtpSlaveStreamProcessor.cpp \ ' ) metric_halo_source = env.Split( '\ metrichalo/mh_avdevice.cpp \ ' ) rme_source = env.Split( '\ rme/rme_avdevice.cpp \ ' ) amdtp_source = env.Split( '\ libstreaming/amdtp/AmdtpPort.cpp \ libstreaming/amdtp/AmdtpPortInfo.cpp \ libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp \ libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp \ ' ) source = ffado_source pkgdata = [] if env['ENABLE_BEBOB']: libenv.AppendUnique( CCFLAGS=["-DENABLE_BEBOB"] ) source += bebob_source pkgdata += bebob_pkgdata if env['ENABLE_FIREWORKS']: libenv.AppendUnique( CCFLAGS=["-DENABLE_FIREWORKS"] ) source += fireworks_source pkgdata += fireworks_pkgdata if env['ENABLE_MOTU']: libenv.AppendUnique( CCFLAGS=["-DENABLE_MOTU"] ) source += motu_source if env['ENABLE_DICE']: libenv.AppendUnique( CCFLAGS=["-DENABLE_DICE"] ) source += dice_source if env['ENABLE_METRIC_HALO']: libenv.AppendUnique( CCFLAGS=["-DENABLE_METRIC_HALO"] ) source += metric_halo_source if env['ENABLE_RME']: libenv.AppendUnique( CCFLAGS=["-DENABLE_RME"] ) source += rme_source if env['ENABLE_BOUNCE']: libenv.AppendUnique( CCFLAGS=["-DENABLE_BOUNCE"] ) source += bounce_source # The list of devices needing GENERICAVC is controlled in ../SConstruct if env['ENABLE_GENERICAVC']: libenv.AppendUnique( CCFLAGS=["-DENABLE_GENERICAVC"] ) source += amdtp_source source += genericavc_source pkgdata += genericavc_pkgdata if not env.GetOption( "clean" ): libenv.MergeFlags( "-lrt" ) libenv.MergeFlags( env['LIBRAW1394_FLAGS'] ) libenv.MergeFlags( env['LIBAVC1394_FLAGS'] ) libenv.MergeFlags( env['LIBIEC61883_FLAGS'] ) if not env['SERIALIZE_USE_EXPAT']: libenv.MergeFlags( env['LIBXML26_FLAGS'] ) else: libenv.PrependUnique( LIBS=["expat"] ) #env1.AppendUnique( LINKFLAGS = env.Split("-Wl,-rpath $libdir -Wl,-soname -Wl,libffado.so.1 --version-info=1:0:0") ) ffadolib = libenv.SharedLibrary( "ffado", source ) if libenv['BUILD_STATIC_LIB']: ffadolib_static = libenv.StaticLibrary( "ffado", source ) # # All the following tries to emulate the versioning of installed libs as seen from libtool... # if False: print "Trying to emulate libtools versioned install" libenv.Alias( "install", libenv.InstallAs( os.path.join('$libdir','libffado.so.$LIBVERSION'), ffadolib ) ) libenv.Ignore( ffadolib, os.path.join('$libdir','libffado.so') ) #env.Ignore( os.path.join('$libdir','libffado.so'), ffadolib ) #env.Ignore( os.path.join('$libdir','libffado.so.0'), "install" ) libenv.Alias( "install", libenv.Command( target="$libdir/libffado.so", source=libenv['libdir']+"/libffado.so.$LIBVERSION", action="ln -s $SOURCE $TARGET" ) ) libenv.Alias( "install", libenv.Command( target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',1)[0], source=libenv['libdir']+"/libffado.so.$LIBVERSION", action="ln -s $SOURCE $TARGET" ) ) libenv.Alias( "install", libenv.Command( target="$libdir/libffado.so.%s" % str(libenv['LIBVERSION']).rsplit('.',2)[0], source=libenv['libdir']+"/libffado.so.$LIBVERSION", action="ln -s $SOURCE $TARGET" ) ) else: #print "Doing simple install" libenv.Install( "$libdir", ffadolib ) # # Install the pkgdata to $sharedir # for data in pkgdata: libenv.Install( "$sharedir", data ) # # For the debugging apps # env2 = libenv.Copy() env2.PrependUnique( LIBPATH=env['build_base']+"src" ) env2.PrependUnique( LIBS="ffado" ) apps = { \ "test-debugmodule" : "debugmodule/test_debugmodule.cpp", \ "test-dll" : "libutil/test-dll.cpp", \ "test-unittests-util" : "libutil/unittests.cpp", \ "test-cyclecalc" : "libieee1394/test-cyclecalc.cpp", \ } installapps = [] for app in apps.keys(): env2.Program( target=app, source = env.Split( apps[app] ) ) if app.find( "test" ) == -1: env2.Install( "$bindir", app )