[okl4-developer] OKL4 2.1: naming the build directory after the machine

Frank Kaiser frank.kaiser at opensynergy.com
Mon Jul 14 22:38:36 EST 2008


Hello

 

When I compile my new platform I tried to give the build directory the
same nam as the machine by invoking the build script this way:

tools/build.py MACHINE=sam9263 PROJECT=iguana BUILD_DIR=sam9263

However, that does not work. This is the response:

scons: Reading SConscript files ...

/home/fka/Projects/COQOS/L4/OKL4/okl4_2.1/tools/build.py:287 Error: type
object 'sam9263' has no attribute 'startswith'

Here the relevant lines of the script:

        def handle_arg(name, default):

            ret = kargs.get(name, default)

            if name in kargs: del kargs[name]

            return ret

 

        self.build_dir = handle_arg("BUILD_DIR", "#build")

        if not self.build_dir.startswith('#'):

            self.build_dir = '#' + self.build_dir

The only explanation for this odd error message is that 'sam9263' is not
treated as a string but as an object reference to the class 'sam9263'
defined in my platform script 'machines.py'. An attempt to quote the
BUILD_DIR parameter has no effect:

tools/build.py MACHINE=sam9263 PROJECT=iguana BUILD_DIR="sam9263"

The result is the same error.

Trying to convert the symbol 'sam9263' to a string by this assignment

        self.build_dir = str(handle_arg("BUILD_DIR", "#build"))

starts compilation into the directory <class 'machines.sam9263'>, which
is not what I want. Finally the build stops with an error message:

[IDL ] <class
'machines.sam9263'>/iguana_server/object/libs_iguana/include/interfaces/
iguana_serverloop.c

sh: class: No such file or directory

scons: *** [<class
'machines.sam9263'>/iguana_server/object/libs_iguana/include/interfaces/
iguana_serverloop.c] Error 1

scons: building terminated because of errors.

I think this is a specialty of Python. The keyword/value paring in a
dictionary apparently allows almost anything as a value, and if the
given value is the identifier of a class, then Python assumes that the
class is meant. That mechanism is quite effective when choosing the
hardware platform. First the script reads all available 'machines.py',
and then simply by using the class name with the MACHINE parameter the
platform to be compiled is selected.

So the question remains: has anyone an idea to enforce the string
treatment of the BUILD_DIR value?

 

Regards

Frank

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080714/e483d6fb/attachment-0001.htm 


More information about the Developer mailing list