Fix resource files
Add it to apps as well as libraries.
Fix the copyright year generation.
Thanks to user RTT for pointing this out.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5704)
Rich Salz
6 years ago
2014 | 2014 | $o = cleanfile($buildd, $o, $blddir); |
2015 | 2015 | $unified_info{sources}->{$ddest}->{$o} = 1; |
2016 | 2016 | $unified_info{sources}->{$o}->{$s} = 1; |
2017 | } elsif ($s =~ /\.rc$/) { | |
2018 | # We also recognise resource files | |
2019 | my $o = $_; | |
2020 | $o =~ s/\.rc$/.res/; # Resource configuration | |
2021 | my $o = cleanfile($buildd, $o, $blddir); | |
2022 | $unified_info{sources}->{$ddest}->{$o} = 1; | |
2023 | $unified_info{sources}->{$o}->{$s} = 1; | |
2017 | 2024 | } else { |
2018 | 2025 | $unified_info{sources}->{$ddest}->{$s} = 1; |
2019 | 2026 | } |
22 | 22 | INCLUDE[openssl]=.. ../include |
23 | 23 | DEPEND[openssl]=libapps.a ../libssl |
24 | 24 | |
25 | IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-)/ -}] | |
26 | GENERATE[openssl.rc]=../util/mkrc.pl openssl | |
27 | SOURCE[openssl]=openssl.rc | |
28 | ENDIF | |
29 | ||
25 | 30 | {- join("\n ", map { (my $x = $_) =~ s|\.c$|.o|; "DEPEND[$x]=progs.h" } |
26 | 31 | @apps_openssl_src) -} |
27 | 32 | GENERATE[progs.h]=progs.pl $(APPS_OPENSSL) |
16 | 16 | my %commands = (); |
17 | 17 | my $cmdre = qr/^\s*int\s+([a-z_][a-z0-9_]*)_main\(\s*int\s+argc\s*,/; |
18 | 18 | my $apps_openssl = shift @ARGV; |
19 | my $YEAR = [localtime()]->[5] + 1900; | |
19 | 20 | |
20 | 21 | # because the program apps/openssl has object files as sources, and |
21 | 22 | # they then have the corresponding C files as source, we need to chain |
22 | 23 | # the lookups in %unified_info |
23 | 24 | my @openssl_source = |
24 | 25 | map { @{$unified_info{sources}->{$_}} } |
26 | grep { /\.o$/ } | |
25 | 27 | @{$unified_info{sources}->{$apps_openssl}}; |
26 | 28 | |
27 | 29 | foreach my $filename (@openssl_source) { |
35 | 37 | |
36 | 38 | @ARGV = sort keys %commands; |
37 | 39 | |
38 | print <<'EOF'; | |
40 | print <<"EOF"; | |
39 | 41 | /* |
40 | 42 | * WARNING: do not edit! |
41 | 43 | * Generated by apps/progs.pl |
42 | 44 | * |
43 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. | |
45 | * Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved. | |
44 | 46 | * |
45 | 47 | * Licensed under the OpenSSL license (the "License"). You may not use |
46 | 48 | * this file except in compliance with the License. You can obtain a copy |
38 | 38 | close(FD); |
39 | 39 | |
40 | 40 | my $filename = $ARGV[0]; |
41 | $filename =~ /(.*)\.([^.]+)$/; | |
42 | my $basename = $1; | |
43 | my $extname = $2; | |
41 | my $description = "OpenSSL library"; | |
42 | my $vft = "VFT_DLL"; | |
43 | if ( $filename =~ /openssl/i ) { | |
44 | $description = "OpenSSL application"; | |
45 | $vft = "VFT_APP"; | |
46 | } | |
44 | 47 | |
45 | my $description = "OpenSSL application"; | |
46 | $description = "OpenSSL shared library" if $extname =~ /dll/i; | |
47 | ||
48 | my $YEAR = [localtime()]->[5] + 1900; | |
48 | 49 | print <<___; |
49 | 50 | #include <winver.h> |
50 | 51 | |
60 | 61 | FILEFLAGS 0x00L |
61 | 62 | #endif |
62 | 63 | FILEOS VOS__WINDOWS32 |
63 | FILETYPE VFT_DLL | |
64 | FILETYPE $vft | |
64 | 65 | FILESUBTYPE 0x0L |
65 | 66 | BEGIN |
66 | 67 | BLOCK "StringFileInfo" |
71 | 72 | VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0" |
72 | 73 | VALUE "FileDescription", "$description\\0" |
73 | 74 | VALUE "FileVersion", "$version\\0" |
74 | VALUE "InternalName", "$basename\\0" | |
75 | VALUE "InternalName", "$filename\\0" | |
75 | 76 | VALUE "OriginalFilename", "$filename\\0" |
76 | 77 | VALUE "ProductName", "The OpenSSL Toolkit\\0" |
77 | 78 | VALUE "ProductVersion", "$version\\0" |
78 | 79 | // Optional: |
79 | 80 | //VALUE "Comments", "\\0" |
80 | VALUE "LegalCopyright", "Copyright 1998-2016 The OpenSSL Authors. All rights reserved.\\0" | |
81 | VALUE "LegalCopyright", "Copyright 1998-$YEAR The OpenSSL Authors. All rights reserved.\\0" | |
81 | 82 | //VALUE "LegalTrademarks", "\\0" |
82 | 83 | //VALUE "PrivateBuild", "\\0" |
83 | 84 | //VALUE "SpecialBuild", "\\0" |