#! sh
# for OS/2 -emx 
# This script reads filenames from STDIN and outputs any relevant requires
# information that needs to be included in the package.

filelist=$(grep -iE "(\\.dll|\\.exe)" )
for f in $filelist; do
if [ -f $f ] ; then
  d=`echo $f | sed 's@[^/]\+$@@' `
  b=`basename $f`
  if [ ! -z $d ] ; then cd $d ; fi
  ldd $b |\
  grep -iEv "(\.exe|emxlibc.*\.dll|emx\.dll|doscalls\.dll|kbdcalls\.dll|\
nls\.dll|quecalls\.dll|sesmgr\.dll|viocalls\.dll|emxio\.dll|\
emxwrap\.dll|pmmerge\.dll)"  | sed -e "s/[ \\*]//g" -e "s@^.*/@@" \
-e "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
fi
done | sort -u
