[52326] trunk/base/src/port1.0
toby at macports.org
toby at macports.org
Sun Jun 14 00:45:39 PDT 2009
Revision: 52326
http://trac.macports.org/changeset/52326
Author: toby at macports.org
Date: 2009-06-14 00:45:33 -0700 (Sun, 14 Jun 2009)
Log Message:
-----------
Incorporate various universal flags directly into portconfigure.tcl, rather than appending in the default variant. This means that configure.args, configure.cflags, etc will always be set correctly.
Modified Paths:
--------------
trunk/base/src/port1.0/portconfigure.tcl
trunk/base/src/port1.0/portutil.tcl
Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl 2009-06-14 07:14:02 UTC (rev 52325)
+++ trunk/base/src/port1.0/portconfigure.tcl 2009-06-14 07:45:33 UTC (rev 52326)
@@ -46,7 +46,7 @@
commands configure autoreconf automake autoconf xmkmf
# defaults
default configure.env ""
-default configure.pre_args {--prefix=${prefix}}
+default configure.pre_args {[portconfigure::configure_get_pre_args]}
default configure.cmd ./configure
default configure.dir {${worksrcpath}}
default autoreconf.dir {${worksrcpath}}
@@ -88,10 +88,12 @@
default configure.optflags {-O2}
# compiler flags section
default configure.cflags {[portconfigure::configure_get_cflags]}
-default configure.cppflags {"-I${prefix}/include"}
+#default configure.cppflags {"-I${prefix}/include"}
+default configure.cppflags {[portconfigure::configure_get_cppflags]}
default configure.cxxflags {[portconfigure::configure_get_cflags]}
default configure.objcflags {[portconfigure::configure_get_cflags]}
-default configure.ldflags {"-L${prefix}/lib"}
+#default configure.ldflags {"-L${prefix}/lib"}
+default configure.ldflags {[portconfigure::configure_get_ldflags]}
default configure.libs {}
default configure.fflags {[portconfigure::configure_get_cflags]}
default configure.f90flags {[portconfigure::configure_get_cflags]}
@@ -102,6 +104,7 @@
proc portconfigure::configure_get_cflags {args} {
global configure.optflags
global configure.m32 configure.m64 configure.march configure.mtune
+ global configure.universal_cflags
set flags "${configure.optflags}"
if {[tbool configure.m64]} {
set flags "-m64 ${flags}"
@@ -114,9 +117,30 @@
if {[info exists configure.mtune] && ${configure.mtune} != {}} {
set flags "${flags} -mtune=${configure.mtune}"
}
+ if {[variant_isset universal] && ${configure.universal_cflags} != ""} {
+ set flags "${flags} ${configure.universal_cflags}"
+ }
return $flags
}
+proc portconfigure::configure_get_cppflags {args} {
+ global prefix configure.universal_cppflags
+ set flags "-I${prefix}/include"
+ if {[variant_isset universal] && ${configure.universal_cppflags} != ""} {
+ set flags "${flags} ${configure.universal_cppflags}"
+ }
+ return $flags
+}
+
+proc portconfigure::configure_get_ldflags {args} {
+ global prefix configure.universal_ldflags
+ set flags "-L${prefix}/lib"
+ if {[variant_isset universal] && ${configure.universal_ldflags} != ""} {
+ set flags "${flags} ${configure.universal_ldflags}"
+ }
+ return $flags
+}
+
# tools section
options configure.perl configure.python configure.ruby configure.install configure.awk configure.bison configure.pkg_config configure.pkg_config_path
default configure.perl {}
@@ -182,12 +206,25 @@
ui_debug "Using compiler '$name'"
}
+proc portconfigure::configure_get_pre_args {args} {
+ global prefix configure.universal_args
+ set result "--prefix=${prefix}"
+ if {[variant_isset universal] && ${configure.universal_args} != ""} {
+ set result "$result ${configure.universal_args}"
+ }
+ return $result
+}
+
# internal function to determine the "-arch xy" flags for the compiler
proc portconfigure::configure_get_universal_archflags {args} {
global configure.universal_archs
set flags ""
foreach arch ${configure.universal_archs} {
- set flags "$flags -arch $arch"
+ if {$flags == ""} {
+ set flags "-arch $arch"
+ } else {
+ set flags "$flags -arch $arch"
+ }
}
return $flags
}
Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl 2009-06-14 07:14:02 UTC (rev 52325)
+++ trunk/base/src/port1.0/portutil.tcl 2009-06-14 07:45:33 UTC (rev 52326)
@@ -1883,11 +1883,6 @@
proc add_default_universal_variant {args} {
# Declare default universal variant if universal SDK is installed
variant universal {
- eval configure.args-append ${configure.universal_args}
- eval configure.cflags-append ${configure.universal_cflags}
- eval configure.cppflags-append ${configure.universal_cppflags}
- eval configure.cxxflags-append ${configure.universal_cxxflags}
- eval configure.ldflags-append ${configure.universal_ldflags}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090614/db3e6403/attachment.html>
More information about the macports-changes
mailing list