upload http
[bottlenecks.git] / rubbos / app / httpd-2.0.64 / srclib / apr / build / win32ver.awk
1 BEGIN {
2
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.
8   #
9   ff = 0;
10
11   file=ARGV[1];
12   desc=ARGV[2];
13   rel_h=ARGV[3];
14
15   filename = file;
16   if (match(file, /\./)) {
17     sub(/\.[^\.]*$/, "", file);
18   }
19
20   i = 4;
21   while (length(ARGV[i])) {
22     if (match(ARGV[i], /icon=/)) {
23       icon = substr(ARGV[i], 6);
24     }
25     if (match(ARGV[i], /vendor=/)) {
26       vendor = substr(ARGV[i], 8);
27       ff = ff + 8;
28     }
29     if (match(ARGV[i], /special=/)) {
30       special = substr(ARGV[i], 9);
31       ff = ff + 32;
32     }
33     i = i + 1
34   }
35
36   i = i - 1;
37   while (i) {
38     delete ARGV[i];
39     i = i - 1;
40   }
41
42   while ((getline < rel_h) > 0) {
43     if (match ($0, /^#define AP_SERVER_BASEREVISION "[^"]+"/)) {
44       ver = substr($0, RSTART + 32, RLENGTH - 33);
45     }
46   }
47   if (ver) {
48     verc = ver;
49     gsub(/\./, ",", verc);
50     if (build) {
51       sub(/-.*/, "", verc)
52       verc = verc "," build;
53     } else if (sub(/-dev/, ",0", verc)) {
54         ff = ff + 2;
55     } else if (!sub(/-alpha/, ",10", verc)  \
56             && !sub(/-beta/, ",100", verc)  \
57             && !sub(/-gold/, ",200", verc)) {
58       sub(/-.*/, "", verc);
59       verc = verc "," 0;
60     }
61   } else {
62 # XXX Gotta fix this for non-httpd installs :(
63     ver = "0.0.0.0"
64     verc = "0,0,0,0"
65     ff = ff + 2;
66   }
67
68   if (length(vendor)) {
69     ff = ff + 8;
70   }
71
72   if (length(icon)) {
73     print "1 ICON DISCARDABLE \"" icon "\"";
74   }
75   print "1 VERSIONINFO";
76   print " FILEVERSION " verc "";
77   print " PRODUCTVERSION " verc "";
78   print " FILEFLAGSMASK 0x3fL";
79   print "#if defined(_DEBUG)"
80   print " FILEFLAGS 0x" sprintf("%02x", ff + 1) "L";
81   print "#else"
82   print " FILEFLAGS 0x" sprintf("%02x", ff) "L";
83   print "#endif"
84   print " FILEOS 0x40004L";
85   print " FILETYPE 0x1L";
86   print " FILESUBTYPE 0x0L";
87   print "BEGIN";
88   print "  BLOCK \"StringFileInfo\"";
89   print "  BEGIN";
90   print "    BLOCK \"040904b0\"";
91   print "    BEGIN";
92   print "      VALUE \"Comments\", \"All rights reserved.  The "\
93         "license is available at <http://www.apache.org/LICENSE.txt>.  "\
94         "The APR project pages are at <http://apr.apache.org/>.\\0\"";
95   print "      VALUE \"CompanyName\", \"Apache Software Foundation\\0\"";
96   print "      VALUE \"FileDescription\", \"" desc "\\0\"";
97   print "      VALUE \"FileVersion\", \"" ver "\\0\"";
98   print "      VALUE \"InternalName\", \"" file "\\0\"";
99   print "      VALUE \"LegalCopyright\", \"Copyright © 2000-2003 "\
100         "The Apache Software Foundation.\\0\"";
101   print "      VALUE \"OriginalFilename\", \"" filename "\\0\"";
102   if (vendor) {
103     print "      VALUE \"PrivateBuild\", \"" vendor "\\0\"";
104   }
105   if (special) {
106     print "      VALUE \"SpecialBuild\", \"" vendor "\\0\"";
107   }
108   print "      VALUE \"ProductName\", \"Apache Portable Runtime\\0\"";
109   print "      VALUE \"ProductVersion\", \"" ver "\\0\"";
110   print "    END";
111   print "  END";
112   print "  BLOCK \"VarFileInfo\"";
113   print "  BEGIN";
114   print "    VALUE \"Translation\", 0x409, 1200";
115   print "  END";
116   print "END";
117 }