#!/bin/sh

installdir=$1
fixlist1=`find $installdir/lib32 -name \*.dylib`
#  $fixlist1
fixlist2=`find $installdir/dsdriver/php32 -name \*.so`
# echo $fixlist2
for lib in $fixlist1 $fixlist2
do
echo $lib
lib32name=`grep 32 $lib`
echo "libname is " $lib32name
#if [ -z "$lib32name" ]; then
# echo "that lib doesn't have 32 in it"
#else 
# echo "that lib has 32 in it" 
#fi
  for deplib in libcapro.dylib libdb2.dylib libdb2dasapi.dylib libdb2dascmn.dylib libdb2g11n.dylib libdb2genreg.dylib libdb2gmf.a libdb2install.dylib libdb2jcct2.so libdb2jdbc.so libdb2licm.dylib libdb2locale.dylib libdb2osse.dylib libdb2osse_db2.dylib libdb2sec.dylib libdb2trcapi.dylib
do
  install_name_tool -change $installdir/lib64/$deplib $installdir/lib32/$deplib $lib
done
done
