The really horrid hack below fixes for me a MINGW/MSys problem that
otherwise occurs inconsistently (fails on different links, and pretends
to have succeeded), but reliably (every run at least one link will not
actually have happened).
There are 2 parts - first we loop a few times until we succeed, and
second after the loop we test that we have actually succeeded, and
complain loudly otherwise.
The second part seems well worth doing. Nobody has yet come up with a
reasonable alternative to the first part (other than making the user do
it by hand, which defeats the whole purpose of configure).
So, the questions are: what parts of this should we do?
1) failure test only or
2) loop plus failure test or
3) nothing
And if not 3), is there some autoconf wizard out there who can help do
this properly? It would probably take me many hours to work out, as I
have never touched the beast.
cheers
andrew
Index: configure
===================================================================
RCS file: /projects/cvsroot/pgsql-server/configure,v
retrieving revision 1.351
diff -c -w -r1.351 configure
*** configure 27 Apr 2004 20:09:27 -0000 1.351
--- configure 29 Apr 2004 20:17:06 -0000
***************
*** 19141,19151 ****
--- 19141,19160 ---- esac
# Make a symlink if possible; otherwise try a hard link.
+ for linktry in 1 2 3 4 5; do ln -s $ac_rel_source $ac_dest 2>/dev/null || ln $srcdir/$ac_source $ac_dest || {
{echo "$as_me:$LINENO: error: cannot link $ac_dest to
$srcdir/$ac_source" >&5echo "$as_me: error: cannot link $ac_dest to $srcdir/$ac_source" >&2;} { (exit 1); exit 1; };
}
+ test -e $ac_dest && break
+ done
+ test -e $ac_dest || + { { echo "$as_me:$LINENO: error: failed to
link $ac_dest to $srcdir/$ac_source"
+ >&5
+ echo "$as_me: error: failed to link $ac_dest to $srcdir/$ac_source" >&2;}
+ { (exit 1); exit 1; }; } done_ACEOF