[33478] trunk/base/src/port1.0

afb at macports.org afb at macports.org
Sun Jan 27 11:13:53 PST 2008


Revision: 33478
          http://trac.macosforge.org/projects/macports/changeset/33478
Author:   afb at macports.org
Date:     2008-01-27 11:13:51 -0800 (Sun, 27 Jan 2008)

Log Message:
-----------
make universal target/sysroot/archs into variables

Modified Paths:
--------------
    trunk/base/src/port1.0/portconfigure.tcl
    trunk/base/src/port1.0/portmain.tcl

Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl	2008-01-27 19:05:24 UTC (rev 33477)
+++ trunk/base/src/port1.0/portconfigure.tcl	2008-01-27 19:13:51 UTC (rev 33478)
@@ -79,9 +79,14 @@
 default configure.pkg_config_path   {}
 
 # Universal options & default values.
+set target "10.4"
 set sysroot "/Developer/SDKs/MacOSX10.4u.sdk"
+set universal_archs {ppc i386}
 
-options configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags
+options configure.universal_target configure.universal_sysroot configure.universal_archs configure.universal_args configure.universal_cflags configure.universal_cppflags configure.universal_cxxflags configure.universal_ldflags
+default configure.universal_target      {${target}}
+default configure.universal_sysroot     {${sysroot}}
+default configure.universal_archs       {${universal_archs}}
 default configure.universal_args        --disable-dependency-tracking
 default configure.universal_cflags      {[configure_get_universal_cflags]}
 default configure.universal_cppflags    {[configure_get_universal_cppflags]}
@@ -111,14 +116,11 @@
     ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] [option portname]]"
 }
 
-# -> these should preferably get a more global scope, perhaps be user-configurable?
-set universal_archs {ppc i386}
-
 # internal function to determine the "-arch xy" flags for the compiler
 proc configure_get_universal_archflags {args} {
-    global universal_archs
+    global configure.universal_archs
     set flags ""
-    foreach arch $universal_archs {
+    foreach arch ${configure.universal_archs} {
         set flags "$flags -arch $arch"
     }
     return $flags
@@ -126,33 +128,33 @@
 
 # internal function to determine the CPPFLAGS for the compiler
 proc configure_get_universal_cppflags {args} {
-    global sysroot
+    global configure.universal_sysroot
     set flags ""
     # include sysroot in CPPFLAGS too (twice), for the benefit of autoconf
-    if {${sysroot} != ""} {
-        set flags "-isysroot ${sysroot}"
+    if {[info exists configure.universal_sysroot]} {
+        set flags "-isysroot ${configure.universal_sysroot}"
     }
     return $flags
 }
 
 # internal function to determine the CFLAGS for the compiler
 proc configure_get_universal_cflags {args} {
-    global sysroot
+    global configure.universal_sysroot
     set flags [configure_get_universal_archflags]
     # these flags should be valid for C/C++ and similar compiler frontends
-    if {${sysroot} != ""} {
-        set flags "-isysroot ${sysroot} ${flags}"
+    if {[info exists configure.universal_sysroot]} {
+        set flags "-isysroot ${configure.universal_sysroot} ${flags}"
     }
     return $flags
 }
 
 # internal function to determine the LDFLAGS for the compiler
 proc configure_get_universal_ldflags {args} {
-    global sysroot os.platform os.arch os.version os.major
+    global configure.universal_sysroot os.platform os.arch os.version os.major
     set flags [configure_get_universal_archflags]
     # works around linking without using the CFLAGS, outside of automake
     if {${os.arch} == "powerpc"} {
-        set flags "-Wl,-syslibroot,${sysroot} ${flags}"
+        set flags "-Wl,-syslibroot,${configure.universal_sysroot} ${flags}"
     }
     return $flags
 }

Modified: trunk/base/src/port1.0/portmain.tcl
===================================================================
--- trunk/base/src/port1.0/portmain.tcl	2008-01-27 19:05:24 UTC (rev 33477)
+++ trunk/base/src/port1.0/portmain.tcl	2008-01-27 19:13:51 UTC (rev 33478)
@@ -106,8 +106,8 @@
             return -code error "Default universal variant only works with ports based on configure"
         }
         eval configure.args-append ${configure.universal_args}
-        if {![file exists /Developer/SDKs/MacOSX10.4u.sdk]} {
-            return -code error "MacOS X 10.4 universal SDK is not installed (are we running on 10.3? did you forget to install it?) and building with +universal will very likely fail"
+        if {![file exists ${configure.universal_sysroot}]} {
+            return -code error "Universal SDK is not installed (are we running on 10.3? did you forget to install it?) and building with +universal will very likely fail"
         }
         eval configure.cflags-append ${configure.universal_cflags}
         eval configure.cppflags-append ${configure.universal_cppflags}
@@ -116,7 +116,10 @@
     }
     if {[info exists variations(universal)] && $variations(universal) == "+"} {
         # cannot go into the variant, due to the amount of ports overriding it
-        eval macosx_deployment_target "10.4"
+        global configure.universal_target
+        if {[info exists configure.universal_target]} {
+            eval macosx_deployment_target ${configure.universal_target}
+        }
     }
 
     # This is not a standard option, because we need to take an action when it's

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080127/e60f9769/attachment.html


More information about the macports-changes mailing list