3 messages in com.perforce.jamming[jamming] workaround for embedded spa...| From | Sent On | Attachments |
|---|---|---|
| Thatcher Ulrich | 16 Nov 2001 08:17 | |
| David Abrahams" <david.abrahams@rcn.com (David Abrahams) | 16 Nov 2001 08:59 | |
| Thatcher Ulrich | 16 Nov 2001 09:35 |
| Subject: | [jamming] workaround for embedded space problem on Windows![]() |
|---|---|
| From: | () |
| Date: | 11/16/2001 08:59:40 AM |
| List: | com.perforce.jamming |
Ooh, very sneaky! You're getting Jam to delay expansion of the path until it's already past the phase of reading environment and command-line variables.
The version of Jam I'm working with for Boost.Build contains an extension which interprets these variables differently if they are surrounded by double quotes. The problem and solution are described here:
http://www.boost.org/tools/build/build_system.htm#variable_splitting
and here:
http://www.boost.org/tools/build/build_system.htm#variable_quoting
----- Original Message ----- From: "Thatcher Ulrich" <tulr...@oddworld.com>
So I've been evaluating Jam as a build tool for my company, and basically I like it. However, our project is Windows-based, and I ran into the problem of jam not being able to spawn the compiler & tools if the path name contains an embedded space character. Unfortunately this is the default for MSVC, and I noticed from the archives of this mailing list that I'm not the first to butt heads with this problem.
Anyway, the consensus workarounds from the list archives were:
1. don't use spaces in the paths of tools.
2. use the 8.3 aliases of the paths (e.g. "c:/Progra~1/" instead of "c:/Program Files/").
Neither workaround is acceptable to me. The first for legitimate political reasons; this is a Windows shop and I only have so much leeway to inconvenience people, and the second because the 8.3 alias is not reliable -- e.g. on my workstation, "c:/Progra~1/Micros~1" aliases to "c:/Program Files/microsoft frontpage", which is not going to find the compiler! It's a marginally OK, but cheesy, workaround for a single workstation.
Anyway, the point of all this is that after perusing the Jam source code, I discovered a very simple workaround that seems to actually work, on my Win2K box at least. Put the following line in your Jamrules:
JAMSHELL = cmd /C % ;
and make sure your tools path has quotes around it when Jam spawns the command line, for example these are the definitions from my sample Xbox project (which uses a special version of the MSVC tools):
JAMSHELL = cmd /C % ; XDK = "c:/Program Files/Microsoft Xbox SDK" ; VISUALC = "$(XDK)/xbox/bin/vc7" ; C++ = \"$(VISUALC)/cl.exe\" ; LINK = \"$(XDK)/xbox/bin/vc7/link.exe\" ; AR = \"$(XDK)/xbox/bin/vc7/lib.exe\" ;
Note the \" around the tool .exe's. I also found I needed to put \" 's around various include and lib paths in the command-line switches.
Hope this helps; I didn't come across this workaround in the list archives. Apologies if it's in the FAQ or something. If it's not, it should be!
-Thatcher Ulrich
_______________________________________________ jamming mailing list - jamm...@perforce.com http://maillist.perforce.com/mailman/listinfo/jamming




