[darwinbuild-changes] [493] trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Mar 20 15:35:30 PDT 2009


Revision: 493
          http://trac.macosforge.org/projects/darwinbuild/changeset/493
Author:   wsiegrist at apple.com
Date:     2009-03-20 15:35:29 -0700 (Fri, 20 Mar 2009)
Log Message:
-----------
Look at the archs in the dylibs we use and only build for the common subset.

Modified Paths:
--------------
    trunk/common.mk

Added Paths:
-----------
    trunk/archs.sh

Added: trunk/archs.sh
===================================================================
--- trunk/archs.sh	                        (rev 0)
+++ trunk/archs.sh	2009-03-20 22:35:29 UTC (rev 493)
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+#
+# Detect which arches we should build for
+#
+
+CRYPTO_ARCHS=`lipo -info /usr/lib/libcrypto.dylib | cut -d : -f 3`
+SQLITE_ARCHS=`lipo -info /usr/lib/libsqlite3.dylib | cut -d : -f 3`
+TCL_ARCHS=`lipo -info /usr/lib/libtcl.dylib | cut -d : -f 3`
+SYSTEM_ARCHS=`lipo -info /usr/lib/libSystem.dylib | cut -d : -f 3`
+
+# start with one set of archs
+FINAL_ARCHS=$SYSTEM_ARCHS
+
+for ARCH in $SYSTEM_ARCHS;
+do
+	# crosscheck against the remaining sets...
+	for ALIST in "$CRYPTO_ARCHS" "$SQLITE_ARCHS" "$TCL_ARCHS";
+	do
+		# see if ARCH is not in ALIST
+		if [[ ${ALIST/$ARCH} == $ALIST ]];
+		then
+			# ARCH was not found, so remove from final archs
+			FINAL_ARCHS="${FINAL_ARCHS/$ARCH}";
+		fi
+	done;
+done;
+
+# print what is left over
+echo $FINAL_ARCHS
+


Property changes on: trunk/archs.sh
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/common.mk
===================================================================
--- trunk/common.mk	2009-03-20 22:22:05 UTC (rev 492)
+++ trunk/common.mk	2009-03-20 22:35:29 UTC (rev 493)
@@ -5,6 +5,7 @@
 DESTDIR?=$(DSTROOT)
 
 ### makefile variables normally set by XBS
+SRCROOT?=.
 OBJROOT?=.
 SYMROOT?=.
 
@@ -20,6 +21,6 @@
 
 SED=/usr/bin/sed
 
-RC_CFLAGS?=$(shell lipo -info /usr/lib/libSystem.dylib | cut -d : -f 3 | sed 's/ppc7400/ppc/' | awk '{ ORS=" "; for(i=1;i<=NF;i++) print "-arch", $$i}')
+RC_CFLAGS?=$(shell ../archs.sh | awk '{ ORS=" "; for(i=1;i<=NF;i++) print "-arch", $$i}')
 CFLAGS+=$(RC_CFLAGS)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20090320/2be595da/attachment.html>


More information about the darwinbuild-changes mailing list