--- cygnus/src/util/libupdate.sh	Tue Jul  1 14:15:07 1997
+++ kerbnet-1.2/util/libupdate.sh	Tue May 27 22:04:10 1997
@@ -2,45 +2,49 @@
 #
 # libupdate: Update a library based on a file of object files.
 #
-# Usage: libupdate <library> <object filelist> <directory> 
+# Usage: libupdate <library> <object filelist> <directories> 
 #
 
 ARADD="@ARADD@"
 ARCHIVE="@ARCHIVE@"
 
-force=
-rmcmd=
-arcmd="$ARADD"
-if test "$1" = "--force" 
-then
+case "$1" in
+--force)
 	force=yes
 	arcmd="$ARCHIVE"
-	rmcmd="rm -f $library"
 	shift
-fi
-
+	rmcmd="rm -f $1"
+	;;
+*)
+	arcmd="$ARADD"
+	rmcmd=
+	force=
+esac
 library=$1
 oblist=$2
-dir=$3
+shift
+shift
+fail=false
+for dir do
+	test -r $dir/$oblist || {
+	    echo "$0: Can't find file $dir/$oblist!"
+	    fail=true
+	}
+	oblists="$oblists${oblists+ }$dir/$oblist"
+done
+$fail && exit 1
 
 stamp=`echo $library | sed -e 's/.a$/.stamp/'`
 
 if test "$force" != yes -a -f $stamp && \
-   ls -lt $stamp $oblist | sed 1q | grep $stamp$ > /dev/null || \
-   test -z "`cat $oblist`"
+   ls -lt $stamp $oblists | sed 1q | grep $stamp$ > /dev/null || \
+   test -z "`cat $oblists`"
 then
 	exit 0
 fi
 
-echo "Updating library $library from $oblist"
+echo "Updating library $library from $oblists"
 
 $rmcmd
-$arcmd $library `cat $oblist | \
-		sed -e "s;^\([^ ]*\);$dir/\1;g" -e "s; \([^ ]*\); $dir/\1;g"`
-
-
-
-
-
-
-
+$arcmd $library `for dir do (cd $dir; cat $oblist | \
+		sed -e "s;^\([^ ]*\);$dir/\1;g" -e "s; \([^ ]*\); $dir/\1;g") ; done`
