bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr / build / nw_ver.awk
1 BEGIN {
2
3   # fetch APR version numbers from input file and writes them to STDOUT
4
5   while ((getline < ARGV[1]) > 0) {
6     if (match ($0, /^#define APR_MAJOR_VERSION/)) {
7       ver_major = $3;
8     }
9     else if (match ($0, /^#define APR_MINOR_VERSION/)) {
10       ver_minor = $3;
11     }
12     else if (match ($0, /^#define APR_PATCH_VERSION/)) {
13       ver_patch = $3;
14     }
15     else if (match ($0, /^#define APR_IS_DEV_VERSION/)) {
16       ver_devbuild = 1;
17     }
18   }
19   ver_str = ver_major "." ver_minor "." ver_patch (ver_devbuild ? "-dev" : "");
20   if (WANTED) {
21     ver_num = ver_major * 1000000 + ver_minor * 1000 + ver_patch;
22     if (ver_num < WANTED) {
23       print "ERROR: APR version " ver_str " does NOT match!";
24       exit 1;
25     } else if (ver_num >= 1000000) {
26       print "ERROR: APR version " ver_str " higher than expected!";
27       exit 1;
28     } else {
29       print "OK: APR version " ver_str "";
30       exit 0;
31     }
32   } else {
33     ver_nlm = ver_major "," ver_minor "," ver_patch;
34     print "VERSION = " ver_nlm "";
35     print "VERSION_STR = " ver_str "";
36   }
37
38 }
39
40