1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 02:25:14 -07:00
libsodium/dist-build/macos.sh

27 lines
736 B
Bash
Raw Normal View History

2015-04-19 02:18:08 -07:00
#! /bin/sh
export PREFIX="$(pwd)/libsodium-osx"
2020-08-05 08:34:44 -07:00
export MACOS_VERSION_MIN=${MACOS_VERSION_MIN-"10.10"}
2015-04-19 02:18:08 -07:00
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
2018-03-06 13:20:17 -07:00
else
export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
fi
NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
PROCESSORS=${NPROCESSORS:-3}
2020-07-04 06:32:13 -07:00
mkdir -p $PREFIX || exit 1
export CFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN} -O3"
2020-08-05 08:34:44 -07:00
export LDFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN}"
2020-07-04 06:32:13 -07:00
make distclean >/dev/null
./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
--prefix="$PREFIX" || exit 1
make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1
2015-04-19 02:18:08 -07:00
# Cleanup
2020-07-04 06:32:13 -07:00
make distclean >/dev/null