[22313] trunk/base

source_changes at macosforge.org source_changes at macosforge.org
Sun Feb 25 20:35:11 PST 2007


Revision: 22313
          http://trac.macosforge.org/projects/macports/changeset/22313
Author:   pguyot at kallisys.net
Date:     2007-02-25 20:35:11 -0800 (Sun, 25 Feb 2007)

Log Message:
-----------
Default +universal variant for configure-based ports.
(experimental)

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

Modified: trunk/base/doc/portfile.7
===================================================================
--- trunk/base/doc/portfile.7	2007-02-26 03:12:25 UTC (rev 22312)
+++ trunk/base/doc/portfile.7	2007-02-26 04:35:11 UTC (rev 22313)
@@ -337,6 +337,42 @@
 .Sy Example:
 .Dl extract.post_args | tar xf -
 .El
+.Sh UNIVERSAL TARGET HOOKS
+For universal builds of configure-based ports, we also define specific target hooks. These can be overrided for specific ports. Please note that these hooks are used by the default universal variant and redefining the variant will make them useless. Please also note that problems may occur with the default code if a port already overrides LDFLAGS or CFLAGS (port(1) will display a warning in such a case).
+.Bl -tag -width lc
+.It Ic configure.universal_args
+Arguments appended to the configure script to build the port universal.
+.br
+.Sy Type:
+.Em optional
+.br
+.Sy Default:
+.Em --disable-dependency-tracking
+.It Ic configure.universal_cflags
+Value of the CFLAGS environment variable when invoking the configure script.
+.br
+.Sy Type:
+.Em optional
+.br
+.Sy Default:
+.Em -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
+.It Ic configure.universal_ldflags
+Value of the LDFLAGS environment variable when invoking the configure script.
+.br
+.Sy Type:
+.Em optional
+.br
+.Sy Default:
+.Em -arch i386 -arch ppc
+.It Ic configure.universal_env
+Environment appended to the port-defined environment when invoking the configure script.
+.br
+.Sy Type:
+.Em optional
+.br
+.Sy Default:
+.Em CFLAGS="${configure.universal_cflags}" LDFLAGS="${configure.universal_ldflags}"
+.El
 .Sh RUNTIME VARIABLES
 Read-only access to the MacPorts configuration is provided.
 .Bl -tag -width lc

Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl	2007-02-26 03:12:25 UTC (rev 22312)
+++ trunk/base/src/port1.0/portconfigure.tcl	2007-02-26 04:35:11 UTC (rev 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} {

Modified: trunk/base/src/port1.0/portmain.tcl
===================================================================
--- trunk/base/src/port1.0/portmain.tcl	2007-02-26 03:12:25 UTC (rev 22312)
+++ trunk/base/src/port1.0/portmain.tcl	2007-02-26 04:35:11 UTC (rev 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}
+	}
+}
 
 proc main {args} {
     return 0

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


More information about the macports-changes mailing list