aboutsummaryrefslogtreecommitdiff
path: root/pkgbuild/toolchain.env
blob: baaf2e85eae818342d0153f9a123301eaf21d808 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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