summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid King <dking@redhat.com>2016-02-26 10:43:04 +0000
committerAlexander Larsson <alexl@redhat.com>2016-02-26 15:03:25 +0100
commit12d49beb728eaaa3bfbb278d2b2781fd4144df6a (patch)
tree04125adf9ff61af4a4156ce47eb8693b6c26f2b4 /configure.ac
parent87be89a7b8c389bb19b1f7f1866b138bbc25f2a7 (diff)
downloadxdg-app-12d49beb728eaaa3bfbb278d2b2781fd4144df6a.tar.gz
Search for dwarf.h in configure
Add a --with-dwarf-header argument for supplying the path containing the dwarf.h header from libdwarf. Either a path must be provided, or a fallback location of $includedir/libdwarf will be tested. https://bugs.freedesktop.org/show_bug.cgi?id=94308
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 57cf968..66e1cab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,6 +206,26 @@ AS_IF([ test $have_libelf = maybe ], [
if test x$have_libelf != xyes; then
AC_MSG_ERROR([libelf not found])
fi
+
+dnl This only checks for the header, not the library.
+AC_ARG_WITH([dwarf-header],
+ [AS_HELP_STRING([--with-dwarf-header],
+ [path containing dwarf.h])],
+ [AS_IF([test "x$with_dwarf_header" = "xno"],
+ [AC_MSG_WARN([either a path containing dwarf.h must be
+provided, or it will be searched for in includedir])])],
+ [with_dwarf_header=yes])
+
+AS_IF([test "x$with_dwarf_header" = "xyes"],
+ [CPPFLAGS="$CPPFLAGS -I$(eval echo \"$includedir\")/libdwarf"
+ AC_CHECK_HEADER([dwarf.h])
+ AS_IF([test "x$ac_cv_header_dwarf_h" != "xyes"],
+ [AC_MSG_ERROR([dwarf.h is required but was not found; locate it using --with-dwarf-header=/path/containing/header])])],
+ [CPPFLAGS="$CPPFLAGS -I$with_dwarf_header"
+ AC_CHECK_HEADER([dwarf.h])
+ AS_IF([test "x$ac_cv_header_dwarf_h" != "xyes"],
+ [AC_MSG_ERROR([dwarf.h is required but was not found])])])
+
AC_ARG_ENABLE(documentation,
AC_HELP_STRING([--enable-documentation], [Build documentation]),,
enable_documentation=yes)