[arch-general] Can you test machine to set --jobs[=N] from w/i PKGBUILD?
Rashif Ray Rahman
schiv at archlinux.org
Sun Apr 1 09:45:43 EDT 2012
On 1 April 2012 10:59, David C. Rankin <drankinatty at suddenlinkmail.com>wrote:
> Is there any way to check the number of cores on a machine to set the
> of jobs within a PKGBUILD?:
> make -j'X'
> I have some dual-core and some quad-core boxes and the difference between
> and -j4 on build time is tremendous. However, for generically creating a
> package to be used by someone else, I can't hardcode the jobs number.
> Anyway to
> test in pkgbuild or is this just a per box makepkg.conf issue?
I had this for a one-fit Arch UFD:
CPUCORES=$(grep processor /proc/cpuinfo | wc -l)
[ $CPUCORES -gt 1 ] && MAKEFLAGS="-j$(($CPUCORES + 1))"
But that's in makepkg.conf :) You shouldn't enforce this from within a
GPG/PGP ID: C0711BF1
More information about the arch-general