1toupper(){ 2 echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 3} 4 5name=lib$1 6ucname=$(toupper ${name}) 7file=$2 8 9eval $(awk "/#define ${ucname}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file") 10eval ${ucname}_VERSION=\$${ucname}_VERSION_MAJOR.\$${ucname}_VERSION_MINOR.\$${ucname}_VERSION_MICRO 11eval echo "${name}_VERSION=\$${ucname}_VERSION" 12eval echo "${name}_VERSION_MAJOR=\$${ucname}_VERSION_MAJOR" 13eval echo "${name}_VERSION_MINOR=\$${ucname}_VERSION_MINOR" 14