Re: [AD] trouble with scons build system

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]



Peter Wang wrote:

On 2006-03-18, Jon Rafkind <workmin@xxxxxxxxxx> wrote:
I dont see anything wrong with it but platform["ALLEGRO_WITH_ESDDIGI" ] should have been defined, 0 if you dont have ESD.

Try running $scons config=1.

Nope.

Where do a look to see if platform["ALLEGRO_WITH_ESDDIGI"] is defined?
The contents of settings.cfg are

[unix]
cppflags = []
linkflags = ['$__RPATH']
libpath = ['/usr/X11R6/lib']
ccflags = ['-mcpu=pentium']
libs = ['m', 'vga', 'c', 'jack', 'X11', 'Xext', 'Xcursor', 'Xxf86dga', 'Xxf86vm', 'Xpm', 'pthread', 'c', 'c', 'c', 'c']
cpppath = ['/usr/X11R6/include']

The settings are for setting up paths and things in scons but all the platform["X"] things are found in include/allegro/platform/alunixac.h. The way it works is if the .h file exists the file will be read as opposed to the configure checks being invoked but only things that are #define'd are set to 1 in the platform[] variable.

Now that I think about it your patch wouldnt work as intended. It just checks to see if a given key is in the hashmap platform[], not if its set to 1. All your checks would have to be

if "foobar" in platform and platform["foobar"]:
    ...dosomething...

maybe it would be more elegant to set all keys that could go into platform to 0 or even more elegantly define a new class that extends hashmap but when [] is called for that object return 0 on a KeyError instead of raising it. Something like

class MyMap( HashMap ):
   def []( x )
      try:
          return self[ x ]
      catch KeyError:
         return 0;

Im no python expert so the syntax is just a guess but I think that would work out.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/