aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-03-08 17:16:16 +0100
committerRichard Levitte <levitte@openssl.org>2016-03-09 12:09:30 +0100
commit30752dd7df7c699b380043cb73e384dd84cab539 (patch)
tree559705d4f92401783f066fa3384324b7f1f49c80
parentdca5c70121e75774feb7d5e2ac6e453e8675645b (diff)
downloadopenssl-30752dd7df7c699b380043cb73e384dd84cab539.zip
openssl-30752dd7df7c699b380043cb73e384dd84cab539.tar.gz
openssl-30752dd7df7c699b380043cb73e384dd84cab539.tar.bz2
Check gcc version to see if it supports -MM and friends
According to manuals found here: https://gcc.gnu.org/onlinedocs/, GNU C version 3 and on support the dependency generation options. We therefore need to check the gcc version to see if we're going to use it or makedepend for dependency generation. Reviewed-by: Andy Polyakov <appro@openssl.org>
-rwxr-xr-xConfigure6
1 files changed, 5 insertions, 1 deletions
diff --git a/Configure b/Configure
index 17f45b0..fa1272b 100755
--- a/Configure
+++ b/Configure
@@ -1104,7 +1104,11 @@ if ($^O ne "VMS" && !$disabled{makedepend}) {
$config{makedepprog} = which('makedepend');
open(PIPE, "$ccpcc --version 2>&1 | head -2 |");
while ( <PIPE> ) {
- $config{makedepprog} = $ccpcc if /clang|gcc/;
+ # Find the version number and save the major.
+ m|(?:.*)\b(\d+)\.\d+\.\d+\b(?:.*)|;
+ # We know that GNU C version 3 and up as well as all clang
+ # versions support dependency generation
+ $config{makedepprog} = $ccpcc if /clang/ || (/gcc/ && $1 > 3);
$ecc = "clang" if /clang/;
$ecc = "gcc" if /gcc/;
}