# SConstruct file for CLAMcore from buildtools import * from buildtools.include_rename import update_includes from buildtools.pkggen import PackageData from buildtools.file_retriever import FileRetriever from buildtools.rulesets import * import os, sys print """\ ############################################## ### BOOTSTRAPPING CLAM CORE LIBRARY ### ##############################################""" Import('core_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') core_folders = ['src/Base', 'src/Data/Base', 'src/Data/BasicProcessing/Audio.*', 'src/Data/Descriptors/Pool', 'src/Defines', 'src/Errors', 'src/Flow/Ports', 'src/Flow/Networks', 'src/Flow/Controls', 'src/Processing/Base', 'src/Processing/Plugins','src/Standard', 'src/Storage', 'src/Storage/Base', 'src/Storage/XML','src/System','src/System/Threads', 'externals/CbLib'] if sys.platform == 'win32' : core_folders.append('src/Defines/Windows') else : core_folders.append('src/Defines/Unix') blacklist = ['ScaleCnv', 'LadspaBridge'] if sys.platform == 'win32' : blacklist.append( 'Watchdog.+' ) if core_env['xmlbackend'] == 'xercesc' : blacklist.append( 'LibXml.+') blacklist.append( 'Null.+' ) elif core_env['xmlbackend'] == 'xmlpp' : blacklist.append( 'Xerces.+') blacklist.append( 'Null.+' ) elif core_env['xmlbackend'] == 'none' : blacklist.append( 'Xerces.+' ) blacklist.append( 'LibXml.+' ) if not core_env.has_key('with_ladspa_support') : blacklist.append( 'Ladspa.+' ) if not core_env.has_key('with_osc_support') : blacklist.append( 'OSC.+') file_retriever = FileRetriever( top+'/..', core_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 if not core_env.GetOption('clean') : print "Creating pkg-config descriptor...", pkg_data = PackageData( 'clam_core', version ) pkg_data.create_pkg_descriptor( core_env, 'clam_core.pc' ) print "ok" if not core_env.GetOption('clean') : header_files, source_files = define_module_contents() else : manifest = Manifest() header_files = [] source_files = [] manifest.load( header_files, source_files ) if not core_env.GetOption('clean') : core_env.Prepend(CPPPATH='include') handle_preinclude( core_env ) headers = [ File(header) for header in header_files ] if sys.platform != 'win32' : core_tgt, core_install_tgt = posix_lib_rules( 'core', version, headers, source_files, install_dirs, core_env ) else : # TODO whats about templates #templates = [ 'src/Point.cxx', 'src/Polar.cxx', 'src/Complex.cxx', 'src/BPF.cxx', 'src/Matrix.cxx', 'src/Order.cxx'] core_tgt, core_install_tgt = win32_lib_rules( 'core', version, headers, source_files, install_dirs, core_env ) Return( 'core_tgt','core_install_tgt' )