From: Theodore Tso Date: Tue, 1 Nov 1994 19:53:16 +0000 (+0000) Subject: libupdate.sh: Add support for the new libupdate shell script. It X-Git-Tag: krb5-1.0-beta5~1046 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=224911c07becad9d9e31366216dc47b91476b41b;p=krb5.git 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 --- diff --git a/src/util/ChangeLog b/src/util/ChangeLog index d76cbcb11..bfd94db16 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 b4ceb6e6c..b95fd594c 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 efbec9283..f70c188a3 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 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 +# + +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 + + + + + + +