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 17:08:54 +0000 (19:08 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Configure
util/domd

index 81b263fa19b22c5396ea2d586fec02464e70e360..e374a69dcadd39a72acbfe5a392132eea5baf701 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1647,10 +1647,11 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
        $shlib_minor=$2;
        }
 
        $shlib_minor=$2;
        }
 
+my $ecc = $cc;
+$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
+
 if ($strict_warnings)
        {
 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$/ or $ecc =~ /clang$/);
        foreach $wopt (split /\s+/, $gcc_devteam_warn)
        my $wopt;
        die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/);
        foreach $wopt (split /\s+/, $gcc_devteam_warn)
@@ -1714,6 +1715,7 @@ while (<IN>)
                s/^AR=\s*ar/AR= $ar/;
                s/^RANLIB=.*/RANLIB= $ranlib/;
                s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
                s/^AR=\s*ar/AR= $ar/;
                s/^RANLIB=.*/RANLIB= $ranlib/;
                s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
+               s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
                }
        s/^CFLAG=.*$/CFLAG= $cflags/;
        s/^DEPFLAG=.*$/DEPFLAG=$depflags/;
                }
        s/^CFLAG=.*$/CFLAG= $cflags/;
        s/^DEPFLAG=.*$/DEPFLAG=$depflags/;
index bab48cb7a27e14477c4805b519f0e4c208370795..6a628c7f96c22b8b1439fd1c95a131153e600a91 100755 (executable)
--- a/util/domd
+++ b/util/domd
@@ -14,7 +14,8 @@ if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi
 cp Makefile Makefile.save
 # fake the presence of Kerberos
 touch $TOP/krb5.h
 cp Makefile Makefile.save
 # fake the presence of Kerberos
 touch $TOP/krb5.h
-if expr "$MAKEDEPEND" : '.*gcc$' > /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
     args=""
     while [ $# -gt 0 ]; do
        if [ "$1" != "--" ]; then args="$args $1"; fi