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