libupdate.sh: Add support for the new libupdate shell script. It
authorTheodore Tso <tytso@mit.edu>
Tue, 1 Nov 1994 19:53:16 +0000 (19:53 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 1 Nov 1994 19:53:16 +0000 (19:53 +0000)
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

src/util/ChangeLog
src/util/Makefile.in
src/util/configure.in
src/util/libupdate.sh [new file with mode: 0644]

index d76cbcb1158e4318628590c964034e1a65854109..bfd94db160ca2f4ea552bb5812b5bffb61704444 100644 (file)
@@ -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
index b4ceb6e6c74c3c435af0a5be384c1bd6aab76436..b95fd594caa17968ba1a6fa884f0568a8ceba871 100644 (file)
@@ -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
index efbec92836f80f7b7dabd7cbfc92b993f5fb3a87..f70c188a3f73c08431a0e0ccf5b5d222eabc4fb0 100644 (file)
@@ -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 (file)
index 0000000..3abcdd1
--- /dev/null
@@ -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
+
+
+
+
+
+
+