[Scons-users] Library configuration
Brady Johnson
bradyallenjohnson at gmail.com
Wed Jun 20 01:51:25 EDT 2012
You could definitely implement some command line arguments and use them to
pass in paths on-the-fly like you mention. Additionally, SCons has
integrated support for functionality similar to autoconf, as can be found
here: http://www.scons.org/doc/production/HTML/scons-user/c4132.html
Hope that helps,
Brady
On Wed, Jun 20, 2012 at 5:25 AM, Evan Driscoll <driscoll at cs.wisc.edu> wrote:
> What's "best practice" for allowing users to specify the location of a
> library?
>
>
> For instance, suppose I have the following file:
>
> // test.cpp
> #include <boost/version.hpp>
> #if BOOST_VERSION < 104601
> # error "You need a newer boost"
> #endif
>
> If I compile this on my RHEL 5 office machine with just 'g++ test.cpp', it
> does
> not work. Instead, I have to pass a different include path. What I'm
> asking is
> how do you get that path into the construction environment (without hard-
> coding it, of course; assume that option is out)?
>
>
> There are so many potential choices; I'm trying to figure out if there's a
> standard, typical way:
>
> * Look at os.environment at C{,PP,XX,C}FLAGS and LDFLAGS and ParseFlags
> them
> into your environment
>
> * Look at ARGUMENTS (or a Variables object) for *FLAGS
>
> * Look at ARGUMENTS for an argument like "with-boost-incdir=/blah/include"
>
> * Use {Add,Get}Option to look for an argument like
> "--with-boost-incdir=..."
>
>
> For instance, in my experience (I build packages fairly regularly, though
> I do
> admittedly run into the need to do something like this relatively
> infrequently) if I am trying to build a project with Autoconf, it seems
> like
> '--with-boost-incdir=...' and '-with-boost-libdir=...' are almost
> guaranteed
> to work, but if I were building an SCons project I don't think I'd know at
> all
> what to expect. This seems like a drawback.
>
> Evan
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20120620/cd9dbc01/attachment.htm>
More information about the Scons-users
mailing list