[x264-devel] msvs: Prefer link.exe from the same directory as cl.exe

Henrik Gramner git at videolan.org
Wed Aug 19 21:16:13 CEST 2015


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Sun Jul 26 23:13:19 2015 +0200| [aa9d22927c0264c08c11c9e72294fc651a155b3e] | committer: Anton Mitrofanov

msvs: Prefer link.exe from the same directory as cl.exe

/usr/bin/link from coreutils may be located before the MSVS linker in $PATH
which causes linking to fail due to using the wrong binary.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=aa9d22927c0264c08c11c9e72294fc651a155b3e
---

 configure |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 768a781..fb761d6 100755
--- a/configure
+++ b/configure
@@ -1243,7 +1243,13 @@ DEPMT="${QPRE}MT"
 if [ $compiler_style = MS ]; then
     AR="lib -nologo -out:"
     LD="link -out:"
-    [ $compiler = ICL ] && AR="xi$AR" && LD="xi$LD"
+    if [ $compiler = ICL ]; then
+        AR="xi$AR"
+        LD="xi$LD"
+    else
+        mslink="$(dirname "$(command -v cl 2>/dev/null)")/link"
+        [ -x "$mslink" ] && LD="\"$mslink\" -out:"
+    fi
     HAVE_GETOPT_LONG=0
     LDFLAGS="-nologo -incremental:no $(cl_ldflags $LDFLAGS)"
     LDFLAGSCLI="$(cl_ldflags $LDFLAGSCLI)"



More information about the x264-devel mailing list