aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2016-10-10 14:41:33 +0300
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2016-10-10 14:50:48 +0300
commit61894e17cdbe6d0828c9bd94bad9b1b2d721311a (patch)
treef2f3ba4355d09a4f0e85ed3fb829fbf6f58d0b2b
parent71b16f4e18b2794b76cc80cb7d0303243656b050 (diff)
downloadtinycc-61894e17cdbe6d0828c9bd94bad9b1b2d721311a.tar.gz
tinycc-61894e17cdbe6d0828c9bd94bad9b1b2d721311a.tar.bz2
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).
-rwxr-xr-xconfigure7
1 files changed, 2 insertions, 5 deletions
diff --git a/configure b/configure
index 7c5d438..efffeec 100755
--- a/configure
+++ b/configure
@@ -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