Blame SOURCES/0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch

4fe85b
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
4fe85b
From: Andrey Borzenkov <arvidjaar@gmail.com>
4fe85b
Date: Sat, 18 Jan 2014 22:48:04 +0400
4fe85b
Subject: [PATCH] fix removal of {cpu,machine} links on mingw/msys
4fe85b
4fe85b
At least on Windows 2003 using "ln -s dir1 dir2" in msys shell succeeds,
4fe85b
but results in what looks like hard link. Subsequent "rm -f dir2" (e.g.
4fe85b
during second config.status invocation) fails. Check that we also can
4fe85b
remove link to directory.
4fe85b
4fe85b
Make it more clear in message that we are checking "ln -s".
4fe85b
---
4fe85b
 ChangeLog    | 5 +++++
4fe85b
 acinclude.m4 | 6 +++---
4fe85b
 2 files changed, 8 insertions(+), 3 deletions(-)
4fe85b
4fe85b
diff --git a/ChangeLog b/ChangeLog
4fe85b
index cff9386d3d2..c3bfa9fcb1b 100644
4fe85b
--- a/ChangeLog
4fe85b
+++ b/ChangeLog
4fe85b
@@ -1,3 +1,8 @@
4fe85b
+2014-01-18  Andrey Borzenkov <arvidjaar@gmail.com>
4fe85b
+
4fe85b
+	* acinclude.m4 (grub_CHECK_LINK_DIR): Check that we can also remove
4fe85b
+	symbolic link to directory. It fails in Msys shell on Windows 2003.
4fe85b
+
4fe85b
 2014-01-18  Vladimir Serbinenko  <phcoder@gmail.com>
4fe85b
 
4fe85b
 	* Makefile.am (default_payload.elf): Add modules
4fe85b
diff --git a/acinclude.m4 b/acinclude.m4
4fe85b
index 32d5477d100..b2bb88d838e 100644
4fe85b
--- a/acinclude.m4
4fe85b
+++ b/acinclude.m4
4fe85b
@@ -418,15 +418,15 @@ else
4fe85b
 [fi]
4fe85b
 ])
4fe85b
 
4fe85b
-dnl Check if ln can handle directories properly (mingw).
4fe85b
+dnl Check if ln -s can handle directories properly (mingw).
4fe85b
 AC_DEFUN([grub_CHECK_LINK_DIR],[
4fe85b
-AC_MSG_CHECKING([whether ln can handle directories properly])
4fe85b
+AC_MSG_CHECKING([whether ln -s can handle directories properly])
4fe85b
 [mkdir testdir 2>/dev/null
4fe85b
 case $srcdir in
4fe85b
 [\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;;
4fe85b
     *) reldir=../$srcdir/include/grub/util ;;
4fe85b
 esac
4fe85b
-if ln -s $reldir testdir/util 2>/dev/null ; then]
4fe85b
+if ln -s $reldir testdir/util 2>/dev/null && rm -f testdir/util 2>/dev/null ; then]
4fe85b
   AC_MSG_RESULT([yes])
4fe85b
   [link_dir=yes
4fe85b
 else