# SConstruct file for CLAM i/o from buildtools import * from buildtools.include_rename import * from buildtools.pkggen import PackageData from buildtools.file_retriever import FileRetriever from buildtools.rulesets import * import os, sys Import('audioio_env version top install_dirs header_db') def define_module_contents() : print "Gathering necessary source files...", 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'] if audioio_env['with_portmidi'] : folders.append( 'src/Tools/PortMIDI' ) if sys.platform == 'linux2' : if audioio_env['with_alsa'] : folders.append( 'src/Tools/MIDIIO/Linux' ) folders.append( 'src/Tools/AudioIO/Linux') elif sys.platform == 'win32': if audioio_env['audio_backend'] == 'rtaudio' : print('using rtaudio') folders += ['src/Tools/AudioIO/RtAudio'] elif audioio_env['audio_backend'] == 'directx' : print('using directx') folders += ['src/Tools/AudioIO/Windows/DirectXAudioDevice.cxx', 'src/Tools/AudioIO/Windows/DXFullDuplex.*xx'] elif audioio_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 audioio_env['audio_backend'] == 'rtaudio' : print('using rtaudio2') folders += ['src/Tools/AudioIO/RtAudio'] blacklist = [ 'foo.cxx','main.cxx'] file_retriever = FileRetriever( top+'/..', folders, blacklist ) file_retriever.scan() store_headers_in_db( header_db ) for filename in file_retriever.headers : update_includes( header_db, filename ) for filename in file_retriever.sources : update_includes( header_db, filename ) manifest = Manifest() manifest.store( file_retriever.headers, file_retriever.sources ) print "ok" return file_retriever.headers, file_retriever.sources # Module dependencies and tasks if not audioio_env.GetOption('clean') : print """\ ############################################## ### BOOTSTRAPPING CLAM AUDIO I/O LIBRARY ### ##############################################""" print "Creating pkg-config descriptor...", pkg_data = PackageData( 'clam_audioio', version, [] ) pkg_data.create_pkg_descriptor( audioio_env, 'clam_audioio.pc' ) print "ok" if not audioio_env.GetOption('clean') : header_files, source_files = define_module_contents() else : manifest = Manifest() header_files = [] source_files = [] manifest.load( header_files, source_files ) audioio_env.Prepend(CPPPATH=['include','../core/include','../processing/include']) if not audioio_env.GetOption('clean') : handle_preinclude( audioio_env ) audioio_env.Append(LIBS=['clam_core','clam_processing']) audioio_env.Prepend(LIBPATH=['../core','../processing']) audioio_env.Append( ARFLAGS= ['/OPT:NOREF', '/OPT:NOICF', '/DEBUG'] ) headers = [ File(header) for header in header_files ] if sys.platform != 'win32' : audioio_tgt, audioio_install_tgt = posix_lib_rules( 'audioio', version, headers, source_files, install_dirs, audioio_env ) else : audioio_tgt, audioio_install_tgt = win32_lib_rules( 'audioio', version, headers, source_files, install_dirs, audioio_env ) Return( 'audioio_tgt', 'audioio_install_tgt' )