/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

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

Revision 1.148 Revision 1.149
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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/eutils.eclass,v 1.148 2005/02/03 23:55:05 azarah Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.149 2005/02/04 21:24:53 chriswhite Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
36ecpu_check() { 36ecpu_check() {
37 # Think about changing below to: if [ "${CROSSCOMPILE}" -ne 1 -a -e "/proc/cpuinfo" ] 37 # Think about changing below to: if [ "${CROSSCOMPILE}" -ne 1 -a -e "/proc/cpuinfo" ]
38 # and dropping the else if you do not plan on adding anything to that 38 # and dropping the else if you do not plan on adding anything to that
39 # empty block .... 39 # empty block ....
40 # PS: also try to add some quoting, and consider rather using ${foo} than $foo ... 40 # PS: also try to add some quoting, and consider rather using ${foo} than $foo ...
41 if [ $CROSSCOMPILE -eq 1 ] || [ ! -e /proc/cpuinfo ] 41 if [ "${CROSSCOMPILE}" != "1" -a -e "/proc/cpuinfo" ]
42 then 42 then
43 :
44 else
45 CPU_FLAGS=$1 43 CPU_FLAGS=${1}
46 USER_CPU=`grep "flags" /proc/cpuinfo` 44 USER_CPU=`grep "flags" /proc/cpuinfo`
47 45
48 for flags in `seq 1 ${#CPU_FLAGS[@]}` 46 for flags in `seq 1 ${#CPU_FLAGS[@]}`
49 do 47 do
50 if has ${CPU_FLAGS[$flags - 1]} $USER_CPU && ! has ${CPU_FLAGS[$flags - 1]} $USE 48 if has ${CPU_FLAGS[${flags} - 1]} ${USER_CPU} && ! has ${CPU_FLAGS[${flags} - 1]} ${USE}
51 then 49 then
52 ewarn "Your system is ${CPU_FLAGS[$flags - 1]} capable but you don't have it enabled!" 50 ewarn "Your system is ${CPU_FLAGS[${flags} - 1]} capable but you don't have it enabled!"
53 ewarn "You might be cross compiling (in this case set CROSSCOMPILE to 1 to disable this warning." 51 ewarn "You might be cross compiling (in this case set CROSSCOMPILE to 1 to disable this warning."
54 fi 52 fi
55 53
56 if ! has ${CPU_FLAGS[$flags - 1]} $USER_CPU && has ${CPU_FLAGS[$flags -1]} $USE 54 if ! has ${CPU_FLAGS[${flags} - 1]} ${USER_CPU} && has ${CPU_FLAGS[${flags} -1]} ${USE}
57 then 55 then
58 ewarn "You have ${CPU_FLAGS[$flags - 1]} support enabled but your processor doesn't" 56 ewarn "You have ${CPU_FLAGS[${flags} - 1]} support enabled but your processor doesn't"
59 ewarn "Seem to support it! You might be cross compiling or do not have /proc filesystem" 57 ewarn "Seem to support it! You might be cross compiling or do not have /proc filesystem"
60 ewarn "enabled. If either is the case, set CROSSCOMPILE to 1 to disable this warning." 58 ewarn "enabled. If either is the case, set CROSSCOMPILE to 1 to disable this warning."
61 fi 59 fi
62 done 60 done
63 fi 61 fi

Legend:
Removed from v.1.148  
changed lines
  Added in v.1.149

  ViewVC Help
Powered by ViewVC 1.1.20