summaryrefslogtreecommitdiff
path: root/contrib/get-gmp-dev
blob: d0ce045e40cdbe8f30290b48839af70ea35af3a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
#
# This script should only be used if your distribution does not ship with the
# GMP configuration you need. For example, for cross-compiling GMP for Windows
# or Linux ARM platforms. You can also use the script if your
# distribution does not ship with static GMP libraries (e.g., Arch Linux) and
# you want to build CVC4 statically.
# In most of the cases the GMP version installed on your system is the one you
# want and should use.
#

source "$(dirname "$0")/get-script-header.sh"

[ -z "${BUILD_TYPE}" ] && BUILD_TYPE="--enable-shared --enable-static"
[ -n "$HOST" ] && HOST="--host=$HOST"
[ -z "$GMPVERSION" ] && GMPVERSION=6.2.0

GMP_DIR="$DEPS_DIR/gmp-$GMPVERSION"
rm -rf "$GMP_DIR"

echo =============================================================================
echo
echo "This script should only be used if your distribution does not ship with the"
echo "GMP configuration you need. For example, for cross-compiling GMP for"
echo "Windows or Linux ARM platforms. You can also use the script if your Linux"
echo "distribution does not ship with static GMP libraries (e.g., Arch Linux)"
echo "and you want to build CVC4 statically."
echo
echo "In most of the cases the GMP version installed on your system is the one you"
echo "want and should use."
echo
echo =============================================================================
echo
echo "Setting up GMP $GMPVERSION..."
echo
setup_dep "https://gmplib.org/download/gmp/gmp-$GMPVERSION.tar.bz2" "$GMP_DIR"
cd "$GMP_DIR"
./configure ${HOST} --prefix="$INSTALL_DIR" --enable-cxx ${BUILD_TYPE}
make \
  CFLAGS="${MAKE_CFLAGS}" \
  CXXFLAGS="${MAKE_CXXFLAGS}" \
  LDFLAGS="${MAKE_LDFLAGS}" \
  -j$(nproc)
make install
echo
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback