summaryrefslogtreecommitdiff
path: root/build_mpdec.sh
blob: 124833c6511208330f67feab461a723d065a93dc (plain) (blame)
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
#!/bin/bash
set -e
set -x

tarball="mpdecimal-2.4.2.tar.gz"
dest="${tarball%%.tar.gz}"
url="http://www.bytereef.org/software/mpdecimal/releases/${tarball}"
prefix="/usr"

function pre()
{
    curl -LO "${url}"
    tar xf "${tarball}"
}

function build()
{
    pre
    pushd "${dest}"
        export LDFLAGS="-Wl,-rpath=$prefix/lib"
        ./configure --prefix=$prefix
        make
        make install
    popd
    post
}

function post()
{
    rm -rf "${dest}"
    rm -rf "${tarball}"
    echo "All done."
}

# Main
build