summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-04-26 09:28:12 +0200
committerRichard Levitte <levitte@openssl.org>2021-04-28 21:35:26 +0200
commit3babc1e468c9a5cfb30582a3ea1d55c1ec776361 (patch)
tree897c3172d7f58ba2f7590e6f627e49f29fadfd4d /util
parent2e535eb50aa9c6b73c796f668e1aef8bc17f14c4 (diff)
util/add-depends.pl: Adapt to localized /showIncludes output
It was discovered that MSVC has localized /showIncludes output. Fortunately, it still seems to follow the same generic format, so we can adapt the regular expression to make it language agnostic. Fixes #14994 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/15006)
Diffstat (limited to 'util')
-rw-r--r--util/add-depends.pl17
1 files changed, 12 insertions, 5 deletions
diff --git a/util/add-depends.pl b/util/add-depends.pl
index f1454323c5..5aa03c4740 100644
--- a/util/add-depends.pl
+++ b/util/add-depends.pl
@@ -169,6 +169,14 @@ my %procedures = (
#
# Note: including file: {whatever header file}
#
+ # This output is localized, so for example, the German pack gives
+ # us this:
+ #
+ # Hinweis: Einlesen der Datei: {whatever header file}
+ #
+ # To accomodate, we need to use a very general regular expression
+ # to parse those lines.
+ #
# Since there's no object file name at all in that information,
# we must construct it ourselves.
@@ -179,7 +187,7 @@ my %procedures = (
# warnings, so we simply discard anything that doesn't start with
# the Note:
- if (/^Note: including file: */) {
+ if (/^[^:]*: [^:]*: */) {
(my $tail = $') =~ s/\s*\R$//;
# VC gives us absolute paths for all include files, so to
@@ -206,11 +214,10 @@ my %procedures = (
},
'embarcadero' =>
sub {
- # With Embarcadero C++Builder's preprocessor (cpp32.exe) the -Hp
- # flag gives us the preprocessed output annotated with the following
- # note whenever a #include file is read:
+ # With Embarcadero C++Builder's preprocessor (cpp32.exe) the -Sx -Hp
+ # flags give us the list of #include files read, like the following:
#
- # Including ->->{whatever header file}
+ # Including ->->{whatever header file}
#
# where each "->" indicates the nesting level of the #include. The
# logic here is otherwise the same as the 'VC' scheme.