title: MinGW system() system call and %PATH% behaviour
body: <p>I am trying to compile ATLAS with MinGW. I started to solve problems, but now I'm stuck with a simple one: the Makefile of ATLAS tries to probe OS with an uname.exe which is provided with MinGW.</p>
  
  <p>If I run MinGW shell (sh.exe) I can call uname. If I open a Windows Command Prompt, I could call uname (so the %PATH% variable and $PATH variable are set up properly).</p>
  
  <p>The code calls internally something like system("uname -s >\tempfilneame &amp;2>1"). The main problem is that (as I analyzed FileMon's output) that the application (sh.exe) create a cmd.exe process, and than execute my command, but uname is not found. If I add system("d:/.../bin/uname -s >\tempfilename &amp;2>1") to the code everything works fine. So it should be a problem with PATH variables. If it's not neccesary I wouldn't modify every single call in the code. The question is: what is special about the cmd.exe process started, so it doesn't recognize uname, and how could I solve this issue.</p>