1toupper(){ 2 echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 3} 4 5name=lib$1 6ucname=$(toupper ${name}) 7file=$2 8file2=$3 9 10eval $(awk "/#define ${ucname}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file") 11if [ -f "$file2" ]; then 12 eval $(awk "/#define ${ucname}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file2") 13fi 14eval ${ucname}_VERSION=\$${ucname}_VERSION_MAJOR.\$${ucname}_VERSION_MINOR.\$${ucname}_VERSION_MICRO 15eval echo "${name}_VERSION=\$${ucname}_VERSION" 16eval echo "${name}_VERSION_MAJOR=\$${ucname}_VERSION_MAJOR" 17eval echo "${name}_VERSION_MINOR=\$${ucname}_VERSION_MINOR" 18