aboutsummaryrefslogtreecommitdiff
path: root/extra/libdw/build
blob: 6f9a77c90f1408d2805948d2e441202ab1d027dc (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
#!/bin/sh -e

# Build sometimes forces -Werror.
export CFLAGS="$CFLAGS -Wno-error"

# Disable configure error for missing argp.
sed -i 's/as_fn_error.*libargp/: "/g' configure

# Don't compile two unrelated C files which require argp.
sed -i 's/color.*printversion../#/g' lib/Makefile.in

./configure \
    --prefix=/usr \
    --disable-symbol-versioning \
    --disable-debuginfod \
    --disable-nls

# Skip the default make target and build only what we need.
for dep in lib libelf backends libebl libcpu libdwelf libdwfl; do
    make -C "$dep"
done
make -C libdw libdw.a

(
cd libebl
install -Dm644 libebl.h "$1/usr/include/elfutils/libebl.h"
install -Dm644 libebl.a "$1/usr/lib/libebl.a"
)

(
cd libdw
install -Dm644 libdw.h "$1/usr/include/elfutils/libdw.h"
install -Dm644 dwarf.h "$1/usr/include/dwarf.h"
install -Dm644 libdw.a "$1/usr/lib/libdw.a"
)