3
# fetch mod_jk version numbers from input file and writes them to STDOUT
5
while ((getline < ARGV[1]) > 0) {
6
if (match ($0, /^#define JK_VERMAJOR [^"]+/)) {
7
jk_ver_major = substr($3, 1, length($3));
9
else if (match ($0, /^#define JK_VERMINOR [^"]+/)) {
10
jk_ver_minor = substr($3, 1, length($3));
12
else if (match ($0, /^#define JK_VERFIX [^"]+/)) {
13
jk_ver_fix = substr($3, 1, length($3));
15
else if (match ($0, /^#define JK_VERISRELEASE [^"]+/)) {
16
jk_ver_isrelease = substr($3, 1, length($3));
18
else if (match ($0, /^#define JK_VERBETA [^"]+/)) {
19
jk_ver_isbeta = substr($3, 1, length($3));
21
else if (match ($0, /^#define JK_BETASTRING [^"]+/)) {
22
jk_ver_betastr = substr($3, 2, length($3) - 2);
25
jk_ver = jk_ver_major "," jk_ver_minor "," jk_ver_fix;
26
jk_ver_str = jk_ver_major "." jk_ver_minor "." jk_ver_fix;
27
if (jk_ver_isrelease != 1) {
28
jk_ver_str = jk_ver_str "-dev";
30
if (jk_ver_isbeta == 1) {
31
jk_ver_str = jk_ver_str "-beta-" jk_ver_betastr;
34
# fetch Apache version numbers from input file and writes them to STDOUT
37
if (match (ARGV[2], /ap_release.h/)) {
38
while ((getline < ARGV[2]) > 0) {
39
if (match ($0, /^#define AP_SERVER_MAJORVERSION "[^"]+"/)) {
40
ap_ver_major = substr($3, 2, length($3) - 2);
42
else if (match ($0, /^#define AP_SERVER_MINORVERSION "[^"]+"/)) {
43
ap_ver_minor = substr($3, 2, length($3) - 2);
45
else if (match ($0, /^#define AP_SERVER_PATCHLEVEL/)) {
46
ap_ver_str_patch = substr($3, 2, length($3) - 2);
47
if (match (ap_ver_str_patch, /[0-9][0-9]*/)) {
48
ap_ver_patch = substr(ap_ver_str_patch, RSTART, RLENGTH);
52
ap_ver_str = ap_ver_major "." ap_ver_minor "." ap_ver_str_patch;
54
if (match (ARGV[2], /httpd.h/)) {
55
while ((getline < ARGV[2]) > 0) {
56
if (match ($0, /^#define SERVER_BASEREVISION "[^"]+"/)) {
57
ap_ver_str = substr($3, 2, length($3) - 2);
61
print "AP_VERSION_STR = " ap_ver_str "";
64
print "JK_VERSION = " jk_ver "";
65
print "JK_VERSION_STR = " jk_ver_str "";