Default +universal variant for configure-based ports

Blair Zajac blair at orcaware.com
Mon Feb 26 09:05:32 PST 2007


Paul Guyot wrote:
> 
> On Feb 26, 2007, at 19:00, Blair Zajac wrote:
> 
>> Hello Paul,
>>
>> Yes, I would love to have a single Universal MacPorts build, but since 
>> I need to support 10.3, that won't be happening.
>>
>> But shouldn't the code adding this feature check to see if it's on 
>> 10.3 before adding the -isysroot and other flags to the builds?
> 
> Hello Blair,
> 
> I just do not understand why a user would try +univeral on 10.3. And 
> even if they did, they would get a warning (which could be turned into 
> an error at some point) because the 10.4 universal SDK would not be 
> present.
> 
> Paul
> 

Hello Paul,

I'm not saying a user would do this.

But isn't the default a +universal variant now if a configure script is 
used?

Here's the commit

svn diff -r 22312:22313 https://svn.macports.org/repository/macports/trunk
Index: base/src/port1.0/portconfigure.tcl
===================================================================
--- base/src/port1.0/portconfigure.tcl  (revision 22312)
+++ base/src/port1.0/portconfigure.tcl  (revision 22313)
@@ -50,6 +50,13 @@
  default xmkmf.dir {${worksrcpath}}
  default use_configure yes

+# Universal options & default values.
+options configure.universal_args configure.universal_cflags 
configure.universal_ldflags configure.universal_env
+default configure.universal_args       --disable-dependency-tracking
+default configure.universal_cflags     {"-isysroot 
/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"}
+default configure.universal_ldflags    {"-arch i386 -arch ppc"}
+default configure.universal_env 
{"CFLAGS=\"${configure.universal_cflags}\" 
LDFLAGS=\"${configure.universal_ldflags}\""}
+
  set_ui_prefix

  proc configure_start {args} {
Index: base/src/port1.0/portmain.tcl
===================================================================
--- base/src/port1.0/portmain.tcl       (revision 22312)
+++ base/src/port1.0/portmain.tcl       (revision 22313)
@@ -94,7 +94,20 @@
  if {[info exists os.platform] && ![info exists 
variations(${os.platform})]} { variant_set ${os.platform}}
  if {[info exists os.arch] && ![info exists variations(${os.arch})]} { 
variant_set ${os.arch} }
  if {[info exists os.platform] && (${os.platform} == "darwin") && 
![file isdirectory /System/Library/Frameworks/Carbon.framework] && 
![info exists variations(puredarwin)]} { variant_set puredarwin }
-if {[info exists os.platform] && (${os.platform} == "darwin") && [file 
isdirectory /System/Library/Frameworks/Carbon.framework] && ![info 
exists variations(macosx)]} { variant_set macosx }
+if {[info exists os.platform] && (${os.platform} == "darwin") && [file 
isdirectory /System/Library/Frameworks/Carbon.framework] && ![info 
exists variations(macosx)]} {
+       variant_set macosx
+       # Declare default universal variant.
+       variant universal {
+               if {[tbool use_xmkmf] || ![tbool use_configure]} {
+                       return -code error "Default universal variant 
only works with ports based on configure"
+               }
+               configure.args-append ${configure.universal_args}
+               if {[info exists configure.env] && [regexp "(^| 
)(LD|C)FLAGS=" ${configure.env}]} {
+                       ui_warn "This port already overrides CFLAGS or 
LDFLAGS. The universal variant may break it."
+               }
+               configure.env-append ${configure.universal_env}
+       }
+}


I'm wondering if on 10.3, the universal_args will be added to 
configure.args anyway?

Shouldn't there be a version check in this above section?

Regards,
Blair



More information about the macports-dev mailing list