2016-04-30 08:07:50 -04:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
export NACL_SDK_ROOT=${NACL_SDK_ROOT-"/opt/nacl_sdk/pepper_49"}
|
|
|
|
export NACL_TOOLCHAIN=${NACL_TOOLCHAIN-"${NACL_SDK_ROOT}/toolchain/mac_x86_glibc"}
|
|
|
|
export NACL_BIN=${NACL_BIN-"${NACL_TOOLCHAIN}/bin"}
|
|
|
|
export PREFIX="$(pwd)/libsodium-nativeclient-x86"
|
|
|
|
export PATH="${NACL_BIN}:$PATH"
|
|
|
|
export CFLAGS="-O3 -fomit-frame-pointer -fforce-addr"
|
|
|
|
|
|
|
|
mkdir -p $PREFIX || exit 1
|
|
|
|
|
|
|
|
make distclean > /dev/null
|
|
|
|
|
2018-03-06 15:10:05 -05:00
|
|
|
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
|
2018-03-06 14:36:39 -05:00
|
|
|
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
|
2018-03-06 15:20:17 -05:00
|
|
|
else
|
|
|
|
export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
|
2018-03-06 14:36:39 -05:00
|
|
|
fi
|
|
|
|
|
2018-03-06 15:20:17 -05:00
|
|
|
|
2018-03-06 14:36:39 -05:00
|
|
|
./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
|
2016-04-30 08:07:50 -04:00
|
|
|
--host=i686-nacl \
|
|
|
|
--disable-ssp --without-pthreads \
|
|
|
|
--prefix="$PREFIX" || exit 1
|
|
|
|
|
2018-03-07 02:15:01 -05:00
|
|
|
NPROCESSORS=$(getconf _NPROCESSORS_ONLN)
|
|
|
|
PROCESSORS=${NPROCESSORS:-3}
|
|
|
|
|
|
|
|
make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1
|