libtool-patches
[Top][All Lists]
Advanced

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

Re: Libtool: Microsoft dumpbin as name lister


From: Albert Chin
Subject: Re: Libtool: Microsoft dumpbin as name lister
Date: Tue, 23 Aug 2005 07:40:01 -0500
User-agent: Mutt/1.5.6i

On Tue, Aug 23, 2005 at 09:53:58AM +0200, Peter Ekberg wrote:
> Albert Chin wrote:
> > > Running "link /dump" has the same effect as running "dumpbin"; so
> > > perhaps checking for MS Link is enough - if you have identified
> > > the MS linker, you can use it to list symbols (and I imagine
> > > libtool may need to know about the linker anyway).
> > 
> > If dumpbin is an alias for "link" with some args, how about scrapping
> > use of dumpbin and replacing with the appropriate "link" command-line?
> 
> As the same is true for "lib" == "link -lib" I have had the same
> thought. The problem is that link is most likely shadowed on the
> PATH on Cygwin. So, some care has to be taken to avoid the use
> of the wrong link program.

So, if "link" appears in multiple places in $PATH, we just need to
pick the "correct" one? Libtool does something similar for grep and
sed (i.e. pick the best one in $PATH that supports the longest
command-line).

> I dreamed up something like this:
> 
> 1. Check if $CC is cl with a test compile to see if $CC
>    defines _MSC_VER, if not bail.
> 
> 2. If (first word of) $CC contains / or \, replace last
>    path component (should be cl or cl.exe) with "link".
> 
> 3. If (first word of) $CC does not contain / or \, use
>    which(1) (or, if which should not be used for some reason,
>    search the path manually) to locate the full path of
>    $CC and replace last path component with "link".
> 
> You now have good input for $LD.
> 
> : ${NM="$LD -dump -symbols"}
> : ${AR="$LD -lib"}
> 
> Any faults in the above? Comments?

Ick. Why not just test all available "link" programs in $PATH for the
features we want and pick the winner?

-- 
albert chin (address@hidden)




reply via email to

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