]>
Commit | Line | Data |
---|---|---|
7629744a | 1 | #!/bin/sh |
9ee03516 | 2 | # SPDX-License-Identifier: LGPL-2.1-or-later |
7629744a | 3 | set -eu |
7b76fce1 | 4 | |
3b6fd3c1 FS |
5 | SOURCE="${1:?}" |
6 | TARGET="${2:?}" | |
7 | ||
09422f9a DDM |
8 | if [ "${MESON_INSTALL_QUIET:-0}" = 1 ] ; then |
9 | VERBOSE="" | |
10 | else | |
11 | VERBOSE="v" | |
12 | fi | |
13 | ||
7b76fce1 ZJS |
14 | # this is needed mostly because $DESTDIR is provided as a variable, |
15 | # and we need to create the target directory... | |
16 | ||
3b6fd3c1 FS |
17 | mkdir -${VERBOSE}p "$(dirname "${DESTDIR:-}$TARGET")" |
18 | if [ "$(dirname "$SOURCE")" = . ] || [ "$(dirname "$SOURCE")" = .. ]; then | |
19 | ln -${VERBOSE}fs -T -- "$SOURCE" "${DESTDIR:-}$TARGET" | |
7b76fce1 | 20 | else |
3b6fd3c1 | 21 | ln -${VERBOSE}fs -T --relative -- "${DESTDIR:-}$SOURCE" "${DESTDIR:-}$TARGET" |
7b76fce1 | 22 | fi |