Merge pull request #693 from joshjdevl/feature-procs

using POSIX getconf for number of available processors
This commit is contained in:
Frank Denis 2018-03-07 10:06:34 +01:00 committed by GitHub
commit e1618774a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 10 deletions

View File

@ -83,6 +83,10 @@ if [ "$NDK_PLATFORM" != "$NDK_PLATFORM_COMPAT" ]; then
rm -f config-def.log config-def-compat.log
fi
NPROCESSORS=$(getconf _NPROCESSORS_ONLN)
PROCESSORS=${NPROCESSORS:-3}
make clean && \
make -j3 install && \
make -j${PROCESSORS} install && \
echo "libsodium has been installed into ${PREFIX}"

View File

@ -44,7 +44,11 @@ fi
${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
--prefix="$SIMULATOR32_PREFIX" || exit 1
make -j3 install || exit 1
NPROCESSORS=$(getconf _NPROCESSORS_ONLN)
PROCESSORS=${NPROCESSORS:-3}
make -j${PROCESSORS} install || exit 1
## x86_64 simulator
export CFLAGS="-O2 -arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}"
@ -57,7 +61,7 @@ make distclean > /dev/null
${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
--prefix="$SIMULATOR64_PREFIX"
make -j3 install || exit 1
make -j${PROCESSORS} install || exit 1
# Build for iOS
export BASEDIR="${XCODEDIR}/Platforms/iPhoneOS.platform/Developer"
@ -75,7 +79,7 @@ make distclean > /dev/null
${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
--prefix="$IOS32_PREFIX" || exit 1
make -j3 install || exit 1
make -j${PROCESSORS} install || exit 1
## 32-bit armv7s iOS
export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}"
@ -88,7 +92,7 @@ make distclean > /dev/null
${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
--prefix="$IOS32s_PREFIX" || exit 1
make -j3 install || exit 1
make -j${PROCESSORS} install || exit 1
## 64-bit iOS
export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN} -fembed-bitcode"
@ -101,7 +105,7 @@ make distclean > /dev/null
${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
--prefix="$IOS64_PREFIX" || exit 1
make -j3 install || exit 1
make -j${PROCESSORS} install || exit 1
# Create universal binary and include folder
rm -fr -- "$PREFIX/include" "$PREFIX/libsodium.a" 2> /dev/null

View File

@ -30,4 +30,8 @@ fi
--disable-ssp --without-pthreads \
--prefix="$PREFIX" || exit 1
make -j3 check && make -j3 install || exit 1
NPROCESSORS=$(getconf _NPROCESSORS_ONLN)
PROCESSORS=${NPROCESSORS:-3}
make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1

View File

@ -23,4 +23,7 @@ fi
--disable-ssp --without-pthreads \
--prefix="$PREFIX" || exit 1
make -j3 check && make -j3 install || exit 1
NPROCESSORS=$(getconf _NPROCESSORS_ONLN)
PROCESSORS=${NPROCESSORS:-3}
make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1

View File

@ -22,4 +22,8 @@ fi
--disable-ssp --without-pthreads \
--prefix="$PREFIX" || exit 1
make -j3 check && make -j3 install || exit 1
NPROCESSORS=$(getconf _NPROCESSORS_ONLN)
PROCESSORS=${NPROCESSORS:-3}
make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1

View File

@ -20,7 +20,11 @@ fi
./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
--prefix="$PREFIX" || exit 1
make -j3 check && make -j3 install || exit 1
NPROCESSORS=$(getconf _NPROCESSORS_ONLN)
PROCESSORS=${NPROCESSORS:-3}
make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1
# Cleanup
make distclean > /dev/null