fn_find_fpath() { save_ifs="$IFS" IFS="${IFS}:" for dir in $3 ; do if test $1 $dir/$2 ; then IFS="$save_ifs" return 0 fi done IFS="$save_ifs" return 1 } fn_find_type() { fail=$1 shift text=$1 shift for fn in $* ; do if test -f "$fn" ; then grep "$text" <$fn >/dev/null if test ! $? = 1 ; then return 1 fi fi done echo "#define "$fail >>$CONFIG return 0 } fn_find_file() { if test ! -f $2 ; then echo "#define "$1 >>$CONFIG return 1 fi return 0 }