/[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.128 Revision 1.134
1n Copyright 1999-2014 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.128 2014/10/15 22:27:25 blueness 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
82tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; } 82tc-getRANLIB() { tc-getPROG RANLIB ranlib "$@"; }
83# @FUNCTION: tc-getOBJCOPY 83# @FUNCTION: tc-getOBJCOPY
84# @USAGE: [toolchain prefix] 84# @USAGE: [toolchain prefix]
85# @RETURN: name of the object copier 85# @RETURN: name of the object copier
86tc-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 "$@"; }
87# @FUNCTION: tc-getF77 91# @FUNCTION: tc-getF77
88# @USAGE: [toolchain prefix] 92# @USAGE: [toolchain prefix]
89# @RETURN: name of the Fortran 77 compiler 93# @RETURN: name of the Fortran 77 compiler
90tc-getF77() { tc-getPROG F77 gfortran "$@"; } 94tc-getF77() { tc-getPROG F77 gfortran "$@"; }
91# @FUNCTION: tc-getFC 95# @FUNCTION: tc-getFC
295# fi 299# fi
296# ... normal build paths ... 300# ... normal build paths ...
297# } 301# }
298# @CODE 302# @CODE
299econf_build() { 303econf_build() {
304 local CBUILD=${CBUILD:-${CHOST}}
300 tc-env_build econf --build=${CBUILD:-${CHOST}} "$@" 305 tc-env_build econf --build=${CBUILD} --host=${CBUILD} "$@"
301} 306}
302 307
303# @FUNCTION: tc-has-openmp 308# @FUNCTION: tc-has-openmp
304# @USAGE: [toolchain prefix] 309# @USAGE: [toolchain prefix]
305# @DESCRIPTION: 310# @DESCRIPTION:
371 aarch64*) echo arm64;; 376 aarch64*) echo arm64;;
372 alpha*) echo alpha;; 377 alpha*) echo alpha;;
373 arm*) echo arm;; 378 arm*) echo arm;;
374 avr*) ninj avr32 avr;; 379 avr*) ninj avr32 avr;;
375 bfin*) ninj blackfin bfin;; 380 bfin*) ninj blackfin bfin;;
376 c6x) echo c6x;; 381 c6x*) echo c6x;;
377 cris*) echo cris;; 382 cris*) echo cris;;
378 frv) echo frv;; 383 frv*) echo frv;;
379 hexagon) echo hexagon;; 384 hexagon*) echo hexagon;;
380 hppa*) ninj parisc hppa;; 385 hppa*) ninj parisc hppa;;
381 i?86*) 386 i?86*)
382 # Starting with linux-2.6.24, the 'x86_64' and 'i386' 387 # Starting with linux-2.6.24, the 'x86_64' and 'i386'
383 # trees have been unified into 'x86'. 388 # trees have been unified into 'x86'.
384 # FreeBSD still uses i386 389 # FreeBSD still uses i386
388 echo x86 393 echo x86
389 fi 394 fi
390 ;; 395 ;;
391 ia64*) echo ia64;; 396 ia64*) echo ia64;;
392 m68*) echo m68k;; 397 m68*) echo m68k;;
393 metag) echo metag;; 398 metag*) echo metag;;
399 microblaze*) echo microblaze;;
394 mips*) echo mips;; 400 mips*) echo mips;;
395 nios2*) echo nios2;; 401 nios2*) echo nios2;;
396 nios*) echo nios;; 402 nios*) echo nios;;
397 or32) echo openrisc;; 403 or32*) echo openrisc;;
398 powerpc*) 404 powerpc*)
399 # Starting with linux-2.6.15, the 'ppc' and 'ppc64' trees 405 # Starting with linux-2.6.15, the 'ppc' and 'ppc64' trees
400 # have been unified into simply 'powerpc', but until 2.6.16, 406 # have been unified into simply 'powerpc', but until 2.6.16,
401 # ppc32 is still using ARCH="ppc" as default 407 # ppc32 is still using ARCH="ppc" as default
402 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
413 ninj ppc64 ppc 419 ninj ppc64 ppc
414 else 420 else
415 echo ppc 421 echo ppc
416 fi 422 fi
417 ;; 423 ;;
424 riscv*) echo riscv;;
418 s390*) echo s390;; 425 s390*) echo s390;;
419 score) echo score;; 426 score*) echo score;;
420 sh64*) ninj sh64 sh;; 427 sh64*) ninj sh64 sh;;
421 sh*) echo sh;; 428 sh*) echo sh;;
422 sparc64*) ninj sparc64 sparc;; 429 sparc64*) ninj sparc64 sparc;;
423 sparc*) [[ ${PROFILE_ARCH} == "sparc64" ]] \ 430 sparc*) [[ ${PROFILE_ARCH} == "sparc64" ]] \
424 && ninj sparc64 sparc \ 431 && ninj sparc64 sparc \
607# Returns true if gcc builds with fno-strict-overflow 614# Returns true if gcc builds with fno-strict-overflow
608gcc-specs-nostrict() { 615gcc-specs-nostrict() {
609 local directive 616 local directive
610 directive=$(gcc-specs-directive cc1) 617 directive=$(gcc-specs-directive cc1)
611 [[ "${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}" ]]
612} 625}
613 626
614 627
615# @FUNCTION: gen_usr_ldscript 628# @FUNCTION: gen_usr_ldscript
616# @USAGE: [-a] <list of libs to create linker scripts for> 629# @USAGE: [-a] <list of libs to create linker scripts for>

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

  ViewVC Help
Powered by ViewVC 1.1.20