[91789] trunk/dports/devel/libgcrypt/Portfile

jeremyhu at macports.org jeremyhu at macports.org
Tue Apr 10 09:12:28 PDT 2012


Revision: 91789
          https://trac.macports.org/changeset/91789
Author:   jeremyhu at macports.org
Date:     2012-04-10 09:12:25 -0700 (Tue, 10 Apr 2012)
Log Message:
-----------
libgcrypt: Rework compiler logic to be a bit cleaner

Modified Paths:
--------------
    trunk/dports/devel/libgcrypt/Portfile

Modified: trunk/dports/devel/libgcrypt/Portfile
===================================================================
--- trunk/dports/devel/libgcrypt/Portfile	2012-04-10 15:45:37 UTC (rev 91788)
+++ trunk/dports/devel/libgcrypt/Portfile	2012-04-10 16:12:25 UTC (rev 91789)
@@ -39,11 +39,8 @@
 # Build fix for compilers that default to c99 (clang)
 configure.cflags-append "-std=gnu89"
 
-if {[string match "*clang*" ${configure.compiler}]} {
-    # libgcrypt-1.5.0 does some ugly stuff with their udiv_qrnnd macro in mpih-div.c
-    # error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast
-    configure.cflags-append "-fheinous-gnu-extensions"
-} elseif {${configure.compiler} == "gcc-4.2"} {
+if {[string match "*gcc-4.2" ${configure.compiler}] ||
+    (${configure.compiler} == "gcc-4.0" && [vercmp ${xcodeversion} 3.0] >= 0)} {
     # Some versions of gcc fail to build this for i386 including:
     #     gcc-4.0 from XCode 3.1.6 (5493) -- Note that gcc-4.0 from XCode 2.5 (5370) works 
     #     gcc-4.2 from XCode 3.1.6 (5577)
@@ -52,8 +49,8 @@
     # rijndael.c:895: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
     # rijndael.c:895: error: 'asm' operand has impossible constraints
     configure.compiler llvm-gcc-4.2
-} elseif {${configure.compiler} == "gcc-4.0" && [vercmp ${xcodeversion} 3.0] >= 0} {
-    if {[variant_isset universal] || ${build_arch} == "i386"} {
+
+    if {(![file exists ${configure.cc}]) && ([variant_isset universal] || ${build_arch} == "i386")} {
         depends_build port:clang-3.0
         depends_skip_archcheck-append clang-3.0
 
@@ -72,6 +69,12 @@
     }
 }
 
+if {[string match "*clang*" ${configure.compiler}]} {
+    # libgcrypt-1.5.0 does some ugly stuff with their udiv_qrnnd macro in mpih-div.c
+    # error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast
+    configure.cflags-append "-fheinous-gnu-extensions"
+}
+
 use_parallel_build  yes
 
 post-patch {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120410/e7eba981/attachment.html>


More information about the macports-changes mailing list