Revision
75415
Author
jmr@macports.org
Date
2011-01-24 10:40:37 -0800 (Mon, 24 Jan 2011)

Log Message

SuiteSparse: add universal and build_arch support (#20675)

Modified Paths

Diff

Modified: trunk/dports/math/SuiteSparse/Portfile (75414 => 75415)


--- trunk/dports/math/SuiteSparse/Portfile	2011-01-24 18:22:53 UTC (rev 75414)
+++ trunk/dports/math/SuiteSparse/Portfile	2011-01-24 18:40:37 UTC (rev 75415)
@@ -31,6 +31,12 @@
                     sha1    6de027d48a573659b40ddf57c10e32b39ab034c6 \
                     rmd160  77ff7376691d2bc8581de6ae89f246cb289b2708
 
+variant universal {}
+if {[variant_isset universal]} {
+    append configure.cflags " " ${configure.universal_cflags}
+} else {
+    append configure.cflags " " ${configure.cc_archflags}
+}
 post-patch {
 	# Metis is included with SuiteSparse, but we want to use
 	#   the MacPorts version
@@ -52,6 +58,11 @@
 	reinplace -E \
 		"s|(\[^a-zA-Z\])Imag(\[^a-zA-Z\])|\\1ImagPart\\2|g" \
 		${worksrcpath}/KLU/Include/klu_version.h
+        # ranlib after ar
+        reinplace "s|ccolamd_global\.o|ccolamd_global.o\\
+	- \$(RANLIB) libccolamd.a|" ${worksrcpath}/CCOLAMD/Lib/Makefile
+        reinplace "s|colamd_global\.o|colamd_global.o\\
+	- \$(RANLIB) libcolamd.a|" ${worksrcpath}/COLAMD/Lib/Makefile
 }
 
 post-configure	{
@@ -71,7 +82,7 @@
 		"s|^CFLAGS = .*$|CFLAGS = ${configure.cflags}|g" \
 		${worksrcpath}/UFconfig/UFconfig.mk
 	reinplace -E \
-		"s|^CFLAGS = -O|CFLAGS = -O3|g" \
+		"s|^CFLAGS = -O|CFLAGS = ${configure.cflags}|g" \
 		${worksrcpath}/CSparse/Demo/Makefile \
 		${worksrcpath}/CSparse/Lib/Makefile
 	reinplace -E \
@@ -86,6 +97,7 @@
 	reinplace -E \
 		"s|^METIS = .*$|METIS = ${prefix}/lib/libmetis.a|g" \
 		${worksrcpath}/UFconfig/UFconfig.mk
+        reinplace "s|(CC)|(CC) \$(CFLAGS)|" ${worksrcpath}/CXSparse/Demo/Makefile
 }
 
 destroot	{