[cmake-commits] king committed System.c 1.5 1.6 System.h.in 1.3 1.4

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Oct 25 11:23:06 EDT 2006


Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv13972/kwsys

Modified Files:
	System.c System.h.in 
Log Message:
ENH: Adding support for # escape in Watcom WMake.


Index: System.h.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/System.h.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- System.h.in	4 Oct 2006 22:52:24 -0000	1.3
+++ System.h.in	25 Oct 2006 15:23:04 -0000	1.4
@@ -32,6 +32,7 @@
 #define kwsysSystem_Shell_Flag_Make                  kwsys_ns(System_Shell_Flag_Make)
 #define kwsysSystem_Shell_Flag_VSIDE                 kwsys_ns(System_Shell_Flag_VSIDE)
 #define kwsysSystem_Shell_Flag_EchoWindows           kwsys_ns(System_Shell_Flag_EchoWindows)
+#define kwsysSystem_Shell_Flag_WatcomWMake           kwsys_ns(System_Shell_Flag_WatcomWMake)
 #define kwsysSystem_Shell_Flag_AllowMakeVariables    kwsys_ns(System_Shell_Flag_AllowMakeVariables)
 
 #if defined(__cplusplus)
@@ -82,12 +83,15 @@
   /** In a windows whell the argument is being passed to "echo".  */
   kwsysSystem_Shell_Flag_EchoWindows        = (1<<2),
 
+  /** The target shell is in a Watcom WMake makefile.  */
+  kwsysSystem_Shell_Flag_WatcomWMake        = (1<<3),
+
   /** Make variable reference syntax $(MAKEVAR) should not be escaped
       to allow a build tool to replace it.  Replacement values
       containing spaces, quotes, backslashes, or other
       non-alphanumeric characters that have significance to some makes
       or shells produce undefined behavior.  */
-  kwsysSystem_Shell_Flag_AllowMakeVariables = (1<<3)
+  kwsysSystem_Shell_Flag_AllowMakeVariables = (1<<4)
 };
 
 #if defined(__cplusplus)
@@ -107,6 +111,7 @@
 # undef kwsysSystem_Shell_Flag_Make
 # undef kwsysSystem_Shell_Flag_VSIDE
 # undef kwsysSystem_Shell_Flag_EchoWindows
+# undef kwsysSystem_Shell_Flag_WatcomWMake
 # undef kwsysSystem_Shell_Flag_AllowMakeVariables
 #endif
 

Index: System.c
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/System.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- System.c	23 Oct 2006 21:20:58 -0000	1.5
+++ System.c	25 Oct 2006 15:23:04 -0000	1.6
@@ -222,7 +222,7 @@
         }
       }
 
-    /* Check whether this character needs escaping.  */
+    /* Check whether this character needs escaping for the shell.  */
     if(isUnix)
       {
       /* On Unix a few special characters need escaping even inside a
@@ -261,7 +261,7 @@
         }
       }
 
-    /* The dollar sign needs special handling in some environments.  */
+    /* Check whether this character needs escaping for a make tool.  */
     if(*c == '$')
       {
       if(flags & kwsysSystem_Shell_Flag_Make)
@@ -277,6 +277,16 @@
         size += 2;
         }
       }
+    else if(*c == '#')
+      {
+      if((flags & kwsysSystem_Shell_Flag_Make) &&
+         (flags & kwsysSystem_Shell_Flag_WatcomWMake))
+        {
+        /* In Watcom WMake makefiles a pound is written $# so we need
+           one extra character.  */
+        ++size;
+        }
+      }
     }
 
   /* Check whether the argument needs surrounding quotes.  */
@@ -333,7 +343,7 @@
         }
       }
 
-    /* Check whether this character needs escaping.  */
+    /* Check whether this character needs escaping for the shell.  */
     if(isUnix)
       {
       /* On Unix a few special characters need escaping even inside a
@@ -377,7 +387,7 @@
         }
       }
 
-    /* The dollar sign needs special handling in some environments.  */
+    /* Check whether this character needs escaping for a make tool.  */
     if(*c == '$')
       {
       if(flags & kwsysSystem_Shell_Flag_Make)
@@ -405,6 +415,23 @@
         *out++ = '$';
         }
       }
+    else if(*c == '#')
+      {
+      if((flags & kwsysSystem_Shell_Flag_Make) &&
+         (flags & kwsysSystem_Shell_Flag_WatcomWMake))
+        {
+        /* In Watcom WMake makefiles a pound is written $#.  The make
+           tool will replace it with just # before passing it to the
+           shell.  */
+        *out++ = '$';
+        *out++ = '#';
+        }
+      else
+        {
+        /* Otherwise a pound is written just #. */
+        *out++ = '#';
+        }
+      }
     else
       {
       /* Store this character.  */



More information about the Cmake-commits mailing list