[Scons-dev] prefix, bindir, datadir, libdir, etc.

Pawel Tomulik ptomulik at meil.pw.edu.pl
Sun May 11 03:25:34 EDT 2014


W dniu 10.05.2014 18:18, Russel Winder pisze:

> On Sat, 2014-05-10 at 15:06 +0100, Russel Winder wrote:

> […]

>> Splendid, I shall take a look at this and what I have been working with

>> and see what the commonalities and differences are. First reaction is

>> that yours is a structured framework, and mine is a quick hack.

>

> First immediate thought:

>

> I have found it best to store values in a file rather than a command

> line: Autoconf/Automake and Waf have a configuration stage and a build

> stage so configuration stage options persist across all build

> executions.


Storing config in a file is supported by the library. Separating config
and build phase should be easy - it's just about creating special target
'configure' (and perhaps few other such as 'distclean' etc.) where SCons
script would maintain config variables provided via commandline, perform
autoconfiguration and cache its results using features of scons-gnu-build.


> SCons is build stage only and doesn't have a real way of

> persisting things.Yes, they should persist in the SCons database but I

> am not sure that works well as a user experience, much better to bring

> that persistence out explicitly in a file.

>


SCons implements command line variables
(http://scons.org/doc/production/HTML/scons-user.html#sect-command-line-variables)
which may be saved to a file. Well, ok it's kinda limited as it supports
only strings, but I believe in most cases options/variables provided via
command line are also strings, so it should be fine.

For auto-configuration SCons provides SConf module which is able to
cache results of configuration. I use this feature heavily in 'feature
test macros' implemented in scons-gnu-build, so results of
autoconfiguration are also persistent between builds.

I use the scons variables mechanism in my library.


> So I would suggest that GVars need to be able to process a configuration

> file. Currently I just cheat and exec a Python script.

>


GVars support persistence/config files. See
http://tomulik.pl/doc/user/manual.html#idp49434384 and
http://tomulik.pl/doc/user/manual.html#idp49444128


Regards!
--
Paweł Tomulik



More information about the Scons-dev mailing list