$NetBSD: manual-ltmain.in,v 1.3 2022/08/03 13:06:32 jperkin Exp $ Avoid empty relink_command. --- build-aux/ltmain.in.orig 2022-03-17 02:43:39.000000000 +0000 +++ build-aux/ltmain.in @@ -6478,7 +6478,11 @@ func_mode_link () # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then - add=$libdir/$linklib + if test -f "$inst_prefix_dir$libdir/$linklib"; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name @@ -9051,7 +9055,7 @@ dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" - if test no,yes = "$installed,$need_relink"; then + if test no,yes = "$installed,$need_relink" && test -n "$relink_command"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi