[139338] trunk/dports/devel/ld64
jeremyhu at macports.org
jeremyhu at macports.org
Thu Aug 13 08:27:39 PDT 2015
Revision: 139338
https://trac.macports.org/changeset/139338
Author: jeremyhu at macports.org
Date: 2015-08-13 08:27:39 -0700 (Thu, 13 Aug 2015)
Log Message:
-----------
ld64: Add an +ld64_xcode variant to default to the Xcode-provided version of ld
Modified Paths:
--------------
trunk/dports/devel/ld64/Portfile
Added Paths:
-----------
trunk/dports/devel/ld64/files/ld-xcode
Modified: trunk/dports/devel/ld64/Portfile
===================================================================
--- trunk/dports/devel/ld64/Portfile 2015-08-13 14:54:59 UTC (rev 139337)
+++ trunk/dports/devel/ld64/Portfile 2015-08-13 15:27:39 UTC (rev 139338)
@@ -178,6 +178,10 @@
}
+subport ld64-xcode {
+ version 1
+}
+
variant universal {}
if {${subport} eq ${name}} {
@@ -185,10 +189,11 @@
build {}
use_configure no
- variant ld64_97 conflicts ld64_127 ld64_136 ld64_236 description {Use ld64-97 as the default linker (last version that works on Tiger)} {}
- variant ld64_127 conflicts ld64_97 ld64_136 ld64_236 description {Use ld64-127 as the default linker (last version to support ppc)} {}
- variant ld64_136 conflicts ld64_97 ld64_127 ld64_236 description {Use ld64-136 as the default linker (last version that works on Leopard)} {}
- variant ld64_236 conflicts ld64_97 ld64_127 ld64_136 description {Use ld64-236 as the default linker (last version that builds against OS X's libstdc++)} {}
+ variant ld64_97 conflicts ld64_127 ld64_136 ld64_236 ld64_xcode description {Use ld64-97 as the default linker (last version that works on Tiger)} {}
+ variant ld64_127 conflicts ld64_97 ld64_136 ld64_236 ld64_xcode description {Use ld64-127 as the default linker (last version to support ppc)} {}
+ variant ld64_136 conflicts ld64_97 ld64_127 ld64_236 ld64_xcode description {Use ld64-136 as the default linker (last version that works on Leopard)} {}
+ variant ld64_236 conflicts ld64_97 ld64_127 ld64_136 ld64_xcode description {Use ld64-236 as the default linker (last version that builds against OS X's libstdc++)} {}
+ variant ld64_xcode conflicts ld64_97 ld64_127 ld64_136 ld64_236 description {Use ld64-xcode as the default linker (version provided by the selected Xcode.app toolchain)} {}
if {![variant_isset ld64_97] && ![variant_isset ld64_127] && ![variant_isset ld64_136]} {
if {${os.major} < 9} {
@@ -208,6 +213,8 @@
set ld64_ver 136
} elseif {[variant_isset ld64_236]} {
set ld64_ver 236
+ } elseif {[variant_isset ld64_xcode]} {
+ set ld64_ver xcode
} else {
set ld64_ver latest
}
@@ -215,16 +222,26 @@
depends_run port:ld64-${ld64_ver}
destroot {
- ln -s dyldinfo-${ld64_ver} ${destroot}${prefix}/bin/dyldinfo
ln -s ld-${ld64_ver} ${destroot}${prefix}/bin/ld
- ln -s machocheck-${ld64_ver} ${destroot}${prefix}/bin/machocheck
- ln -s ObjectDump-${ld64_ver} ${destroot}${prefix}/bin/ObjectDump
- ln -s rebase-${ld64_ver} ${destroot}${prefix}/bin/rebase
- ln -s unwinddump-${ld64_ver} ${destroot}${prefix}/bin/unwinddump
file mkdir ${destroot}${prefix}/libexec/ld64
ln -s ld-${ld64_ver} ${destroot}${prefix}/libexec/ld64/ld
+
+ if {![variant_isset ld64_xcode]} {
+ ln -s dyldinfo-${ld64_ver} ${destroot}${prefix}/bin/dyldinfo
+ ln -s machocheck-${ld64_ver} ${destroot}${prefix}/bin/machocheck
+ ln -s ObjectDump-${ld64_ver} ${destroot}${prefix}/bin/ObjectDump
+ ln -s rebase-${ld64_ver} ${destroot}${prefix}/bin/rebase
+ ln -s unwinddump-${ld64_ver} ${destroot}${prefix}/bin/unwinddump
+ }
}
+} elseif {${subport} eq "${name}-xcode"} {
+ distfiles
+ use_configure no
+ build {}
+ destroot {
+ xinstall -m 755 ${filespath}/ld-xcode ${destroot}${prefix}/bin/ld-xcode
+ }
} else {
depends_build path:include/mach-o/dyld_priv.h:dyld-headers \
path:include/mach-o/arm/reloc.h:libmacho-headers
Added: trunk/dports/devel/ld64/files/ld-xcode
===================================================================
--- trunk/dports/devel/ld64/files/ld-xcode (rev 0)
+++ trunk/dports/devel/ld64/files/ld-xcode 2015-08-13 15:27:39 UTC (rev 139338)
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [[ -x /usr/bin/xcrun ]] ; then
+ exec /usr/bin/xcrun ld "${@}"
+elif [[ -x /usr/bin/ld ]] ; then
+ exec /usr/bin/ld "${@}"
+else
+ exec ld "${@}"
+fi
Property changes on: trunk/dports/devel/ld64/files/ld-xcode
___________________________________________________________________
Added: svn:executable
+ *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150813/383d38cf/attachment.html>
More information about the macports-changes
mailing list