[92243] trunk/dports/devel/ld64/Portfile
jeremyhu at macports.org
jeremyhu at macports.org
Sun Apr 22 04:05:16 PDT 2012
Revision: 92243
https://trac.macports.org/changeset/92243
Author: jeremyhu at macports.org
Date: 2012-04-22 04:05:14 -0700 (Sun, 22 Apr 2012)
Log Message:
-----------
ld64: Possible build fix for Leopard/ppc, and provide user feedback about invalid variant choices.
Modified Paths:
--------------
trunk/dports/devel/ld64/Portfile
Modified: trunk/dports/devel/ld64/Portfile
===================================================================
--- trunk/dports/devel/ld64/Portfile 2012-04-22 10:44:45 UTC (rev 92242)
+++ trunk/dports/devel/ld64/Portfile 2012-04-22 11:05:14 UTC (rev 92243)
@@ -31,8 +31,14 @@
patchfiles ld64-version.patch
-if {![variant_isset llvm29] && ![variant_isset llvm30] && ![variant_isset llvm31]} {
+if {![variant_isset llvm29] && ![variant_isset llvm30] && ![variant_isset llvm31] &&
+ ${os.arch} != "powerpc" && ${os.major} >= 9} {
default_variants +llvm30
+
+ if {![variant_isset llvm30]} {
+ ui_error "Your platform cannot be configured without LTO support in ld64. Please enable one of the llvmXX variants, and try again."
+ return -code error "Your platform cannot be configured without LTO support in ld64. Please enable one of the llvmXX variants, and try again."
+ }
}
set llvm_version {}
@@ -61,6 +67,11 @@
sha256 4bcbcbdfd62efdc46c51700b8f5dae2cbd1638e9e50f649d5c7f242d32fca804
supported_archs i386 ppc
+ if {[variant_isset llvm29] || [variant_isset llvm30] || [variant_isset llvm31]} {
+ ui_error "Your platform does not yet support LTO in ld64. Please disable the llvmXX variant, and try again."
+ return -code error "Your platform does not yet support LTO in ld64. Please disable the llvmXX variant, and try again."
+ }
+
# No LTO Support until we work around CFLAGS and CXXFLAGS setting with XCode 2.5 below
# We will also need to edit the XCode project to define LTO_SUPPORT correctly
depends_lib-delete port:llvm-${llvm_version}
@@ -83,7 +94,7 @@
xcode.destroot.path ${prefix}/bin
post-patch {
- if {${os.arch} != "powerpc" && ${os.major} >= 9} {
+ if {[variant_isset llvm29] || [variant_isset llvm30] || [variant_isset llvm31]} {
reinplace "s|/Developer/usr/lib|${prefix}/libexec/llvm-${llvm_version}/lib|g" \
${worksrcpath}/ld64.xcodeproj/project.pbxproj
}
@@ -115,7 +126,7 @@
}
}
-if {${os.arch} != "powerpc" && ${os.major} >= 9} {
+if {[variant_isset llvm29] || [variant_isset llvm30] || [variant_isset llvm31]} {
pre-build {
set extra_flags "[exec ${prefix}/bin/llvm-config-mp-${llvm_version} --cflags] -I${prefix}/include"
build.env OTHER_CFLAGS="${extra_flags}" OTHER_CPLUSPLUSFLAGS="${extra_flags}"
@@ -133,6 +144,10 @@
if {${os.major} < 9} {
xcode.build.settings-append OTHER_LDFLAGS='-lcrypto'
xcode.destroot.settings-append OTHER_LDFLAGS='-lcrypto'
+ } else {
+ # To remove a potential weak link against libLTO.dylib
+ xcode.build.settings-append OTHER_LDFLAGS=''
+ xcode.destroot.settings-append OTHER_LDFLAGS=''
}
}
@@ -142,7 +157,7 @@
file mkdir ${destroot}${prefix}/libexec/ld64
file copy ${destroot}${prefix}/bin/ld ${destroot}${prefix}/libexec/ld64/ld
- if {${os.arch} != "powerpc" && ${os.major} >= 9} {
+ if {[variant_isset llvm29] || [variant_isset llvm30] || [variant_isset llvm31]} {
system "install_name_tool -change ${prefix}/libexec/llvm-${llvm_version}/lib/libLTO.dylib \
@executable_path/../lib/libLTO.dylib ${destroot}${prefix}/libexec/ld64/ld"
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120422/bdc3c0c4/attachment-0001.html>
More information about the macports-changes
mailing list