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

Diff of /eclass/eutils.eclass

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

Revision 1.20 Revision 1.21
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
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.20 2003/02/18 09:00:45 carpaski Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.21 2003/02/18 20:23:20 zwelch 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.
341 ADMINPARAM="${ADMINPARAM/-j}" 341 ADMINPARAM="${ADMINPARAM/-j}"
342 fi 342 fi
343 343
344 export MAKEOPTS="`echo ${MAKEOPTS} | sed -e 's:-j *[0-9]*::g'`" 344 export MAKEOPTS="`echo ${MAKEOPTS} | sed -e 's:-j *[0-9]*::g'`"
345 345
346 if [ "${ARCH}" = "x86" -o "${ARCH}" = "hppa" ] 346 if [ "${ARCH}" = "x86" -o "${ARCH}" = "hppa" -o \
347 "${ARCH}" = "arm" -o "${ARCH}" = "mips" ]
347 then 348 then
348 # x86 and hppa always has "processor" 349 # these archs will always have "[Pp]rocessor"
349 jobs="$((`grep -c ^processor /proc/cpuinfo` * 2))" 350 jobs="$((`grep -c ^[Pp]rocessor /proc/cpuinfo` * 2))"
350 351
351 elif [ "${ARCH}" = "sparc" -o "${ARCH}" = "sparc64" ] 352 elif [ "${ARCH}" = "sparc" -o "${ARCH}" = "sparc64" ]
352 then 353 then
353 # sparc always has "ncpus active" 354 # sparc always has "ncpus active"
354 jobs="$((`grep "^ncpus active" /proc/cpuinfo | sed -e "s/^.*: //"` * 2))" 355 jobs="$((`grep "^ncpus active" /proc/cpuinfo | sed -e "s/^.*: //"` * 2))"
370 then 371 then
371 jobs="$((`grep -c ^processor /proc/cpuinfo` * 2))" 372 jobs="$((`grep -c ^processor /proc/cpuinfo` * 2))"
372 else 373 else
373 jobs=2 374 jobs=2
374 fi 375 fi
375 elif [ "${ARCH}" = "mips" ]
376 then
377 # mips always has "processor"
378 jobs="$((`grep -c ^processor /proc/cpuinfo` * 2))"
379
380 else 376 else
381 jobs="$((`grep -c ^cpu /proc/cpuinfo` * 2))" 377 jobs="$((`grep -c ^cpu /proc/cpuinfo` * 2))"
382 die "Unknown ARCH -- ${ARCH}!" 378 die "Unknown ARCH -- ${ARCH}!"
383 fi 379 fi
384 380

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20