diff options
Diffstat (limited to 'sys-devel/native-cctools')
-rw-r--r-- | sys-devel/native-cctools/Manifest | 9 | ||||
-rw-r--r-- | sys-devel/native-cctools/files/aix-2/ld | 138 | ||||
-rw-r--r-- | sys-devel/native-cctools/files/aix-2/mkexpfile | 70 | ||||
-rw-r--r-- | sys-devel/native-cctools/files/aix-2/nm | 6 | ||||
-rw-r--r-- | sys-devel/native-cctools/files/ld-aix-1 | 140 | ||||
-rw-r--r-- | sys-devel/native-cctools/files/ld-aix-2 | 138 | ||||
-rw-r--r-- | sys-devel/native-cctools/metadata.xml | 8 | ||||
-rw-r--r-- | sys-devel/native-cctools/native-cctools-4.ebuild | 114 |
8 files changed, 623 insertions, 0 deletions
diff --git a/sys-devel/native-cctools/Manifest b/sys-devel/native-cctools/Manifest new file mode 100644 index 000000000000..4146bb01d2de --- /dev/null +++ b/sys-devel/native-cctools/Manifest @@ -0,0 +1,9 @@ +AUX aix-2/ld 2717 SHA256 a2c264df546aa8d42583d30e41042ba43c1b2baabf4a3f3966426f9d3cfd09d2 SHA512 38ab347451d67a36b37ae2aea8f27876a20cda7a6b3ba1f3ae3acbed5f8a8016822991e3aabc82c8d14f3b0962922d765e5c01ade0e9853ff03f3f0d8e743846 WHIRLPOOL 7758b8a8bedfb2d26335a4995e4b0ee99f9c6f46507cf11f4dd2459f4f91589d7911808125607dc782e1d08e8b532ca1c74a90a2c9a91da4f33e85eaa2c4c67b +AUX aix-2/mkexpfile 1535 SHA256 4ba886dd45b53cb9109eea2722b7cbb720b07d4afce8fcd21cb7977d3be39520 SHA512 51491a3b215b2efcbf3a14ee7cc90ea6e9062eb98a939e88671b288cbd8262864aec8cffe481689ba325c1aed125881a2c6a375eff1bb1f4f9902f29b53944c6 WHIRLPOOL bfdea62c671c2b6829e35be48e43b5d6162d90820139703d7f5dd3b7a7b0fd3aa76af479374dc590e0afa821498ce70a692d9bf09dfbec7cf3bb1838167b1ec1 +AUX aix-2/nm 176 SHA256 e3ff019fc3ba6d12841c62b23bc676cf1338ad4af02fd5ba0da3189a825133c8 SHA512 d5206f7bf3ce54f79c292f9734b028aa8c9d0db811db4cb6ef2a4570f3bd13e38b2e41def4d6053a3794dd0f5ed81b485deee4d27c3db6462035071d7c522411 WHIRLPOOL b3192f2c36685b99b0840c4c0abd36b99f8ae7b823d8cdd0a5a375dda9af475e36bc3a681ca72a8522f9ca8a79d0f230335d15617a98ecdc2969b2ebf31f1ad4 +AUX ld-aix-1 2753 SHA256 e1f31000aecfd60671797423783478ccaa352c91d0ca831aadc25eca0409b268 SHA512 e637a4596164b88fef8d0e9b7259970f49bcee04b4baa75aa811c87e7973fdf63e89d3e72ed8b953ef07fa121e8e8f58d6da3de995c190bc2df59cea950d7cbb WHIRLPOOL 65ca22ca5c48dd29bc45a9db476b0b958667dc6efa92b791df440c31c90a43bbe6dde618b695cf7859b72332778a9da704e242ff1096b8fd17ff42bcae25ed8b +AUX ld-aix-2 2717 SHA256 8635efef392a72da5ad0196de97e59c4e55c9f96590ff12e58ff37a1d7fc95af SHA512 88c88e80e38f2da69bc2adb0ccbaeb35b65ce6c0e00afdf7867c7fa254ed24aacd680ddb98aee3743613f606a18a46fc5525ff4667258c15b17d24ea3da718fe WHIRLPOOL 1578fdf23d39a60cffbab8c02aef91f6de903e1f60fa250cf02ee0fc8450fe8ae64ad772a1a8bcc3350daa4ee5beee1a8d37106bf681071ff0f595220244114a +EBUILD native-cctools-4.ebuild 2816 SHA256 61aaa94ab0a4bbb6178d9b8c46d45167d0354a1b40e616d454b3e32fbfda2d23 SHA512 92382257c82fe3b1a9c109a8628d1a08a588ce95fcc3ec799cd331f5e5b61ee536cc285f5dae5e83dc6e760c3128da294b81020779a2d668656bb08bc2b1a1c9 WHIRLPOOL 531a1de77f7e16c7af15e38d6d3d284fbd46c090f0acebb8d59a2be333a2a9b16a0255cea9a3edc80953eb606a5687ece937c42cba69d8efda4d10941de7baff +MISC ChangeLog 2935 SHA256 9448b6594d9ceee05bef928cbd40208a85a612da3a2d3b63e57b4f5ae209b7fd SHA512 29ae2150bda77be5ccdb90bb12903972e08053134257d37d61d612d7e224a5780578e77342809455792f0f7c8ae92ebaa25be7f2bd40d9f7a352acca4728cc8b WHIRLPOOL 2767eb92659c3a2cfd8e74af3b53ee8d72e166352b051bce278d4a57b8dd75ec65d93e5dafcbbec477958b91fc6bcef56063fc0294706948708be5cc1b1d8776 +MISC ChangeLog-2015 1925 SHA256 1d54c8be32d7e7ef4ee07baf6ccb26f65a339d2e6831484a87da176f5e181b49 SHA512 8c92412c5f41388472ed1757508b0158a99b67dc2264f15a70e14699d577b04a86f66e9aef43b51f176703897de93749640511dbd98040f45a13d877e4610a54 WHIRLPOOL c489e1a48f0618db2223e795a9dd40653f9e69823f91ef4bc20d6d46fea02b8c353b22374f137431ca56af020e3bed38f6b8708f988b46ceb814a31144a33332 +MISC metadata.xml 243 SHA256 acb891975882d2b75bb5a1a76063f1d61ad1d96c799548e7f141e1623a0cc57e SHA512 8489be9ea6eac385511b0d193b1b61fad9c8e0d4cb86fd711e6faf04e66b2c935ae64ce6ce0a044d036e76de6787e5d440d67f831e89261a71e74b645a0999d9 WHIRLPOOL e06d2acbfdb38aa17edb0da41bcafece9c9a5d0542c9192ee3b74ae0b6250d24fb096e3a153f6a215a29d3dd7c5794f2c67f0917db3aa3f1cc65e86ea27e228f diff --git a/sys-devel/native-cctools/files/aix-2/ld b/sys-devel/native-cctools/files/aix-2/ld new file mode 100644 index 000000000000..7477f11cf6e9 --- /dev/null +++ b/sys-devel/native-cctools/files/aix-2/ld @@ -0,0 +1,138 @@ +#! /usr/bin/env /bin/ksh +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 + +# Upon '-soname' and similar flags, create a "shared library" on AIX being an +# archive file containing an Import File and the shared object file, as in: +# http://lists.gnu.org/archive/html/libtool/2011-01/msg00023.html +# with updates in: +# http://lists.gnu.org/archive/html/libtool/2011-02/msg00000.html +# +# This helper script is meant not depend on anything Gentoo specific. + +ld=/usr/ccs/bin/ld +ar=/usr/ccs/bin/ar +strip=/usr/ccs/bin/strip +dump=/usr/sbin/dump +awk=/usr/bin/awk +rm=/usr/bin/rm +mkdir=/usr/bin/mkdir +mv=/usr/bin/mv +ln=/usr/bin/ln + +oldargs= +output= +soname= +newargs= +OBJECT_MODE=${OBJECT_MODE:-32} + +while [[ $# -gt 0 ]] +do + arg=$1 + shift + oldargs="${oldargs} '${arg}'" + case ${arg} in + -o) + newargs="${newargs} -o '$1'" + output=$1 + oldargs="${oldargs} '$1'" + shift + ;; + -bM:SRE) + newargs="${newargs} '-G' '-bernotok'" + ;; + -soname=*) + soname=${arg#-soname=} + ;; + -h*) + soname=${arg#-h} + ;; + -soname|-h) + soname=$1 + shift + ;; + -b32) + newargs="${newargs} '${arg}'" + OBJECT_MODE=32 + ;; + -b64) + newargs="${newargs} '${arg}'" + OBJECT_MODE=64 + ;; + *) + newargs="${newargs} '${arg}'" + ;; + esac +done + +if [[ -z ${output} || -z ${soname} ]]; then + eval "exec ${ld} ${oldargs}" + exit 1 +fi + +# Running ld against the orginal target file to retain +# ld error message when there's a problem with it: +eval "${ld} -o '${output}' ${newargs}" || exit 1 + +workdir="${output}.$$" + +${rm} -rf "${workdir}" || exit 1 +trap "${rm} -rf '${workdir}'" 0 + +case ${soname} in +*\(*\)) + shro=${soname#*\(} + shro=${shro%\)} + shri=${shro%.*}.imp + ;; +*\[*\]) + shro=${soname#*\[} + shro=${shro%\]} + shri=${shro%.*}.imp + ;; +none) # loadable only module, not linkable: no import file + shro='shr.o' + soname="${output##*/}(${shro})" + shri= + ;; +auto) + shro='shr.o' + soname=${output##*/} + if [[ ${soname} == lib*.so* ]]; then + # linkable library: need import file + shri=${shro%.*}.imp + else + # loadable only module, not linkable: no import file + shri= + fi + soname="${soname}(${shro})" + ;; +*) + shro='shr.o' + shri=${shro%.*}.imp + soname="${soname}(${shro})" + ;; +esac + +export OBJECT_MODE + +${mkdir} "${workdir}" || exit 1 +${strip} -e "${output}" || exit 1 +if [[ -n ${shri} ]]; then + ${dump} -Tv "${output}" > "${workdir}"/syms || exit 1 + ${awk} ' + BEGIN { + print "#! '"${soname}"'" + print "# '"${OBJECT_MODE}"'" + } + { + if ($4 == "EXP" || $4 == "ImpExp") { + print $8 + } else + if ($4 == "wEXP") { + print $8" weak" + } + }' <"${workdir}"/syms > "${workdir}"/${shri} || exit 1 +fi +${mv} "${output}" "${workdir}/${shro}" || exit 1 +${ar} rc "${output}" ${shri:+"${workdir}/${shri}"} "${workdir}/${shro}" || exit 1 +exit 0 diff --git a/sys-devel/native-cctools/files/aix-2/mkexpfile b/sys-devel/native-cctools/files/aix-2/mkexpfile new file mode 100644 index 000000000000..4e79e4647b06 --- /dev/null +++ b/sys-devel/native-cctools/files/aix-2/mkexpfile @@ -0,0 +1,70 @@ +#! /bin/sh + +nm="${0%mkexpfile}nm" +showwith= +expfile="ld.aix.exports.$$" +srcobjs= + +# /bin/sort does not allow TMPDIR to be longer than 85 characters +test ${#TMPDIR} -le 85 || TMPDIR=/tmp export TMPDIR + +while test $# -gt 0 +do + arg=$1 + shift + + case ${arg} in + --) for arg in "$@" + do + srcobjs="${srcobjs} '${arg}'" + done + break + ;; + --show-with=*) showwith="${arg#--show-with=}" ;; + -o) expfile="${1}"; shift ;; + -o*) expfile="${arg#-o}"; ;; + *) srcobjs="${srcobjs} '${arg}'" ;; + esac +done + +/bin/rm -f "${expfile}" || exit 1 + +if ! type "${nm}" >/dev/null 2>&1 +then + case ${nm} in + *-nm) nm=${nm##*/} ;; # use "powerpc-ibm-aix7.1.0.0-nm" from PATH + */nm|nm) nm=/usr/ccs/bin/nm ;; # native anyway + esac + type "${nm}" >/dev/null || exit 1 # let 'type' yell when necessary +fi + +if "${nm}" -V 2>&1 | /bin/grep 'GNU' >/dev/null +then + eval "${nm}" -Bpg ${srcobjs} | + /bin/awk '{ + if ((($2 == "T") || ($2 == "D") || ($2 == "B") || ($2 == "W")) && (substr($3,1,1) != ".")) { + if ($2 == "W") { + print $3 " weak" + } else { + print $3 + } + } + }' | + /bin/sort -u > "${expfile}" || exit 1 +else + eval "${nm}" -PCpgl ${srcobjs} | + /bin/awk '{ + if ((($2 == "T") || ($2 == "D") || ($2 == "B") || ($2 == "W") || ($2 == "V") || ($2 == "Z")) && (substr($1,1,1) != ".")) { + if (($2 == "W") || ($2 == "V") || ($2 == "Z")) { + print $1 " weak" + } else { + print $1 + } + } + }' | + /bin/sort -u > "${expfile}" || exit 1 +fi + +echo "${showwith}${expfile}" + +exit 0 diff --git a/sys-devel/native-cctools/files/aix-2/nm b/sys-devel/native-cctools/files/aix-2/nm new file mode 100644 index 000000000000..5ba1d650d23a --- /dev/null +++ b/sys-devel/native-cctools/files/aix-2/nm @@ -0,0 +1,6 @@ +#! /bin/sh + +# /usr/bin/sort (used by nm) cannot work with TMPDIR longer than 85 characters. +test ${#TMPDIR} -le 85 || TMPDIR=/tmp export TMPDIR + +exec /usr/ccs/bin/nm ${1+"$@"} diff --git a/sys-devel/native-cctools/files/ld-aix-1 b/sys-devel/native-cctools/files/ld-aix-1 new file mode 100644 index 000000000000..452edad70d87 --- /dev/null +++ b/sys-devel/native-cctools/files/ld-aix-1 @@ -0,0 +1,140 @@ +#! /usr/bin/env /bin/ksh +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 + +# Upon '-soname' and similar flags, create a "shared library" on AIX being an +# archive file containing an Import File and the shared object file, as in: +# http://lists.gnu.org/archive/html/libtool/2011-01/msg00023.html +# with updates in: +# http://lists.gnu.org/archive/html/libtool/2011-02/msg00000.html +# +# This helper script is meant not depend on anything Gentoo specific. + +ld=/usr/ccs/bin/ld +ar=/usr/ccs/bin/ar +strip=/usr/ccs/bin/strip +dump=/usr/sbin/dump +awk=/usr/bin/awk +rm=/usr/bin/rm +mkdir=/usr/bin/mkdir +mv=/usr/bin/mv +ln=/usr/bin/ln + +oldargs= +output= +soname= +newargs= +OBJECT_MODE=${OBJECT_MODE:-32} + +while [[ $# -gt 0 ]] +do + arg=$1 + shift + oldargs="${oldargs} '${arg}'" + case ${arg} in + -o) + newargs="${newargs} -o '$1'" + output=$1 + oldargs="${oldargs} '$1'" + shift + ;; + -bM:SRE) + newargs="${newargs} '-G' '-bernotok'" + ;; + -soname=*) + soname=${arg#-soname=} + ;; + -h*) + soname=${arg#-h} + ;; + -soname|-h) + soname=$1 + shift + ;; + -b32) + newargs="${newargs} '${arg}'" + OBJECT_MODE=32 + ;; + -b64) + newargs="${newargs} '${arg}'" + OBJECT_MODE=64 + ;; + *) + newargs="${newargs} '${arg}'" + ;; + esac +done + +if [[ -z ${output} || -z ${soname} ]]; then + eval "exec ${ld} ${oldargs}" + exit 1 +fi + +# Running ld against the orginal target file to retain +# ld error message when there's a problem with it: +eval "${ld} -o '${output}' ${newargs}" || exit 1 + +workdir="${output}.$$" + +${rm} -rf "${workdir}" || exit 1 +trap "${rm} -rf '${workdir}'" 0 + +case ${soname} in +*\(*\)) + shro=${soname#*\(} + shro=${shro%\)} + shri=${shro%.*}.imp + ;; +*\[*\]) + shro=${soname#*\[} + shro=${shro%\]} + shri=${shro%.*}.imp + ;; +none) # loadable only module, not linkable: no import file + shro='shr.o' + soname="${output##*/}(${shro})" + shri= + ;; +auto) + shro='shr.o' + soname=${output##*/} + if [[ ${soname} == lib*.so* ]]; then + # linkable library: need import file + shri=${shro%.*}.imp + else + # loadable only module, not linkable: no import file + shri= + fi + soname="${soname}(${shro})" + ;; +*) + shro='shr.o' + shri=${shro%.*}.imp + soname="${soname}(${shro})" + ;; +esac + +export OBJECT_MODE + +${mkdir} "${workdir}" || exit 1 +${strip} -e "${output}" || exit 1 +if [[ -n ${shri} ]]; then + ${dump} -Tv "${output}" > "${workdir}"/syms || exit 1 + ${awk} ' + BEGIN { + print "#! '"${soname}"'" + print "# '"${OBJECT_MODE}"'" + } + { + if ($6 != "SECdef") { + if ($4 == "EXP" || $4 == "ImpExp") { + print $8 + } else + if ($4 == "wEXP") { + print $8" weak" + } + } + }' <"${workdir}"/syms > "${workdir}"/${shri} || exit 1 +fi +${mv} "${output}" "${workdir}/${shro}" || exit 1 +${ar} rc "${output}" ${shri:+"${workdir}/${shri}"} "${workdir}/${shro}" || exit 1 +exit 0 diff --git a/sys-devel/native-cctools/files/ld-aix-2 b/sys-devel/native-cctools/files/ld-aix-2 new file mode 100644 index 000000000000..3ca9eb2357eb --- /dev/null +++ b/sys-devel/native-cctools/files/ld-aix-2 @@ -0,0 +1,138 @@ +#! /usr/bin/env /bin/ksh +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 + +# Upon '-soname' and similar flags, create a "shared library" on AIX being an +# archive file containing an Import File and the shared object file, as in: +# http://lists.gnu.org/archive/html/libtool/2011-01/msg00023.html +# with updates in: +# http://lists.gnu.org/archive/html/libtool/2011-02/msg00000.html +# +# This helper script is meant not depend on anything Gentoo specific. + +ld=/usr/ccs/bin/ld +ar=/usr/ccs/bin/ar +strip=/usr/ccs/bin/strip +dump=/usr/sbin/dump +awk=/usr/bin/awk +rm=/usr/bin/rm +mkdir=/usr/bin/mkdir +mv=/usr/bin/mv +ln=/usr/bin/ln + +oldargs= +output= +soname= +newargs= +OBJECT_MODE=${OBJECT_MODE:-32} + +while [[ $# -gt 0 ]] +do + arg=$1 + shift + oldargs="${oldargs} '${arg}'" + case ${arg} in + -o) + newargs="${newargs} -o '$1'" + output=$1 + oldargs="${oldargs} '$1'" + shift + ;; + -bM:SRE) + newargs="${newargs} '-G' '-bernotok'" + ;; + -soname=*) + soname=${arg#-soname=} + ;; + -h*) + soname=${arg#-h} + ;; + -soname|-h) + soname=$1 + shift + ;; + -b32) + newargs="${newargs} '${arg}'" + OBJECT_MODE=32 + ;; + -b64) + newargs="${newargs} '${arg}'" + OBJECT_MODE=64 + ;; + *) + newargs="${newargs} '${arg}'" + ;; + esac +done + +if [[ -z ${output} || -z ${soname} ]]; then + eval "exec ${ld} ${oldargs}" + exit 1 +fi + +# Running ld against the orginal target file to retain +# ld error message when there's a problem with it: +eval "${ld} -o '${output}' ${newargs}" || exit 1 + +workdir="${output}.$$" + +${rm} -rf "${workdir}" || exit 1 +trap "${rm} -rf '${workdir}'" 0 + +case ${soname} in +*\(*\)) + shro=${soname#*\(} + shro=${shro%\)} + shri=${shro%.*}.imp + ;; +*\[*\]) + shro=${soname#*\[} + shro=${shro%\]} + shri=${shro%.*}.imp + ;; +none) # loadable only module, not linkable: no import file + shro='shr.o' + soname="${output##*/}(${shro})" + shri= + ;; +auto) + shro='shr.o' + soname=${output##*/} + if [[ ${soname} == lib*.so* ]]; then + # linkable library: need import file + shri=${shro%.*}.imp + else + # loadable only module, not linkable: no import file + shri= + fi + soname="${soname}(${shro})" + ;; +*) + shro='shr.o' + shri=${shro%.*}.imp + soname="${soname}(${shro})" + ;; +esac + +export OBJECT_MODE + +${mkdir} "${workdir}" || exit 1 +${strip} -e "${output}" || exit 1 +if [[ -n ${shri} ]]; then + ${dump} -Tv "${output}" > "${workdir}"/syms || exit 1 + ${awk} ' + BEGIN { + print "#! '"${soname}"'" + print "# '"${OBJECT_MODE}"'" + } + { + if ($4 == "EXP" || $4 == "ImpExp") { + print $8 + } else + if ($4 == "wEXP") { + print $8" weak" + } + }' <"${workdir}"/syms > "${workdir}"/${shri} || exit 1 +fi +${mv} "${output}" "${workdir}/${shro}" || exit 1 +${ar} rc "${output}" ${shri:+"${workdir}/${shri}"} "${workdir}/${shro}" || exit 1 +exit 0 diff --git a/sys-devel/native-cctools/metadata.xml b/sys-devel/native-cctools/metadata.xml new file mode 100644 index 000000000000..d33cce94b0d4 --- /dev/null +++ b/sys-devel/native-cctools/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>prefix@gentoo.org</email> + <name>Gentoo Prefix</name> +</maintainer> +</pkgmetadata> diff --git a/sys-devel/native-cctools/native-cctools-4.ebuild b/sys-devel/native-cctools/native-cctools-4.ebuild new file mode 100644 index 000000000000..e94fdaa2f606 --- /dev/null +++ b/sys-devel/native-cctools/native-cctools-4.ebuild @@ -0,0 +1,114 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="6" + +inherit eutils + +DESCRIPTION="Host OS native assembler as and static linker ld" +HOMEPAGE="https://prefix.gentoo.org/" +SRC_URI="" + +LICENSE="GPL-2" # actually, we don't know, the wrapper is +SLOT="0" + +AIX_V='aix-2' + +KEYWORDS="~ppc-aix ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris" + +IUSE="" + +DEPEND="sys-devel/binutils-config" +RDEPEND="${DEPEND}" + +src_unpack() { + mkdir -p "${S}" +} + +src_install() { + LIBPATH=/usr/$(get_libdir)/binutils/${CHOST}/native-${PV} + BINPATH=/usr/${CHOST}/binutils-bin/native-${PV} + + keepdir ${LIBPATH} || die + dodir ${BINPATH} || die + + # allow for future hosts with different paths + nativepath="" + wrappers=() + case ${CHOST} in + *-solaris*) + nativepath=/usr/sfw/bin + ;; + *-aix*) + nativepath=/usr/ccs/bin + wrappers=("${wrappers[@]}" "ld=${FILESDIR}/${AIX_V}/ld") + wrappers=("${wrappers[@]}" "nm=${FILESDIR}/${AIX_V}/nm") + wrappers=("${wrappers[@]}" "mkexpfile=${FILESDIR}/${AIX_V}/mkexpfile") + ;; + *-apple-darwin*|*-netbsd*|*-openbsd*) + nativepath=/usr/bin + ;; + *-interix*) + nativepath=/opt/gcc.3.3/bin + ;; + *) + die "Don't know where the native linker for your platform is" + ;; + esac + + what="addr2line as ar c++filt gprof ld nm objcopy objdump \ + ranlib readelf elfdump size strings strip" + # Darwin things + what="${what} install_name_tool ld64 libtool lipo nmedit \ + otool otool64 pagestuff redo_prebinding segedit" + + # copy from the host os + cd "${ED}${BINPATH}" + for b in ${what} ; do + if [[ ${CHOST} == *-darwin* && ${b} == libtool ]] ; then + echo "linking darwin libtool ${nativepath}/${b}" + ln -s "${nativepath}/${b}" "${b}" + elif [[ -x ${nativepath}/g${b} ]] ; then + einfo "linking ${nativepath}/g${b}" + ln -s "${nativepath}/g${b}" "${b}" + elif [[ -x ${nativepath}/${b} ]] ; then + einfo "linking ${nativepath}/${b}" + ln -s "${nativepath}/${b}" "${b}" + else + ewarn "skipping ${b} (not in ${nativepath})" + fi + done + + # post fix for Darwin's ranlib (doesn't like it when its called other than + # that, as libtool and ranlib are one tool) + if [[ ${CHOST} == *-darwin* ]] ; then + rm -f ranlib + cat <<-EOF > ranlib + #!/usr/bin/env bash + exec ${nativepath}/ranlib "\$@" + EOF + chmod 755 ranlib + fi + + exeinto ${BINPATH} + local wrapper source target + for wrapper in "${wrappers[@]}" ; do + source=${wrapper#*=} + target=${wrapper%%=*} + rm -f "${target}" + newexe "${source}" "${target}" || die + done + # Generate an env.d entry for this binutils + insinto /etc/env.d/binutils + cat <<-EOF > "${T}"/env.d + TARGET="${CHOST}" + VER="native-${PV}" + LIBPATH="${EPREFIX}/${LIBPATH}" + FAKE_TARGETS="${CHOST}" + EOF + newins "${T}"/env.d ${CHOST}-native-${PV} +} + +pkg_postinst() { + binutils-config ${CHOST}-native-${PV} +} |