3
# ff bits: 1(debug), 2(prerelease), 4(patched), 8(vendor) and 32(special)
4
# debug is summed based on the /Define _DEBUG
5
# prerelease is based on the -dev extension,
6
# patched is based on a non-standard "-ver" extension,
7
# special and vendor are toggled by their args.
16
if (match(file, /\./)) {
17
sub(/\.[^\.]*$/, "", file);
21
while (length(ARGV[i])) {
22
if (match(ARGV[i], /icon=/)) {
23
icon = substr(ARGV[i], 6);
25
if (match(ARGV[i], /vendor=/)) {
26
vendor = substr(ARGV[i], 8);
29
if (match(ARGV[i], /special=/)) {
30
special = substr(ARGV[i], 9);
42
while ((getline < rel_h) > 0) {
43
if (match ($0, /^#define AP._MAJOR_VERSION/)) {
46
if (match ($0, /^#define AP._MINOR_VERSION/)) {
49
if (match ($0, /^#define AP._PATCH_VERSION/)) {
52
if (match ($0, /^#define AP._IS_DEV_VERSION/)) {
56
if (match ($0, /^#undef AP._IS_DEV_VERSION/)) {
59
if (match ($0, /^.*Copyright /)) {
60
copyright = substr($0, RLENGTH + 1);
63
ver = ver_major "." ver_minor "." ver_patch ver_suffix;
64
verc = ver_major "," ver_minor "," ver_patch "," ver_build;
71
print "1 ICON DISCARDABLE \"" icon "\"";
73
print "1 VERSIONINFO";
74
print " FILEVERSION " verc "";
75
print " PRODUCTVERSION " verc "";
76
print " FILEFLAGSMASK 0x3fL";
77
print "#if defined(_DEBUG)"
78
print " FILEFLAGS 0x" sprintf("%02x", ff + 1) "L";
80
print " FILEFLAGS 0x" sprintf("%02x", ff) "L";
82
print " FILEOS 0x40004L";
83
print " FILETYPE 0x1L";
84
print " FILESUBTYPE 0x0L";
86
print " BLOCK \"StringFileInfo\"";
88
print " BLOCK \"040904b0\"";
90
print " VALUE \"Comments\", "\
91
"\"Licensed under the Apache License, Version 2.0 (the \"\"License\"\"); "\
92
"you may not use this file except in compliance with the License. "\
93
"You may obtain a copy of the License at\\r\\n\\r\\n"\
94
"http://www.apache.org/licenses/LICENSE-2.0\\r\\n\\r\\n"\
95
"Unless required by applicable law or agreed to in writing, "\
96
"software distributed under the License is distributed on an "\
97
"\"\"AS IS\"\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, "\
98
"either express or implied. See the License for the specific "\
99
"language governing permissions and limitations under the License.\\0\"";
100
print " VALUE \"CompanyName\", \"Apache Software Foundation\\0\"";
101
print " VALUE \"FileDescription\", \"" desc "\\0\"";
102
print " VALUE \"FileVersion\", \"" ver "\\0\"";
103
print " VALUE \"InternalName\", \"" file "\\0\"";
104
print " VALUE \"LegalCopyright\", \"Copyright " copyright "\\0\"";
105
print " VALUE \"OriginalFilename\", \"" filename "\\0\"";
107
print " VALUE \"PrivateBuild\", \"" vendor "\\0\"";
110
print " VALUE \"SpecialBuild\", \"" vendor "\\0\"";
112
print " VALUE \"ProductName\", \"Apache Portable Runtime\\0\"";
113
print " VALUE \"ProductVersion\", \"" ver "\\0\"";
116
print " BLOCK \"VarFileInfo\"";
118
print " VALUE \"Translation\", 0x409, 1200";