[32194] trunk/base/src/port1.0/portconfigure.tcl
mww at macports.org
mww at macports.org
Wed Dec 19 06:44:15 PST 2007
Revision: 32194
http://trac.macosforge.org/projects/macports/changeset/32194
Author: mww at macports.org
Date: 2007-12-19 06:44:11 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
make the universal flags take the archs from a single source (thanks to ryandesign for the idea), enable 64 bit universal builds
Modified Paths:
--------------
trunk/base/src/port1.0/portconfigure.tcl
Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl 2007-12-19 12:43:35 UTC (rev 32193)
+++ trunk/base/src/port1.0/portconfigure.tcl 2007-12-19 14:44:11 UTC (rev 32194)
@@ -85,12 +85,12 @@
} else {
set sysroot "/Developer/SDKs/MacOSX10.4u.sdk"
}
-options configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags configure.universal_env
+options configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags configure.universal_env
default configure.universal_args --disable-dependency-tracking
-default configure.universal_cflags {"-isysroot $sysroot -arch i386 -arch ppc"}
+default configure.universal_cflags {[configure_get_universal_cflags]}
default configure.universal_cppflags {}
-default configure.universal_cxxflags {"-isysroot $sysroot -arch i386 -arch ppc"}
-default configure.universal_ldflags {"-arch i386 -arch ppc"}
+default configure.universal_cxxflags {[configure_get_universal_cflags]}
+default configure.universal_ldflags {[configure_get_universal_ldflags]}
# Select a distinct compiler (C, C preprocessor, C++)
options configure.ccache configure.distcc configure.cc configure.cxx configure.cpp configure.objc configure.f77 configure.f90 configure.fc configure.javac configure.compiler
@@ -114,6 +114,35 @@
ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] [option portname]]"
}
+#
+# internal functions to determine the "-arch xy" flags for the compiler
+# -> these should preferably get a more global scope, perhaps be user-configurable?
+set universal_archs {ppc ppc64 i386 x86_64}
+
+proc configure_get_universal_archflags {args} {
+ global universal_archs
+ set flags ""
+ foreach arch $universal_archs {
+ set flags "$flags -arch $arch"
+ }
+ return $flags
+}
+
+proc configure_get_universal_cflags {args} {
+ global sysroot
+ set flags [configure_get_universal_archflags]
+ if {${sysroot} != ""} {
+ set flags "-isysroot ${sysroot} ${flags}"
+ }
+ return $flags
+}
+
+proc configure_get_universal_ldflags {args} {
+ return [configure_get_universal_archflags]
+}
+
+
+
# internal function for setting compiler variables; use like "_set_compiler string var val var val .."
# this function will NOT override explicitely set variables from the portfile
proc select_compiler {info args} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071219/481b4f64/attachment.html
More information about the macports-changes
mailing list