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

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