Configure: fix Mac OS X builds that still require makedepend
authorTodd Short <tshort@akamai.com>
Thu, 3 May 2018 15:17:49 +0000 (11:17 -0400)
committerAndy Polyakov <appro@openssl.org>
Sat, 5 May 2018 18:58:21 +0000 (20:58 +0200)
Earlier Apple Xcode compilers, e.g. one targeting Mac OS X 10.7, don't
support dependency generation and one still has to use makedepend.  It's
unclear when it was fixed, but all clang-based Apple compilers seem to
support -M options.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6169)

Configure

index 66507039cda08fdbada7b13a609b65cae8c78936..62c354abf0d8d5503e83561df4f8237db9acf202 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1415,9 +1415,11 @@ if (!$disabled{makedepend}) {
         # For VC- and vms- targets, there's nothing more to do here.  The
         # functionality is hard coded in the corresponding build files for
         # cl (Windows) and CC/DECC (VMS).
         # For VC- and vms- targets, there's nothing more to do here.  The
         # functionality is hard coded in the corresponding build files for
         # cl (Windows) and CC/DECC (VMS).
-    } elsif ($predefined{__GNUC__} >= 3) {
+    } elsif (($predefined{__GNUC__} // -1) >= 3
+            && !($predefined{__APPLE_CC__} && !$predefined{__clang__})) {
         # We know that GNU C version 3 and up as well as all clang
         # We know that GNU C version 3 and up as well as all clang
-        # versions support dependency generation
+        # versions support dependency generation, but Xcode did not
+        # handle $cc -M before clang support (but claims __GNUC__ = 3)
         $config{makedepprog} = "\$(CROSS_COMPILE)$config{CC}";
     } else {
         # In all other cases, we look for 'makedepend', and disable the
         $config{makedepprog} = "\$(CROSS_COMPILE)$config{CC}";
     } else {
         # In all other cases, we look for 'makedepend', and disable the