aboutsummaryrefslogtreecommitdiff
path: root/extra/mold/build
blob: 477dc98c6432730c2a79336806199ade16ce403d (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
#!/bin/sh -e

# Create static library of xxhash to link locally.
make -C xxhash

export CXXFLAGS="$CXXFLAGS -I$PWD/xxhash -L$PWD/xxhash -static-libgcc -static-libstdc++"

export DESTDIR="$1"

cmake -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DMI_BUILD_SHARED=OFF \
    -DMOLD_MOSTLY_STATIC=ON

cmake --build   build
cmake --install build

ln -s mold "$1/usr/bin/ld"

# Create symbolic link for GCC to use mold.
mkdir -p "$1/usr/lib/mold"
ln -s ../../bin/mold "$1/usr/lib/mold/ld"