use a wrapper script to call MS link.exe to avoid mixing with /usr/bin/link.exe
authorSteve Lhomme <robux4@gmail.com>
Fri, 24 Jul 2015 07:38:04 +0000 (09:38 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 24 Jul 2015 18:02:32 +0000 (20:02 +0200)
favor link over link.exe in case some wrapper script already exists
fallback to "link" in the path if the one next to cl is not found

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
compat/windows/mslink [new file with mode: 0755]
configure

diff --git a/compat/windows/mslink b/compat/windows/mslink
new file mode 100755 (executable)
index 0000000..07b2b3e
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+LINK_EXE_PATH=$(dirname "$(command -v cl)")/link
+if [ -x "$LINK_EXE_PATH" ]; then
+    "$LINK_EXE_PATH" $@
+else
+    link $@
+fi
+exit $?
index 7b8815f..7748bc7 100755 (executable)
--- a/configure
+++ b/configure
@@ -3183,7 +3183,7 @@ case "$toolchain" in
         else
             cc_default="c99wrap cl"
         fi
-        ld_default="link"
+        ld_default="$source_path/compat/windows/mslink"
         nm_default="dumpbin -symbols"
         ar_default="lib"
         target_os_default="win32"