aboutsummaryrefslogtreecommitdiff
path: root/extra/libelf
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2021-01-12 15:52:10 +0300
committerCem Keylan <cem@ckyln.com>2021-01-12 15:52:10 +0300
commit954902a8496d8cbddbd650c87bd5ff9f3e6c1deb (patch)
tree422b238103c824e6fef78bad072453776b356c4b /extra/libelf
parent8bd7d55373db3480f909d0798dc512c81a7dec07 (diff)
downloadrepository-954902a8496d8cbddbd650c87bd5ff9f3e6c1deb.tar.gz
libelf: move to extra
Diffstat (limited to 'extra/libelf')
-rwxr-xr-xextra/libelf/build21
-rw-r--r--extra/libelf/checksums2
-rw-r--r--extra/libelf/depends2
-rw-r--r--extra/libelf/files/error.h27
-rw-r--r--extra/libelf/sources2
-rw-r--r--extra/libelf/version1
6 files changed, 55 insertions, 0 deletions
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 <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+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