repo/extra/libelf/build
2021-07-12 03:38:43 +03:00

31 lines
825 B
Bash
Executable File

#!/bin/sh -e
# Build sometimes forces -Werror.
export CFLAGS="$CFLAGS -Wno-error"
# Disable configure error for missing argp/fts/obstack.
sed 's/as_fn_error.*\(argp\|fts\|_obstack\)/: "/g' configure > _
mv -f _ configure
chmod +x configure
# Don't compile two unrelated C files which require argp.
sed 's/color.*printversion../#/g' lib/Makefile.in > _
mv -f _ lib/Makefile.in
./configure \
--prefix=/usr \
--disable-symbol-versioning \
--disable-debuginfod \
--disable-libdebuginfod \
--disable-nls \
ac_cv_c99=yes # Override check for Clang.
# Skip the default make target and build only what we need.
make -C lib
make -C libelf
make -C libelf DESTDIR="$1" install
make -C doc DESTDIR="$1" install-man3
mkdir -p "$1/usr/lib/pkgconfig"
cp -f config/libelf.pc "$1/usr/lib/pkgconfig/libelf.pc"