Archive: scons problems on linux


scons problems on linux
I read through all of the scons/linux posts and none of them answered my question. So here I go:

I need to compile and execute NSIS in Linux. I'm having problems with scons not locating my compiler(s) correctly. I've read through the docs and it seems like such a simple fix, but I've been racking my brains over it.

Here's the error:

scons SKIPSTUBS=all SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA=no PREFIX=/usr/pkg/nsis install-compiler
scons: Building targets ...
o build/release/makensis/build.o -c -O2 -Wall -Wno-non-virtual-dtor -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 -Ibuild/release/makensis -ISource Source/build.cpp
sh: o: command not found
o build/release/makensis/clzma.o -c -O2 -Wall -Wno-non-virtual-dtor -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 -Ibuild/release/makensis -ISource Source/clzma.cpp
sh: o: command not found
gcc -o build/release/makensis/crc32.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 -Ibuild/release/makensis -ISource Source/crc32.c
sh: gcc: command not found
scons: *** [build/release/makensis/crc32.o] Error 127
scons: building terminated because of errors.



gcc -v
Using built-in specs.
Target: x86_64-multiling-linux
Configured with: ../gcc-4.2.3/configure --prefix=/usr/pkg/gcc --build=i486-slackware-linux --host=x86_64-multiling-linux --target=x86_64-multiling-linux --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-c99 --enable-long-long --enable-clocale=gnu --enable-languages=c,c++ --disable-libstdcxx-pch
Thread model: posix
gcc version 4.2.3



Has anyone run into this problem and fixed it? I know scons does not extract the external environment by default, but it appears that the NSIS scons script handles that...

Thanks


This is supposedly solved by extracting the external PATH environment like so:

import os
env = Environment(ENV = {'PATH' : os.environ['PATH']})

But that doesn't work. Anyone?


Where is gcc located on your computer?


Hi Kichik, gcc is located and executed from /usr/pkg/gcc/bin/gcc

I have a script that adds every /usr/pkg/X/bin folder to PATH.

I ended up making a symbolic link to gcc in /usr/bin. This took me a bit further, but I am now getting this:


scons: Building targets ...
o build/release/makensis/build.o -c -O2 -Wall -Wno-non-virtual-dtor -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 -Ibuild/release/makensis -ISource Source/build.cpp
sh: o: command not found
o build/release/makensis/clzma.o -c -O2 -Wall -Wno-non-virtual-dtor -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 -Ibuild/release/makensis -ISource Source/clzma.cpp
sh: o: command not found
gcc -o build/release/makensis/crc32.o -c -O2 -Wall -D__BIG_ENDIAN__ -D_WIN32_IE=0x0500 -Ibuild/release/makensis -ISource Source/crc32.c
gcc: error trying to exec 'as': execvp: No such file or directory


Thanks


scons doesn't use PATH and you indeed have to point /usr/bin/gcc and /usr/bin/g++ to the real gcc and g++. /bin/gcc and some others should work as well.