[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:

> Guys,
>
>  Is there any way to check the number of cores on a machine to set the
> number
> of jobs within a PKGBUILD?:
>
> make -j'X'
>
> I have some dual-core and some quad-core boxes and the difference between
> -j2
> and -j4 on build time is tremendous. However, for generically creating a
> source
> 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
PKGBUILD.


--
GPG/PGP ID: C0711BF1


More information about the arch-general mailing list