changeset 604:7fc1f4695c29

Minor cosmetic cleanup (don't warn about re-linking things that are expected to already be there), and don't build distccd if it's already in $PATH. (We need to put genext2fs in host/path because system-image.sh isn't using host's $PATH, but run-from-build.sh and friends do use host $PATH.)
author Rob Landley <rob@landley.net>
date Sun, 01 Feb 2009 16:45:51 -0600
parents 524215827ef8
children 9b36b9dbfc4c
files host-tools.sh
diffstat 1 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/host-tools.sh	Thu Jan 29 15:55:25 2009 -0600
+++ b/host-tools.sh	Sun Feb 01 16:45:51 2009 -0600
@@ -35,7 +35,7 @@
   do
     for j in $(ls $i)
     do
-      ln -s wrappy "$BUILD/wrapdir/$j"
+      [ -f "$BUILD/wrapdir/$j" ] || ln -s wrappy "$BUILD/wrapdir/$j"
     done
   done
 
@@ -145,13 +145,18 @@
 
 if [ ! -f "${HOSTTOOLS}"/genext2fs ]
 then
-  setupfor genext2fs &&
-  ./configure &&
-  make -j $CPUS &&
-  cp genext2fs "${HOSTTOOLS}" &&
-  cd ..
+  if [ ! -z "$(which genext2fs)" ]
+  then
+    ln -s "$(which genext2fs)" "${HOSTTOOLS}"/genext2fs
+  else
+    setupfor genext2fs &&
+    ./configure &&
+    make -j $CPUS &&
+    cp genext2fs "${HOSTTOOLS}" &&
+    cd ..
 
-  cleanup genext2fs
+    cleanup genext2fs
+  fi
 fi
 
 # Everything after here is stuff we _could_ build, but currently don't.
@@ -167,10 +172,10 @@
 
 if [ ! -z "$RECORD_COMMANDS" ]
 then 
-  # Add the host tools we just built to wrapdir
+  # Make sure the host tools we just built are also in wrapdir
   for j in $(ls "$HOSTTOOLS")
   do
-    ln -s wrappy "$BUILD/wrapdir/$j"
+    [ -f "$BUILD/wrapdir/$j" ] || ln -s wrappy "$BUILD/wrapdir/$j"
   done
 fi