2015-04-19 02:18:08 -07:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
export PREFIX="$(pwd)/libsodium-osx"
|
2020-03-14 09:28:39 -07:00
|
|
|
export OSX_VERSION_MIN=${OSX_VERSION_MIN-"10.10"}
|
2015-04-19 02:18:08 -07:00
|
|
|
|
2018-03-06 13:10:05 -07:00
|
|
|
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
|
2018-03-06 12:36:39 -07:00
|
|
|
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
|
2018-03-06 13:20:17 -07:00
|
|
|
else
|
|
|
|
export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
|
2018-03-06 12:36:39 -07:00
|
|
|
fi
|
|
|
|
|
2018-03-07 02:14:01 -07:00
|
|
|
NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
|
2018-03-07 00:15:01 -07:00
|
|
|
PROCESSORS=${NPROCESSORS:-3}
|
|
|
|
|
2020-07-04 06:32:13 -07:00
|
|
|
mkdir -p $PREFIX || exit 1
|
|
|
|
|
2020-07-04 06:47:43 -07:00
|
|
|
export CFLAGS="-mmacosx-version-min=${OSX_VERSION_MIN} -O2 -g"
|
|
|
|
export LDFLAGS="-mmacosx-version-min=${OSX_VERSION_MIN}"
|
2020-07-04 06:32:13 -07:00
|
|
|
|
|
|
|
make distclean >/dev/null
|
|
|
|
./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
|
|
|
|
--prefix="$PREFIX" || exit 1
|
2018-03-07 00:15:01 -07:00
|
|
|
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
|