$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r49846 - in trunk/tools/build/v2: kernel tools
From: ghost_at_[hidden]
Date: 2008-11-19 13:20:40
Author: vladimir_prus
Date: 2008-11-19 13:20:39 EST (Wed, 19 Nov 2008)
New Revision: 49846
URL: http://svn.boost.org/trac/boost/changeset/49846
Log:
Use or not use escape sequences depending on availability.
Emit warning only on cygwin.
Text files modified: 
   trunk/tools/build/v2/kernel/bootstrap.jam |    10 +++++++---                              
   trunk/tools/build/v2/tools/common.jam     |    21 +++++++++++++++++++--                   
   2 files changed, 26 insertions(+), 5 deletions(-)
Modified: trunk/tools/build/v2/kernel/bootstrap.jam
==============================================================================
--- trunk/tools/build/v2/kernel/bootstrap.jam	(original)
+++ trunk/tools/build/v2/kernel/bootstrap.jam	2008-11-19 13:20:39 EST (Wed, 19 Nov 2008)
@@ -76,9 +76,13 @@
 # Make sure that \n escape is avaiable.
 if "\n" = "n"
 {
-    ECHO "warning: escape sequences are not supported" ;
-    ECHO "warning: your version of bjam is likely out of date" ;
-    ECHO "warning: please get a fresh version from SVN." ;
+    if $(OS) = CYGWIN 
+    {        
+        ECHO "warning: escape sequences are not supported" ;
+        ECHO "warning: this will cause major misbehaviour on cygwin" ;
+        ECHO "warning: your version of bjam is likely out of date" ;
+        ECHO "warning: please get a fresh version from SVN." ;
+    }    
 }
 
 # Bootstrap the module system. Then bring the import rule into the global module.
Modified: trunk/tools/build/v2/tools/common.jam
==============================================================================
--- trunk/tools/build/v2/tools/common.jam	(original)
+++ trunk/tools/build/v2/tools/common.jam	2008-11-19 13:20:39 EST (Wed, 19 Nov 2008)
@@ -495,6 +495,18 @@
 }
 
 
+if "\n" = "n" 
+{    
+    # Escape characters are not supported. Use ugly hacks that won't work,
+    # see below.
+    nl = "
+" ;
+}
+else
+{
+    nl = "\n" ; 
+}
+
 # Returns the command needed to set an environment variable on the current
 # platform. The variable setting persists through all following commands and is
 # visible in the environment seen by subsequently executed commands. In other
@@ -505,11 +517,16 @@
 {
     if [ os.name ] = NT
     {
-        return "set $(variable)=$(value)\n" ;
+        return "set $(variable)=$(value)$(nl)" ;
     }
     else
     {
-        return "$(variable)=$(value)\nexport $(variable)\n" ;
+        # If we don't have escape characters support in bjam, the below blows
+        # up on CYGWIN, since the $(nl) variable holds a Windows new-line \r\n 
+        # sequence that messes up the executed export command which then reports
+        # that the passed variable name is incorrect.
+        # But we have a check for cygwin in kernel/bootstrap.jam already.
+        return "$(variable)=$(value)$(nl)export $(variable)$(nl)" ;
     }
 }