summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/System.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-25 15:23:04 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-25 15:23:04 (GMT)
commit54731fa2c88879bf19cee97493556a02f833dda3 (patch)
treeed914c77b53837aedf6e014ddb426bd1fe3f6a80 /Source/kwsys/System.c
parent9e29a742a931e67ed92038e0250af66bbff07ff7 (diff)
downloadCMake-54731fa2c88879bf19cee97493556a02f833dda3.zip
CMake-54731fa2c88879bf19cee97493556a02f833dda3.tar.gz
CMake-54731fa2c88879bf19cee97493556a02f833dda3.tar.bz2
ENH: Adding support for # escape in Watcom WMake.
Diffstat (limited to 'Source/kwsys/System.c')
-rw-r--r--Source/kwsys/System.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/Source/kwsys/System.c b/Source/kwsys/System.c
index 288513f..62807c8 100644
--- a/Source/kwsys/System.c
+++ b/Source/kwsys/System.c
@@ -222,7 +222,7 @@ static int kwsysSystem_Shell__GetArgumentSize(const char* in,
}
}
- /* 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 @@ static int kwsysSystem_Shell__GetArgumentSize(const char* in,
}
}
- /* 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 @@ static int kwsysSystem_Shell__GetArgumentSize(const char* in,
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 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out,
}
}
- /* 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 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out,
}
}
- /* 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 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out,
*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. */