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

Diff of /eclass/eutils.eclass

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

Revision 1.144 Revision 1.145
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.144 2005/02/03 22:11:33 chriswhite Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.145 2005/02/03 22:33:36 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.
32# CPU_FLAGS=(mmx mmx2 sse sse2) 32# CPU_FLAGS=(mmx mmx2 sse sse2)
33# ecpu_check CPU_FLAGS 33# ecpu_check CPU_FLAGS
34# Chris White <chriswhite@gentoo.org> (03 Feb 2005) 34# Chris White <chriswhite@gentoo.org> (03 Feb 2005)
35 35
36ecpu_check() { 36ecpu_check() {
37 if [ $CROSSCOMPILE -eq 1 ]
38 then
39 else
37 CPU_FLAGS=$1 40 CPU_FLAGS=$1
38 USER_CPU=`grep "flags" /proc/cpuinfo` 41 USER_CPU=`grep "flags" /proc/cpuinfo`
39 42
40 for flags in `seq 1 ${#CPU_FLAGS[@]}` 43 for flags in `seq 1 ${#CPU_FLAGS[@]}`
41 do 44 do
42 if has ${CPU_FLAGS[$flags - 1]} $USER_CPU && ! has ${CPU_FLAGS[$flags - 1]} $USE 45 if has ${CPU_FLAGS[$flags - 1]} $USER_CPU && ! has ${CPU_FLAGS[$flags - 1]} $USE
43 then 46 then
44 ewarn "Your system is ${CPU_FLAGS[$flags - 1]} capable but you don't have it enabled!" 47 ewarn "Your system is ${CPU_FLAGS[$flags - 1]} capable but you don't have it enabled!"
45 ewarn "You might be cross compiling (in this case set CROSSCOMPILE to 1 to disable this warning." 48 ewarn "You might be cross compiling (in this case set CROSSCOMPILE to 1 to disable this warning."
46 fi 49 fi
47 50
48 if ! has ${CPU_FLAGS[$flags - 1]} $USER_CPU && has ${CPU_FLAGS[$flags -1]} $USE 51 if ! has ${CPU_FLAGS[$flags - 1]} $USER_CPU && has ${CPU_FLAGS[$flags -1]} $USE
49 then 52 then
50 ewarn "You have ${CPU_FLAGS[$flags - 1]} support enabled but your processor doesn't" 53 ewarn "You have ${CPU_FLAGS[$flags - 1]} support enabled but your processor doesn't"
51 ewarn "Seem to support it! You might be cross compiling or do not have /proc filesystem" 54 ewarn "Seem to support it! You might be cross compiling or do not have /proc filesystem"
52 ewarn "enabled. If either is the case, set CROSSCOMPILE to 1 to disable this warning." 55 ewarn "enabled. If either is the case, set CROSSCOMPILE to 1 to disable this warning."
53 fi 56 fi
54 done 57 done
58 fi
55} 59}
56 60
57# Wait for the supplied number of seconds. If no argument is supplied, defaults 61# Wait for the supplied number of seconds. If no argument is supplied, defaults
58# to five seconds. If the EPAUSE_IGNORE env var is set, don't wait. If we're not 62# to five seconds. If the EPAUSE_IGNORE env var is set, don't wait. If we're not
59# outputting to a terminal, don't wait. For compatability purposes, the argument 63# outputting to a terminal, don't wait. For compatability purposes, the argument

Legend:
Removed from v.1.144  
changed lines
  Added in v.1.145

  ViewVC Help
Powered by ViewVC 1.1.20