From: Richard Levitte Date: Tue, 8 Mar 2016 16:16:16 +0000 (+0100) Subject: Check gcc version to see if it supports -MM and friends X-Git-Tag: OpenSSL_1_1_0-pre4~166 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=30752dd7df7c699b380043cb73e384dd84cab539;p=oweals%2Fopenssl.git 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 --- diff --git a/Configure b/Configure index 17f45b0bd0..fa1272b6e9 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 ( ) { - $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/; }