summaryrefslogtreecommitdiff
path: root/build/win32ver.awk
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2001-08-16 22:10:27 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2001-08-16 22:10:27 +0000
commita7b5a807cc2c55442150f828e62fb0b255529b45 (patch)
tree409877c791a0fcdaabae39d768ce616e8e46cbac /build/win32ver.awk
parent27a72e2c110a99f329a222a79a4aeb7aec09b784 (diff)
downloadapr-a7b5a807cc2c55442150f828e62fb0b255529b45.tar.gz
Just for us (apr/apr-util) - independent of Apache.
We still need two of these unless we plan on growing a whole lot more (generally repetitive) arguments to this script git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62176 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'build/win32ver.awk')
-rw-r--r--build/win32ver.awk106
1 files changed, 106 insertions, 0 deletions
diff --git a/build/win32ver.awk b/build/win32ver.awk
new file mode 100644
index 000000000..810e5fc5b
--- /dev/null
+++ b/build/win32ver.awk
@@ -0,0 +1,106 @@
+BEGIN {
+
+ # ff bits: 1(debug), 2(prerelease), 4(patched), 8(vendor) and 32(special)
+ # debug is summed based on the /Define _DEBUG
+ # prerelease is based on the -dev extension,
+ # patched is based on a non-standard "-ver" extension,
+ # special and vendor are toggled by their args.
+ #
+ ff = 0;
+
+ file=ARGV[1];
+ desc=ARGV[2];
+ rel_h=ARGV[3];
+
+ i = 4;
+ while (length(ARGV[i])) {
+ if (match(ARGV[i], /icon=/)) {
+ icon = substr(ARGV[i], 6);
+ }
+ if (match(ARGV[i], /vendor=/)) {
+ vendor = substr(ARGV[i], 8);
+ ff = ff + 8;
+ }
+ if (match(ARGV[i], /special=/)) {
+ special = substr(ARGV[i], 9);
+ ff = ff + 32;
+ }
+ i = i + 1
+ }
+
+ i = i - 1;
+ while (i) {
+ delete ARGV[i];
+ i = i - 1;
+ }
+
+ while ((getline < rel_h) > 0) {
+ if (match ($0, /^#define AP_SERVER_BASEREVISION "[^"]+"/)) {
+ ver = substr($0, RSTART + 32, RLENGTH - 33);
+ }
+ }
+
+ verc = ver;
+ gsub(/\./, ",", verc);
+ if (build) {
+ sub(/-.*/, "", verc)
+ verc = verc "," build;
+ } else if (sub(/-dev/, ",0", verc)) {
+ ff = ff + 2;
+ } else if (!sub(/-alpha/, ",10", verc) \
+ && !sub(/-beta/, ",100", verc) \
+ && !sub(/-gold/, ",200", verc)) {
+ sub(/-.*/, "", verc);
+ verc = verc "," 0;
+ }
+
+ if (length(vendor)) {
+ ff = ff + 8;
+ }
+
+ if (length(icon)) {
+ print "1 ICON DISCARDABLE \"" icon "\"";
+ }
+ print "1 VERSIONINFO";
+ print " FILEVERSION " verc "";
+ print " PRODUCTVERSION " verc "";
+ print " FILEFLAGSMASK 0x3fL";
+ print "#if defined(_DEBUG)"
+ print " FILEFLAGS 0x" sprintf("%02x", ff + 1) "L";
+ print "#else"
+ print " FILEFLAGS 0x" sprintf("%02x", ff) "L";
+ print "#endif"
+ print " FILEOS 0x40004L";
+ print " FILETYPE 0x1L";
+ print " FILESUBTYPE 0x0L";
+ print "BEGIN";
+ print " BLOCK \"StringFileInfo\"";
+ print " BEGIN";
+ print " BLOCK \"040904b0\"";
+ print " BEGIN";
+ print " VALUE \"Comments\", \"All rights reserved. The "\
+ "license is available at <http://www.apache.org/LICENSE.txt>. "\
+ "The APR project pages are at <http://apr.apache.org/>.\\0\"";
+ print " VALUE \"CompanyName\", \"Apache Software Foundation\\0\"";
+ print " VALUE \"FileDescription\", \"" desc "\\0\"";
+ print " VALUE \"FileVersion\", \"" ver "\\0\"";
+ print " VALUE \"InternalName\", \"" file "\\0\"";
+ print " VALUE \"LegalCopyright\", \"Copyright © 2001 "\
+ "The Apache Software Foundation.\\0\"";
+ print " VALUE \"OriginalFilename\", \"" file ".exe\\0\"";
+ if (vendor) {
+ print " VALUE \"PrivateBuild\", \"" vendor "\\0\"";
+ }
+ if (special) {
+ print " VALUE \"SpecialBuild\", \"" vendor "\\0\"";
+ }
+ print " VALUE \"ProductName\", \"Apache Portable Runtime\\0\"";
+ print " VALUE \"ProductVersion\", \"" ver "\\0\"";
+ print " END";
+ print " END";
+ print " BLOCK \"VarFileInfo\"";
+ print " BEGIN";
+ print " VALUE \"Translation\", 0x409, 1200";
+ print " END";
+ print "END";
+} \ No newline at end of file