]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): MSYS `ln -s' fails
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 10 Apr 2006 17:55:33 +0000 (17:55 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 10 Apr 2006 17:55:33 +0000 (17:55 +0000)
with a target directory; it's internally implemented as `cp'
anyway, but since Autoconf advertises the possibility to use
a target directory when LN_S is `ln -s', we need to find out.
Reported by Rolf Ebert <rolf.ebert.gcc@gmx.de> against MSYS,
analyzed by Keith Marshall <keith.marshall@total.com>.

ChangeLog
lib/m4sugar/m4sh.m4

index 31735b116aef92c9aed6dccf8aed374e9a08ec2b..98e42ddc526ec8fecfbf8c9a94a1dbdcdf1612a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2006-04-10  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): MSYS `ln -s' fails
+       with a target directory; it's internally implemented as `cp'
+       anyway, but since Autoconf advertises the possibility to use
+       a target directory when LN_S is `ln -s', we need to find out.
+       Reported by Rolf Ebert <rolf.ebert.gcc@gmx.de> against MSYS,
+       analyzed by Keith Marshall <keith.marshall@total.com>.
+
        * THANKS: Update.
 
 2006-04-10  Paul Eggert  <eggert@cs.ucla.edu>
index c6b01c9ed9e098e99ea0ed44e9f2f979f0ca6147..6ab58f942cce5eaa0d883791f7a2192477077bc4 100644 (file)
@@ -857,11 +857,18 @@ _AS_LINENO_WORKS || {
 # Don't use conftest.sym to avoid file name issues on DJGPP, where this
 # would yield conftest.sym.exe for DJGPP < 2.04.  And don't use `conftest'
 # as base name to avoid prohibiting concurrency (e.g., concurrent
-# config.statuses).
+# config.statuses).  MSYS `ln -s' fails with a target directory.
 m4_defun([_AS_LN_S_PREPARE],
 [rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
+if ln -s conf$$.file conf$$ 2>/dev/null &&
+   ln -s conf$$.file conf$$.dir 2>/dev/null; then
   # We could just check for DJGPP; but this test a) works b) is more generic
   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
   if test -f conf$$.exe; then
@@ -875,7 +882,8 @@ elif ln conf$$.file conf$$ 2>/dev/null; then
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 ])# _AS_LN_S_PREPARE