Skip to contentSkip to conversation

configure: Don't create symlinks to nonexistent targets

PATCH Superseded Peter Maydell 1 participant 1 message May 25, 2011

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Don't create symlinks to nonexistent targets

When we create the symlinks to source tree files, don't create them if the file is not actually present in the source tree; this will happen if the file is in a git submodule that wasn't checked out.

This also avoids the odd effect where an in-source-tree configure will end up creating the missing file as a symlink to itself.

---
 configure |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
configure +4 -1
index a318d37..e4d29d9 100755
@@ -3564,7 +3564,10 @@ for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.rom $source_p
 done
 mkdir -p $DIRS
 for f in $FILES ; do
-    test -e $f || symlink $source_path/$f $f
+    if [ -e "$source_path/$f" -a ! -e "$f" ]; then
+        echo "symlinking $source_path/$f $f"
+        symlink "$source_path/$f" "$f"
+    fi
 done
 
 # temporary config to build submodules
Signature · 1 line
1.7.1