nw_ver.awk revision 9f19273e0c3dc7cbea8a5ec5d61f41b2c6ccaa5f
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# Licensed to the Apache Software Foundation (ASF) under one or more
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# contributor license agreements. See the NOTICE file distributed with
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# this work for additional information regarding copyright ownership.
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# The ASF licenses this file to You under the Apache License, Version 2.0
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# (the "License"); you may not use this file except in compliance with
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# the License. You may obtain a copy of the License at
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg#
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# http://www.apache.org/licenses/LICENSE-2.0
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg#
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# Unless required by applicable law or agreed to in writing, software
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# distributed under the License is distributed on an "AS IS" BASIS,
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0662ed52e814f8f08ef0e09956413a792584eddffuankg# See the License for the specific language governing permissions and
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg# limitations under the License.
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankgBEGIN {
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg # fetch Apache version numbers from input file and writes them to STDOUT
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg while ((getline < ARGV[1]) > 0) {
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg if (match ($0, /^#define AP_SERVER_MAJORVERSION_NUMBER /)) {
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg ver_major = $3;
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg }
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg else if (match ($0, /^#define AP_SERVER_MINORVERSION_NUMBER /)) {
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg ver_minor = $3;
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg }
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg else if (match ($0, /^#define AP_SERVER_PATCHLEVEL_NUMBER/)) {
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg ver_patch = $3;
44f575c8cb19a7a5cd61664a7848be6bc197df02fuankg }
16b55a35cff91315d261d1baa776138af465c4e4fuankg else if (match ($0, /^#define AP_SERVER_DEVBUILD_BOOLEAN/)) {
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg ver_devbuild = $3;
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg }
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg }
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg ver_nlm = ver_major "," ver_minor "," ver_patch;
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg ver_str = ver_major "." ver_minor "." ver_patch (ver_devbuild ? "-dev" : "");
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg print "VERSION = " ver_nlm "";
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg print "VERSION_STR = " ver_str "";
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg}
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg
cb8c861baa9316dc6ecc8a29e18178b224d7445afuankg