summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuankg <fuankg@13f79535-47bb-0310-9956-ffa450edef68>2007-08-08 12:40:06 +0000
committerfuankg <fuankg@13f79535-47bb-0310-9956-ffa450edef68>2007-08-08 12:40:06 +0000
commit91131c8ad69e12d61c279c26f19a7719b36e5669 (patch)
tree8543b422bb82eacfe02c89758411a5635521a8f2
parentf9ce1136bc0213edf1ca46466c818e75570090d0 (diff)
downloadlibapr-91131c8ad69e12d61c279c26f19a7719b36e5669.tar.gz
fixed version string for dev builds;
added check for wanted version. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.2.x@563838 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--build/nw_ver.awk33
1 files changed, 24 insertions, 9 deletions
diff --git a/build/nw_ver.awk b/build/nw_ver.awk
index ae82305a1..b656f2a7e 100644
--- a/build/nw_ver.awk
+++ b/build/nw_ver.awk
@@ -10,16 +10,31 @@ BEGIN {
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_patch = $3;
+ }
+ else if (match ($0, /^#define APR_IS_DEV_VERSION/)) {
+ ver_devbuild = 1;
}
}
- ver = ver_major "," ver_minor "," ver_patch;
- ver_str = ver_major "." ver_minor "." ver_str_patch;
-
- print "VERSION = " ver "";
- print "VERSION_STR = " ver_str "";
+ ver_str = ver_major "." ver_minor "." ver_patch (ver_devbuild ? "-dev" : "");
+ if (WANTED) {
+ ver_num = ver_major * 1000000 + ver_minor * 1000 + ver_patch;
+ if (ver_num < WANTED) {
+ print "ERROR: APR version " ver_str " does NOT match!";
+ exit 1;
+ } else if (ver_num > (WANTED + 1000)) {
+ print "WARNING: APR version " ver_str " higher than expected!";
+ exit 0;
+ } else {
+ print "OK: APR version " ver_str "";
+ exit 0;
+ }
+ } else {
+ ver_nlm = ver_major "," ver_minor "," ver_patch;
+ print "VERSION = " ver_nlm "";
+ print "VERSION_STR = " ver_str "";
+ }
}
+
+