On 4/5/2011 10:21 AM, Ralf Wildenhues wrote:
> * Charles Wilson wrote on Tue, Apr 05, 2011 at 04:15:02PM CEST:
>> On 4/5/2011 9:21 AM, Arnaud Charlet wrote:
>>>> I'm one of the MSys "devs" (if you want to call the sporadic process of
>>>> updating MSys "development").  I'll take a look at implementing
>>>>    ln -s file dir
>>>> as synonymous with
>>>>    ln -s file dir/basename-of-file
>>>> in the next few days.
> 
> Please use LN_S *only* in the way that it is documented.  Let me quote 'info 
> Autoconf --index LN_S':
> 
>  -- Macro: AC_PROG_LN_S
>      If `ln -s' works on the current file system (the operating system
>      and file system support symbolic links), set the output variable
>      `LN_S' to `ln -s'; otherwise, if `ln' works, set `LN_S' to `ln',
>      and otherwise set it to `cp -p'.
> 
>      If you make a link in a directory other than the current
>      directory, its meaning depends on whether `ln' or `ln -s' is used.
>      To safely create links using `$(LN_S)', either find out which form
>      is used and adjust the arguments, or always invoke `ln' in the
>      directory where the link is to be created.
> 
>      In other words, it does not work to do:
>           $(LN_S) foo /x/bar
> 
>      Instead, do:
> 
>           (cd /x && $(LN_S) foo bar)

OK, so you're saying "don't 'fix' MSys's ln -s behavior since doing so
would contravene normal expectations"

However, as Arno pointed out, right now for MSys LN_S is defined as "cp
-p" so it appears that "ln -s" behavior is a red herring.

This confuses me, because as I demonstrated earlier:

$ cp -p file dir

*works* on MSys.  So, I think we need more information from Kai about
WHAT exactly is failing here.  He claims that
        cp -p file dir
fails for him (and, wants to 'fix' it by adding -r, which implies that
some element of the foreach statement resolves to a *dir*, not a *file*
-- but Arno says that is not the case. /me = confused...)

What version of coreutils, and msys, are you using, Kai?  I tested with
msys-1.0.16 and coreutils-5.97-3.  Contact me offlist if you want help
running these details down.


As a side issue, it ALSO seems to me that Ada's Mafile.in is doing it
wrong, given Ralf's statements above:

        # Copy target independent sources
        $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
          $(LN_S) $(fsrcpfx)ada/$(f) $(RTSDIR) ;) true

But as this isn't shell code (some sort of Ada buildfile? I'm not
familiar with building Ada), I'm not sure exactly how to "fix" it in the
event LN_S is ACTUALLY defined as "ln -s" or "ln" (which, recall, is NOT
the case on MSYS, which apparently uses cp -p).

--
Chuck

Reply via email to