[Scons-users] using Configure Contexts

Bill Deegan bill at baddogconsulting.com
Fri Dec 25 13:49:00 EST 2015


Stefan,

So to check for the python you want would you walk the PATH and try running
any pythons there to see what the output of --version matches the one you
are looking for?

-Bill

On Fri, Dec 25, 2015 at 9:40 AM, Stefan Seefeld <stefan at seefeld.name> wrote:

> On 25.12.2015 12:27, Bill Deegan wrote:
> > Stefan,
> >
> > I'm not sure what you mean by "appropriate use of configure contexts"?
> > There's reasonable examples in the users guide.
> >
> > Basically you create an Environment(), then you create a configure
> > context using that, then you setup a bunch of checkers.
> > The results of those you use to alter the Environment() you've
> > specified to the configure context.
> >
> > The configure contexts are part of SCons's functionality meant to
> > replace autoconf.
>
> OK, sorry again for being vague. Let me illustrate a specific question:
>
> From the docs I'm learning that I can write tests such as
>
> conf = Configure()
> if not conf.CheckLibWithHeader('m', 'math.h', 'c'):
>     print 'Did not find libm.a or m.lib, exiting!'
>     Exit(1)
> env = conf.Finish()
>
> That's fine. Now I want to write my own check functions, such as find a
> python installation (not necessarily the one SCons itself is using).
> and determine CPPFLAGS and LIBS to compile with its C API.
>
> Section 23.8 seems to suggest that a "custom check" would be appropriate
> here, so I'm trying to write my own
> "CheckPython(context)" function. However, inside that function I don't
> have access to the 'conf' object from above, only a 'context',
> which doesn't provide the same API. So I wonder what the purpose of these
> two objects is ('conf' and 'context' in my code above),
> and why the custom check functions don't receive a 'conf' object as
> argument instead.
>
> Hope that illustrates my question a bit.
>
> Thanks,
>                 Stefan
>
>
>
>
> >
> > -Bill
> >
> > On Fri, Dec 25, 2015 at 8:53 AM, Stefan Seefeld <stefan at seefeld.name
> > <mailto:stefan at seefeld.name>> wrote:
> >
> >     I'm trying to understand the appropriate use of configure contexts. A
> >     call to 'Configure()' yields a SCons.SConf.SconfBase object, while
> >     what
> >     is passed in to 'custom checks' (Section 23.8 in the User's Guide) as
> >     'context' turns out to be of type 'Scons.Sconf.CheckContext. What
> >     is the
> >     relationship between these two types ? They don't have the same API
> >     (even though they seem quite similar in many ways), and it isn't
> >     entirely clear to me how to use them properly.
> >
> >     Thanks,
> >             Stefan
> >
> >     --
> >
> >           ...ich hab' noch einen Koffer in Berlin...
> >
> >     _______________________________________________
> >     Scons-users mailing list
> >     Scons-users at scons.org <mailto:Scons-users at scons.org>
> >     https://pairlist4.pair.net/mailman/listinfo/scons-users
> >
> >
> >
> >
> > _______________________________________________
> > Scons-users mailing list
> > Scons-users at scons.org
> > https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
> --
>
>       ...ich hab' noch einen Koffer in Berlin...
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20151225/5a9ca7d6/attachment-0001.html>


More information about the Scons-users mailing list