1
0
Fork 0

build: win32: don't use mklink - use ln or fallback to cp

For the following reasons:
- Native windows links are rarely used in general.
- Require elevated privileges even if the current user has administrator
  privileges (needs further "run as administrator").
- Most/all windows shell environments capable of running configure already
  support ln (msys[1], msys2, most probably cygwin too).
- If cross building tcc on linux for windows then native mklink is not
  available, as well as 'cmd' (in this scenario the build later fails
  for other reasons, but at least configures succeeds now).
- cp is good enough as fallback since we only copy 5 makefiles anyway.
- The only environment I'm aware of which doesn't support ln -s is busybox
  for windows, and with this patch it falls back to cp and completes
  configure successfully (and the build later succeeds, assuming valid
  $CC and $AR).
This commit is contained in:
Avi Halachmi (:avih) 2016-10-10 14:41:33 +03:00
parent 71b16f4e18
commit 61894e17cd
1 changed files with 2 additions and 5 deletions

7
configure vendored
View File

@ -551,11 +551,8 @@ fn_makelink()
esac
;;
esac
if test "$mingw32" = "yes" ; then
cmd //c mklink `echo "$2 $tgt" | sed 's,/,\\\\,g'`
else
ln -sfn $tgt $2
fi
ln -sfn $tgt $2 || ( echo "ln failed. Using cp instead."; cp -f $1/$2 $2 )
}
if test "$source_path_used" = "yes" ; then