|
Boost-Build : |
From: Michael Stevens (Michael.Stevens_at_[hidden])
Date: 2004-05-28 13:08:29
Dear All,
I was looking at cleaning up the way that the OS detection works in BBv2.
This primarily interests me as I do a fair bit of cross compiling. Also the
many and varied combinations make the code very colourful!
To give you an idea I have listed all the relevent OS detections using at
present:
borland.jam
if [ os.name ] = CYGWIN
if [ os.name ] = NT
gcc.jam
if [ os.name ] = NT
if [ os.on-windows ]
if [ modules.peek : UNIX ]
intel.jam
if [ os.name ] = LINUX
msvc.jam
if [ os.name ] in CYGWIN
testing.jam
if [ os.name ] = NT
buitin.jam
local os = [ modules.peek : OS ] ;
common.jam
if [ os.name ] = NT
if [ modules.peek : NT ]
symlink.jam
if [ modules.peek : UNIX ] { os = UNIX ; }
else { os ?= [ os.name ] ; }
name = [ modules.peek : OS ] ;
platform = [ modules.peek : OSPLAT ] ;
version = [ modules.peek : OSVER ] ;
rule on-windows
{
.... code base on NT UNIX and JAMUNAME
}
>From this the following points seem to be important.
a) The tool specific files generally use use os.name. The exception is gcc.jam
which uses both "on-windows" and the builtin "UNIX"
b) CYGWIN detection is inconsistent. The tools use os.name=CYGWIN.
os.jam defines an entirely different mechanism base on JAMUNAME!
c) builtin.jam should probably import and use "os.name"
d) common.jam could use "os.name" consitently
e) I don't understand symlink.jam at all!
It would seem correct to localise all the detection code in os.jam. This would
prevent inconsistencies spreading throughout the code. It may even be worth
clearing the remaining Platform Identifier Variables (MAC,NT,OS2,UNIX,VMS) so
dependency on them does not spread.
Does anyone know the correct way to detect for CYGWIN?
All the best,
Michael
-- ___________________________________ Michael Stevens Systems Engineering 34128 Kassel, Germany Phone/Fax: +49 561 5218038 Navigation Systems, Estimation and Bayesian Filtering http://bayesclasses.sf.net ___________________________________
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