Ticket #39523: 0001-zlib-Build-fix-for-using-clang-as-default-compiler.patch

File 0001-zlib-Build-fix-for-using-clang-as-default-compiler.patch, 2.1 KB (added by daniel@…, 11 years ago)
  • Portfile

    From 95cb4472120626afa1561ef3701c691872120b8a Mon Sep 17 00:00:00 2001
    From: Daniel Dunbar <ddunbar@lordcrumb.apple.com>
    Date: Mon, 24 Jun 2013 16:40:27 -0700
    Subject: [PATCH] zlib: Build fix for using clang as default compiler.
    
    ---
     Portfile                         |  3 +++
     files/patch-configure-clang.diff | 33 +++++++++++++++++++++++++++++++++
     2 files changed, 36 insertions(+)
     create mode 100644 files/patch-configure-clang.diff
    
    diff --git a/Portfile b/Portfile
    index 8e11c87..11c42fe 100644
    a b use_xz yes 
    2525checksums               rmd160  2675993cab2db4a1eb69beb885c118e87bf86c64 \
    2626                        sha256  831df043236df8e9a7667b9e3bb37e1fcb1220a0f163b6de2626774b9590d057
    2727
     28patchfiles              patch-configure-clang.diff
     29patch.pre_args          -p1
     30
    2831minimum_xcodeversions   {8 2.4.1 9 3.1}
    2932
    3033configure.universal_args
  • new file files/patch-configure-clang.diff

    diff --git a/files/patch-configure-clang.diff b/files/patch-configure-clang.diff
    new file mode 100644
    index 0000000..08fcb7f
    - +  
     1From 8a4e86305a0ed5cf3b0f0cd7338c77a4b564f486 Mon Sep 17 00:00:00 2001
     2From: Daniel Dunbar <daniel@zuster.org>
     3Date: Mon, 24 Jun 2013 16:02:55 -0700
     4Subject: [PATCH] Fix detection of "gcc"-likeness for use with LLVM/Clang.
     5
     6 - When CC does not include "gcc" or "clang" explicitly in the name,
     7   then configure will check the "$CC -v" output to see if the
     8   compiler is gcc-like. In such cases it should also recognize the
     9   presence of "clang" as indicating a gcc-like compiler.
     10
     11 - This fixes problems when using Clang as the default compiler "/usr/bin/cc" on
     12   Darwin, because otherwise the configure logic does not properly compute the
     13   shared library extension, etc.
     14
     15---
     16 configure | 1 +
     17 1 file changed, 1 insertion(+)
     18
     19diff --git a/configure b/configure
     20index b77a8a8..54f33f7 100755
     21--- a/configure
     22+++ b/configure
     23@@ -159,6 +159,7 @@ case "$cc" in
     24 esac
     25 case `$cc -v 2>&1` in
     26   *gcc*) gcc=1 ;;
     27+  *clang*) gcc=1 ;;
     28 esac
     29 
     30 show $cc -c $test.c
     31--
     321.8.2.1 (Apple Git-45)
     33