1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements. See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 # ff bits: 1(debug), 2(prerelease), 4(patched), 8(vendor) and 32(special)
19 # debug is summed based on the /Define _DEBUG
20 # prerelease is based on the -dev extension,
21 # patched is based on a non-standard "-ver" extension,
22 # special and vendor are toggled by their args.
31 while (length(ARGV[i])) {
32 if (match(ARGV[i], /icon=/)) {
33 icon = substr(ARGV[i], 6);
35 if (match(ARGV[i], /vendor=/)) {
36 vendor = substr(ARGV[i], 8);
39 if (match(ARGV[i], /special=/)) {
40 special = substr(ARGV[i], 9);
52 while ((getline < rel_h) > 0) {
53 if (match ($0, /^.*\* Copyright /)) {
54 copyright = substr($0, RLENGTH + 1);
56 if (match ($0, /^#define AP_SERVER_MAJORVERSION_NUMBER /)) {
59 else if (match ($0, /^#define AP_SERVER_MINORVERSION_NUMBER /)) {
62 else if (match ($0, /^#define AP_SERVER_PATCHLEVEL_NUMBER /)) {
65 else if (match ($0, /^#define AP_SERVER_ADD_STRING +"[^"]*"/)) {
66 ver_build = substr($3, 2, length($3) - 2);
70 ver = ver_major "." ver_minor "." ver_patch ver_build;
71 verc = ver_major "," ver_minor "," ver_patch;
72 if (match (ver_build, /-dev/)) {
75 } else if (!ver_build) {
86 print "1 ICON DISCARDABLE \"" icon "\"";
88 print "1 VERSIONINFO";
89 print " FILEVERSION " verc "";
90 print " PRODUCTVERSION " verc "";
91 print " FILEFLAGSMASK 0x3fL";
92 print "#if defined(_DEBUG)"
93 print " FILEFLAGS 0x" sprintf("%02x", ff + 1) "L";
95 print " FILEFLAGS 0x" sprintf("%02x", ff) "L";
97 print " FILEOS 0x40004L";
98 print " FILETYPE 0x1L";
99 print " FILESUBTYPE 0x0L";
101 print " BLOCK \"StringFileInfo\"";
103 print " BLOCK \"040904b0\"";
105 print " VALUE \"Comments\", "\
106 "\"Licensed under the Apache License, Version 2.0 (the \"\"License\"\"); "\
107 "you may not use this file except in compliance with the License. "\
108 "You may obtain a copy of the License at\\r\\n\\r\\n"\
109 "http://www.apache.org/licenses/LICENSE-2.0\\r\\n\\r\\n"\
110 "Unless required by applicable law or agreed to in writing, "\
111 "software distributed under the License is distributed on an "\
112 "\"\"AS IS\"\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, "\
113 "either express or implied. See the License for the specific "\
114 "language governing permissions and limitations under the License.\\0\"";
115 print " VALUE \"CompanyName\", \"Apache Software Foundation\\0\"";
116 print " VALUE \"FileDescription\", \"" desc "\\0\"";
117 print " VALUE \"FileVersion\", \"" ver "\\0\"";
118 print " VALUE \"InternalName\", \"" file "\\0\"";
119 print " VALUE \"LegalCopyright\", \"Copyright " copyright "\\0\"";
120 print " VALUE \"OriginalFilename\", \"" file "\\0\"";
122 print " VALUE \"PrivateBuild\", \"" vendor "\\0\"";
125 print " VALUE \"SpecialBuild\", \"" vendor "\\0\"";
127 print " VALUE \"ProductName\", \"Apache HTTP Server\\0\"";
128 print " VALUE \"ProductVersion\", \"" ver "\\0\"";
131 print " BLOCK \"VarFileInfo\"";
133 print " VALUE \"Translation\", 0x409, 1200";