forked from I2P_Developers/i2p.i2p
Revamped downloading of gmp files.
Revamped cross-compilation support.
This commit is contained in:
35
core/c/jbigi/download_gmp.sh
Normal file
35
core/c/jbigi/download_gmp.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
export GMP_VER=6.0.0
|
||||
export GMP_TARVER=${GMP_VER}a
|
||||
export GMP_DIR="gmp-$GMP_VER"
|
||||
export GMP_TAR="gmp-$GMP_TARVER.tar.bz2"
|
||||
|
||||
|
||||
function download_tar
|
||||
{
|
||||
GMP_TAR_URL="https://gmplib.org/download/gmp/${GMP_TAR}"
|
||||
if [ $(which wget) ]; then
|
||||
echo "Downloading $GMP_TAR_URL"
|
||||
wget -N --progress=dot $GMP_TAR_URL
|
||||
else
|
||||
echo "ERROR: Cannot find wget." >&2
|
||||
echo >&2
|
||||
echo "Please download $GMP_TAR_URL" >&2
|
||||
echo "manually and rerun this script." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function extract_tar
|
||||
{
|
||||
tar -xjf ${GMP_TAR} > /dev/null 2>&1 || (rm -f ${GMP_TAR} && download_tar && extract_tar || exit 1)
|
||||
}
|
||||
|
||||
if [ ! -d "$GMP_DIR" -a ! -e "$GMP_TAR" ]; then
|
||||
download_tar
|
||||
fi
|
||||
|
||||
if [ ! -d "$GMP_DIR" ]; then
|
||||
extract_tar
|
||||
fi
|
||||
Reference in New Issue
Block a user