make depend: prefer clang over makedepend
authorEmilia Kasper <emilia@openssl.org>
Fri, 9 Oct 2015 18:00:53 +0000 (20:00 +0200)
committerEmilia Kasper <emilia@openssl.org>
Wed, 14 Oct 2015 15:10:20 +0000 (17:10 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Configure
util/domd

index 06b2278c16a1eac27c57e47ad73b4aaefa3e1e89..9ff6e70dd8f2f7d521304172d526a3957f81bcce 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1635,10 +1635,11 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
        $shlib_minor=$2;
        }
 
+my $ecc = $cc;
+$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
+
 if ($strict_warnings)
        {
-       my $ecc = $cc;
-       $ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
        my $wopt;
        die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc(-\d(\.\d)*)?$/ or $ecc =~ /clang$/);
        foreach $wopt (split /\s+/, $gcc_devteam_warn)
@@ -1703,7 +1704,7 @@ while (<IN>)
                s/^CC=.*$/CC= $cc/;
                s/^AR=\s*ar/AR= $ar/;
                s/^RANLIB=.*/RANLIB= $ranlib/;
-               s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc" || ($cc eq 'cc' && $target =~ /darwin/);
+               s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
                }
        s/^CFLAG=.*$/CFLAG= $cflags/;
        s/^DEPFLAG=.*$/DEPFLAG=$depflags/;
index 552a352e3a84bea33ffd88b05f1dceb032760b4f..f5be00deec4943636b6715f38d9dfbdb6bbb0c6b 100755 (executable)
--- a/util/domd
+++ b/util/domd
@@ -12,7 +12,8 @@ fi
 if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
 
 cp Makefile Makefile.save
-if expr "$MAKEDEPEND" : '.*cc' > /dev/null; then
+if ${MAKEDEPEND} --version 2>&1 | grep -q "clang" ||
+   echo $MAKEDEPEND | grep -q "gcc"; then
     args=""
     while [ $# -gt 0 ]; do
        if [ "$1" != "--" ]; then args="$args $1"; fi