scons

Cross-Compiling Swiften library for ARM-embedded with SCons makery

*爱你&永不变心* 提交于 2019-12-14 03:59:42
问题 Swiften is a XMPP client library and my objective was to build it for a ARM-embedded target running Linux. I hacked my way to a successful cross-compile with little knowledge of SCons. I'll lay out my hack here with the hope that someone can point me to a maintainable solution using the two makery files, SConscript.boot and SConstruct . I had two tasks (neither accomplished satisfactorily): Successfully switching the tool-chain from native-compile to cross-compile Ensuring that OpenSSL

How do I tell SCons to ignore implicit dependencies from command actions?

二次信任 提交于 2019-12-14 01:27:04
问题 By default, SCons seems to look at the 'recipe' used to build a program and extracts implicit dependencies from it. For example suppose my SConstruct contains: Command('foo', 'foocreator.py', '/usr/bin/python foocreator.py > foo') And I've already built 'foo' ('foo' is up to date). Now I change SConstruct (or more realistically, pass different options) so that the command for 'foo' becomes: Command('foo', 'foocreator.py', '/usr/bin/qrsh -V -cwd /usr/bin/python foocreator.py > foo') (In other

How to handle building files outside of directory

£可爱£侵袭症+ 提交于 2019-12-13 07:15:57
问题 I have a build set up and I'm struggling on how to handle one aspect. I have successfully setup a variantdir for my project folder src build output, however I have source that resides outside the project folder that needs to be build and included. I am able to add the files I need into the build, however the object files are put into the external directory where the library souce files are. Is there a standard way to solve this. I would like to avoid adding any scons files to the external

How to deal with this error when build with Scons?

筅森魡賤 提交于 2019-12-13 05:16:30
问题 /usr/bin/ld: build/bsp_src/main.o: Undefined first referenced symbol «_ZN5boost6system15system_categoryEv» //usr/lib/i386-linux-gnu/libboost_system.so.1.54.0: error adding symbols: DSO missing from command line SConstruct file I'm trying to build this project https://github.com/TTimo/es_core, and don't have enought expirience with scons 回答1: Based on the SConstruct file referenced in your question, you're not correctly linking in the boost_system library. You're doing it as follows: env

Scons (Build System) Variables : load config file with custom/unknown values

白昼怎懂夜的黑 提交于 2019-12-13 02:52:07
问题 I have a trouble with Scons.Variables. I want to use config files with custom keys and values. My idea to load config files with keys and values and use it with SubstFile method. For example (rough code) : vars = Variables('templateValues.conf') vars_dict = vars.UnknownVariables().keys() # bad code, need something to convert vars to Python dictionary env.Substfile('myconfig.cfg.in', SUBST_DICT = vars_dict) But vars.UnknownVariables() return empty list. My test template file : version = 105

CCCOMSTR/LINKCOMSTR for SharedLibrary in SConscript will not work

匆匆过客 提交于 2019-12-13 01:39:15
问题 I'm pretty new to SCons and noticed that CCCOMSTR and LINKCOMSTR will not work when I'm building a shared library in the SConscript. Here is the simplified version of my SConstruct: CFLAGS = ["-Wall", "-pedantic", "-std=c99"] # building environment env = Environment(CFLAGS = CFLAGS, CPPDEFINES = ["DEBUG"]) # checking dependencies conf = env.Configure() conf.CheckHeader("stdlib.h") conf.CheckHeader("string.h") conf.CheckLib("libdl") env["CCCOMSTR"] = "Compiling $SOURCE ..." env["LINKCOMSTR"] =

Setting compiler specific flags in scons

让人想犯罪 __ 提交于 2019-12-13 01:35:57
问题 When writing a scons script that will be used on different platform and compiler it's sometimes desired to add compiler specific flags. Fx in pseudo code if using_gcc: env.Append( CCFLAGS=["-g"] ) elif using_msvc: env.Append( CCFLAGS=["/Zi"] ) At an earlier occation I just copied the appropriate(?) .py files under Tools and modified these and placed under site_tools , but that seems like a hackish solution. Is there a better way to achieve this result? It would of course be nice if it could

How to get executable in debug mode using scons

谁说我不能喝 提交于 2019-12-12 18:29:32
问题 I am using scons to compile with vc10 and renesas compiler. Is there any commands to get an executable in debug mode? If I executed my project with the command " scons and enter" it is going to release mode. I am unable to debug that .exe file using the visual studio debugger. Can anyone tell me how to get the debugging executable in debug mode? Is there any commands or flags to set in scons? 回答1: To get the executable in debug mode, its just a simple matter of adding the appropriate compiler

Read scons build variables from a external.py file

时间秒杀一切 提交于 2019-12-12 18:27:43
问题 I want to define the scons build variables in external.py file like external.py mode=debug toolchain=x86 This I want to read back these variables in the SConstruct file which is there in the same directory. Depending on the variable values I want to do some operations! vars = Variables('external.py') vars.Add('mode', 'Set the mode for debug or release', 'debug') if ${RELEASE}=="debug" #Do these! elif ${RELEASE}=="release" #Do that! 回答1: If external.py contains valid Python code then you can

scons executable + shared library in project directory

不想你离开。 提交于 2019-12-12 14:52:15
问题 Here's a sample SConscript file: env = Environment() hello_lib = env.SharedLibrary('hello', ['libhello.c']) exe = env.Program('main', ['main.c'], LIBS=hello_lib) env.Install('/usr/lib', hello_lib) env.Install('/usr/bin', exe) env.Alias('install', '/usr/bin') env.Alias('install', '/usr/lib') It builds one shared library, and one executable linked to that library: $ scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... gcc -o libhello.os -c