#!/bin/sh # $Id: save-vile,v 1.8 1996/12/09 18:31:12 dickey Exp $ # # save the built-stuff from configuring & building vile, to make it simpler # to do rebuilds # SRC=`pwd` DST=../save-vile THIS=`basename $SRC` THAT=`echo $THIS|sed -e s/vile//` if test "$THIS" = "$THAT" then echo '? cannot save '$SRC exit 1 fi for f in config.status config.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'` Disp=`egrep '^s%@SCREEN@%.*%g' config.status | sed -e 's/s%@SCREEN@%//' -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$//'` set -- `egrep '^s%@LIBS@%.*g$' config.status | sed -e 's/^.*@%//' -e 's/%g$//'` if [ "$Disp" = "x11" ] then while [ $# != 0 -a "$Disp" = "x11" ] do case $1 in -lXol) Disp=Xol ;; -lXm) Disp=Xm ;; -lXt) Disp=Xt ;; esac shift done elif [ "$Disp" = "tcap" ] then while [ $# != 0 -a "$Disp" = "tcap" ] do case $1 in -lncurses) Disp=ncurses ;; esac shift done fi OUT=${Host}-${Comp}${Opts}-${Disp} 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 config.h |(cd $DST/$OUT; tar xf -) cd $DST archive $OUT chmod -w .