From: Ralf Wildenhues Date: Mon, 10 Apr 2006 17:55:33 +0000 (+0000) Subject: * lib/m4sugar/m4sh.m4 (_AS_LN_S_PREPARE): MSYS `ln -s' fails X-Git-Tag: AUTOCONF-2.59c~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ca1cfdde2a036abce9713ab5c635b2a868c87f2;p=thirdparty%2Fautoconf.git * 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 against MSYS, analyzed by Keith Marshall . --- diff --git a/ChangeLog b/ChangeLog index 31735b116..98e42ddc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2006-04-10 Ralf Wildenhues + * 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 against MSYS, + analyzed by Keith Marshall . + * THANKS: Update. 2006-04-10 Paul Eggert diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index c6b01c9ed..6ab58f942 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -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