delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/05/08/08:13:17

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4A041AC5.4020404@gmail.com>
Date: Fri, 08 May 2009 12:43:01 +0100
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: [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]
References: <20090507 DOT 232840 DOT 13468 DOT 0 AT webmail11 DOT dca DOT untd DOT com>
In-Reply-To: <20090507.232840.13468.0@webmail11.dca.untd.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

[ 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019