From: Henrik Gramner Date: Sun, 26 Jul 2015 21:13:19 +0000 (+0200) Subject: msvs: Prefer link.exe from the same directory as cl.exe X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa9d22927c0264c08c11c9e72294fc651a155b3e;p=libx264 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. --- diff --git a/configure b/configure index 768a7814..fb761d63 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)"