1*0ac341f1SConrad Meyer#! /bin/sh 2*0ac341f1SConrad Meyer 3*0ac341f1SConrad Meyerexport NACL_SDK_ROOT=${NACL_SDK_ROOT-"/opt/nacl_sdk/pepper_49"} 4*0ac341f1SConrad Meyerexport NACL_TOOLCHAIN=${NACL_TOOLCHAIN-"${NACL_SDK_ROOT}/toolchain/mac_x86_glibc"} 5*0ac341f1SConrad Meyerexport NACL_BIN=${NACL_BIN-"${NACL_TOOLCHAIN}/bin"} 6*0ac341f1SConrad Meyerexport PREFIX="$(pwd)/libsodium-nativeclient-x86_64" 7*0ac341f1SConrad Meyerexport PATH="${NACL_BIN}:$PATH" 8*0ac341f1SConrad Meyerexport CFLAGS="-O3 -fomit-frame-pointer -fforce-addr" 9*0ac341f1SConrad Meyer 10*0ac341f1SConrad Meyermkdir -p $PREFIX || exit 1 11*0ac341f1SConrad Meyer 12*0ac341f1SConrad Meyermake distclean > /dev/null 13*0ac341f1SConrad Meyer 14*0ac341f1SConrad Meyerif [ -z "$LIBSODIUM_FULL_BUILD" ]; then 15*0ac341f1SConrad Meyer export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal" 16*0ac341f1SConrad Meyerelse 17*0ac341f1SConrad Meyer export LIBSODIUM_ENABLE_MINIMAL_FLAG="" 18*0ac341f1SConrad Meyerfi 19*0ac341f1SConrad Meyer 20*0ac341f1SConrad Meyer./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ 21*0ac341f1SConrad Meyer --host=x86_64-nacl \ 22*0ac341f1SConrad Meyer --disable-ssp --without-pthreads \ 23*0ac341f1SConrad Meyer --prefix="$PREFIX" || exit 1 24*0ac341f1SConrad Meyer 25*0ac341f1SConrad Meyer 26*0ac341f1SConrad MeyerNPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) 27*0ac341f1SConrad MeyerPROCESSORS=${NPROCESSORS:-3} 28*0ac341f1SConrad Meyer 29*0ac341f1SConrad Meyermake -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1 30