get-authors: Exclude common source code patterns. (#2900)
[cvc5.git] / contrib / get-gmp
1 #!/bin/bash
2 #
3 # This script should only be used if your distribution does not ship with the
4 # GMP configuration you need. For example, contrib/get-win-dependencies
5 # cross-compiles GMP for Windows. You can also use the script if your
6 # distribution does not ship with static GMP libraries (e.g., Arch Linux) and
7 # you want to build CVC4 statically.
8 # In most of the cases the GMP version installed on your system is the one you
9 # want and should use.
10 #
11
12 source "$(dirname "$0")/get-script-header.sh"
13
14 [ -z "${BUILD_TYPE}" ] && BUILD_TYPE="--disable-shared --enable-static"
15 [ -n "$HOST" ] && HOST="--host=$HOST"
16 [ -z "$GMPVERSION" ] && GMPVERSION=6.1.2
17
18 echo =============================================================================
19 echo
20 echo "Setting up GMP $GMPVERSION..."
21 echo
22 ( set -ex
23 mkdir gmp-$GMPVERSION
24 cd gmp-$GMPVERSION
25 gmpprefix=`pwd` &&
26 mkdir src &&
27 cd src &&
28 webget https://gmplib.org/download/gmp/gmp-$GMPVERSION.tar.bz2 gmp-$GMPVERSION.tar.bz2 &&
29 tar xfj gmp-$GMPVERSION.tar.bz2 &&
30 cd gmp-$GMPVERSION &&
31 ./configure ${HOST} --prefix="$gmpprefix" --enable-cxx ${BUILD_TYPE} &&
32 make CFLAGS="${MAKE_CFLAGS}" CXXFLAGS="${MAKE_CXXFLAGS}" LDFLAGS="${MAKE_LDFLAGS}" &&
33 make install
34 ) || exit 1
35 echo