From 126b1ffd109f8a976126e8132b594c3245811e33 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Wed, 4 Dec 2024 11:20:53 +0200 Subject: [PATCH] configure: win32: error only once about 'ln failed' Don't try ln again if it failed, it won't have better luck next time. --- configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index e0fe6efb..f135700f 100755 --- a/configure +++ b/configure @@ -710,6 +710,7 @@ rm -f $TMPN* $CONFTEST # --------------------------------------------------------------------------- # build tree in object directory if source path is different from current one +use_cp= fn_makelink() { tgt=$1/$2 @@ -726,7 +727,9 @@ fn_makelink() ;; esac - ln -sfn "$tgt" $2 || ( echo "ln failed. Using cp instead."; cp -f "$1/$2" $2 ) + test -n "$use_cp" || ln -sfn "$tgt" $2 || + { use_cp=yes; echo "ln failed. Using cp instead."; } + test -z "$use_cp" || cp -f "$1/$2" $2 } if test "$source_path_used" = "yes" ; then