diff options
author | Monwarez <monwarez@gmail.com> | 2017-03-25 23:47:16 +0100 |
---|---|---|
committer | Thibault Payet <monwarez@gmail.com> | 2017-07-26 00:20:36 +0200 |
commit | ef92d33af87cddb0269ac50ae78ee2499daf231d (patch) | |
tree | f74e6c6e7199cea5bb040ebac71c76e25da09f90 /build.sh | |
parent | 38a48f8136c3fa326e126cacbd8131608f25d51c (diff) | |
download | plugin-ef92d33af87cddb0269ac50ae78ee2499daf231d.tar.gz plugin-ef92d33af87cddb0269ac50ae78ee2499daf231d.tar.bz2 plugin-ef92d33af87cddb0269ac50ae78ee2499daf231d.tar.xz plugin-ef92d33af87cddb0269ac50ae78ee2499daf231d.zip |
Use /usr/bin/env instead of full path to bash
And also, use sysctl for detecting the number of CPU
when the system is FreeBSD
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash CMD="$1" @@ -9,9 +9,17 @@ fi export LANG=C source tools/vars.sh +if [[ "$(uname)" == "FreeBSD" ]]; then + export CORES=$(sysctl hw.ncpu | awk '{print $2}') +else + export CORES=$(cat /proc/cpuinfo|grep processor|wc -l) +fi + mkdir build # this need for some outdated os mkdir m4 +# for some os, libtoolize should be launch +libtoolize -i autoreconf -i cd build if [[ "${CMD}" == "default" ]]; then @@ -23,7 +31,7 @@ elif [[ "${CMD}" == "gprof" ]]; then export CC=gcc ../configure --enable-gprof CPPFLAGS="${VARS}" fi -make -j3 +make -j${CORES} export RET=$? cd - exit $RET |