On 14/05/11 09:07, Paul Eggert wrote:
>> If something treats symlink mtime as significant,
>> then I suspect that it's at fault.
>
> Yes, there's something busted there. GNU 'make' does the right thing:
> it follows symlinks when checking time stamps. Is some other 'make'
> is being used, or perhaps some tool other than 'make'?
I suspect something else in the depths of auto* is busted,
as I'm using standard make.
>> If we did want to maintain the symlink timestamps for some reason,
>> then I suppose we could do something like the following,
>> but I'm unsure as how to do this best portably.
>
> We can use 'ls' rather than 'stat'. Something like the following, perhaps?
> (I haven't tested it.)
I tested your ls ordering trick on linux, solaris 10 and freebsd and it works.
Please push.
thanks!
Pádraig.
>
> diff --git a/build-aux/bootstrap b/build-aux/bootstrap
> index d32db57..b6dacb7 100755
> --- a/build-aux/bootstrap
> +++ b/build-aux/bootstrap
> @@ -670,10 +670,17 @@ symlink_to_dir()
> cp -fp "$src" "$dst"
> }
> else
> + # Leave any existing symlink alone, if it already points to the source,
> + # so that broken 'make' implementations that care about symlink times
> + # aren't confused into doing unnecessary builds. Conversely, if the
> + # existing symlink's time stamp is older than the source, make it
> afresh,
> + # so that broken 'make's aren't confused into skipping needed builds.
> test -h "$dst" &&
> src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
> dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
> - test "$src_i" = "$dst_i" || {
> + test "$src_i" = "$dst_i" &&
> + both_ls=`ls -dt "$src" "$dst"` &&
> + test "X$both_ls" = "X$dst$nl$src" || {
> dot_dots=
> case $src in
> /*) ;;