scons

Using 'LIBS' in scons 'Program' command failed to find static library, why?

懵懂的女人 提交于 2019-12-02 14:46:23
问题 I've got a 'n.c' as main function, and 'o.c' as import function, like below: $ cat n.c o.c int f(); int main(){ f(); return 0; } #include<stdio.h> int f(){ printf("hello\n"); return 2; } Then scons file like below: Library('o.c') Program('n.c',LIBS=['o']) What I hope here is to compile o.c and generate libo.a(OK), and n.c will use this '.a' to generate final executable. So I specified LIBS=['o'], in hoep that it will specify an archive file to find libo.a library. But: $ scons -Q gcc -o n n.o

compile SCons in python3

妖精的绣舞 提交于 2019-12-02 11:21:05
问题 I am newbie at Python and am learning to code with Python 3 (which I plan to keep as my default version). Another software, I intend to use needs Python 2 for compiling (compilation with SCons). Is there a way around this i.e. keeping Python 3 while still compiling with SCons. Can virtualenv do this? 回答1: the fact that scons is python2 doesn't matter. Your own project can be python3, python4, or anything your heart desires. Scons doesn't care, you just need to remember that you're in python2

Using 'LIBS' in scons 'Program' command failed to find static library, why?

旧巷老猫 提交于 2019-12-02 11:07:49
I've got a 'n.c' as main function, and 'o.c' as import function, like below: $ cat n.c o.c int f(); int main(){ f(); return 0; } #include<stdio.h> int f(){ printf("hello\n"); return 2; } Then scons file like below: Library('o.c') Program('n.c',LIBS=['o']) What I hope here is to compile o.c and generate libo.a(OK), and n.c will use this '.a' to generate final executable. So I specified LIBS=['o'], in hoep that it will specify an archive file to find libo.a library. But: $ scons -Q gcc -o n n.o -lo /usr/bin/ld: cannot find -lo collect2: error: ld returned 1 exit status scons: *** [n] Error 1

error at building libjingle on Mac OS X 10.7.2 like “error: string.h: No such file or directory”

谁说胖子不能爱 提交于 2019-12-02 09:41:52
I failed to build libjingle on Mac OS X 10.7.2. The output was the following when I run $path_to_swtoolkit/hammer.sh according to the README of libjingle. MBP17:talk rei25$ ~/Desktop/swtoolkit/hammer.sh scons: Reading SConscript files ... scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead. File "/Users/rei25/Desktop/swtoolkit/site_scons/site_init.py", line 203, in BuildEnvironmentSConscripts scons: done reading SConscript files. scons: Building targets ... ________Compiling build/dbg/obj/third_party/expat-2.0.1/lib/xmlparse.o third_party/expat-2.0.1

error: stray '\\' in program in macro definition

风格不统一 提交于 2019-12-02 08:23:24
while trying to compile this program with scons, we faced this error build/opt/zsim_harness.cpp:315:5: error: stray '\' in program build/opt/zsim_harness.cpp:315:5: error: stray '#' in program build/opt/zsim_harness.cpp: In function 'int main(int, char**)': build/opt/zsim_harness.cpp:310:24: error: 'ZSIM_BUILDVERSION' was not declared in this scope build/opt/zsim_harness.cpp:315:5: error: expected ')' before 'n' build/opt/zsim_harness.cpp:315:5: error: 'ZSIM_BUILDVERSION' was not declared in this scope The line that has this error is info("Starting zsim, built %s (rev %s)", ZSIM_BUILDDATE,

Using Python subprocess.call() to launch an ncurses process

送分小仙女□ 提交于 2019-12-02 05:39:35
I'm trying to call ct-ng ( http://crosstool-ng.org/ ) from a SCons SConstruct script, so basically from Python. using the following method: ret = subprocess.call(["/mnt/build/pw_build/crosstool-ng/bin/ct-ng menuconfig"], env=env_cross,shell=True) crosstool-ng uses ncurses to present the user with a menu: Unfortunately when trying to navigate the menus I get: Using cat to display the sequences when using the arrow keys I see: :/mnt/build$ cat > /dev/null ^[OA^[OD^[OB^[OC^[OA^[OB^[OD^[OC^[OA^[OB It seems like something is possibly stripping the escape characters from the sequence. When I call

SCons- *** No SConstruct file found

。_饼干妹妹 提交于 2019-12-01 17:25:46
Installed SCons using # cd scons-2.3.0 # python setup.py install After Installation, when i try to run scons , got the below error. scons: * No SConstruct file found. File "/usr/local/lib/scons-2.3.0/SCons/Script/Main.py", line 905, in _main How to overcome this ??? There are 3 ways to specify the SConstruct file when using SCons, as follows: Execute scons from the root of the project, where there should be a SConstruct file. This is the most standard way. From a subdirectory of the project, where there should be a SConsctruct file at the root, execute scons with one of the following options

Scons. Go recursive with Glob

柔情痞子 提交于 2019-12-01 05:53:08
I using scons for a few days and confused a bit. Why there is no built-in tools for building sources recursively starting from given root? Let me explain: I have such source disposition: src Core folder1 folder2 subfolder2_1 Std folder1 ..and so on. This tree could be rather deeper. Now I build this with such construction: sources = Glob('./builds/Std/*/*.cpp') sources = sources + Glob('./builds/Std/*.cpp') sources = sources + Glob('./builds/Std/*/*/*.cpp') sources = sources + Glob('./builds/Std/*/*/*/*.cpp') and this looks not so perfect as at can be. Of cause, I can write some python code,

How do I run some code after every build in scons?

旧街凉风 提交于 2019-12-01 05:40:11
问题 I'm looking for a way to register somthing like an end-build callback in scons. For example, I'm doing something like this right now: def print_build_summary(): failures = SCons.Script.GetBuildFailures() notifyExe = 'notify-send ' if len(failures) > 0: notifyExe = notifyExe + ' --urgency=critical Build Failed' else: notifyExe = notifyExe + ' --urgency=normal Build Succeed' os.system(notifyExe) atexit.register(print_build_summary) This only works in non-interactive mode. I'd like to be able to

Why does SCons VariantDir() not put output in the given directory?

让人想犯罪 __ 提交于 2019-12-01 03:52:21
I'm thinking about using SCons for a new project. It looks really good, though I'm finding VariantDir quite confusing. I have a simple project with a handful of C source files in one directory, and I want to build in "normal" and in "profile" mode -- with two different sets of options to gcc. I want the outputs to go in the normal/ and profile/ directories, respectively. For testing, I've cut back to just a single source file, t.c, which has a main() in it. My SConstruct file is in the same directory, and looks like this: normal = DefaultEnvironment(tools=['mingw'], CCFLAGS = '-O2') normal