File: check_linker

package info (click to toggle)
opam 2.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,500 kB
  • sloc: ml: 61,414; sh: 2,963; ansic: 1,147; makefile: 479; sed: 6; csh: 1
file content (17 lines) | stat: -rwxr-xr-x 441 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash

# Ensure that the Microsoft Linker isn't being messed up by /usr/bin/link
FIRST=1
FAULT=0
PREPEND=
while IFS= read -r line; do
  OUTPUT=$("$line" --version 2>/dev/null | head -1 | grep -F "Microsoft (R) Incremental Linker")
  if [ "x$OUTPUT" = "x" -a $FIRST -eq 1 ] ; then
    FAULT=1
  elif [ $FAULT -eq 1 ] ; then
    PREPEND=$(dirname "$line"):
    FAULT=0
  fi
done < <(which --all link)

echo $PATH_PREPEND$PREPEND