diff options
Diffstat (limited to 'pkgbuild/toolchain.env')
-rw-r--r-- | pkgbuild/toolchain.env | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pkgbuild/toolchain.env b/pkgbuild/toolchain.env new file mode 100644 index 0000000..baaf2e8 --- /dev/null +++ b/pkgbuild/toolchain.env @@ -0,0 +1,22 @@ +# The toolchain will be installed into PREFIX +export PREFIX=/usr/local/pacman + +# Setup toolchain search paths +export PATH=$PREFIX/root/bin:$PREFIX/bin:$PATH +export MANPATH=$PREFIX/root/share/man:$PREFIX/share/man:$MANPATH +export PKG_CONFIG_PATH=$PREFIX/root/lib/pkgconfig: + +# Basic compile/link flags +export CFLAGS="-I$PREFIX/root/include -O2 -pipe" +export LDFLAGS="-L$PREFIX/root/lib" + +# Use the most basic locale possible +export LANG=C + +# Helper for `make -j` calls +if [[ $(type -P nproc) ]]; then + export CPU_COUNT=$(nproc --ignore 1) +else + export CPU_COUNT=$(python -c 'import os; print(os.cpu_count())') + if (( CPU_COUNT > 1 )); then (( CPU_COUNT-- )); fi +fi |