/[gentoo-x86]/eclass/toolchain-funcs.eclass
Gentoo

Diff of /eclass/toolchain-funcs.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.109 Revision 1.134
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2015 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.109 2011/12/10 19:45:00 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-funcs.eclass,v 1.134 2015/03/16 19:26:39 vapier Exp $
4 4
5# @ECLASS: toolchain-funcs.eclass 5# @ECLASS: toolchain-funcs.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Toolchain Ninjas <toolchain@gentoo.org> 7# Toolchain Ninjas <toolchain@gentoo.org>
8# @BLURB: functions to query common info about the toolchain 8# @BLURB: functions to query common info about the toolchain
11# for gleaning useful information about the toolchain and to simplify 11# for gleaning useful information about the toolchain and to simplify
12# ugly things like cross-compiling and multilib. All of this is done 12# ugly things like cross-compiling and multilib. All of this is done
13# in such a way that you can rely on the function always returning 13# in such a way that you can rely on the function always returning
14# something sane. 14# something sane.
15 15
16if [[ ${___ECLASS_ONCE_TOOLCHAIN_FUNCS} != "recur -_+^+_- spank" ]] ; then 16if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then
17___ECLASS_ONCE_TOOLCHAIN_FUNCS="recur -_+^+_- spank" 17_TOOLCHAIN_FUNCS_ECLASS=1
18 18
19inherit multilib 19inherit multilib
20
21DESCRIPTION="Based on the ${ECLASS} eclass"
22 20
23# tc-getPROG <VAR [search vars]> <default> [tuple] 21# tc-getPROG <VAR [search vars]> <default> [tuple]
24_tc-getPROG() { 22_tc-getPROG() {
25 local tuple=$1 23 local tuple=$1
26 local v var vars=$2 24 local v var vars=$2
84tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; } 82tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; }
85# @FUNCTION: tc-getOBJCOPY 83# @FUNCTION: tc-getOBJCOPY
86# @USAGE: [toolchain prefix] 84# @USAGE: [toolchain prefix]
87# @RETURN: name of the object copier 85# @RETURN: name of the object copier
88tc-getOBJCOPY() { tc-getPROG OBJCOPY objcopy "$@"; } 86tc-getOBJCOPY() { tc-getPROG OBJCOPY objcopy "$@"; }
87# @FUNCTION: tc-getOBJDUMP
88# @USAGE: [toolchain prefix]
89# @RETURN: name of the object dumper
90tc-getOBJDUMP() { tc-getPROG OBJDUMP objdump "$@"; }
89# @FUNCTION: tc-getF77 91# @FUNCTION: tc-getF77
90# @USAGE: [toolchain prefix] 92# @USAGE: [toolchain prefix]
91# @RETURN: name of the Fortran 77 compiler 93# @RETURN: name of the Fortran 77 compiler
92tc-getF77() { tc-getPROG F77 gfortran "$@"; } 94tc-getF77() { tc-getPROG F77 gfortran "$@"; }
93# @FUNCTION: tc-getFC 95# @FUNCTION: tc-getFC
169} 171}
170 172
171# @FUNCTION: tc-is-cross-compiler 173# @FUNCTION: tc-is-cross-compiler
172# @RETURN: Shell true if we are using a cross-compiler, shell false otherwise 174# @RETURN: Shell true if we are using a cross-compiler, shell false otherwise
173tc-is-cross-compiler() { 175tc-is-cross-compiler() {
174 return $([[ ${CBUILD:-${CHOST}} != ${CHOST} ]]) 176 [[ ${CBUILD:-${CHOST}} != ${CHOST} ]]
175} 177}
176 178
177# @FUNCTION: tc-is-softfloat 179# @FUNCTION: tc-is-softfloat
178# @DESCRIPTION: 180# @DESCRIPTION:
179# See if this toolchain is a softfloat based one. 181# See if this toolchain is a softfloat based one.
180# @CODE 182# @CODE
181# The possible return values: 183# The possible return values:
182# - only: the target is always softfloat (never had fpu) 184# - only: the target is always softfloat (never had fpu)
183# - yes: the target should support softfloat 185# - yes: the target should support softfloat
186# - softfp: (arm specific) the target should use hardfloat insns, but softfloat calling convention
184# - no: the target doesn't support softfloat 187# - no: the target doesn't support softfloat
185# @CODE 188# @CODE
186# This allows us to react differently where packages accept 189# This allows us to react differently where packages accept
187# softfloat flags in the case where support is optional, but 190# softfloat flags in the case where support is optional, but
188# rejects softfloat flags where the target always lacks an fpu. 191# rejects softfloat flags where the target always lacks an fpu.
189tc-is-softfloat() { 192tc-is-softfloat() {
193 local CTARGET=${CTARGET:-${CHOST}}
190 case ${CTARGET} in 194 case ${CTARGET} in
191 bfin*|h8300*) 195 bfin*|h8300*)
192 echo "only" ;; 196 echo "only" ;;
193 *) 197 *)
194 [[ ${CTARGET//_/-} == *-softfloat-* ]] \ 198 if [[ ${CTARGET//_/-} == *-softfloat-* ]] ; then
195 && echo "yes" \ 199 echo "yes"
200 elif [[ ${CTARGET//_/-} == *-softfp-* ]] ; then
201 echo "softfp"
202 else
196 || echo "no" 203 echo "no"
204 fi
197 ;; 205 ;;
198 esac 206 esac
199}
200
201# @FUNCTION: tc-is-hardfloat
202# @DESCRIPTION:
203# See if this toolchain is a hardfloat based one.
204# @CODE
205# The possible return values:
206# - yes: the target should support hardfloat
207# - no: the target doesn't support hardfloat
208tc-is-hardfloat() {
209 [[ ${CTARGET//_/-} == *-hardfloat-* ]] \
210 && echo "yes" \
211 || echo "no"
212} 207}
213 208
214# @FUNCTION: tc-is-static-only 209# @FUNCTION: tc-is-static-only
215# @DESCRIPTION: 210# @DESCRIPTION:
216# Return shell true if the target does not support shared libs, shell false 211# Return shell true if the target does not support shared libs, shell false
217# otherwise. 212# otherwise.
218tc-is-static-only() { 213tc-is-static-only() {
219 local host=${CTARGET:-${CHOST}} 214 local host=${CTARGET:-${CHOST}}
220 215
221 # *MiNT doesn't have shared libraries, only platform so far 216 # *MiNT doesn't have shared libraries, only platform so far
222 return $([[ ${host} == *-mint* ]]) 217 [[ ${host} == *-mint* ]]
218}
219
220# @FUNCTION: tc-export_build_env
221# @USAGE: [compiler variables]
222# @DESCRIPTION:
223# Export common build related compiler settings.
224tc-export_build_env() {
225 tc-export "$@"
226 : ${BUILD_CFLAGS:=-O1 -pipe}
227 : ${BUILD_CXXFLAGS:=-O1 -pipe}
228 : ${BUILD_CPPFLAGS:=}
229 : ${BUILD_LDFLAGS:=}
230 export BUILD_{C,CXX,CPP,LD}FLAGS
231
232 # Some packages use XXX_FOR_BUILD.
233 local v
234 for v in BUILD_{C,CXX,CPP,LD}FLAGS ; do
235 export ${v#BUILD_}_FOR_BUILD="${!v}"
236 done
223} 237}
224 238
225# @FUNCTION: tc-env_build 239# @FUNCTION: tc-env_build
226# @USAGE: <command> [command args] 240# @USAGE: <command> [command args]
227# @INTERNAL 241# @INTERNAL
229# Setup the compile environment to the build tools and then execute the 243# Setup the compile environment to the build tools and then execute the
230# specified command. We use tc-getBUILD_XX here so that we work with 244# specified command. We use tc-getBUILD_XX here so that we work with
231# all of the semi-[non-]standard env vars like $BUILD_CC which often 245# all of the semi-[non-]standard env vars like $BUILD_CC which often
232# the target build system does not check. 246# the target build system does not check.
233tc-env_build() { 247tc-env_build() {
248 tc-export_build_env
234 CFLAGS=${BUILD_CFLAGS:--O1 -pipe} \ 249 CFLAGS=${BUILD_CFLAGS} \
235 CXXFLAGS=${BUILD_CXXFLAGS:--O1 -pipe} \ 250 CXXFLAGS=${BUILD_CXXFLAGS} \
236 CPPFLAGS=${BUILD_CPPFLAGS} \ 251 CPPFLAGS=${BUILD_CPPFLAGS} \
237 LDFLAGS=${BUILD_LDFLAGS} \ 252 LDFLAGS=${BUILD_LDFLAGS} \
238 AR=$(tc-getBUILD_AR) \ 253 AR=$(tc-getBUILD_AR) \
239 AS=$(tc-getBUILD_AS) \ 254 AS=$(tc-getBUILD_AS) \
240 CC=$(tc-getBUILD_CC) \ 255 CC=$(tc-getBUILD_CC) \
284# fi 299# fi
285# ... normal build paths ... 300# ... normal build paths ...
286# } 301# }
287# @CODE 302# @CODE
288econf_build() { 303econf_build() {
304 local CBUILD=${CBUILD:-${CHOST}}
289 tc-env_build econf --build=${CBUILD:-${CHOST}} "$@" 305 tc-env_build econf --build=${CBUILD} --host=${CBUILD} "$@"
290} 306}
291 307
292# @FUNCTION: tc-has-openmp 308# @FUNCTION: tc-has-openmp
293# @USAGE: [toolchain prefix] 309# @USAGE: [toolchain prefix]
294# @DESCRIPTION: 310# @DESCRIPTION:
350 366
351 local type=$1 367 local type=$1
352 local host=$2 368 local host=$2
353 [[ -z ${host} ]] && host=${CTARGET:-${CHOST}} 369 [[ -z ${host} ]] && host=${CTARGET:-${CHOST}}
354 370
371 local KV=${KV:-${KV_FULL}}
372 [[ ${type} == "kern" ]] && [[ -z ${KV} ]] && \
373 ewarn "QA: Kernel version could not be determined, please inherit kernel-2 or linux-info"
374
355 case ${host} in 375 case ${host} in
376 aarch64*) echo arm64;;
356 alpha*) echo alpha;; 377 alpha*) echo alpha;;
357 arm*) echo arm;; 378 arm*) echo arm;;
358 avr*) ninj avr32 avr;; 379 avr*) ninj avr32 avr;;
359 bfin*) ninj blackfin bfin;; 380 bfin*) ninj blackfin bfin;;
381 c6x*) echo c6x;;
360 cris*) echo cris;; 382 cris*) echo cris;;
383 frv*) echo frv;;
384 hexagon*) echo hexagon;;
361 hppa*) ninj parisc hppa;; 385 hppa*) ninj parisc hppa;;
362 i?86*) 386 i?86*)
363 # Starting with linux-2.6.24, the 'x86_64' and 'i386' 387 # Starting with linux-2.6.24, the 'x86_64' and 'i386'
364 # trees have been unified into 'x86'. 388 # trees have been unified into 'x86'.
365 # FreeBSD still uses i386 389 # FreeBSD still uses i386
369 echo x86 393 echo x86
370 fi 394 fi
371 ;; 395 ;;
372 ia64*) echo ia64;; 396 ia64*) echo ia64;;
373 m68*) echo m68k;; 397 m68*) echo m68k;;
398 metag*) echo metag;;
399 microblaze*) echo microblaze;;
374 mips*) echo mips;; 400 mips*) echo mips;;
375 nios2*) echo nios2;; 401 nios2*) echo nios2;;
376 nios*) echo nios;; 402 nios*) echo nios;;
403 or32*) echo openrisc;;
377 powerpc*) 404 powerpc*)
378 # Starting with linux-2.6.15, the 'ppc' and 'ppc64' trees 405 # Starting with linux-2.6.15, the 'ppc' and 'ppc64' trees
379 # have been unified into simply 'powerpc', but until 2.6.16, 406 # have been unified into simply 'powerpc', but until 2.6.16,
380 # ppc32 is still using ARCH="ppc" as default 407 # ppc32 is still using ARCH="ppc" as default
381 if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.16) ]] ; then 408 if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.16) ]] ; then
392 ninj ppc64 ppc 419 ninj ppc64 ppc
393 else 420 else
394 echo ppc 421 echo ppc
395 fi 422 fi
396 ;; 423 ;;
424 riscv*) echo riscv;;
397 s390*) echo s390;; 425 s390*) echo s390;;
426 score*) echo score;;
398 sh64*) ninj sh64 sh;; 427 sh64*) ninj sh64 sh;;
399 sh*) echo sh;; 428 sh*) echo sh;;
400 sparc64*) ninj sparc64 sparc;; 429 sparc64*) ninj sparc64 sparc;;
401 sparc*) [[ ${PROFILE_ARCH} == "sparc64" ]] \ 430 sparc*) [[ ${PROFILE_ARCH} == "sparc64" ]] \
402 && ninj sparc64 sparc \ 431 && ninj sparc64 sparc \
403 || echo sparc 432 || echo sparc
404 ;; 433 ;;
434 tile*) echo tile;;
405 vax*) echo vax;; 435 vax*) echo vax;;
406 x86_64*freebsd*) echo amd64;; 436 x86_64*freebsd*) echo amd64;;
407 x86_64*) 437 x86_64*)
408 # Starting with linux-2.6.24, the 'x86_64' and 'i386' 438 # Starting with linux-2.6.24, the 'x86_64' and 'i386'
409 # trees have been unified into 'x86'. 439 # trees have been unified into 'x86'.
411 echo x86 441 echo x86
412 else 442 else
413 ninj x86_64 amd64 443 ninj x86_64 amd64
414 fi 444 fi
415 ;; 445 ;;
446 xtensa*) echo xtensa;;
416 447
417 # since our usage of tc-arch is largely concerned with 448 # since our usage of tc-arch is largely concerned with
418 # normalizing inputs for testing ${CTARGET}, let's filter 449 # normalizing inputs for testing ${CTARGET}, let's filter
419 # other cross targets (mingw and such) into the unknown. 450 # other cross targets (mingw and such) into the unknown.
420 *) echo unknown;; 451 *) echo unknown;;
437 local host=$1 468 local host=$1
438 [[ -z ${host} ]] && host=${CTARGET:-${CHOST}} 469 [[ -z ${host} ]] && host=${CTARGET:-${CHOST}}
439 host=${host%%-*} 470 host=${host%%-*}
440 471
441 case ${host} in 472 case ${host} in
473 aarch64*be) echo big;;
474 aarch64) echo little;;
442 alpha*) echo big;; 475 alpha*) echo big;;
443 arm*b*) echo big;; 476 arm*b*) echo big;;
444 arm*) echo little;; 477 arm*) echo little;;
445 cris*) echo little;; 478 cris*) echo little;;
446 hppa*) echo big;; 479 hppa*) echo big;;
447 i?86*) echo little;; 480 i?86*) echo little;;
448 ia64*) echo little;; 481 ia64*) echo little;;
449 m68*) echo big;; 482 m68*) echo big;;
450 mips*l*) echo little;; 483 mips*l*) echo little;;
451 mips*) echo big;; 484 mips*) echo big;;
485 powerpc*le) echo little;;
452 powerpc*) echo big;; 486 powerpc*) echo big;;
453 s390*) echo big;; 487 s390*) echo big;;
454 sh*b*) echo big;; 488 sh*b*) echo big;;
455 sh*) echo little;; 489 sh*) echo little;;
456 sparc*) echo big;; 490 sparc*) echo big;;
549 583
550# Returns true if gcc sets relro 584# Returns true if gcc sets relro
551gcc-specs-relro() { 585gcc-specs-relro() {
552 local directive 586 local directive
553 directive=$(gcc-specs-directive link_command) 587 directive=$(gcc-specs-directive link_command)
554 return $([[ "${directive/\{!norelro:}" != "${directive}" ]]) 588 [[ "${directive/\{!norelro:}" != "${directive}" ]]
555} 589}
556# Returns true if gcc sets now 590# Returns true if gcc sets now
557gcc-specs-now() { 591gcc-specs-now() {
558 local directive 592 local directive
559 directive=$(gcc-specs-directive link_command) 593 directive=$(gcc-specs-directive link_command)
560 return $([[ "${directive/\{!nonow:}" != "${directive}" ]]) 594 [[ "${directive/\{!nonow:}" != "${directive}" ]]
561} 595}
562# Returns true if gcc builds PIEs 596# Returns true if gcc builds PIEs
563gcc-specs-pie() { 597gcc-specs-pie() {
564 local directive 598 local directive
565 directive=$(gcc-specs-directive cc1) 599 directive=$(gcc-specs-directive cc1)
566 return $([[ "${directive/\{!nopie:}" != "${directive}" ]]) 600 [[ "${directive/\{!nopie:}" != "${directive}" ]]
567} 601}
568# Returns true if gcc builds with the stack protector 602# Returns true if gcc builds with the stack protector
569gcc-specs-ssp() { 603gcc-specs-ssp() {
570 local directive 604 local directive
571 directive=$(gcc-specs-directive cc1) 605 directive=$(gcc-specs-directive cc1)
572 return $([[ "${directive/\{!fno-stack-protector:}" != "${directive}" ]]) 606 [[ "${directive/\{!fno-stack-protector:}" != "${directive}" ]]
573} 607}
574# Returns true if gcc upgrades fstack-protector to fstack-protector-all 608# Returns true if gcc upgrades fstack-protector to fstack-protector-all
575gcc-specs-ssp-to-all() { 609gcc-specs-ssp-to-all() {
576 local directive 610 local directive
577 directive=$(gcc-specs-directive cc1) 611 directive=$(gcc-specs-directive cc1)
578 return $([[ "${directive/\{!fno-stack-protector-all:}" != "${directive}" ]]) 612 [[ "${directive/\{!fno-stack-protector-all:}" != "${directive}" ]]
579} 613}
580# Returns true if gcc builds with fno-strict-overflow 614# Returns true if gcc builds with fno-strict-overflow
581gcc-specs-nostrict() { 615gcc-specs-nostrict() {
582 local directive 616 local directive
583 directive=$(gcc-specs-directive cc1) 617 directive=$(gcc-specs-directive cc1)
584 return $([[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]]) 618 [[ "${directive/\{!fstrict-overflow:}" != "${directive}" ]]
619}
620# Returns true if gcc builds with fstack-check
621gcc-specs-stack-check() {
622 local directive
623 directive=$(gcc-specs-directive cc1)
624 [[ "${directive/\{!fno-stack-check:}" != "${directive}" ]]
585} 625}
586 626
587 627
588# @FUNCTION: gen_usr_ldscript 628# @FUNCTION: gen_usr_ldscript
589# @USAGE: [-a] <list of libs to create linker scripts for> 629# @USAGE: [-a] <list of libs to create linker scripts for>
603 local lib libdir=$(get_libdir) output_format="" auto=false suffix=$(get_libname) 643 local lib libdir=$(get_libdir) output_format="" auto=false suffix=$(get_libname)
604 [[ -z ${ED+set} ]] && local ED=${D%/}${EPREFIX}/ 644 [[ -z ${ED+set} ]] && local ED=${D%/}${EPREFIX}/
605 645
606 tc-is-static-only && return 646 tc-is-static-only && return
607 647
648 # Eventually we'd like to get rid of this func completely #417451
649 case ${CTARGET:-${CHOST}} in
650 *-darwin*) ;;
651 *linux*|*-freebsd*|*-openbsd*|*-netbsd*)
652 use prefix && return 0 ;;
653 *) return 0 ;;
654 esac
655
608 # Just make sure it exists 656 # Just make sure it exists
609 dodir /usr/${libdir} 657 dodir /usr/${libdir}
610 658
611 if [[ $1 == "-a" ]] ; then 659 if [[ $1 == "-a" ]] ; then
612 auto=true 660 auto=true
614 dodir /${libdir} 662 dodir /${libdir}
615 fi 663 fi
616 664
617 # OUTPUT_FORMAT gives hints to the linker as to what binary format 665 # OUTPUT_FORMAT gives hints to the linker as to what binary format
618 # is referenced ... makes multilib saner 666 # is referenced ... makes multilib saner
667 local flags=( ${CFLAGS} ${LDFLAGS} -Wl,--verbose )
668 if $(tc-getLD) --version | grep -q 'GNU gold' ; then
669 # If they're using gold, manually invoke the old bfd. #487696
670 local d="${T}/bfd-linker"
671 mkdir -p "${d}"
672 ln -sf $(which ${CHOST}-ld.bfd) "${d}"/ld
673 flags+=( -B"${d}" )
674 fi
619 output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') 675 output_format=$($(tc-getCC) "${flags[@]}" 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
620 [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" 676 [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
621 677
622 for lib in "$@" ; do 678 for lib in "$@" ; do
623 local tlib 679 local tlib
624 if ${auto} ; then 680 if ${auto} ; then
669 # understand linker scripts, just create a symlink. 725 # understand linker scripts, just create a symlink.
670 pushd "${ED}/usr/${libdir}" > /dev/null 726 pushd "${ED}/usr/${libdir}" > /dev/null
671 ln -snf "../../${libdir}/${tlib}" "${lib}" 727 ln -snf "../../${libdir}/${tlib}" "${lib}"
672 popd > /dev/null 728 popd > /dev/null
673 ;; 729 ;;
674 *-aix*|*-irix*|*64*-hpux*|*-interix*|*-winnt*)
675 if ${auto} ; then
676 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die
677 # no way to retrieve soname on these platforms (?)
678 tlib=$(readlink "${ED}"/${libdir}/${lib})
679 tlib=${tlib##*/}
680 if [[ -z ${tlib} ]] ; then
681 # ok, apparently was not a symlink, don't remove it and
682 # just link to it
683 tlib=${lib}
684 else
685 rm -f "${ED}"/${libdir}/${lib}
686 fi
687 else
688 tlib=${lib}
689 fi
690
691 # we don't have GNU binutils on these platforms, so we symlink
692 # instead, which seems to work fine. Keep it relative, otherwise
693 # we break some QA checks in Portage
694 # on interix, the linker scripts would work fine in _most_
695 # situations. if a library links to such a linker script the
696 # absolute path to the correct library is inserted into the binary,
697 # which is wrong, since anybody linking _without_ libtool will miss
698 # some dependencies, since the stupid linker cannot find libraries
699 # hardcoded with absolute paths (as opposed to the loader, which
700 # seems to be able to do this).
701 # this has been seen while building shared-mime-info which needs
702 # libxml2, but links without libtool (and does not add libz to the
703 # command line by itself).
704 pushd "${ED}/usr/${libdir}" > /dev/null
705 ln -snf "../../${libdir}/${tlib}" "${lib}"
706 popd > /dev/null
707 ;;
708 hppa*-hpux*) # PA-RISC 32bit (SOM) only, others (ELF) match *64*-hpux* above.
709 if ${auto} ; then
710 tlib=$(chatr "${ED}"/usr/${libdir}/${lib} | sed -n '/internal name:/{n;s/^ *//;p;q}')
711 [[ -z ${tlib} ]] && tlib=${lib}
712 tlib=${tlib##*/} # 'internal name' can have a path component
713 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die
714 # some SONAMEs are funky: they encode a version before the .so
715 if [[ ${tlib} != ${lib}* ]] ; then
716 mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die
717 fi
718 [[ ${tlib} != ${lib} ]] &&
719 rm -f "${ED}"/${libdir}/${lib}
720 else
721 tlib=$(chatr "${ED}"/${libdir}/${lib} | sed -n '/internal name:/{n;s/^ *//;p;q}')
722 [[ -z ${tlib} ]] && tlib=${lib}
723 tlib=${tlib##*/} # 'internal name' can have a path component
724 fi
725 pushd "${ED}"/usr/${libdir} >/dev/null
726 ln -snf "../../${libdir}/${tlib}" "${lib}"
727 # need the internal name in usr/lib too, to be available at runtime
728 # when linked with /path/to/lib.sl (hardcode_direct_absolute=yes)
729 [[ ${tlib} != ${lib} ]] &&
730 ln -snf "../../${libdir}/${tlib}" "${tlib}"
731 popd >/dev/null
732 ;;
733 *) 730 *)
734 if ${auto} ; then 731 if ${auto} ; then
735 tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) 732 tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib})
736 [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}" 733 [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}"
737 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die 734 mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.134

  ViewVC Help
Powered by ViewVC 1.1.20