summaryrefslogtreecommitdiffstats
path: root/src
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
parente650371a292ac4c39479ab95500d18d5222273b6 (diff)
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')
-rw-r--r--src/util/ChangeLog11
-rw-r--r--src/util/Makefile.in11
-rw-r--r--src/util/configure.in2
-rw-r--r--src/util/libupdate.sh42
4 files changed, 66 insertions, 0 deletions
diff --git a/src/util/ChangeLog b/src/util/ChangeLog
index d76cbcb115..bfd94db160 100644
--- a/src/util/ChangeLog
+++ b/src/util/ChangeLog
@@ -1,3 +1,14 @@
+Tue Nov 1 14:49:00 1994 (tytso@rsx-11)
+
+ * configure.in:
+ * Makefile.in:
+ * 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.)
+
Tue Oct 11 19:07:09 1994 Mark Eichin (eichin@cygnus.com)
* kbuild (MAKETARGETS): default to "all check" for make, but allow
diff --git a/src/util/Makefile.in b/src/util/Makefile.in
index b4ceb6e6c7..b95fd594ca 100644
--- a/src/util/Makefile.in
+++ b/src/util/Makefile.in
@@ -1,5 +1,16 @@
CFLAGS = $(CCOPTS)
LDFLAGS = -g
+editsh = sed -e 's,@''ARADD''@,$(ARADD),g' -e 's,@''ARCHIVE''@,$(ARCHIVE),g'
+
+all:: libupdate
+
+libupdate: $(srcdir)/libupdate.sh
+ rm -f $@ $@.tmp
+ $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
+
+clean::
+ $(RM) libupdate
+
install::
@echo nothing to install in util
diff --git a/src/util/configure.in b/src/util/configure.in
index efbec92836..f70c188a3f 100644
--- a/src/util/configure.in
+++ b/src/util/configure.in
@@ -2,6 +2,8 @@ AC_INIT(configure.in)
WITH_CCOPTS
CONFIG_RULES
AC_SET_BUILDTOP
+AC_PROG_ARCHIVE
+AC_PROG_ARCHIVE_ADD
CONFIG_DIRS(et ss)
MAKE_SUBDIRS("making",all)
MAKE_SUBDIRS("cleaning",clean)
diff --git a/src/util/libupdate.sh b/src/util/libupdate.sh
new file mode 100644
index 0000000000..3abcdd114a
--- /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
+
+
+
+
+
+
+