[OT] Avoiding symlinks when launching cygwin apps from win32 apps [was Re: [1.5][gcc-3.4.4] python-2.5.4 distutils failed to compile c files]

Dave Korn dave.korn.cygwin@googlemail.com
Fri May 8 12:13:00 GMT 2009


[ Subject changed, and OT tagged because this is really becoming about windows
command shell programming techniques. ]

Joe Pham wrote:
> Dave Korn writes:
> 
>>   What about calling distutils.Ccompiler.set_executables() in your
>> script that invokes distutils?
> 
> I probably could, but I'd have to do that for each and every package that I need to build.

  Well, there's always the Windows-way-of-interposing-by-symlink: put a .bat
file in your %PATH% ahead of or even alongside the executable.  If you just
invoke "gcc", and there's a "gcc.bat" and a "gcc.exe" (which happens to be a
non-executable symlink, but let that pass for now) both in the same directory
in PATH, the .bat file will win.  And can then invoke the actual
(differently-named) exe passing through all the command-line args.

  To prevent the .bat from interfering with normal Cygwin operation, I'd
recommend you add an extra (new) directory to the front of your windows PATH
and put the .bat file(s) there, rather than shoving them alongside in /bin.

  (Aren't you going to have hideous nightmares in this whole thing anyway when
windows python passes windows-style paths to cygwin gcc?  Well, it should
mostly work, but don't expect to get anything useful if you're generating
dependency files.)

    cheers,
      DaveK


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list