summaryrefslogtreecommitdiffstats
path: root/src/util/libupdate.sh
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-11-01 19:53:16 +0000
committerTheodore Tso <tytso@mit.edu>1994-11-01 19:53:16 +0000
commit224911c07becad9d9e31366216dc47b91476b41b (patch)
tree18e222744b184c7be8bc755e78a6dde7b37daa6b /src/util/libupdate.sh
parente650371a292ac4c39479ab95500d18d5222273b6 (diff)
downloadkrb5-224911c07becad9d9e31366216dc47b91476b41b.tar.gz
krb5-224911c07becad9d9e31366216dc47b91476b41b.tar.xz
krb5-224911c07becad9d9e31366216dc47b91476b41b.zip
libupdate.sh: Add support for the new libupdate shell script. It
automatically updates a library from a file listing of constituent .o files. It only calls "ar" if it absolutely has to, in order to speed things up for partial recompilations. (ar is dreadfully slow if you're using one based on the BFD library.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4602 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/libupdate.sh')
-rw-r--r--src/util/libupdate.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/util/libupdate.sh b/src/util/libupdate.sh
new file mode 100644
index 000000000..3abcdd114
--- /dev/null
+++ b/src/util/libupdate.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# libupdate: Update a library based on a file of object files.
+#
+# Usage: libupdate <library> <object filelist> <directory>
+#
+
+ARADD="@ARADD@"
+ARCHIVE="@ARCHIVE@"
+
+force=
+arcmd="$ARADD"
+if test "$1" = "--force"
+then
+ force=yes
+ arcmd="$ARCHIVE"
+ shift
+fi
+
+library=$1
+oblist=$2
+dir=$3
+
+if test "$force" != yes -a -f $library && \
+ ls -lt $library $oblist | head -1 | grep $library$ > /dev/null || \
+ test -z "`cat $oblist`"
+then
+ exit 0
+fi
+
+echo "Updating library $library from $oblist"
+
+$arcmd $library `cat $oblist | \
+ sed -e "s;^\([^ ]*\);$dir/\1;g" -e "s; \([^ ]*\); $dir/\1;g"`
+touch $library
+
+
+
+
+
+
+