help in simplification of code [string manipulation]

2005-09-13 Thread John
How could I simplify the code to get libs out of LDFLAGS or vice versa automatically in the following python/scons code? if sys.platform[:5] == 'linux': env.Append (CPPFLAGS = '-D__LINUX') env.Append (LDFLAGS = '-lglut -lGLU -lGL -lm') env.Append(CPPPATH=['include', 'incl

Re: help in simplification of code [string manipulation]

2005-09-13 Thread Kent Johnson
John wrote: > How could I simplify the code to get libs out of LDFLAGS > or vice versa automatically in the following python/scons code? > > if sys.platform[:5] == 'linux': > env.Append (CPPFLAGS = '-D__LINUX') > env.Append (LDFLAGS = '-lglut -lGLU -lGL -lm') > env.Append(CPPPAT

Re: help in simplification of code [string manipulation]

2005-09-13 Thread Christophe
John a écrit : > How could I simplify the code to get libs out of LDFLAGS > or vice versa automatically in the following python/scons code? > > if sys.platform[:5] == 'linux': > env.Append (CPPFLAGS = '-D__LINUX') > env.Append (LDFLAGS = '-lglut -lGLU -lGL -lm') > env.Append(CPP

Re: help in simplification of code [string manipulation]

2005-09-13 Thread John
Thanks for your replies... Solved my problem. --j Christophe wrote: > John a écrit : > > How could I simplify the code to get libs out of LDFLAGS > > or vice versa automatically in the following python/scons code? > > > > if sys.platform[:5] == 'linux': > > env.Append (CPPFLAGS = '-D__LINUX')

Re: help in simplification of code [string manipulation]

2005-09-14 Thread Christophe
John a écrit : > Thanks for your replies... > Solved my problem. Even so, I made a big mistake here. The Split function is of no use because there is already a list of flags. Better do it like that : libs = Split('glut GLU GL m') env.Append (LIBS = libs) BTW, Split is a scons function. > Christ

Re: help in simplification of code [string manipulation]

2005-09-14 Thread John
But ur previous solution worked on my machine... although a friend tried it on his machine and the libraries were not found even if they existed! (Even the -lm was not found) Can you explain a bit why the previous solution worked? Thanks for ur help, --j -- http://mail.python.org/mailman/listi