diff --git a/configure b/configure index 25697bb590..9d213020c3 100755 --- a/configure +++ b/configure @@ -41,8 +41,8 @@ compile_prog() { # symbolically link $1 to $2. Portable version of "ln -sf". symlink() { - rm -f $2 - ln -s $1 $2 + rm -rf "$2" + ln -s "$1" "$2" } # check whether a command is available to this shell (may be either an @@ -3435,7 +3435,7 @@ fi for d in libdis libdis-user; do mkdir -p $d - symlink $source_path/Makefile.dis $d/Makefile + symlink "$source_path/Makefile.dis" "$d/Makefile" echo > $d/config.mak done @@ -3444,13 +3444,13 @@ if test "$linux" = "yes" ; then mkdir -p linux-headers case "$cpu" in i386|x86_64) - symlink $source_path/linux-headers/asm-x86 linux-headers/asm + symlink "$source_path/linux-headers/asm-x86" linux-headers/asm ;; ppcemb|ppc|ppc64) - symlink $source_path/linux-headers/asm-powerpc linux-headers/asm + symlink "$source_path/linux-headers/asm-powerpc" linux-headers/asm ;; s390x) - symlink $source_path/linux-headers/asm-s390 linux-headers/asm + symlink "$source_path/linux-headers/asm-s390" linux-headers/asm ;; esac fi @@ -3515,7 +3515,7 @@ mkdir -p $target_dir/kvm if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then mkdir -p $target_dir/nwfpe fi -symlink $source_path/Makefile.target $target_dir/Makefile +symlink "$source_path/Makefile.target" "$target_dir/Makefile" echo "# Automatically generated by configure - do not modify" > $config_target_mak @@ -3958,7 +3958,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 @@ -3981,7 +3981,7 @@ for hwlib in 32 64; do mkdir -p $d mkdir -p $d/ide mkdir -p $d/usb - symlink $source_path/Makefile.hw $d/Makefile + symlink "$source_path/Makefile.hw" "$d/Makefile" mkdir -p $d/9pfs echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak done @@ -3989,7 +3989,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 @@ -3997,7 +3996,7 @@ d=libuser mkdir -p $d mkdir -p $d/trace mkdir -p $d/qom -symlink $source_path/Makefile.user $d/Makefile +symlink "$source_path/Makefile.user" "$d/Makefile" if test "$docs" = "yes" ; then mkdir -p QMP