From 954902a8496d8cbddbd650c87bd5ff9f3e6c1deb Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Tue, 12 Jan 2021 15:52:10 +0300 Subject: libelf: move to extra --- extra/libelf/build | 21 +++++++++++++++++++++ extra/libelf/checksums | 2 ++ extra/libelf/depends | 2 ++ extra/libelf/files/error.h | 27 +++++++++++++++++++++++++++ extra/libelf/sources | 2 ++ extra/libelf/version | 1 + 6 files changed, 55 insertions(+) create mode 100755 extra/libelf/build create mode 100644 extra/libelf/checksums create mode 100644 extra/libelf/depends create mode 100644 extra/libelf/files/error.h create mode 100644 extra/libelf/sources create mode 100644 extra/libelf/version (limited to 'extra/libelf') diff --git a/extra/libelf/build b/extra/libelf/build new file mode 100755 index 00000000..7bade69a --- /dev/null +++ b/extra/libelf/build @@ -0,0 +1,21 @@ +#!/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. +make -C lib +make -C libelf +make -C libelf DESTDIR="$1" install diff --git a/extra/libelf/checksums b/extra/libelf/checksums new file mode 100644 index 00000000..f822f2fa --- /dev/null +++ b/extra/libelf/checksums @@ -0,0 +1,2 @@ +ecc406914edf335f0b7fc084ebe6c460c4d6d5175bfdd6688c1c78d9146b8858 elfutils-0.182.tar.bz2 +bf11b56670c7919b44e33b5b0f3a216b7f20cf2859b74bf5e2e837532f8e0579 error.h diff --git a/extra/libelf/depends b/extra/libelf/depends new file mode 100644 index 00000000..70b01bc5 --- /dev/null +++ b/extra/libelf/depends @@ -0,0 +1,2 @@ +pkgconf make +zlib diff --git a/extra/libelf/files/error.h b/extra/libelf/files/error.h new file mode 100644 index 00000000..ef06827a --- /dev/null +++ b/extra/libelf/files/error.h @@ -0,0 +1,27 @@ +#ifndef _ERROR_H_ +#define _ERROR_H_ + +#include +#include +#include +#include +#include + +static unsigned int error_message_count = 0; + +static inline void error(int status, int errnum, const char* format, ...) +{ + va_list ap; + fprintf(stderr, "%s: ", program_invocation_name); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + if (errnum) + fprintf(stderr, ": %s", strerror(errnum)); + fprintf(stderr, "\n"); + error_message_count++; + if (status) + exit(status); +} + +#endif /* _ERROR_H_ */ diff --git a/extra/libelf/sources b/extra/libelf/sources new file mode 100644 index 00000000..71eb0aea --- /dev/null +++ b/extra/libelf/sources @@ -0,0 +1,2 @@ +https://sourceware.org/elfutils/ftp/0.182/elfutils-0.182.tar.bz2 +files/error.h lib diff --git a/extra/libelf/version b/extra/libelf/version new file mode 100644 index 00000000..c62d59ae --- /dev/null +++ b/extra/libelf/version @@ -0,0 +1 @@ +0.182 1 -- cgit v1.2.3