summaryrefslogtreecommitdiff
path: root/scripts/0150-build-static-deps.sh
blob: cc68ecbc85924fd3723e308507f40e762a46049e (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
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/env bash

set -e

mkdir -p $STATIC_DEPS_PREFIX/include $STATIC_DEPS_PREFIX/lib
mkdir -p /static-deps && cd /static-deps

echo "Building static zlib..."
tar xf /downloads/zlib-$ZLIB_VERSION.tar.gz
cd zlib-$ZLIB_VERSION
./configure --prefix=$STATIC_DEPS_PREFIX --static
make -j$(nproc) && make install
cd ..

echo "Building static ncurses..."
tar xf /downloads/ncurses-$NCURSES_VERSION.tar.gz
cd ncurses-$NCURSES_VERSION
./configure --prefix=$STATIC_DEPS_PREFIX --disable-shared --enable-static --with-termlib
make -j$(nproc) && make install
cd ..

echo "Building static expat..."
tar xf /downloads/expat-$EXPAT_VERSION.tar.gz
cd expat-$EXPAT_VERSION
./configure --prefix=$STATIC_DEPS_PREFIX --disable-shared --enable-static
make -j$(nproc) && make install
cd ..

echo "Building static readline..."
tar xf /downloads/readline-$READLINE_VERSION.tar.gz
cd readline-$READLINE_VERSION
./configure --prefix=$STATIC_DEPS_PREFIX --disable-shared --enable-static
make -j$(nproc) && make install
cd ..

echo "Building static gmp..."
tar xf /downloads/gmp-$GMP_VERSION.tar.xz
cd gmp-$GMP_VERSION
## PATCH BEGIN
sed -i 's/void g(){}/void g(int,t1 const*,t1,t2,t1 const*,int){}/' configure
## PATCH END
./configure --prefix=$STATIC_DEPS_PREFIX --disable-shared --enable-static || cat config.log
make -j$(nproc) && make install
cd ..

echo "Building static mpfr..."
tar xf /downloads/mpfr-$MPFR_VERSION.tar.xz
cd mpfr-$MPFR_VERSION
./configure --prefix=$STATIC_DEPS_PREFIX --with-gmp=$STATIC_DEPS_PREFIX --disable-shared --enable-static
make -j$(nproc) && make install
cd ..

echo "Building static mpc..."
tar xf /downloads/mpc-$MPC_VERSION.tar.gz
cd mpc-$MPC_VERSION
./configure --prefix=$STATIC_DEPS_PREFIX --with-gmp=$STATIC_DEPS_PREFIX --with-mpfr=$STATIC_DEPS_PREFIX --disable-shared --enable-static
make -j$(nproc) && make install
cd ..