summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-01-08 16:47:01 +0100
committerAlexander Larsson <alexl@redhat.com>2016-01-11 11:40:46 +0100
commit62b4ffaa72891520d57ce32ba99b40ceeda6cd99 (patch)
treed78a57f078ecfdd499cebb210326f5d6064328b4 /configure.ac
parent8be003135589486ce8e6570e45af022950af8665 (diff)
downloadxdg-app-62b4ffaa72891520d57ce32ba99b40ceeda6cd99.tar.gz
builder: Use libelf to detect elf files
This additionally looks for already stripped files
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 1cdeab6..b055c20 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,7 +177,27 @@ AS_IF([ test x$with_libarchive != xno ], [
], [ with_libarchive=no ])
AM_CONDITIONAL(USE_LIBARCHIVE, test $with_libarchive != no)
+dnl ************************
+dnl *** check for libelf ***
+dnl ************************
+PKG_CHECK_MODULES([LIBELF], [libelf >= 0.8.12], [have_libelf=yes], [have_libelf=maybe])
+AS_IF([ test $have_libelf = maybe ], [
+ save_LIBS=$LIBS
+ AC_CHECK_LIB([elf], [elf_begin], [:], [have_libelf=no])
+ AC_CHECK_LIB([elf], [elf_getshdrstrndx], [:], [have_libelf=no])
+ AC_CHECK_LIB([elf], [elf_getshdrnum], [:], [have_libelf=no])
+ AC_CHECK_HEADER([libelf.h], [:], [have_libelf=no])
+ LIBS=$save_LIBS
+
+ if test $have_libelf != no; then
+ LIBELF_LIBS=-lelf
+ have_libelf=yes
+ fi
+])
+if test x$have_libelf != xyes; then
+ AC_MSG_ERROR([libelf not found])
+fi
AC_ARG_ENABLE(documentation,
AC_HELP_STRING([--enable-documentation], [Build documentation]),,
enable_documentation=yes)