freeswitch/libs/apr/build/nw_ver.awk
Michael Jerris 0488a5109a add apr to in tree libs
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3733 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-12-19 19:58:23 +00:00

26 lines
668 B
Awk

BEGIN {
# fetch APR version numbers from input file and writes them to STDOUT
while ((getline < ARGV[1]) > 0) {
if (match ($0, /^#define APR_MAJOR_VERSION/)) {
ver_major = $3;
}
else if (match ($0, /^#define APR_MINOR_VERSION/)) {
ver_minor = $3;
}
else if (match ($0, /^#define APR_PATCH_VERSION/)) {
ver_str_patch = $3;
if (match (ver_str_patch, /[0-9][0-9]*/)) {
ver_patch = substr(ver_str_patch, RSTART, RLENGTH);
}
}
}
ver = ver_major "," ver_minor "," ver_patch;
ver_str = ver_major "." ver_minor "." ver_str_patch;
print "VERSION = " ver "";
print "VERSION_STR = " ver_str "";
}