Revision
145156
Author
khindenburg@macports.org
Date
2016-01-26 19:37:11 -0800 (Tue, 26 Jan 2016)

Log Message

p7zip: attempt to use the right compiler on multiple architecture #50146

Modified Paths

Diff

Modified: trunk/dports/archivers/p7zip/Portfile (145155 => 145156)


--- trunk/dports/archivers/p7zip/Portfile	2016-01-27 03:09:24 UTC (rev 145155)
+++ trunk/dports/archivers/p7zip/Portfile	2016-01-27 03:37:11 UTC (rev 145156)
@@ -36,16 +36,28 @@
 }
 
 configure {
-    copy -force ${worksrcpath}/makefile.macosx_llvm_64bits ${worksrcpath}/makefile.machine
-    # this also corrects a typo in the makefile ('XX' rather than 'CXX')
-    reinplace "s|^XX=/usr/bin/llvm-g++|CXX=${configure.cxx}|" \
+    if {${build_arch} eq "x86_64"} {
+        copy -force ${worksrcpath}/makefile.macosx_llvm_64bits ${worksrcpath}/makefile.machine
+        # this also corrects a typo in the makefile ('XX' rather than 'CXX')
+        reinplace "s|^XX=/usr/bin/llvm-g++|CXX=${configure.cxx}|g" \
+             ${worksrcpath}/makefile.machine
+        reinplace "s|^CC=/usr/bin/llvm-gcc|CC=${configure.cc}|g" \
+             ${worksrcpath}/makefile.machine
+    } else {
+        if {${build_arch} eq "ppc"} {
+            copy -force ${worksrcpath}/makefile.macosx_gcc_32bits_ppc ${worksrcpath}/makefile.machine
+        } elseif {${build_arch} eq "ppc64"} {
+            copy -force ${worksrcpath}/makefile.macosx_gcc_64bits ${worksrcpath}/makefile.machine
+        } else {
+            copy -force ${worksrcpath}/makefile.macosx_gcc_32bits_asm ${worksrcpath}/makefile.machine
+        }
+        reinplace "s|^CXX=c++|CXX=${configure.cxx}|g" \
             ${worksrcpath}/makefile.machine
-    reinplace "s|^CC=/usr/bin/llvm-gcc|CC=${configure.cc}|" \
+        reinplace "s|^CC=cc|CC=${configure.cc}|g" \
             ${worksrcpath}/makefile.machine
-    reinplace "s|-m64||g" \
-            ${worksrcpath}/makefile.machine
-    reinplace "s|\$(LOCAL_FLAGS)|[get_canonical_archflags] \$(LOCAL_FLAGS)|" \
-            ${worksrcpath}/makefile.machine
+    }
+    reinplace "s|\$(LOCAL_FLAGS)|[get_canonical_archflags] \$(LOCAL_FLAGS)|g" \
+        ${worksrcpath}/makefile.machine
 }
 
 # build 7za, 7z and 7zr