2015-08-02 08:17:22 -04:00
|
|
|
#! /bin/sh
|
|
|
|
|
2016-04-29 03:45:12 -04:00
|
|
|
export NACL_SDK_ROOT=${NACL_SDK_ROOT-"/opt/nacl_sdk/pepper_49"}
|
2015-08-02 08:17:22 -04:00
|
|
|
export NACL_TOOLCHAIN=${NACL_TOOLCHAIN-"${NACL_SDK_ROOT}/toolchain/mac_pnacl"}
|
|
|
|
export NACL_BIN=${NACL_BIN-"${NACL_TOOLCHAIN}/bin"}
|
|
|
|
export PREFIX="$(pwd)/libsodium-nativeclient"
|
|
|
|
export PATH="${NACL_BIN}:$PATH"
|
|
|
|
export AR=${AR-"pnacl-ar"}
|
|
|
|
export AS=${AS-"pnacl-as"}
|
|
|
|
export CC=${CC-"pnacl-clang"}
|
|
|
|
export LD=${LD-"pnacl-ld"}
|
|
|
|
export NM=${NM-"pnacl-nm"}
|
|
|
|
export RANLIB=${RANLIB-"pnacl-ranlib"}
|
|
|
|
export PNACL_FINALIZE=${PNACL_FINALIZE-"pnacl-finalize"}
|
|
|
|
export PNACL_TRANSLATE=${PNACL_TRANSLATE-"pnacl-translate"}
|
2016-04-29 16:29:34 -04:00
|
|
|
export CFLAGS="-O3 -fomit-frame-pointer -fforce-addr"
|
2015-08-02 08:17:22 -04:00
|
|
|
|
|
|
|
mkdir -p $PREFIX || exit 1
|
|
|
|
|
|
|
|
make distclean > /dev/null
|
|
|
|
|
2018-03-14 15:01:10 -04:00
|
|
|
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
|
|
|
|
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
|
|
|
|
else
|
|
|
|
export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
|
2015-08-02 08:17:22 -04:00
|
|
|
--host=nacl \
|
2016-04-30 04:17:47 -04:00
|
|
|
--disable-ssp --without-pthreads \
|
2015-08-02 08:17:22 -04:00
|
|
|
--prefix="$PREFIX" || exit 1
|
|
|
|
|
2018-03-14 15:01:10 -04:00
|
|
|
|
|
|
|
NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
|
|
|
|
PROCESSORS=${NPROCESSORS:-3}
|
|
|
|
|
|
|
|
make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1
|