Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2007-10-10 08:12:31


Author: vladimir_prus
Date: 2007-10-10 08:12:31 EDT (Wed, 10 Oct 2007)
New Revision: 39888
URL: http://svn.boost.org/trac/boost/changeset/39888

Log:
Change utility.py to use bjam variables to decide
that platform we're on. It might be better to use
Python functions, but we know that bjam approached
works.

Text files modified:
   branches/build/python_port/python/boost/build/util/utility.py | 55 ++++++++--------------------------------
   1 files changed, 11 insertions(+), 44 deletions(-)

Modified: branches/build/python_port/python/boost/build/util/utility.py
==============================================================================
--- branches/build/python_port/python/boost/build/util/utility.py (original)
+++ branches/build/python_port/python/boost/build/util/utility.py 2007-10-10 08:12:31 EDT (Wed, 10 Oct 2007)
@@ -9,6 +9,7 @@
 
 import re
 import os
+import bjam
 from boost.build.exceptions import *
 
 __re_grist_and_value = re.compile (r'(<[^>]*>)(.*)')
@@ -128,59 +129,25 @@
         name = split [1]
     return (toolset, name)
 
-
-# NOTE: Moved the functions below from os.jam because os confilicted with Python's os. Renamed some of the functions.
-#
-# TODO: Below are the values defined in jam for OSMAJOR, OSMINOR and OSPLAT. Most haven't yet been implemented in this port.
-#
-# OSMAJOR:
-# VMS, NT, MINGW, OS2, MAC, UNIX
-#
-# OSMINOR:
-# VMS, NT, AS400, MINGW, OS2, MAC, AIX, AMIGA, BEOS, BSDI, COHERENT, CYGWIN, FREEBSD, DRAGONFLYBSD,
-# DGUX, HPUX, INTERIX, IRIX, ISC, LINUX, LYNX, MACHTEN, MPEIX, MVS, NCR, NETBSD, QNXNTO, QNX,
-# RHAPSODY, NEXT, MACOSX, OSF, PTX, SCO, SINIX, SOLARIS, SUNOS, ULTRIX, UNICOS, UNIXWARE, OPENBSD
-#
-# OSPLAT:
-# VAX, PPC, AXP, X86, SPARC, MIPS, IA64, 390
-
-__major_map = {
- 'Darwin': 'UNIX',
- 'Linux': 'UNIX'
-}
-
-__minor_map = {
- 'Darwin': 'MACOSX',
- 'Linux': 'Linux'
-}
-
-__platform_map = {
- 'Darwin': 'PPC',
- 'Linux': 'x86'
-}
-
-__major = __major_map [os.uname () [0]]
-__minor = __minor_map [os.uname () [0]]
-__platform = __platform_map [os.uname () [0]]
-__version = os.uname () [2]
-
 def os_name ():
- return __minor
+ return bjam.variable("OS")
 
 def platform ():
- return __platform
-
+ return bjam.variable("OSPLAT")
+
 def os_version ():
- return __version
-
+ return bjam.variable("OSVER")
 
 def on_windows ():
     """ Returns true if running on windows, whether in cygwin or not.
     """
- if __major == 'NT':
+ if bjam.variable("NT"):
         return True
 
- elif __minor == 'CYGWIN':
- return True
+ elif bjam.variable("UNIX"):
+
+ uname = bjam.variable("JAMUNAME")
+ if uname and uname[0].startswith("CYGWIN"):
+ return True
 
     return False


Boost-Commit 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