#! /bin/sh

CRTDIR=${1-${CRTDIR-/usr/local/Gnu/lib/gcc/aux/2.4.2}}

files=`echo /lib/*crt*.o /usr/lib/*crt*.o`

cp $files $CRTDIR

for file in $files; do
	lfile=$CRTDIR/`basename $file`
	./crtfix $lfile
	fixout=`cmp $file $lfile`
	if [ $? = 0 ]; then
		rm $lfile
	else
		echo Fixed `basename $file`
	fi
done
