qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: Fix creation of symbolic links for MinGW toolchain
@ 2012-03-17 15:31 Stefan Weil
  2012-03-17 15:49 ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Weil @ 2012-03-17 15:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Stefan Weil

The MinGW toolchain on w32/w64 hosts does not create symbolic links,
but implements 'ln -s' similar to 'cp -r'.

In incremental out of tree builds, this resulted in files which
were not updated when their counterparts in the QEMU source tree
changed. Especially for Makefile* this happened very often.

With this patch, the 'symlinked' files are now always updated for
out of tree builds. Similar code was already used for the symbolic
link of libcacard/Makefile.

The symlink macro always removes the target before it is created
again, therefore the rm command for libcacard/Makefile was redundant
and is removed now.

Macro symlink is also used with directories. To remove them on w32
hosts, a recursive rm is needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 configure |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index afe7395..acf63a9 100755
--- a/configure
+++ b/configure
@@ -41,7 +41,7 @@ compile_prog() {
 
 # symbolically link $1 to $2.  Portable version of "ln -sf".
 symlink() {
-  rm -f $2
+  rm -rf $2
   ln -s $1 $2
 }
 
@@ -3883,7 +3883,7 @@ do
 done
 mkdir -p $DIRS
 for f in $FILES ; do
-    if [ -e "$source_path/$f" ] && ! [ -e "$f" ]; then
+    if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then
         symlink "$source_path/$f" "$f"
     fi
 done
@@ -3914,7 +3914,6 @@ done
 if [ "$source_path" != `pwd` ]; then
     # out of tree build
     mkdir -p libcacard
-    rm -f libcacard/Makefile
     symlink "$source_path/libcacard/Makefile" libcacard/Makefile
 fi
 
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-19 12:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-17 15:31 [Qemu-devel] [PATCH] configure: Fix creation of symbolic links for MinGW toolchain Stefan Weil
2012-03-17 15:49 ` Peter Maydell
2012-03-17 15:59   ` Stefan Weil
2012-03-17 17:24     ` Peter Maydell
2012-03-19 11:30       ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-03-19 12:20         ` [Qemu-devel] [PATCH v2] " Stefan Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).