libtool-patches
[Top][All Lists]
Advanced

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

Re: [4/11] Native MSVC support (file-magic-glob)


From: Peter Rosin
Subject: Re: [4/11] Native MSVC support (file-magic-glob)
Date: Thu, 12 Jul 2007 13:11:08 +0200
User-agent: Mutt/1.5.12-2006-07-14

On Thu, Jul 12, 2007 at 03:32:18AM -0400, Charles Wilson wrote:
> Peter Rosin wrote:
> >     * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD),
> >     libltdl/config/ltmain.m4sh (func_mode_link): On Windows,
> >     find potential libs regardless of file name case.
> 
> Hmm.  Well, this one might pose some problems.  On cygwin, there exists 
> something called "managed mounts" where cygwin transmogrifies all 
> filenames (using RFC2396 encoding -- see 
> http://www.rfc-editor.org/rfc/rfc2396.txt section 2.4) to work around 
> the limitations of Windows' filesystems.
> 
> In particular, it allows you to have distinct files in the same 
> directory whose names differ only in case.  e.g.
> 
> FOO.a ==> %46%4F%4F.a
> Foo.a ==> %46oo.a
> foo.a ==> foo.a
> 
> (If you look at the directory using a non-cygwin app, the files are 
> actually names as they appear in the right hand column above)
> 
> If managed mounts are in use, and some idiot actually has libraries like 
> this [*], what does -lfoo mean?  With this patch, it seems a bit -- 
> well, not really random, but non-intuitive and unpredictable to the 
> casual user.   Whichever of FOO.a, Foo.a, or foo.a is returned first by 
> the shell glob -- which may differ depending on $SHELL and the 
> underlying glob implementation[**] -- is the one you get.
> 
> OTOH, this may be a case of "Doctor, it hurts when I do this", "OK, 
> don't do that then": don't be stupid when naming distinct libraries.  If 
> you insist on being stupid, we can't help you.
> 
> In fact, I rather lean toward this approach -- and to accepting Peter's 
> patch in principle. There is such a thing as being TOO defensive when 
> programming.
> 
> 
> 
> As to implementation...ye gods.  Turning every libname into

*giggle*

> [lL][iI][bB][nN][aA][mM][eE]
> 
> by using this sed expr
> 
> s/[aA]/[aA]/g;s/[bB]/[bB]/g;<22 more>;s/[yY]/[yY]/g;s/[zZ]/[zZ]/g;
> 
> Isn't there a better way? (I can't think of one offhand, given how this 
> is used to generate a list of "potential_libs", but still...this can't 
> be very efficient.)

I was aiming for minimal impact on unaffected systems, that way I
feel more confident that I'm not causing regressions. Perhaps a bit
defensive...

It is probably easier to make it more efficient if you allow yourself
more drastic changes in ltmain.m4sh. But I'm no shell guru, so who am
I to tell?

Anyway, works for me. I could also quote this from Ralf from February
last year: "It'd be great if you could separate out the file_magic_glob
related changes and post them with a ChangeLog entry.  They are probably
ok."

There is that pesky little "probably" in there though, that still leaves
the patch dangling.

Cheers,
Peter




reply via email to

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