]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
util/add-depends.pl: Rebuild the build file after reconfiguration
authorRichard Levitte <levitte@openssl.org>
Thu, 19 Aug 2021 18:45:00 +0000 (20:45 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 19 Aug 2021 18:45:00 +0000 (20:45 +0200)
Reconfiguration is assumed if any dependency (.d) file is older than
configdata.pm.

Fixes #16364

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16365)

util/add-depends.pl

index 1e2ade78fe07e5f43fa321239f6693e3fe64ac5c..599a267f6dd550aa9296dd4c3efeedb48ea3b47b 100644 (file)
@@ -23,6 +23,7 @@ ${^WIN32_SLOPPY_STAT} = 1;
 my $debug = $ENV{ADD_DEPENDS_DEBUG};
 my $buildfile = $config{build_file};
 my $build_mtime = (stat($buildfile))[9];
+my $configdata_mtime = (stat('configdata.pm'))[9];
 my $rebuild = 0;
 my $depext = $target{dep_extension} || ".d";
 my @depfiles =
@@ -30,9 +31,11 @@ my @depfiles =
     grep {
         # This grep has side effects.  Not only does if check the existence
         # of the dependency file given in $_, but it also checks if it's
-        # newer than the build file, and if it is, sets $rebuild.
+        # newer than the build file or older than configdata.pm, and if it
+        # is, sets $rebuild.
         my @st = stat($_);
-        $rebuild = 1 if @st && $st[9] > $build_mtime;
+        $rebuild = 1
+            if @st && ($st[9] > $build_mtime || $st[9] < $configdata_mtime);
         scalar @st > 0;         # Determines the grep result
     }
     map { (my $x = $_) =~ s|\.o$|$depext|; $x; }