2015-04-19 05:18:08 -04:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
export PREFIX="$(pwd)/libsodium-osx"
|
|
|
|
export OSX_VERSION_MIN=${OSX_VERSION_MIN-"10.8"}
|
|
|
|
export OSX_CPU_ARCH=${OSX_CPU_ARCH-"core2"}
|
|
|
|
|
|
|
|
mkdir -p $PREFIX || exit 1
|
|
|
|
|
2017-12-30 18:56:51 -05:00
|
|
|
export CFLAGS="-arch x86_64 -mmacosx-version-min=${OSX_VERSION_MIN} -march=${OSX_CPU_ARCH} -O2 -g"
|
|
|
|
export LDFLAGS="-arch x86_64 -mmacosx-version-min=${OSX_VERSION_MIN} -march=${OSX_CPU_ARCH}"
|
2015-04-19 05:18:08 -04:00
|
|
|
|
|
|
|
make distclean > /dev/null
|
|
|
|
|
2018-03-06 15:10:05 -05:00
|
|
|
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
|
2018-03-06 14:36:39 -05:00
|
|
|
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
|
2018-03-06 15:20:17 -05:00
|
|
|
else
|
|
|
|
export LIBSODIUM_ENABLE_MINIMAL_FLAG=""
|
2018-03-06 14:36:39 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \
|
2015-04-19 05:18:08 -04:00
|
|
|
--prefix="$PREFIX" || exit 1
|
|
|
|
|
|
|
|
make -j3 check && make -j3 install || exit 1
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
make distclean > /dev/null
|