/[gentoo-x86]/eclass/flag-o-matic.eclass
Gentoo

Diff of /eclass/flag-o-matic.eclass

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

Revision 1.165 Revision 1.166
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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/flag-o-matic.eclass,v 1.165 2012/01/14 08:05:32 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.166 2012/01/14 08:22:13 vapier Exp $
4 4
5# @ECLASS: flag-o-matic.eclass 5# @ECLASS: flag-o-matic.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# toolchain@gentoo.org 7# toolchain@gentoo.org
8# @BLURB: common functions to manipulate and query toolchain flags 8# @BLURB: common functions to manipulate and query toolchain flags
517# @DESCRIPTION: 517# @DESCRIPTION:
518# This doesn't test if the flag is accepted, it tests if the flag actually 518# This doesn't test if the flag is accepted, it tests if the flag actually
519# WORKS. Non-multilib gcc will take both -m32 and -m64. If the flag works 519# WORKS. Non-multilib gcc will take both -m32 and -m64. If the flag works
520# return code is 0, else the return code is 1. 520# return code is 0, else the return code is 1.
521has_m64() { 521has_m64() {
522 eqawarn "${FUNCNAME}: don't use this anymore"
523
522 # this doesnt test if the flag is accepted, it tests if the flag 524 # this doesnt test if the flag is accepted, it tests if the flag
523 # actually -WORKS-. non-multilib gcc will take both -m32 and -m64! 525 # actually -WORKS-. non-multilib gcc will take both -m32 and -m64!
524 # please dont replace this function with test_flag in some future 526 # please dont replace this function with test_flag in some future
525 # clean-up! 527 # clean-up!
526 528
532 rm -f "${temp}".c 534 rm -f "${temp}".c
533 [[ ${ret} != 1 ]] && return 0 535 [[ ${ret} != 1 ]] && return 0
534 return 1 536 return 1
535} 537}
536 538
537# @FUNCTION: has_m32
538# @DESCRIPTION:
539# This doesn't test if the flag is accepted, it tests if the flag actually
540# WORKS. Non-mulilib gcc will take both -m32 and -64. If the flag works return
541# code is 0, else return code is 1.
542has_m32() { 539has_m32() {
543 # this doesnt test if the flag is accepted, it tests if the flag 540 die "${FUNCNAME}: don't use this anymore"
544 # actually -WORKS-. non-multilib gcc will take both -m32 and -m64!
545 # please dont replace this function with test_flag in some future
546 # clean-up!
547
548 [ "$(tc-arch)" = "amd64" ] && has_multilib_profile && return 0
549
550 local temp=$(emktemp)
551 echo "int main() { return(0); }" > "${temp}".c
552 MY_CC=$(tc-getCC)
553 ${MY_CC/ .*/} -m32 -o "$(emktemp)" "${temp}".c > /dev/null 2>&1
554 local ret=$?
555 rm -f "${temp}".c
556 [[ ${ret} != 1 ]] && return 0
557 return 1
558} 541}
559 542
560# @FUNCTION: replace-sparc64-flags 543# @FUNCTION: replace-sparc64-flags
561# @DESCRIPTION: 544# @DESCRIPTION:
562# Sets mcpu to v8 and uses the original value as mtune if none specified. 545# Sets mcpu to v8 and uses the original value as mtune if none specified.

Legend:
Removed from v.1.165  
changed lines
  Added in v.1.166

  ViewVC Help
Powered by ViewVC 1.1.20