Showing posts with label scons. Show all posts
Showing posts with label scons. Show all posts

Thursday, September 18, 2008

SCons in Ubuntu Linux box

After fixing the annoying varnish installation problem, I could proceed with installation of SCons in my Ubuntu box.
$ sudo apt-get install scons

Then I created the same SConstruct file, with content:

Program('hello.c')

Invoke SCons:

$ scons




scons: Reading SConscript files ...

scons: done reading SConscript files.

scons: Building targets ...

gcc -o hello.o -c hello.c

gcc -o hello hello.o

scons: done building targets.

Invoke the executable binary:



$ ./hello




hello, world!

It really works as advertised! Excellent!


Wednesday, September 17, 2008

SCons 1.0.1: Python Based Multiplatform Builder Application

I was looking for a way to build application in a Maven  way, but which works beyond Java environment. I know that Maven 2 will somehow able to compile other source code such as C/C++ using some of the plugins. The reason I look for another tools because I might want to maintain my Python code as well.
Google search produced this SCons from Tigris. I downloaded  the version 1.0.1 and try to make a working instance of it.

I downloaded the zip from here, and the installation is straightforward if you already have a Python 2.5.2 installation.

python setup.py install

Voila. It works!

I ran the sample on my Windows machine, create a hello.c code.

int main() {

printf("Hello, world!");

}

Make a SConstruct file containing:

Program('hello.c')

It works as advertised! It invoked the Microsoft Visual C++ Express 8.0 on my machine.

Apart of it, it also produce a byproduct file: .sconsign.dblite of size less than 2k. I guess this is some kind of checksum to check whether the latest build is still up to date.

I will try it again in my VirtualBox Ubuntu machine.