diff --git a/build-aux/meson-make-symlink.sh b/build-aux/meson-make-symlink.sh index 501cd43d..24a0dd2c 100644 --- a/build-aux/meson-make-symlink.sh +++ b/build-aux/meson-make-symlink.sh @@ -4,9 +4,13 @@ set -eu # this is needed mostly because $DESTDIR is provided as a variable, # and we need to create the target directory... +# test if ln is GNU or not +LN_FLAG="-T" +strings /bin/ln | grep -q 'GNU coreutils' || LN_FLAG="" + mkdir -vp "$(dirname "${DESTDIR:-}$2")" if [ "$(dirname $1)" = . ]; then - ln -vfs -T "$1" "${DESTDIR:-}$2" + ln -vfs ${LN_FLAG} "$1" "${DESTDIR:-}$2" else - ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2" + ln -vfs ${LN_FLAG} --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2" fi