[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Mon Feb 1 14:42:24 UTC 2016


The branch master has been updated
       via  f1f07a2367e5381ff6e96a89b2512adfa3e14d0e (commit)
      from  eb507efba8e2333a284a2a79638f729bdc35c502 (commit)


- Log -----------------------------------------------------------------
commit f1f07a2367e5381ff6e96a89b2512adfa3e14d0e
Author: Rich Salz <rsalz at akamai.com>
Date:   Fri Jan 29 19:50:28 2016 -0500

    Better check for gcc/clang
    
    Iteratively improved with Richard and Andy.
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>
    Reviewed-by: Richard Levitte <levitte at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 Configure    | 17 +++++++++++++----
 util/domd.in | 11 ++++++-----
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/Configure b/Configure
index 09c7697..06eca50 100755
--- a/Configure
+++ b/Configure
@@ -1072,11 +1072,19 @@ if (!$no_asm) {
     }
 }
 
+# Is the compiler gcc or clang?  $ecc is used below to see if error-checking
+# can be turned on.
 my $ecc = $target{cc};
-$ecc = "clang" if `$target{cc} --version 2>&1` =~ /clang/;
+my $ccpcc = "$config{cross_compile_prefix}$target{cc}";
+$config{makedepprog} = 'makedepend';
+open(PIPE, "$ccpcc --version 2>&1 | head -2 |");
+while ( <PIPE> ) {
+    $config{makedepprog} = $ccpcc if /clang|gcc/;
+    $ecc = "clang" if /clang/;
+    $ecc = "gcc" if /gcc/;
+}
+close(PIPE);
 
-$config{makedepprog} =
-    $ecc eq "gcc" || $ecc eq "clang" ? $target{cc} : "makedepend";
 $config{depflags} =~ s/^\s*//;
 
 
@@ -1121,7 +1129,8 @@ if (defined($config{api})) {
 if ($strict_warnings)
 	{
 	my $wopt;
-	die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc(-\d(\.\d)*)?$/ or $ecc =~ /clang$/);
+	die "ERROR --strict-warnings requires gcc or clang"
+            unless $ecc eq 'gcc' || $ecc eq 'clang';
 	foreach $wopt (split /\s+/, $gcc_devteam_warn)
 		{
 		$config{cflags} .= " $wopt" unless ($config{cflags} =~ /(^|\s)$wopt(\s|$)/)
diff --git a/util/domd.in b/util/domd.in
index ede2733..20d3474 100755
--- a/util/domd.in
+++ b/util/domd.in
@@ -6,20 +6,21 @@
 {- "MAKEDEPEND=" . quotify1($config{makedepprog}) -}
 
 case "${MAKEDEPEND}" in
+cat)
+    ;;
 makedepend)
-    cp Makefile.in Makefile
     ${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $@ || exit 1
     ;;
 *)
-    args="-Werror -M"
+    args="-Werror -MM"
     while [ $# -gt 0 ]; do
         if [ "$1" != '--' ] ; then
             args="$args $1"
         fi
         shift
     done
-    ${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $args >Makefile.tmp || exit 1
-    cat Makefile.in Makefile.tmp >Makefile
-    rm Makefile.tmp
+    sed -e '/DO NOT DELETE THIS LINE/q' Makefile >Makefile.tmp
+    ${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $args >>Makefile.tmp || exit 1
+    mv Makefile.tmp Makefile
     ;;
 esac


More information about the openssl-commits mailing list