Boost logo

Boost-Build :

From: Mat Marcus (mat-lists_at_[hidden])
Date: 2005-08-24 14:31:41


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am working towards a patch for boost build (both versions) to allow
executables produced by boost-build to work when linked against shared
library versions of boost, under gcc 4.0. See for example:

<http://article.gmane.org/gmane.comp.lib.boost.build/10072>

I am more familiar with bbv2 so I will begin with there. The idea is to
add a new feature <symbol-visibility>, which defaults to
- -fvisibility=hidden:

### add to builtins.jam

feature symbol-visibility : exported hidden : propagated ;

### add to gcc.jam

flags gcc.compile OPTIONS <symbol-visibility>exported :
- -fvisibility=default ;
flags gcc.compile OPTIONS <symbol-visibility>hidden :
- -fvisibility=hidden ;

### end

That won't quite work, since gcc versions prior to 4.0 don't understand
this flag (except for some patched versions IIUC). I tried to make it
conditional, following some code I found in darwin.jam, by wrapping it
as follows:

local gccversion = [ SHELL "$(command) -dumpversion" ] ;
if $(version) >= "4.0.0"
{
flags gcc.compile OPTIONS <symbol-visibility>exported :
- -fvisibility=default ;
flags gcc.compile OPTIONS <symbol-visibility>hidden :
- -fvisibility=hidden ;
}

This doesn't work well when under cygwin for me though.

Questions:
1) What is the right way to make some flags dependent on compiler
version?
2) Does anyone dislike the idea of making <symbol-visibility> a feature?

Same questions for BBv1.

Thanks,
Mat

-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.2 (Build 2424)

iQA/AwUBQwzLIBIZBaoznf65EQIEIwCeL/41mwtXPSMmQUFp2U7jUCw+xfYAoOj0
nYyBn+1/Nx+J/i4hWMSu3rds
=oxux
-----END PGP SIGNATURE-----

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk