From db14e8faa7a07d9fb84f6770f0333c0ee7f6a375 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 16 Aug 2001 05:27:50 +0000 Subject: [PATCH] A first step at auto-generating the version resource for all win32 binaries. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90193 13f79535-47bb-0310-9956-ffa450edef68 --- build/win32/.cvsignore | 2 + {os => build}/win32/apache.ico | Bin build/win32/win32ver.awk | 108 +++++++++++++++++++++++++++++++++ os/win32/apache.rc | 78 ------------------------ 4 files changed, 110 insertions(+), 78 deletions(-) create mode 100644 build/win32/.cvsignore rename {os => build}/win32/apache.ico (100%) create mode 100644 build/win32/win32ver.awk delete mode 100644 os/win32/apache.rc diff --git a/build/win32/.cvsignore b/build/win32/.cvsignore new file mode 100644 index 0000000000..3a75560491 --- /dev/null +++ b/build/win32/.cvsignore @@ -0,0 +1,2 @@ +Apache.aps +Apache.rc diff --git a/os/win32/apache.ico b/build/win32/apache.ico similarity index 100% rename from os/win32/apache.ico rename to build/win32/apache.ico diff --git a/build/win32/win32ver.awk b/build/win32/win32ver.awk new file mode 100644 index 0000000000..8862aa87f3 --- /dev/null +++ b/build/win32/win32ver.awk @@ -0,0 +1,108 @@ +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 \"00000000\""; + print " BEGIN"; + print " VALUE \"Comments\", \"This software consists of " \ + "voluntary contributions made by many individuals on behalf of " \ + "the Apache Software Foundation. For more information on the " \ + "Apache Software Foundation, please see \\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 (c) 2001, " \ + "The Apache Software Foundation. Current License is available from " \ + "\\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 httpd Server\\0\""; + print " VALUE \"ProductVersion\", \"" ver "\\0\""; + print " END"; + print " END"; + print " BLOCK \"VarFileInfo\""; + print " BEGIN"; + print " VALUE \"Translation\", 0, 1200"; + print " END"; + print "END"; +} \ No newline at end of file diff --git a/os/win32/apache.rc b/os/win32/apache.rc deleted file mode 100644 index d1105fe554..0000000000 --- a/os/win32/apache.rc +++ /dev/null @@ -1,78 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winresrc.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Neutral resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -101 ICON DISCARDABLE "apache.ico" -#endif // Neutral resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""winresrc.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - -- 2.40.0