[Scons-users] Library configuration

John Pye john.pye at anu.edu.au
Wed Jun 20 16:17:46 EDT 2012


Hi all

FWIW I have not found uniformity in the way that autotools links to
different shared/shatic libraries, nor have I found uniformity in the
commands required to force autotools to *build* static vs shared
libraries. There might be some conventions, but they're not universal.
SCons provides the means to generate sane command-line user's
documentation ('scons -h') which you always need to check with
./configure, equally.

The shortcoming here that I see is that SCons is not very good at
figuring out if what your system provides is a static library, or a
shared library, and linking to the correct version (or allowing the user
to choose, in the case that both are there). Attempting to do this stuff
and simultaneously support multiple compilers probably makes things
almost impossible (C++ ABI incompatibilities, etc etc).

I suggest that a solution to this should be done specific with
dependency-specific flags and/or env vars, since in a large project, one
doesn't want to link every output file to any given library, it will be
something that internally you want to retain control over. So I suggest
something like

scons GSL_LIB=gsl GSL_LIBPATH=/usr/lib GSL_INCLUDE=/usr/include/gsl-1.11

or

scons GSL_STATIC=/usr/lib/libgsl1-11.a GSL_INCLUDE=/usr/include/gsl-1.11

also, nice to have

scons GSL_PREFIX=~/my-gsl

We use something similar to this approach with ASCEND, although it's
fairly messy/wordy, and we don't support non-GCC compilers.

Cheers
JP

On 20/06/12 11:37, Guillaume Turri wrote:

> Hi,

>

> 2012/6/20 Evan Driscoll<driscoll at cs.wisc.edu>:

>> On 06/20/2012 12:51 AM, Brady Johnson wrote:

>> (2) it would hopefully give some uniformity in how those features are accessed.

>>

>> And while I'm at it, I might as well ask now: does this feature sound (a)

>> awesome, (b) meh, (c) stupid?

> To me, it could be awesome to have a standard way to let the end user

> add options like --with-myLib=xxx, or flags such as LDFLAGS and so on

> (à la autotools!)

>

> I really like scons, and this lack of uniformity is the only thing

> that prevent me from using it more than I currently do.

> Fixing it could remove that fear that an end user tells me "Hey, I've

> this special config, and I know that with autotools I just have to set

> this flag, but since you use scons I don't know how you handle it

> without reading your Sconscripts".

>

> Regards,

> Guillaume

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users




More information about the Scons-users mailing list