From 71118082fc3022c9acb659bd6e42aa982643932a Mon Sep 17 00:00:00 2001 From: Matthieu Brucher Date: Fri, 11 Feb 2011 20:38:23 +0100 Subject: [PATCH] Linux support for the blocks --- SConscript | 20 ++++++++++++--- SConstruct | 7 ------ boost-linux2.scons | 20 +++++++++++++++ gcc-linux2.scons | 35 +++++++++++++++++++++++++++ icl-linux2.scons | 39 ++++++++++++++++++++++++++++++ plugins/SConstruct | 9 ++++--- plugins/variable filter/SConstruct | 12 ++++----- 7 files changed, 123 insertions(+), 19 deletions(-) create mode 100644 boost-linux2.scons create mode 100644 gcc-linux2.scons create mode 100644 icl-linux2.scons diff --git a/SConscript b/SConscript index 1b3372c..7b418e5 100644 --- a/SConscript +++ b/SConscript @@ -2,6 +2,20 @@ Import('env') env.SConscript([ - "blocks\SConstruct", - "plugins\SConstruct", - ]) \ No newline at end of file + "blocks/SConstruct", + ]) + +env_plugin = env.Clone() + +if env_plugin['debug']: + env_plugin.EnableQt4Modules(['QtCore', 'QtGui', ], debug=True) + env_plugin['QWinMigratelib'] = 'QtSolutions_MFCMigrationFramework-2.8d' +else: + env_plugin.EnableQt4Modules(['QtCore', 'QtGui', ], debug=False) + env_plugin['QWinMigratelib'] = 'QtSolutions_MFCMigrationFramework-2.8' + +Export('env_plugin') + +env_plugin.SConscript([ + "plugins/SConstruct", + ]) diff --git a/SConstruct b/SConstruct index c7d56b7..c73a02e 100644 --- a/SConstruct +++ b/SConstruct @@ -50,12 +50,5 @@ env.Append(CPPPATH=env['vst']) env.Append(CPPPATH=env['qwinmigrate'] + os.sep + 'src') env.Append(LIBPATH=env['qwinmigrate'] + os.sep + 'lib') -if env['debug']: - env.EnableQt4Modules(['QtCore', 'QtGui', ], debug=True) - env['QWinMigratelib'] = 'QtSolutions_MFCMigrationFramework-2.8d' -else: - env.EnableQt4Modules(['QtCore', 'QtGui', ], debug=False) - env['QWinMigratelib'] = 'QtSolutions_MFCMigrationFramework-2.8' - Export('env') env.SConscript(['SConscript', ], variant_dir='build') diff --git a/boost-linux2.scons b/boost-linux2.scons new file mode 100644 index 0000000..aa12b05 --- /dev/null +++ b/boost-linux2.scons @@ -0,0 +1,20 @@ + +import os.path +import glob + +Import('env') + +for libpath in os.environ['LD_LIBRARY_PATH'].split(':'): + l = list(glob.glob(libpath + '/libboost_thread-%s-mt*.so' % env['boost'])) + if len(l) > 0: + env['boost_suffix'] = l[0][l[0].find("libboost_thread") + 15:-3] + env.Prepend(LIBPATH=[libpath]) + break + if os.path.exists(libpath + '/libboost_thread.so'): + env['boost_suffix'] = '' + env.Prepend(LIBPATH=[libpath]) + break + +env['boost_optimize_flags'] = ['BOOST_DISABLE_ASSERTS', ] + +Return('env') diff --git a/gcc-linux2.scons b/gcc-linux2.scons new file mode 100644 index 0000000..6addae5 --- /dev/null +++ b/gcc-linux2.scons @@ -0,0 +1,35 @@ + +import os +import re + +Import('env') + +env.Append(FORTRANFLAGS='') + +if env['debug']: + env.Append(CFLAGS='-g -Wall') + env.Append(CXXFLAGS='-g -Wall') +if env['optimized']: + env.Append(CFLAGS='-O3') + env.Append(CXXFLAGS='-O3') + +if env['profile']: + env.Append(CFLAGS='-g') + env.Append(CXXFLAGS='-g') + +env['boost'] = 'gcc' + +env.Tool('gcc') + +env['SWIGCFILESUFFIX'] = '_wrap.gcc$CFILESUFFIX' +env['SWIGCXXFILESUFFIX'] = '_wrap.gcc$CXXFILESUFFIX' +env['LIBPATH'] = [] + +env['no_exception_flag'] = ['-fno-exceptions', ] + +Export('env') +env = SConscript('common.scons') +Export('env') +env = SConscript('boost-linux2.scons') + +Return('env') diff --git a/icl-linux2.scons b/icl-linux2.scons new file mode 100644 index 0000000..a35accc --- /dev/null +++ b/icl-linux2.scons @@ -0,0 +1,39 @@ + +import os +import re + +opts = {'1' : '', + '2' : '-xHost', + '3' : '-xSSSE3 -axSSE4.2', + } + +Import('env') + +env.Append(CCFLAGS='-g -sox -wd177,304,383,869,981,1418,1572,2196') +env.Append(CXXFLAGS='-std=c++0x') + +if env['debug']: + env.Prepend(CCFLAGS='-DDEBUG -debug full -Wall -ftrapuv') +if env['optimized']: + env.Append(CPPDEFINES = 'USE_RESTRICT') + env.Append(CPPDEFINES = 'x86_64') + env.Append(CCFLAGS='-Wall -O3 -no-prec-div -ansi-alias -ftz -DNDEBUG -restrict -fp-model fast=2 ') #-vec-report2 + +if env['profile']: + env.Append(CCFLAGS='-g') + +env['boost'] = 'il' + +env.Tool('icl', topdir = os.environ['PATH']) + +env['SWIGCFILESUFFIX'] = '_wrap.icl$CFILESUFFIX' +env['SWIGCXXFILESUFFIX'] = '_wrap.icl$CXXFILESUFFIX' + +env['no_exception_flag'] = ['-fno-exceptions', ] + +Export('env') +env = SConscript('common.scons') +Export('env') +env = SConscript('boost-linux2.scons') + +Return('env') diff --git a/plugins/SConstruct b/plugins/SConstruct index e67cc28..7b9d2c2 100644 --- a/plugins/SConstruct +++ b/plugins/SConstruct @@ -1,6 +1,9 @@ -Import('env') +import sys -env.SConscript([ - "variable filter\SConstruct", +Import('env_plugin') + +if env_plugin['vst'] is not "" and sys.platform == "win32": + env_plugin.SConscript([ + "variable filter/SConstruct", ]) \ No newline at end of file diff --git a/plugins/variable filter/SConstruct b/plugins/variable filter/SConstruct index 0046531..02ae339 100644 --- a/plugins/variable filter/SConstruct +++ b/plugins/variable filter/SConstruct @@ -1,9 +1,9 @@ -Import('env') +Import('env_plugin') -env.Prepend(LIBS = [env['QWinMigratelib'], "user32"]) -env.Append(CPPDEFINES = "QT_QTWINMIGRATE_IMPORT") -env.Append(CPPPATH = env["vst"] + r"\public.sdk\source\vst2.x") +env_plugin.Prepend(LIBS = [env_plugin['QWinMigratelib'], "user32"]) +env_plugin.Append(CPPDEFINES = "QT_QTWINMIGRATE_IMPORT") +env_plugin.Append(CPPPATH = env_plugin["vst"] + r"\public.sdk\source\vst2.x") -libmain = env.SharedLibrary('QtVariableFilter', Glob("*.cpp") + [r"..\vstplug.def", env["vst"] + r"\public.sdk\source\vst2.x\audioeffect.cpp", env["vst"] + r"\public.sdk\source\vst2.x\audioeffectx.cpp", ]) -libmain = env.Install('$LIBDIR', libmain) +libmain = env_plugin.SharedLibrary('QtVariableFilter', Glob("*.cpp") + [r"..\vstplug.def", env_plugin["vst"] + r"\public.sdk\source\vst2.x\audioeffect.cpp", env_plugin["vst"] + r"\public.sdk\source\vst2.x\audioeffectx.cpp", ]) +libmain = env_plugin.Install('$LIBDIR', libmain)