0ac341f145
Bring in https://github.com/jedisct1/libsodium at 461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified. libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl ("Networking and Cryptography Library," pronounced "salt") software library. At the risk of oversimplifying, libsodium primarily exists to make it easier to use NaCl. NaCl and libsodium provide high quality implementations of a number of useful cryptographic concepts (as well as the underlying primitics) seeing some adoption in newer network protocols. I considered but dismissed cleaning up the directory hierarchy and discarding artifacts of other build systems in favor of remaining close to upstream (and easing future updates). Nothing is integrated into the build system yet, so in that sense, no functional change.
30 lines
918 B
Bash
Executable File
30 lines
918 B
Bash
Executable File
#! /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_64"
|
|
export PATH="${NACL_BIN}:$PATH"
|
|
export CFLAGS="-O3 -fomit-frame-pointer -fforce-addr"
|
|
|
|
mkdir -p $PREFIX || exit 1
|
|
|
|
make distclean > /dev/null
|
|
|
|
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} \
|
|
--host=x86_64-nacl \
|
|
--disable-ssp --without-pthreads \
|
|
--prefix="$PREFIX" || exit 1
|
|
|
|
|
|
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
|