[49990] trunk/dports/graphics/libart_lgpl/Portfile

mcalhoun at macports.org mcalhoun at macports.org
Tue Apr 21 16:54:40 PDT 2009


Revision: 49990
          http://trac.macports.org/changeset/49990
Author:   mcalhoun at macports.org
Date:     2009-04-21 16:54:39 -0700 (Tue, 21 Apr 2009)
Log Message:
-----------
libart_lgpl: Fix 64-bit build (incorrect ART_SIZEOF_LONG value) using muniversal PortGroup.

Modified Paths:
--------------
    trunk/dports/graphics/libart_lgpl/Portfile

Modified: trunk/dports/graphics/libart_lgpl/Portfile
===================================================================
--- trunk/dports/graphics/libart_lgpl/Portfile	2009-04-21 22:53:12 UTC (rev 49989)
+++ trunk/dports/graphics/libart_lgpl/Portfile	2009-04-21 23:54:39 UTC (rev 49990)
@@ -1,6 +1,7 @@
 # $Id$
 
 PortSystem      1.0
+PortGroup       muniversal 1.0
 
 name            libart_lgpl
 version         2.3.20
@@ -31,6 +32,67 @@
 
 use_parallel_build  yes
 
+pre-configure {
+    # Check to see if universal_archs order is correct for post-configure below.
+    if { [variant_isset universal] } {
+        set ppcv     [lsearch ${universal_archs} ppc]
+        set i386v    [lsearch ${universal_archs} i386]
+        set ppc64v   [lsearch ${universal_archs} ppc64]
+        set x86_64v  [lsearch ${universal_archs} x86_64]
+
+        if { ${os.arch}=="i386" } {
+            if { ${os.major} >= 10 } {
+                if { (${ppcv}>0 && ${i386v}<0) || (${ppcv} < ${i386v}) } {
+                    ui_msg "When building a universal binary of ${name}, make sure i386 is before ppc in universal_archs in ${prefix}/etc/macports/macports.conf"
+                    error "incompatible universal_archs value"
+                }
+            }
+
+            if { (${ppc64v}>0 && ${x86_64v}<0) || (${ppc64v} < ${x86_64v}) } {
+                ui_msg "When building a universal binary of ${name}, make sure x86_64 is before ppc64 in universal_archs in ${prefix}/etc/macports/macports.conf"
+                error "incompatible universal_archs value"
+            }
+        } else {
+             if { (${ppcv}<0 && ${i386v}>0) || (${ppcv} > ${i386v}) } {
+                ui_msg "When building a universal binary of ${name}, make sure ppc is before i386 in universal_archs in ${prefix}/etc/macports/macports.conf"
+                error "incompatible universal_archs value"
+            }
+
+            if { (${ppc64v}<0 && ${x86_64v}>0) || (${ppc64v} > ${x86_64v}) } {
+                ui_msg "When building a universal binary of ${name}, make sure ppc64 is before x86_64 in universal_archs in ${prefix}/etc/macports/macports.conf"
+                error "incompatible universal_archs value"
+            }
+        }
+    }
+}
+
+# There is a small program called gen_art_config which outputs the various sizeof values into a header file.
+# The answers should be the same on PowerPC and Intel as long the same 32/64-bit mode is the same.
+# The only problem might be if ART_SIZEOF_BOOL (from C99) were ever added (32-bit Intel and PowerPC would be different).
+post-configure {
+    if { [variant_isset universal] } {
+        if { ${os.arch}=="i386" } {
+            if { ${os.major}>=10 && [file exists ${worksrcpath}-ppc] } {
+                reinplace "s|./gen_art_config|${worksrcpath}-i386/gen_art_config|" \
+                    ${worksrcpath}-ppc/Makefile
+            }
+            if { [file exists ${worksrcpath}-ppc64] } {
+                reinplace "s|./gen_art_config|${worksrcpath}-x86_64/gen_art_config|" \
+                    ${worksrcpath}-ppc64/Makefile
+            }
+        } else {
+            if { [file exists ${worksrcpath}-i386] } {
+                reinplace "s|./gen_art_config|${worksrcpath}-ppc/gen_art_config|" \
+                    ${worksrcpath}-i386/Makefile
+            }
+            if { [file exists ${worksrcpath}-x86_64] } {
+                reinplace "s|./gen_art_config|${worksrcpath}-ppc64/gen_art_config|" \
+                    ${worksrcpath}-x86_64/Makefile
+            }
+        }
+    }
+}
+
 platform darwin 6 {
     depends_lib-append lib:libdl:dlcompat
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090421/db481783/attachment-0001.html>


More information about the macports-changes mailing list