1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-16 03:24:07 +00:00
freebsd-ports/devel/llvm34/files/llvm-wrapper.sh.in
Tobias Kortkamp ef23d24eb5 devel/llvm*: Fix wrapper scripts to support symlinking to them
The wrapper scripts currently do not resolve the real path to $0:

$ install -l rs /usr/local/bin/clang50 gcc
$ ./gcc
./gcc: /usr/local/llvm50/bin/gcc: not found

Here /usr/local/llvm50/bin/clang should be called not
/usr/local/llvm50/bin/gcc.

Approved by:		brooks (maintainer)
Differential Revision:	https://reviews.freebsd.org/D14727
2018-03-31 03:28:42 +00:00

12 lines
274 B
Bash

#!/bin/sh
# $FreeBSD$
LLVM_PREFIX="%%LLVM_PREFIX%%"
LLVM_SUFFIX="%%LLVM_SUFFIX%%"
tool=$(/bin/realpath $0)
tool=${tool##*/}
tool="${LLVM_PREFIX}/bin/${tool%${LLVM_SUFFIX}}"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}${LLVM_PREFIX}/lib" \
"${tool}" "${@}"