libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cygwin/mingw: binary wrapper fails when invoked via $PATH


From: Bob Friesenhahn
Subject: Re: [PATCH] cygwin/mingw: binary wrapper fails when invoked via $PATH
Date: Tue, 15 Jul 2003 11:39:35 -0500 (CDT)

On Tue, 15 Jul 2003, Charles Wilson wrote:

> Bob Friesenhahn wrote:
>
> > Charles,
> >
> > These changes to ltmain.in seem pretty complex.  For Windows isn't it
> > easier and more reliable to use the GetModuleFileName() function?
> > This allows using a single line of code:
> >
> >   GetModuleFileName(0,path,PATHLENGTH);
> >
> > to obtain the full path to the binary wrapper.
>
> Yes, that will work but...
>
> Are mingw/cygwin going to be the only platforms that ever use a binary
> wrapper?  I know OUR reasons for using it are specific to the cygwin

I have no idea.

> platform, but who knows whether other platforms may have some other
> reason to use a binary wrapper?  (sure, nobody else does NOW, but...)
>
> In any case, I was trying to stick with portable code (".exe" issue
> notwithstanding), instead of restricting the binary wrappers to windows
> only, even though currently they ARE only used on windows.
>
> And besides, $PATH walking is not really that complex.  Every shell does
> it -- and every kernel (execlp).

Do you *know* exactly how Windows locates executables?  I thought not. :-)

Unlike Unix, Windows uses the PATH as a means of last resort.  It
performs a series of checks (likely Windows version dependent) before
it gives up and uses the PATH.  It may be that for libtool's purposes,
the PATH will always be used so your method will always work.

One thing to consider is that GetModuleFileName() will execute faster
than a method which executes a series of stat() calls and that users
will likely appreciate it if their program runs sooner.

Bob
======================================
Bob Friesenhahn
address@hidden
http://www.simplesystems.org/users/bfriesen





reply via email to

[Prev in Thread] Current Thread [Next in Thread]