The "-T" flag is something available with GNU ln, but on other implementations of ln, "-T" is not an option. So, to make this script more portable, a strings check of ln for "GNU coreutils" is done to determine if "-T" should be used.
Signed-off-by: Mark Weiman <mark.weiman@markzz.com> --- build-aux/meson-make-symlink.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
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="" No strings needed just do: ln --version|grep GNU
Or skip -T even with GNU ln.