diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-18 05:11:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-18 05:11:30 +0300 |
commit | f0c7e9a220302b67b95bd8ab5f71b2ffac15c0c1 (patch) | |
tree | 498caeae743b75797813d34f3fe5219be0f0b61d /scripts/include | |
parent | 6a33d05eb81437e6e6a61bef203c16d4ef16a796 (diff) | |
parent | 59b1bb420f2a713e8efa96fd1edba44f37676f94 (diff) | |
download | spm-f0c7e9a220302b67b95bd8ab5f71b2ffac15c0c1.tar.gz spm-f0c7e9a220302b67b95bd8ab5f71b2ffac15c0c1.tar.bz2 spm-f0c7e9a220302b67b95bd8ab5f71b2ffac15c0c1.tar.xz spm-f0c7e9a220302b67b95bd8ab5f71b2ffac15c0c1.zip |
Merge branch 'master' into SDL
Diffstat (limited to 'scripts/include')
-rw-r--r-- | scripts/include/common.sh | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/scripts/include/common.sh b/scripts/include/common.sh index e54922b..e7e8f8c 100644 --- a/scripts/include/common.sh +++ b/scripts/include/common.sh @@ -165,9 +165,19 @@ function run_cmake { } function run_make { - echo "make" - make + if [[ "${jobs}" == "" ]]; then + if [ -f "/proc/cpuinfo" ]; then + jobs="$(cat /proc/cpuinfo|grep processor|wc -l)" + else + jobs="1" + fi + fi + j=" -j${jobs}" + + echo "make$j" + make$j check_error $? + unset j } function run_make_install { @@ -307,6 +317,43 @@ function common_use_package { check_error $? } +function common_use_packages { + cd "${scriptsdir}" + check_error $? + + export envname="$1" + export installname0="${installname}" + export envfile="../env/run${envname}.sh" + echo "#!/bin/bash" >"${envfile}" + check_error $? + echo "" >>"${envfile}" + shift + names="$*" + IFS=" " + for package in $names + do + export installname="${installname0}" + unset ENV_PATH + unset ENV_LD_LIBRARY_PATH + unset ENV_PKG_CONFIG_PATH + unset ENV_MANPATH + unset ENV_ACLOCAL_PATH + unset ENV_LDFLAGS_PATH + unset ENV_CPPFLAGS_PATH + + common_package_init + common_build_init + common_run_package + package_use + check_error $? + done + unset IFS + echo "\$*" >>"${envfile}" + check_error $? + chmod 0755 "${envfile}" + check_error $? +} + function package_get_source { echo "package_get_source" run_clone "${SRCURL}" |