# SConstruct for SMS Tools # import sys, os, glob tools_env = Environment( ENV=os.environ ) opts = Options( 'SMSTools.conf' ) opts.Add( PathOption( 'clam_prefix', 'Prefix where CLAM was installed', '/usr') ) opts.Add( PathOption( 'install_prefix', 'Prefix where SMS Tools is to be installed', '/usr') ) opts.Add( BoolOption( 'release', 'Build SMS Tools enabling compiler optimizations', 'yes' ) ) opts.Update( tools_env ) opts.Save( 'SMSTools.conf', tools_env ) Help( opts.GenerateHelpText( tools_env ) ) if tools_env['release'] : tools_env.Append( CCFLAGS=['-O3', '-fomit-frame-pointer', '-Wall'] ) else : tools_env.Append( CCFLAGS=['-g', '-Wall'] ) tools_env.ParseConfig( 'pkg-config --cflags --libs clam_core clam_processing clam_audioio clam_vmfl' ) source_dirs = ['../../src', '../../src/GUI', '../../src/GUI/ScoreEditor'] tools_env.Append( CPPPATH=source_dirs ) tools_env.Append( CCFLAGS='-include CLAM/preinclude.hxx' ) tools_env.Append( CPPFLAGS='-DRESOURCES_BASE="\\"/usr/share/smstools\\""' ) sourcefiles = [] for dir in source_dirs : sourcefiles += glob.glob(dir+'/*.cxx') sourcefiles.remove('../../src/SMSBatch.cxx') sourcefiles.remove('../../src/SMS.cxx') tools_bin = tools_env.Program( 'SMSTools', sourcefiles, LINKFLAGS=['-rdynamic'] ) install_bin = tools_env.Install( tools_env['install_prefix']+"/bin", tools_bin ) tools_env.AddPostAction( install_bin, 'chmod 755 $TARGET' ) htmls = [ '../../resources/html/en/license.html' ] install_html = tools_env.Install( tools_env['install_prefix']+"/share/smstools/html/en", htmls ) manpage = ['../../resources/man/man9/SMSTools.9'] install_manpage = tools_env.Install( tools_env['install_prefix']+"/share/man/man9", manpage ) tools_env.Alias( 'install', [install_bin, install_html, install_manpage ] ) Default( tools_bin )