#!/bin/sh # $Id: save-xterm,v 1.1 1997/06/13 12:59:54 dickey Exp $ # # save the built-stuff from configuring & building xterm, to make it simpler # to do rebuilds # SRC=`pwd` DST=../save-xterm THIS=`basename $SRC` THAT=`echo $THIS|sed -e s/xterm//` if test "$THIS" = "$THAT" then echo '? cannot save '$SRC exit 1 fi for f in config.status xtermcfg.h do if test ! -f $f then echo '? nothing to save: '$f exit 1 fi done if test ! -d $DST then mkdir $DST fi cd $SRC Host=`egrep '^# on host .*:$' config.status | sed -e 's/# on host //' -e 's/://'` Comp=`egrep '^s%@CC@%.*%g' config.status | sed -e 's/s%@CC@%//' -e 's/%g//' -e 's/ //g'` Opts=`egrep '^s%@CFLAGS@%.*g$' config.status | sed -e 's/^.*@%//' -e 's/-[IUD][^ ]*//g' -e 's/-W[a-z-]*//g' -e 's/-g//' -e 's/-O[0-9]*//' -e 's/ //g' -e 's/%g$//'` OUT=${Host}-${Comp}${Opts} if [ -f main.o -a ! -f size.out ] then size *.o >size.out fi echo Creating ${OUT}: chmod u+wx $DST rm -f $DST/${OUT}.tgz rm -rf $DST/$OUT mkdir $DST/$OUT tar cvf - config.status config.cache *.out *.log xtermcfg.h |(cd $DST/$OUT; tar xf -) cd $DST archive $OUT chmod -w .