You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

30 lines
942 B

GMP_VERSION=$(sh "${SCRIPT_DIR}"/get-pEp-version.sh "GMP_VERSION")
GMP_NAME="gmp-${GMP_VERSION}"
OUTPUT_DIR=${SCRIPT_DIR}/build
# Exit on errors
set -e
if [ -f "${LIB_DIR}/libgmp.a" ]; then
echo "lib exists already in ${LIB_DIR}. If you want to rebuild it, delete the existing one."
exit 0
fi
GMP_DIR="${TMP_DIR}/${GMP_NAME}"
if [ ! -d "${GMP_DIR}" ]; then
# GMP snapshot must be used until released
wget -nc https://gmplib.org/download/gmp/$GMP_NAME.tar.bz2
tar xvf ${GMP_NAME}.tar.bz2
fi
export CFLAGS="-arch ${ARCH} -isysroot ${SDK_PATH} -miphoneos-version-min=${IOS_DEPLOYMENT_TARGET} -std=c99"
export LDFLAGS="-arch ${ARCH}"
export CC="$(xcrun --sdk ${SDK} -f clang) -arch ${ARCH} -isysroot ${SDK_PATH}"
pushd gmp-$GMP_VERSION
PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH=${CURRENT_LIB_DIR}/lib/pkgconfig ./configure --host=${HOST} --prefix=${CURRENT_LIB_DIR} --disable-assembly
make clean
make -j4
make install
popd