#!/usr/bin/python from clam_build_helpers import * import os, sys Import('audioio_env version install_dirs crosscompiling') def define_module_contents(env) : if not os.path.exists('src') : os.mkdir('src') if not os.path.exists('include' ) : os.makedirs('include/CLAM') folders = [ 'src/Processing/AudioFileIO', 'src/Processing/AudioIO', 'src/Processing/MIDIIO', 'src/Tools/MIDIIO', 'src/Tools/MIDIIO/File', 'src/Tools/MIDIIO/TextFile', 'src/Tools/AudioIO', 'src/Tools/AudioFileIO', 'src/Processing/AudioIO*.*xx', 'src/Flow/Networks/BlockingNetworkPlayer*.*xx', 'src/Flow/Networks/FreewheelingNetworkPlayer.*xx', 'src/System/Application', ] blacklist = [] if env.has_key('with_jack') and env['with_jack'] == True: folders.append('src/Flow/Networks/JACKNetworkPlayer*.*xx') if not env.has_key('with_mad') or not env['with_mad']: blacklist += ['Mpeg'] if not env.has_key('with_oggvorbis') or not env['with_oggvorbis']: blacklist += ['Vorbis'] if env['with_portaudio'] : folders.append('src/Flow/Networks/PANetworkPlayer*.*xx') if env['with_portmidi'] : folders.append( 'src/Tools/MIDIIO/PortMIDI' ) if crosscompiling : pass elif sys.platform == 'linux2' : if env['with_alsa'] : folders.append( 'src/Tools/MIDIIO/Linux' ) folders.append( 'src/Tools/AudioIO/Linux') elif False and sys.platform == 'win32' : if env['audio_backend'] == 'rtaudio' : print('using rtaudio') folders += ['src/Tools/AudioIO/RtAudio'] #, 'src/Defines/Windows/CLAM_windows.h'] elif env['audio_backend'] == 'directx' : print('using directx') folders += [ 'src/Tools/AudioIO/Windows/DirectXAudioDevice.cxx', 'src/Tools/AudioIO/Windows/DXFullDuplex.*xx', ] elif env['audio_backend'] == 'portaudio' : print('using portaudio') folders += [ 'src/Tools/AudioIO/Windows/PAAudio*.*xx', 'src/Tools/AudioIO/Windows/PACLAM*.*xx', 'src/Tools/AudioIO/Windows/PortAudioUtils.*', 'src/Tools/AudioIO/Windows/DoubleBuffer.*xx', ] else : if env['audio_backend'] == 'rtaudio' : print('using rtaudio2') folders += ['src/Tools/AudioIO/RtAudio'] env.Append( LINKFLAGS=['-framework','CoreAudio'] ) elif audioio_env['audio_backend'] == 'portaudio' : print('using portaudio') # folders += ['src/Flow/Networks/PANetworkPlayer*.*xx'] blacklist += [ 'foo.cxx', 'main.cxx', 'GUIAudioApplication.*xx', ] env.AppendUnique(LDFLAGS=["-Wl,--exclude-libs,ogg.lib"]) file_retriever = FileRetriever( '../../..', folders, blacklist ) file_retriever.scan_without_copy() realHeaders = [] for orig,target in file_retriever.origTargetHeaders : env.CopyFileAndUpdateIncludes(target, orig) realHeaders.append(target) realSources = [] for orig,target in file_retriever.origTargetSources: env.CopyFileAndUpdateIncludes(target,orig) realSources.append(target) return realHeaders, realSources realHeaders, realSources = define_module_contents(audioio_env) moduleDependencies = ['core','processing'] lib_tgt, install_tgt = lib_rules( 'audioio', version, realHeaders, realSources, install_dirs, audioio_env, moduleDependencies ) Return( 'lib_tgt', 'install_tgt' )