cmpliball 1.63 KB
#!/bin/sh
#
# script to compare library in asm level 
#
#  cmplib [ROOTpath1] [ROOTpath2]
#

if test $# -gt 0 
  then
    if test $1 = "-h" ; then
       echo "cmpliball [ROOTpath1] [ROOTpath2 (default:\$ROOT)]" ; exit 1
    else
       PRDIR1=$1 ; fi
  else
    PRDIR1="/hosts/cocaine/usr/people/nightly/mdev2"  ;fi

if test $# -gt 1 
 then PRDIR2=$2
 else PRDIR2=$ROOT
 fi

if test ! -d $PRDIR1 ;then
  echo $PRDIR1 is not a directory  ;  exit 0 ; fi

if test ! -d $PRDIR2 ;then
  echo $PRDIR2 is not a directory  ;  exit 0 ; fi

liblist="\
         libleo/libleo_d/libleo_d.a \
         libleo/libleo/libleo.a \
         libleo/libddwrite/libddwrite.a \
         libleo/libleowriter/libleowriter.a \
         libultra/libultra/libultra.a \
         libultra/libultra_d/libultra_d.a \
         libultra/libultra_rom/libultra_rom.a \
        "

#echo $liblist

for libname in $liblist
do
  FILE1=$PRDIR1/PR/$libname
  FILE2=$PRDIR2/PR/$libname

  if test ! -r $FILE1 ;then
    echo $FILE1 is not found
    STRBUF="$STRBUF$libname skip !\n"
  else  
    STRBUF="$STRBUF$libname success !\n" ;fi

  if test ! -r $FILE2 ;then echo $FILE2 is not found ;fi
  echo "in $libname"

  OBJS=`ar t $FILE1`
  ar x $FILE1  
  for OBJ in $OBJS ; do gdis $OBJ >$OBJ.tmp1 ;done  	

  OBJS=`ar t $FILE2`
  ar x $FILE2  
  for OBJ in $OBJS ; do gdis $OBJ >$OBJ.tmp2 ;done  	

  for OBJ in $OBJS
  do
    if test "`diff $OBJ.tmp1 $OBJ.tmp2`" ;then 
      echo "  $OBJ \t:unmatch!"
      diff $OBJ.tmp1 $OBJ.tmp2 > lastdiff.error
      exit 0 
    else
      echo "  $OBJ \t:match"
      rm -f $OBJ.tmp1 $OBJ.tmp2 $OBJ
    fi
  done
done

echo $STRBUF
echo "conglatulations! v(^_^)v"