]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Windows bulding: Make dependency generation not quite as talkative
authorRichard Levitte <levitte@openssl.org>
Fri, 23 Apr 2021 14:19:23 +0000 (16:19 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 28 Apr 2021 19:35:26 +0000 (21:35 +0200)
The modified way to generate .d files had an unfortunate side effect,
that it outputs the whole preprocessed file and not just the dependency
lines, at least with MSVC's cl.  That gave util/add-depends.pl a whole
lot more to read through, which impacts greatly on the performance of
dependency treatment.

We modify the process by adding a config target attribute 'make_depend',
which can be any suitable command for generating such lines.  All it
needs is to also accept C flags and macro definitions.

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)

Configurations/10-main.conf
Configurations/50-cppbuilder.conf
Configurations/windows-makefile.tmpl

index f5e5754b3a6cdf467b448904643dd0964f2f3fcf..882af5e65bed549a192845b2ef14e0b6fd9bd03c 100644 (file)
@@ -1276,9 +1276,9 @@ my %targets = (
         template         => 1,
         CC               => "cl",
         CPP              => '"$(CC)" /EP /C',
+        make_depend      => '"$(CC)" /Zs /showIncludes',
         CFLAGS           => "/W3 /wd4090 /nologo",
         coutflag         => "/Fo",
-        cpp_depend_flags => "/Zs /showIncludes",
         LD               => "link",
         LDFLAGS          => "/nologo /debug",
         ldoutflag        => "/out:",
index 1c47a4c2be1b625896167a44f16c9ae9ef5a872f..fad905267bf182c6467770a5be542784dee857de 100644 (file)
@@ -6,6 +6,10 @@ my %targets = (
         thread_scheme    => "winthreads",
         cc               => "bcc32c",
         CPP              => "cpp32 -oCON -Sc -Sr",
+        # -Sx isn't documented, but 'cpp32 -H -S' explains it:
+        #
+        # -Sx     Omit preprocessed text in output
+        make_depend      => "cpp32 -oCON -Sx -Hp",
         defines          => add("WIN32_LEAN_AND_MEAN", "OPENSSL_SYS_WIN32",
                                 "L_ENDIAN", "DSO_WIN32", "_stricmp=stricmp",
                                 "_strnicmp=strnicmp", "_malloca=malloc",
@@ -18,7 +22,6 @@ my %targets = (
         bin_cflags       => "-tWC",
         lib_cflags       => shared("-tWD -D_WINDLL -D_DLL"),
         coutflag         => "-o",
-        cpp_depend_flags => "-Hp",
         LD               => "ilink32",
         LDFLAGS          => picker(default => "-x -Gn -q -w-dup",
                                    debug   => '-j"$(BDS)\lib\win32c\debug" ' .
index 6ceab7e94d5c4dbc3f0dfe051aaaf01a89f3f74f..a5afe3848a89f57c0473c7cd39837f993dc025ad 100644 (file)
@@ -836,7 +836,7 @@ $obj: $deps
        \$(CC) $cflags $defs -c \$(COUTFLAG)\$\@ $srcs
 EOF
      $recipe .= <<"EOF"        unless $disabled{makedepend};
-       cmd /C "\$(CPP) $cflags $defs $target{cpp_depend_flags} $srcs > $dep 2>&1"
+       cmd /C "$target{make_depend} $cflags $defs $srcs > $dep 2>&1"
 EOF
      return $recipe;
  }